|
@@ -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');
|