You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
10 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <template id="report_debtor_card">
  5. <t t-call="report.html_container">
  6. <t t-call="report.internal_layout">
  7. <div class="page">
  8. <t t-foreach="docs" t-as="o">
  9. <div class="oe_structure"/>
  10. <div class="row">
  11. <div class="col-xs-6" style="margin-top:30px;">
  12. <h2>
  13. <span>Customer:</span>
  14. <span t-field="o.name"/>
  15. </h2>
  16. </div>
  17. </div>
  18. <t t-foreach="o.sale_order_ids" t-as="so">
  19. <t t-set="state_name" t-value="dict(so.fields_get(allfields=['state'])['state']['selection'])[so.state]"/>
  20. <h3>
  21. <span>Order N°:</span>
  22. <t t-esc="so.name"/>&#160;&#160;<span>Status:</span>
  23. <t t-esc="state_name"/>
  24. </h3>
  25. <div class="row mt32 mb32" id="informations">
  26. <div t-if="so.client_order_ref"
  27. class="col-xs-3">
  28. <strong>Your Reference:</strong>
  29. <p t-field="so.client_order_ref"/>
  30. </div>
  31. <div t-if="so.date_order" class="col-xs-3">
  32. <strong>Date Ordered:</strong>
  33. <p t-field="so.date_order" t-options='{"format": "d MMMM y"}'/>
  34. </div>
  35. <div t-if="so.user_id.name"
  36. class="col-xs-3">
  37. <strong>Salesperson:</strong>
  38. <p t-field="so.user_id.name"/>
  39. </div>
  40. <div t-if="so.payment_term"
  41. class="col-xs-3">
  42. <strong>Payment Term:</strong>
  43. <p t-field="so.payment_term"/>
  44. </div>
  45. </div>
  46. <!--<table class="table table-condensed">-->
  47. <table class="table table-condensed">
  48. <thead>
  49. <tr>
  50. <th>Description</th>
  51. <th class="text-right">Quantity</th>
  52. <th class="text-right">Unit Price
  53. </th>
  54. <th class="text-right">Price</th>
  55. </tr>
  56. </thead>
  57. <tbody class="sale_tbody">
  58. <tr t-foreach="so.order_line" t-as="l">
  59. <td>
  60. <span t-field="l.name"/>
  61. </td>
  62. <td class="text-right">
  63. <span t-esc="'%.1f'%(l.product_uom_qty)"/>
  64. <span groups="product.group_uom"
  65. t-field="l.product_uom"/>
  66. </td>
  67. <td class="text-right">
  68. <span t-field="l.price_unit"/>
  69. </td>
  70. <td class="text-right">
  71. <span t-field="l.price_subtotal"/>
  72. </td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <div class="row">
  77. <div class="col-xs-4 pull-right">
  78. <table class="table table-condensed">
  79. <tr class="border-black">
  80. <td>
  81. <strong>Total</strong>
  82. </td>
  83. <td class="text-right">
  84. <span t-field="so.amount_total"
  85. t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;so.pricelist_id.currency_id&quot;}"/>
  86. </td>
  87. </tr>
  88. </table>
  89. </div>
  90. </div>
  91. <!-- Related Invoices -->
  92. <t t-if="so.invoice_ids">
  93. <table class="table table-condensed"
  94. style="font-size:120%;">
  95. <tr>
  96. <th style="text-align:center;">Related Invoices</th>
  97. </tr>
  98. </table>
  99. <table class="table table-striped table-condensed"
  100. style="font-size:90%;">
  101. <tr>
  102. <th>Date</th>
  103. <th>Description</th>
  104. <th>Status</th>
  105. <th>Quantity</th>
  106. <th class="text-right">Unit Price
  107. </th>
  108. <th class="text-right">Total</th>
  109. </tr>
  110. <t t-foreach="so.invoice_ids" t-as="i">
  111. <t t-set="state_name" t-value="dict(i.fields_get(allfields=['state'])['state']['selection'])[i.state]"/>
  112. <tr t-foreach="i.invoice_line"
  113. t-as="il">
  114. <td>
  115. <span t-esc="i.date_invoice"/>
  116. </td>
  117. <td>
  118. <span t-esc="il.name"/>
  119. </td>
  120. <td>
  121. <span t-esc="state_name"/>
  122. </td>
  123. <td>
  124. <span t-esc="il.quantity"/>
  125. </td>
  126. <td class="text-right">
  127. <span t-esc="il.price_unit"/>
  128. </td>
  129. <td class="text-right">
  130. <span t-esc="il.price_subtotal "/>
  131. </td>
  132. </tr>
  133. </t>
  134. </table>
  135. <t t-set="total"
  136. t-value="sum(so.mapped('invoice_ids.amount_total'))"/>
  137. <t t-set="pending"
  138. t-value="so.amount_total - total"/>
  139. <div class="row">
  140. <div class="col-xs-4 pull-right">
  141. <table class="table table-condensed">
  142. <tr class="border-black">
  143. <td>
  144. <strong>Total</strong>
  145. </td>
  146. <td class="text-right">
  147. <span t-esc="total"/>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td>
  152. <strong>Pending</strong>
  153. </td>
  154. <td class="text-right">
  155. <span t-esc="pending"/>
  156. </td>
  157. </tr>
  158. </table>
  159. </div>
  160. </div>
  161. <hr style="border-top: dotted 1px;"/>
  162. </t>
  163. <t t-if="not so.invoice_ids">
  164. <table class="table table-condensed"
  165. style="font-size:120%;">
  166. <tr>
  167. <th style="text-align:center;">No Invoices for this order</th>
  168. </tr>
  169. </table>
  170. <hr style="border-top: dotted 1px;"/>
  171. </t>
  172. </t>
  173. <p style="text-align: center;">---- Printed:
  174. <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%A, %B %d, %Y')"/>
  175. ----
  176. </p>
  177. </t>
  178. </div>
  179. </t>
  180. </t>
  181. </template>
  182. </data>
  183. </openerp>