Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/CubicERP/cubicerp
Browse files Browse the repository at this point in the history
  • Loading branch information
cubicerpdev committed Jul 30, 2018
2 parents 317bf24 + eb54933 commit 22afce5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 25 deletions.
59 changes: 36 additions & 23 deletions addons/l10n_pe_einvoice/reports/report_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
</div>
<div class="col-xs-3" style="border: 1px solid black;">
<table style="width:100%; line-height:20px;">
<tr class="text-center"><td><strong>FACTURA ELECTRONICA</strong></td></tr>
<tr class="text-center"><td><strong>RUC: <span t-field="o.company_id.partner_id.doc_number"/></strong></td></tr>
<tr class="text-center"><td><strong><span t-esc="o.number"/></strong></td></tr>
<tr class="text-center"><td><strong style="text-transform:uppercase;"><span t-field="o.sunat_payment_type"/> ELECTRÓNICA</strong></td></tr>
<tr class="text-center"><td><strong style="text-transform:uppercase;"><span t-field="o.company_id.partner_id.doc_type_abbr"/>: <span t-field="o.company_id.partner_id.doc_number"/></strong></td></tr>
<tr class="text-center"><td><strong><span t-field="o.number"/></strong></td></tr>
</table>
</div>
</div>

<div class="row" style="padding: 20px 10px 5px 0px">

<div class="col-xs-7">
<table style="width:100%; line-height:20px;">
<tr>
Expand All @@ -44,15 +45,34 @@
<td style="width:50%;">Señor(es)</td>
<td>: <strong><span t-field="o.partner_id.name"/></strong></td></tr>
<tr>
<td style="width:50%;">RUC</td>
<td style="width:50%;"><span t-field="o.partner_id.doc_type_abbr"/></td>
<td>: <strong><span t-field="o.partner_id.doc_number"/></strong></td>
</tr>
</table>
</div>

<div class="col-xs-5">
<table style="width:100%; line-height:20px;">
<tr>
<td style="width:50%;">Documento Origen</td>
<td>: <strong><span t-field="o.origin"/></strong></td></tr>
<tr>
<td style="width:50%;">Guía de Remisión Remitente</td>
<td>: <strong><span t-field="o.picking"/></strong></td></tr>
<tr>
<td style="width:50%;">Otros</td>
<td>: <strong><span t-field="o.other_comment"/></strong></td></tr>
</table>
</div>

<div class="col-xs-12">
<table style="width:100%; line-height:20px;">
<tr>
<td style="width:50%;">Establecimiento del emisor</td>
<td style="width:28.5%;">Establecimiento del emisor</td>
<td>: <strong><span t-field="o.partner_id.street"/> <span t-esc="o.company_id.street2"/> <span t-esc="o.company_id.city"/> - <span t-esc="o.company_id.state_id.name"/> - <span t-esc="o.company_id.country_id.name"/></strong></td>
</tr>
<tr>
<td style="width:50%;">Tipo de moneda</td>
<td style="width:28.5%;">Tipo de moneda</td>
<td>:
<strong>
<t t-if="o.currency_id.long_name"><span t-field="o.currency_id.long_name"/></t>
Expand All @@ -61,39 +81,32 @@
</td>
</tr>
<tr>
<td style="width:50%;">Observación</td>
<td style="width:28.5%;">Observación</td>
<td>: <strong><span t-field="o.comment"/></strong></td></tr>
</table>
</div>
<div class="col-xs-5">
<table style="width:100%; line-height:20px;">
<tr>
<td style="width:50%;">GUIA DE REMISION REMITENTE</td>
<td>: <strong><span t-field="o.picking"/></strong></td></tr>
<tr>
<td style="width:50%;">OTROS</td>
<td>: <strong><span t-field="o.other_comment"/></strong></td></tr>
</table>
</div>

</div>
<div class="row" style="padding: 10px 10px;">
<table style="width:100%; line-height:20px; border: 1px solid black; padding: 10px 10px;">
<table style="width:100%; line-height:20px; border:1px solid black; padding:10px 10px;">
<thead style="border: 1px solid black;">
<tr>
<th class="text-center" style="padding: 2px"><strong>Cantidad</strong></th>
<th class="text-center" style="padding: 2px"><strong>Unidad Medida</strong></th>
<th class="text-center" style="padding: 2px"><strong>Código</strong></th>
<th class="text-left" style="padding: 2px"><strong>Descripción</strong></th>
<th class="text-right" style="padding: 2px"><strong>Valor Unitario</strong></th>
<th class="text-center" style="padding: 2px"><strong>Descripción</strong></th>
<th class="text-center" style="padding: 2px"><strong>Valor Unitario</strong></th>
<th class="text-center" style="padding: 2px"><strong>Valor Total</strong></th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tbody class="invoice_tbody" style="font-size:12px">
<tr t-foreach="o.invoice_line" t-as="l">
<td class="text-center" style="padding: 2px"><span t-field="l.quantity"/></td>
<td class="text-center" style="padding: 2px"><span t-field="l.uos_id"/></td>
<td class="text-center" style="padding: 2px"><span t-field="l.product_id.code"/></td>
<td class="text-left" style="padding: 2px"><span t-field="l.product_id.code"/></td>
<td class="text-left" style="padding: 2px"><span t-field="l.product_id.name"/></td>
<td class="text-right" style="padding: 2px"><span t-field="l.price_unit"/></td>
<td class="text-center" style="padding: 2px"><span t-field="l.price_unit"/></td>
<td class="text-center" style="padding: 2px"><span t-field="l.price_subtotal"/></td>
</tr>
</tbody>
</table>
Expand Down
16 changes: 15 additions & 1 deletion addons/l10n_pe_ple/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,23 @@ def _get_bienes_servicios(self, cr, uid, context=None):

def _get_vinculacion(self, cr, uid, context=None):
return self.pool.get('base.element').get_as_selection(cr, uid, 'PE.SUNAT.TABLA_27', context=context)


def _compute_doc_type_abbr(self, cr, uid, ids, field_name, arg, context=None):
# todo: se sugiere incluir las abreviaturas del tipo de documento en la respectiva tabla
abbrs = {'A': 'Cédula Diplomática de Identidad',
'7': 'Pasaporte',
'6': 'RUC',
'4': 'Carnet de Extranjeria',
'1': 'DNI',
'0': 'NIT'}
res = {}
for partner in self.browse(cr, uid, ids, context=context):
res[partner.id] = partner.doc_type and abbrs[partner.doc_type] or False
return res

_columns = {
'doc_type': fields.selection (_get_doc_types, 'Document type'),
'doc_type_abbr': fields.function(_compute_doc_type_abbr, string="Document type abbreviation", type="char"),
'doc_number': fields.char('Document Number',32,select=1),
'sunat_bienes_servicios': fields.selection (_get_bienes_servicios, 'Bienes / Servicios', help="""Clasificación de los bienes y servicios adquiridos (Tabla 30)
Aplicable solo a los contribuyentes que hayan obtenido ingresos mayores a 1,500 UIT en el ejercicio anterior"""),
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==1.2.3
mercurial==3.2.2
mercurial==4.6.2
sphinx-patchqueue==0.4.0

0 comments on commit 22afce5

Please sign in to comment.