PageRenderTime 52ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/workorder/default.tpl

https://github.com/merchantos/PrintTemplates
Smarty Template | 356 lines | 305 code | 51 blank | 0 comment | 45 complexity | f031c565883bae5d9f4c893105421644 MD5 | raw file
  1. {% extends parameters.print ? "printbase" : "base" %}
  2. {% block extrastyles %}
  3. <!-- default -->
  4. @page { margin: 0px; }
  5. body{
  6. margin: 0px;
  7. }
  8. .pagebreak {
  9. page-break-after: always;
  10. }
  11. .workorder {
  12. margin: 0px;
  13. padding: 1px;
  14. font: normal 10pt 'Helvetica Neue',Helvetica,Arial,sans-serif;
  15. }
  16. .header {
  17. text-align: center;
  18. margin-bottom: 30px;
  19. }
  20. .header p {
  21. margin: 0;
  22. }
  23. .header h1 {
  24. text-align: center;
  25. font-size: 12pt;
  26. }
  27. .header h3 {
  28. font-size: 10pt;
  29. margin: 0;
  30. }
  31. .header h1 strong {
  32. border: 3px solid black;
  33. font-size: 24pt;
  34. padding: 10px;
  35. }
  36. .header img {
  37. display: block;
  38. margin: 8px auto 4px;
  39. height: {{ Workorder.Shop.ReceiptSetup.logoHeight }};
  40. width: {{ Workorder.Shop.ReceiptSetup.logoWidth }}
  41. }
  42. .detail h2 {
  43. margin: 0px 0px 10px 0px;
  44. padding: 0px;
  45. font-size: 11pt;
  46. }
  47. .detail h3 {
  48. margin: 0px 0px 10px 0px;
  49. padding: 0px;
  50. font-size: 11pt;
  51. text-decoration: underline;
  52. }
  53. .detail {
  54. margin-bottom: 1em;
  55. }
  56. .detail p {
  57. margin: 0;
  58. }
  59. table.lines, table.totals {
  60. width: 100%;
  61. border-spacing:0;
  62. border-collapse:collapse;
  63. }
  64. table.lines td {
  65. padding: 4px 0;
  66. }
  67. table.totals td {
  68. margin: 0px;
  69. }
  70. table.lines th {
  71. font-size: 10pt;
  72. border-bottom: 1px solid #000;
  73. margin-bottom: 3px;
  74. text-align: left;
  75. }
  76. table.lines td.notes {
  77. margin-left: 15px;
  78. }
  79. table td.amount {
  80. width: 10%;
  81. text-align: left;
  82. }
  83. table.totals {
  84. text-align: right;
  85. border-top: 1px solid #000;
  86. }
  87. table.totals tr td:first-child {
  88. padding-right: 10px;
  89. }
  90. table tr.total td {
  91. font-weight: bold;
  92. }
  93. table .description {
  94. font-weight: bold;
  95. }
  96. table p {
  97. font-weight: normal;
  98. margin: 0;
  99. }
  100. .notes {
  101. overflow: hidden;
  102. margin: 0 0 1em;
  103. }
  104. .notes h1 {
  105. margin: 1em 0 0;
  106. }
  107. img.barcode {
  108. display: block;
  109. margin: 2em auto;
  110. }
  111. {% endblock extrastyles %}
  112. {% block content %}
  113. <!-- replace.email_custom_header_msg -->
  114. {% for Workorder in Workorders %}
  115. <div class="workorder {% if not loop.last %} pagebreak{% endif %}">
  116. <div class="header">
  117. {% if parameters.type == 'invoice' %}
  118. {% if Workorder.Shop.ReceiptSetup.hasLogo == "true" %}
  119. <img class="header" src="{{ Workorder.Shop.ReceiptSetup.logo }}" height="{{ Workorder.Shop.ReceiptSetup.logoHeight }}" width="{{ Workorder.Shop.ReceiptSetup.logoWidth }}">
  120. {% else %}
  121. <h3>{{ Workorder.Shop.name }}</h3>
  122. {% endif %}
  123. {% if Workorder.Shop.ReceiptSetup.header|strlen > 0 %}
  124. {{ Workorder.Shop.ReceiptSetup.header|nl2br|raw }}
  125. {% else %}
  126. <p>{{ Workorder.Shop.Contact.Addresses.ContactAddress.address1 }}</p>
  127. <p>{{ Workorder.Shop.Contact.Addresses.ContactAddress.city }}, {{ Workorder.Shop.Contact.Addresses.ContactAddress.state }} {{ Workorder.Shop.Contact.Addresses.ContactAddress.zip }}</p>
  128. <p>{{ Workorder.Shop.Contact.Phones.ContactPhone.number }}</p>
  129. {% endif %}
  130. {% endif %}
  131. <h1>Work Order</h1>
  132. <br>
  133. <h1><strong>#{{ Workorder.workorderID }}</strong></h1>
  134. {% if parameters.type == 'shop-tag' %}
  135. {% if Workorder.hookIn|strlen > 0 or Workorder.hookOut|strlen > 0 %}
  136. <h1 style="margin-top:20px;">Hook In: {{Workorder.hookIn}} <br />
  137. Hook Out: {{Workorder.hookOut}}</h1>
  138. {% endif %}
  139. {% endif %}
  140. </div>
  141. <div class="detail">
  142. <h3>Customer:</h3>
  143. <p>{{ Workorder.Customer.firstName}} {{ Workorder.Customer.lastName}}</p>
  144. <p>{{ Workorder.Customer.Contact.Addresses.ContactAddress.address1 }}</p>
  145. <p>{{ Workorder.Customer.Contact.Addresses.ContactAddress.address2 }}</p>
  146. <p>
  147. {{ Workorder.Customer.Contact.Addresses.ContactAddress.city }}{% if Workorder.Customer.Contact.Addresses.ContactAddress.city and (Workorder.Customer.Contact.Addresses.ContactAddress.state or Workorder.Customer.Contact.Addresses.ContactAddress.zip) %},{% endif %}
  148. {{ Workorder.Customer.Contact.Addresses.ContactAddress.state }}
  149. {{ Workorder.Customer.Contact.Addresses.ContactAddress.zip }}
  150. </p>
  151. {% for ContactPhone in Workorder.Customer.Contact.Phones.ContactPhone %}
  152. <p>{{ ContactPhone.number }} ({{ ContactPhone.useType }})</p>
  153. {% endfor %}
  154. {% for ContactEmail in Workorder.Customer.Contact.Emails.ContactEmail %}
  155. <p>{{ ContactEmail.address }}</p>
  156. {% endfor %}
  157. <br />
  158. {% for serializedID in Workorder.Serialized %}
  159. <h3>Work Order Item:</h3>
  160. <p>{% if Workorder.Serialized.description|strlen > 0 %}
  161. {{ Workorder.Serialized.description }}
  162. {% elseif Workorder.Serialized.Item.description|strlen > 0 %}
  163. {{ Workorder.Serialized.Item.description }}
  164. {% endif %}
  165. {% if Workorder.Serialized.colorName|strlen > 0 %}
  166. / {{ Workorder.Serialized.colorName }}
  167. {% endif %}
  168. {% if Workorder.Serialized.sizeName|strlen > 0 %}
  169. / {{ Workorder.Serialized.sizeName }}
  170. {% endif %}
  171. {% if Workorder.Serialized.serial|strlen > 0 %}
  172. / {{ Workorder.Serialized.serial }}
  173. {% endif %}</p>
  174. <br />
  175. {% endfor %}
  176. <h2>Started: {{Workorder.timeIn|correcttimezone|date ("m/d/y h:i a")}}<br />
  177. Due on: {{Workorder.etaOut|correcttimezone|date ("m/d/y h:i a")}}</h2>
  178. </div>
  179. <table class="lines">
  180. <tr>
  181. <th>Item/Labor</th>
  182. <th>Notes</th>
  183. <th>Charge</th>
  184. </tr>
  185. {% for WorkorderItem in Workorder.WorkorderItems.WorkorderItem %}
  186. <tr>
  187. {% if WorkorderLine.itemID != 0 %}
  188. <td class="description">
  189. </td>
  190. {% else %}
  191. <td class="description">
  192. {% if WorkorderItem.unitQuantity > 0 %}
  193. {{ WorkorderItem.unitQuantity }} &times;
  194. {% endif %}
  195. {{ WorkorderItem.Item.description }}
  196. {% if WorkorderItem.Discount %}
  197. <p>Discount: {{ WorkorderItem.Discount.name }} (-{{ WorkorderItem.SaleLine.calcLineDiscount|money }})</p>
  198. {% endif %}
  199. </td>
  200. {% endif %}
  201. <td class="notes">
  202. {{ WorkorderItem.note }}
  203. </td>
  204. {% if WorkorderItem.warranty == 'true' %}
  205. <td class="amount"> $0.00
  206. {% endif %}
  207. {% if WorkorderItem.warranty == 'false' %}
  208. <td class="amount">
  209. {{ WorkorderItem.SaleLine.calcSubtotal|money }}
  210. </td>
  211. {% endif %}
  212. </tr>
  213. {% endfor %}
  214. {% for WorkorderLine in Workorder.WorkorderLines.WorkorderLine %} <!--this loop is necessary for showing labor charges -->
  215. <tr>
  216. {% if WorkorderLine.itemID != 0 %}
  217. <td class="description">
  218. {{ WorkorderLine.Item.description }}
  219. {% if WorkorderLine.Discount %}
  220. <br />
  221. <p>Discount: {{ WorkorderLine.Discount.name }} (-{{ WorkorderLine.SaleLine.calcLineDiscount|money }})</p>
  222. {% endif %}
  223. </td>
  224. <td class="notes">
  225. {{ WorkorderLine.note }}
  226. </td>
  227. {% else %}
  228. <td class="notes" colspan="2">
  229. {{ WorkorderLine.note }}
  230. {% if WorkorderLine.Discount %}
  231. <br />
  232. Discount: {{ WorkorderLine.Discount.name }} (-{{ WorkorderLine.SaleLine.calcLineDiscount|money }})
  233. {% endif %}
  234. </td>
  235. {% endif %}
  236. <td class="amount">
  237. {{ WorkorderLine.SaleLine.calcSubtotal|money }}
  238. </td>
  239. </tr>
  240. {% endfor %}
  241. </table>
  242. <table class="totals">
  243. <tbody>
  244. <tr>
  245. <td>Labor</td>
  246. <td class="amount">
  247. {{Workorder.MetaData.labor|money}}
  248. </td>
  249. </tr>
  250. <tr>
  251. <td>Parts</td>
  252. <td class="amount">
  253. {{Workorder.MetaData.parts|money}}
  254. </td>
  255. </tr>
  256. {% if Workorder.MetaData.discount > 0 %}
  257. <tr>
  258. <td>Discounts</td>
  259. <td class="amount">
  260. -{{Workorder.MetaData.discount|money}}
  261. </td>
  262. </tr>
  263. {% endif %}
  264. <tr>
  265. <td>Tax</td>
  266. <td class="amount">
  267. {{Workorder.MetaData.tax|money}}
  268. </td>
  269. </tr>
  270. <tr class="total">
  271. <td>Total</td>
  272. <td class="amount">
  273. {{Workorder.MetaData.total|money}}
  274. </td>
  275. </tr>
  276. </tbody>
  277. </table>
  278. {% if Workorder.note|strlen > 0 %}
  279. <div class="notes">
  280. <h3>Notes:</h3>
  281. {{ Workorder.note|noteformat|raw }}
  282. </div>
  283. {% endif %}
  284. {% if parameters.type == 'shop-tag' %}
  285. {% if Workorder.internalNote|strlen > 0 %}
  286. <div class="notes">
  287. <h3>Internal Notes:</h3>
  288. {{ Workorder.internalNote|noteformat|raw }}
  289. </div>
  290. {% endif %}
  291. {% endif %}
  292. <img height="50" width="250" class="barcode" src="/barcode.php?type=receipt&number={{Workorder.systemSku}}">
  293. {% if parameters.type == 'invoice' %}
  294. {% if Workorder.Shop.ReceiptSetup.workorderAgree|strlen > 0 %}
  295. <div style="padding: 10px 0px">
  296. <p style="margin-bottom:40px;">{{ Workorder.Shop.ReceiptSetup.workorderAgree|noteformat|raw }}</p>
  297. X_______________________________
  298. <br/>
  299. {{ Workorder.Customer.firstName}} {{ Workorder.Customer.lastName}}
  300. </div>
  301. </div>
  302. {% endif %}
  303. {% endif %}
  304. {% endfor %}
  305. {% endblock content %}