SEBAS 1 год назад
Родитель
Сommit
e1960e109f

+ 16 - 1
static/src/js/reports/report_purchases.js

@@ -95,7 +95,7 @@ function report_purchases (reporting){
                 return item.id;
             }));
             var filter =[['state', 'in',['open','paid']],['type', 'in', ['in_invoice','in_refund']],['journal_id', 'in',journal_ids]];
-            var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids','timbrado'];
+            var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids','timbrado','imputa_irp'];
             var defer = $.Deferred();
             var Invoice = new instance.web.Model('account.invoice');
             Invoice.query(field).filter(filter).all().then(function (results) {
@@ -201,10 +201,12 @@ function report_purchases (reporting){
             var iva_10 = 0;
             var IVA = 0;
             var TAX = 0;
+            var IRE = 0;
             var adjunto;
             var untaxed;
             var condicion;
             var contador = 0;
+            var monto_ire =  0;
             var icons = 0;
             var imagen;
             var img;
@@ -242,6 +244,7 @@ function report_purchases (reporting){
                 iva_10 = 0;
                 tasa_10 = 0;
                 tasa_5 = 0;
+
                 // Determinar si fue aplicado algun impuesto a la factura.
                 if(invoice.amount_total == invoice.amount_untaxed){
                     untaxed = accounting.formatNumber(invoice.amount_untaxed,"","");
@@ -255,6 +258,14 @@ function report_purchases (reporting){
                         tasa_5 = accounting.formatNumber(invoice.amount_untaxed,"","");
                     }
                 }
+
+                // Determinar si tiene IRE.
+                if(invoice.imputa_irp){
+                    monto_ire = invoice.amount_total;
+                }else{
+                   monto_ire =  0;
+                }
+
                 // Obtener binario del archivo adjunto
                 adjunto = self.getAttachment(invoice.attachment_ids[0]);
                 imagen = _.flatten(adjunto);
@@ -286,6 +297,7 @@ function report_purchases (reporting){
                     tasa_5 : tasa_5,
                     iva_5 : iva_5,
                     amount_untaxed: untaxed,
+                    monto_ire : monto_ire,
                     tipo_operacion : 8,
                     condicion_compra : condicion,
                     cantidad_cuotas : cuota,
@@ -420,6 +432,9 @@ function report_purchases (reporting){
                     // Monto de la compra no gravada o exenta
                     datos.push(newInvoice.amount_untaxed);
                     datos.push('\t');
+                    // Monto de IRE
+                    datos.push(newInvoice.monto_ire);
+                    datos.push('\t');
                     // Tipo de operacion
                     datos.push(newInvoice.tipo_operacion);
                     datos.push('\t');

+ 14 - 1
static/src/js/reports/report_sales.js

@@ -90,7 +90,7 @@ function report_sales (reporting){
                 return item.id;
             }));
             var filter =[['state', 'in',['open','paid']],['type', 'in', ['out_invoice','out_refund']],['journal_id', 'in',journal_ids]];
-            var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids'];
+            var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids', 'imputa_irp'];
             var defer = $.Deferred();
             var Invoice = new instance.web.Model('account.invoice');
             Invoice.query(field).filter(filter).all().then(function (results) {
@@ -202,6 +202,7 @@ function report_sales (reporting){
             var TAX;
             var adjunto;
             var untaxed;
+            var monto_ire;
             var contador = 0;
             var icons = 0;
             var imagen;
@@ -246,6 +247,8 @@ function report_sales (reporting){
                 iva_10 = 0;
                 tasa_10 = 0;
                 tasa_5 = 0;
+                monto_ire = 0;
+
                 // Determinar si fue aplicado algun impuesto a la factura.
                 if(invoice.amount_total == invoice.amount_untaxed){
                     untaxed = accounting.formatNumber(invoice.amount_untaxed,"","");
@@ -259,6 +262,12 @@ function report_sales (reporting){
                         tasa_5 = accounting.formatNumber(invoice.amount_untaxed,"","");
                     }
                 }
+                // Determinar si tiene IRE.
+                if(invoice.imputa_irp){
+                    monto_ire = invoice.amount_total;
+                }else{
+                   monto_ire =  0;
+                }
                 total = 0;
                 // Calcular total del ingreso
                 total = parseInt(tasa_10) + parseInt(iva_10) + parseInt(tasa_5) + parseInt(iva_5) + parseInt(untaxed);
@@ -294,6 +303,7 @@ function report_sales (reporting){
                     iva_5 : iva_5,
                     amount: untaxed,
                     total : total,
+                    monto_ire : monto_ire,
                     condicion_venta : condicion,
                     cantidad_cuotas : cuota,
                     number: self.valorNull(valor_timbrado.timbrado),
@@ -442,6 +452,9 @@ function report_sales (reporting){
                     // Monto de la venta no gravada o exenta
                     datos.push(newInvoice.amount);
                     datos.push('\t');
+                    // Monto de IRE
+                    datos.push(newInvoice.monto_ire);
+                    datos.push('\t');
                     // Monto del ingreso
                     datos.push(newInvoice.total);
                     datos.push('\t');

+ 13 - 11
static/src/reports/report_purchases.xml

@@ -17,16 +17,17 @@
                         <tr>
                             <th>
                                 <label for="rectificativa"> Rectificativa</label>
-                                <input type="checkbox" name="Rectificativa" id="rectificativa"/>     
-                            </th> 
+                                <input type="checkbox" name="Rectificativa" id="rectificativa"/>
+                            </th>
                         </tr>
+
                         <tr>
                             <th>
-                                <button class="oe_button oe_form_button oe_highlight btn btn-block btn-lg" value="txt" id="txt">Exportar <i class="fa fa-file-text fa-lg"></i></button>   
+                                <button class="oe_button oe_form_button oe_highlight btn btn-block btn-lg" value="txt" id="txt">Exportar <i class="fa fa-file-text fa-lg"></i></button>
                             </th>
                         </tr>
                     </table>
-                </div>   
+                </div>
             </div>
             <table id="table"
                 data-pagination="true"
@@ -50,14 +51,15 @@
                         <th data-field="tipo_documento">Tipo de Documento</th>
                         <th data-field="number">Número de Documento</th>
                         <th data-field="date">Fecha Documento</th>
-                        <th data-field="tasa_10">Monto de la compra a la Tasa 10%</th>
-                        <th data-field="iva_10">IVA Crédito 10%</th>
-                        <th data-field="tasa_5">Monto de la compra a la Tasa 5%</th>
-                        <th data-field="iva_5">IVA Crédito 5%</th>
-                        <th data-field="amount_untaxed">Monto de Compra no Gravada o Exenta</th>
+                        <th data-field="tasa_10" data-align="right">Monto de la compra a la Tasa 10%</th>
+                        <th data-field="iva_10" data-align="right">IVA Crédito 10%</th>
+                        <th data-field="tasa_5" data-align="right">Monto de la compra a la Tasa 5%</th>
+                        <th data-field="iva_5" data-align="right">IVA Crédito 5%</th>
+                        <th data-field="amount_untaxed" data-align="right">Monto de Compra no Gravada o Exenta</th>
+                        <th data-field="monto_ire" data-align="right">Monto de IRE</th>
                         <th data-field="tipo_operacion">Tipo de operación</th>
                         <th data-field="condicion_compra">Condición de Compra</th>
-                        <th data-field="cantidad_cuotas">Cantidad de Cuotas</th>
+                        <th data-field="cantidad_cuotas" data-align="right">Cantidad de Cuotas</th>
                         <th data-field="download_icon" data-align="center">Documentos</th>
                     </tr>
                 </thead>
@@ -65,4 +67,4 @@
             <div id="dialog"></div>
         </div>
     </t>
-</template>
+</template>

+ 14 - 12
static/src/reports/report_sales.xml

@@ -19,24 +19,25 @@
                             <tr>
                                 <th>
                                     <label for="rectificativa"> Rectificativa</label>
-                                    <input type="checkbox" name="Rectificativa" id="rectificativa"/>     
-                                </th> 
+                                    <input type="checkbox" name="Rectificativa" id="rectificativa"/>
+                                </th>
                             </tr>
+  
                             <tr>
                                 <th>
-                                    <button class="oe_button oe_form_button oe_highlight btn btn-block btn-lg" value="txt" id="txt">Exportar <i class="fa fa-file-text fa-lg"></i></button> 
+                                    <button class="oe_button oe_form_button oe_highlight btn btn-block btn-lg" value="txt" id="txt">Exportar <i class="fa fa-file-text fa-lg"></i></button>
                                 </th>
                             </tr>
                         </table>
 
-                    </div>   
+                    </div>
                 </div>
             <!-- </div> -->
             <table id="table"
                 data-pagination="true"
                 data-toggle="table"
                 data-reorderable-columns="true"
-                data-toolbar="#toolbar"                
+                data-toolbar="#toolbar"
                 data-buttons-class="oe_button oe_form_button oe_highlight"
                 data-height="auto"
                 data-classes="table table-hover table-condensed table-bordered"
@@ -53,12 +54,13 @@
                         <th data-field="tipo_documento">Tipo de Documento</th>
                         <th data-field="numero_documento">Número Documento</th>
                         <th data-field="date">Fecha Documento</th>
-                        <th data-field="tasa_10">Monto de la venta a la Tasa 10%</th>
-                        <th data-field="iva_10">IVA Débito 10%</th>
-                        <th data-field="tasa_5">Monto de la venta a la Tasa 5%</th>
-                        <th data-field="iva_5">IVA Débito 5%</th>
-                        <th data-field="amount">Monto de la Venta no Grabada o Exenta</th>
-                        <th data-field="total">Monto del Ingreso</th>
+                        <th data-field="tasa_10" data-align="right">Monto de la venta a la Tasa 10%</th>
+                        <th data-field="iva_10" data-align="right">IVA Débito 10%</th>
+                        <th data-field="tasa_5" data-align="right">Monto de la venta a la Tasa 5%</th>
+                        <th data-field="iva_5" data-align="right">IVA Débito 5%</th>
+                        <th data-field="amount" data-align="right">Monto de la Venta no Gravada o Exenta</th>
+                        <th data-field="monto_ire" data-align="right">Monto de IRE</th>
+                        <th data-field="total" data-align="right">Monto del Ingreso</th>
                         <th data-field="condicion_venta">Condición de Venta</th>
                         <th data-field="cantidad_cuotas">Cantidad de Cuotas</th>
                         <th data-field="number">Número de Timbrado</th>
@@ -70,4 +72,4 @@
             <div id="dialog"></div>
         </div>
     </t>
-</template>
+</template>