Browse Source

Retocar informe de DNA

root 3 năm trước cách đây
mục cha
commit
e74c5be7cf
2 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 1 1
      models.py
  2. 8 1
      static/src/js/reports/report_cuenta_resumen_dna.js

+ 1 - 1
models.py

@@ -68,7 +68,7 @@ class AccountInvoice(models.Model):
 				'amount_tax_currency': invoice.amount_tax * (invoice.company_id.currency_id.rate / invoice.currency_id.rate),
 				'amount_total_currency': invoice.amount_total * (invoice.company_id.currency_id.rate / invoice.currency_id.rate),
 				'comment' : invoice.comment,
-				'date_pay' : invoice.date_pay or "",
+				'date_pay' : invoice.date_pay,
 			})
 
 		return values

+ 8 - 1
static/src/js/reports/report_cuenta_resumen_dna.js

@@ -664,6 +664,7 @@ function report_cuenta_resumen_dna(reporting){
             var AccountInvoice = self.getAccountInvoice();
             _.each(AccountInvoice,function(item2) {
               var description_product = '';
+              var date_pay = '';
               if(item2.is_anticipo == false){
               var total_sale = 0;
               var forma = 'Contado';
@@ -673,6 +674,12 @@ function report_cuenta_resumen_dna(reporting){
                if (item2.credito == true){
                   forma = 'Credito'
                };
+               if (!item2.date_pay){
+                  date_pay = ''
+               };
+               if (item2.date_pay){
+                  date_pay = item2.date_pay
+               };
                var AccountInvoiceLine = self.getAccountInvoiceLine(item2.id);
                _.each(AccountInvoiceLine, function(line_item){
                   description_product = description_product + " " + line_item.product_id.name
@@ -694,7 +701,7 @@ function report_cuenta_resumen_dna(reporting){
                         invoice_name : self.valorNull(item2.number),
                         supplier_invoice_number: self.valorNull(item2.supplier_invoice_number),
                         forma: forma,
-                        date_pay:  moment(item2.date_pay).format('DD/MM/YYYY'),
+                        date_pay:  moment(date_pay).format('DD/MM/YYYY'),
                         product_name: description_product,
                         amount_total: accounting.formatMoney(item2.amount_total_currency, '', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
                         amount_pagado:accounting.formatMoney(item2.amount_total - item2.residual,'',CurrencyBase.decimal_places,CurrencyBase.thousands_separator,CurrencyBase.decimal_separator),