work_order_company.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- Declarar el informe -->
  5. <report
  6. id="action_work_order_company_report"
  7. string="Work order (company copy)"
  8. model="repair.workorder"
  9. report_type="qweb-pdf"
  10. name="repair_workorder.company_report"
  11. file="workorder_company"
  12. />
  13. <record id="action_work_order_company_report" model="ir.actions.report.xml">
  14. <field name="paperformat_id" ref="repair_workorder.paperformat_repair_workorder"/>
  15. </record>
  16. <!-- Informe -->
  17. <template id="company_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.company_report_document')"/>
  21. </t>
  22. </t>
  23. </template>
  24. <template id="workorder_company">
  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">PARTE TRABAJO <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. <span class="text-md">Fecha Recogida: <span t-if="o.planned_end_date" t-field="o.planned_end_date"/></span><br/>
  118. Cliente: <span t-if="o.partner_id.name" t-field="o.partner_id.name"/><br/>
  119. 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/>
  120. Fecha Entrada: <span t-if="o.order_date" t-field="o.order_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></p>
  147. </t>
  148. <t t-if="o.causes">
  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. <div t-field="o.causes"/>
  153. </div>
  154. </div>
  155. </t>
  156. <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
  157. <div class="row">
  158. <div class="col-xs-6">
  159. <p class="text-center bordered sign"><br/><br/><br/><br/>Firma cliente</p>
  160. </div>
  161. <div class="col-xs-6">
  162. <p class="agreement">Doy mi consentimiento para la realización de las operaciones y montaje del material aquí descritos.</p>
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <!-- Contenido del informe -->
  168. <template id="company_report_document">
  169. <t t-call="report.html_container">
  170. <t t-call="repair_workorder.workorder_company"/>
  171. </t>
  172. </template>
  173. </data>
  174. </openerp>