work_order_partner.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- Declarar el informe -->
  5. <report
  6. id="action_work_order_partner_report"
  7. string="Work order (partner copy)"
  8. model="repair.workorder"
  9. report_type="qweb-pdf"
  10. name="repair_workorder.partner_report"
  11. file="workorder_partner"
  12. />
  13. <record id="action_work_order_partner_report" model="ir.actions.report.xml">
  14. <field name="paperformat_id" ref="repair_workorder.paperformat_repair_workorder"/>
  15. </record>
  16. <!-- Informe -->
  17. <template id="partner_report">
  18. <t t-call="report.html_container">
  19. <t t-foreach="doc_ids" t-as="doc_id">
  20. <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'repair_workorder.partner_report_document')"/>
  21. </t>
  22. </t>
  23. </template>
  24. <template id="workorder_partner">
  25. <div class="page">
  26. <style>
  27. body {
  28. color: #000;
  29. font-family: Arial, Helvetica, sans-serif;
  30. font-size: 14px;
  31. letter-spacing: 0.0px;
  32. line-height: 20px;
  33. margin:0;
  34. padding:0;
  35. word-spacing:1px;
  36. }
  37. .text-lg {
  38. font-size: 18px;
  39. font-weight: bold;
  40. }
  41. .text-md {
  42. display: inline-block;
  43. font-size: 18px;
  44. font-weight: bold;
  45. }
  46. .bordered {
  47. border: 1px solid #000;
  48. padding: 10px;
  49. }
  50. /* http://www.squareonemd.co.uk/how-to-crop-an-image-with-a-css-class/ */
  51. .image-container {
  52. width: 366px;
  53. text-align: center;
  54. }
  55. .image-cropper {
  56. position: relative;
  57. height: 45px;
  58. overflow: hidden;
  59. }
  60. .centered {
  61. position: absolute;
  62. left: -50%;
  63. top: -50%;
  64. max-width: 100%;
  65. }
  66. .bottom {
  67. position: absolute;
  68. bottom: 0px;
  69. max-width: 100%;
  70. }
  71. .top {
  72. position: absolute;
  73. top: 0px;
  74. max-width: 100%;
  75. }
  76. .separator {
  77. border-top: 1px solid #000;
  78. margin-top: 20px;
  79. margin-bottom: 20px;
  80. }
  81. </style>
  82. <section class="header">
  83. <div class="row">
  84. <div class="col-xs-12">
  85. <p class="text-center" style="margin-top: 10px; margin-bottom: 10px;"><span class="text-lg">COMPROBANTE SAT <span t-if="o.name" t-field="o.name"/></span></p>
  86. <div class="image-container">
  87. <div class="image-cropper">
  88. <img class="top" t-att-src="'data:image/png;base64,%s' % printBarcode(o.id, 732, 472)"/>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </section>
  94. <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
  95. <div class="row">
  96. <div class="col-xs-12">
  97. MATERIAL A RECOGER<br/>
  98. <t t-if="o.line_ids">
  99. <table class="order_lines" style="width: 100%;">
  100. <thead>
  101. <tr>
  102. <th style="width: 75%;">Concepto</th>
  103. <th style="width: 25%;" class="text-right">Uds.</th>
  104. </tr>
  105. </thead>
  106. <tbody>
  107. <t t-foreach="o.line_ids" t-as="line">
  108. <tr>
  109. <td><span t-if="line.description" t-field="line.description"></span></td>
  110. <td class="text-right"><span t-if="line.quantity" t-field="line.quantity"></span></td>
  111. </tr>
  112. </t>
  113. </tbody>
  114. </table>
  115. </t>
  116. <br/>
  117. Cliente: <span t-if="o.partner_id.name" t-field="o.partner_id.name"/><br/>
  118. Teléfono: <span t-if="o.partner_id.phone" t-field="o.partner_id.phone"/><t t-if="o.partner_id.mobile"> - <span t-field="o.partner_id.mobile"/></t><br/>
  119. Fecha Entrada: <span t-if="o.order_date" t-field="o.order_date"/><br/>
  120. Fecha Recogida: <span t-if="o.planned_end_date" t-field="o.planned_end_date"/>
  121. </div>
  122. </div>
  123. <t t-if="o.consumed_ids">
  124. <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
  125. <table class="consumed_lines" style="width: 100%;">
  126. <thead>
  127. <tr>
  128. <th style="width: 45%;">Concepto</th>
  129. <th style="width: 15%;" class="text-right">Uds.</th>
  130. <th style="width: 20%;" class="text-right">Precio</th>
  131. <th style="width: 20%;" class="text-right">Subtotal</th>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. <t t-foreach="o.consumed_ids" t-as="consumed">
  136. <tr>
  137. <td><span t-if="consumed.description" t-field="consumed.description"/></td>
  138. <td class="text-right"><span t-if="consumed.quantity" t-field="consumed.quantity"/></td>
  139. <td class="text-right"><span t-if="consumed.price_unit" t-field="consumed.price_unit"/></td>
  140. <td class="text-right"><span t-if="consumed.subtotal and consumed.price_unit" t-raw="consumed.quantity * consumed.price_unit"/></td>
  141. </tr>
  142. </t>
  143. </tbody>
  144. </table>
  145. <t t-set="total" t-value="get_total(o)"/>
  146. <p class="text-right" style="margin-top: 10px; margin-bottom: 0px;">Total <span class="text-md" t-esc="total"></span> EUR</p>
  147. </t>
  148. <section class="warning">
  149. <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
  150. <div class="row">
  151. <div class="col-xs-12">
  152. <p style="text-align: justify; margin-bottom: 0px;">
  153. <small class="warning-text">Presupuesto estimado, si durante la reparación el importe se modificara sustancialmente se consultará al cliente para su aprobación.</small>
  154. </p>
  155. </div>
  156. </div>
  157. </section>
  158. <t t-if="o.partner_id.company_id">
  159. <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
  160. <div class="row">
  161. <div class="col-xs-12">
  162. <p class="company-info text-center">
  163. <t t-if="o.partner_id.company_id.name"><span t-field="o.partner_id.company_id.name"/></t>
  164. <t t-if="o.partner_id.company_id.street">- <span t-field="o.partner_id.company_id.street"/>,</t>
  165. <t t-if="o.partner_id.company_id.zip"> <span t-field="o.partner_id.company_id.zip"/></t>
  166. <t t-if="o.partner_id.company_id.city">- <span t-field="o.partner_id.company_id.city"/></t>
  167. <t t-if="o.partner_id.company_id.state_id">(<span t-field="o.partner_id.company_id.state_id.name"/>)</t>
  168. <t t-if="o.partner_id.company_id.phone">- <span t-field="o.partner_id.company_id.phone"/></t>
  169. <t t-if="o.partner_id.company_id.email">- <span t-field="o.partner_id.company_id.email"/></t>
  170. <t t-if="o.partner_id.company_id.website">- <span t-field="o.partner_id.company_id.website"/></t>
  171. </p>
  172. </div>
  173. </div>
  174. </t>
  175. </div>
  176. </template>
  177. <!-- Contenido del informe -->
  178. <template id="partner_report_document">
  179. <t t-call="report.html_container">
  180. <t t-call="repair_workorder.workorder_partner"/>
  181. </t>
  182. </template>
  183. </data>
  184. </openerp>