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