Prechádzať zdrojové kódy

Agregar en en dresumen de cuenta dna una posible fecha de pago

root 2 rokov pred
rodič
commit
3062a68f68

+ 1 - 0
__openerp__.py

@@ -13,6 +13,7 @@
         'eiru_reports',
         'product_brand',
         'extra_accountinvoice_anticipo',
+        'eiru_datepay_accountinvoice',
     ],
     'qweb': [
         'static/src/xml/*.xml',

+ 1 - 0
models.py

@@ -68,6 +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,
 			})
 
 		return values

BIN
models.pyc


+ 37 - 54
static/src/js/reports/report_cuenta_resumen_dna.js

@@ -275,7 +275,7 @@ function report_cuenta_resumen_dna(reporting){
         ====================================================================*/
         fetchAccountInvoice: function () {
             var self = this;
-              var content = self.AccountInvoice;
+            var content = self.AccountInvoice;
             var store = self.$el.find('#current-store').val();
             var period = self.$el.find('#current-period').val();
             var company = self.$el.find('#current-company').val();
@@ -362,46 +362,43 @@ function report_cuenta_resumen_dna(reporting){
             });
         },
 
+        /*====================================================================
+            ACCOUNT INVOICE LINE
+        ====================================================================*/
+        fetchAccountInvoiceLine: function () {
+            var self = this;
+            var categ_ids = [];
+            var category = self.$el.find('#current-category').val();
+            var invoice_ids = _.flatten(_.map(self.AccountInvoice, function (item) {
+                return item.id;
+            }));
+            var domain = [
+                ['invoice_id','in',invoice_ids],
+            ];
 
+            if(category){
+                var category_ids = _.map(_.filter(self.ProductCategory,function (item) {
+                    return item.id == category;
+                }), function(map){
+                    return map.id;
+                });
 
-                      /*====================================================================
-                          ACCOUNT INVOICE LINE
-                      ====================================================================*/
-                      fetchAccountInvoiceLine: function () {
-                          var self = this;
-                          var categ_ids = [];
-                          var category = self.$el.find('#current-category').val();
-                          var invoice_ids = _.flatten(_.map(self.AccountInvoice, function (item) {
-                              return item.id;
-                          }));
-                          var domain = [
-                              ['invoice_id','in',invoice_ids],
-                          ];
-
-                          if(category){
-                              var category_ids = _.map(_.filter(self.ProductCategory,function (item) {
-                                  return item.id == category;
-                              }), function(map){
-                                  return map.id;
-                              });
-
-
-                              categ_ids =  _.map(_.filter(self.ProductCategory,function (item) {
-                                  return _.contains(category_ids, item.parent_id[0]) || item.id == category;
-                              }), function(map){
-                                  return map.id;
-                              });
-                          };
+                categ_ids =  _.map(_.filter(self.ProductCategory,function (item) {
+                    return _.contains(category_ids, item.parent_id[0]) || item.id == category;
+                }), function(map){
+                    return map.id;
+                });
+            };
 
-                          if(category && category != 9999999){
-                              domain.push(['product_id.categ_id','in',categ_ids]);
-                          }
+            if(category && category != 9999999){
+                domain.push(['product_id.categ_id','in',categ_ids]);
+            }
 
-                          var AccountInvoiceLine = new model.web.Model('account.invoice.line');
-                          return AccountInvoiceLine.call('getAccountInvoiceLineDental',[domain], {
-                              context: new model.web.CompoundContext()
-                          });
-                      },
+            var AccountInvoiceLine = new model.web.Model('account.invoice.line');
+                return AccountInvoiceLine.call('getAccountInvoiceLineDental',[domain], {
+                    context: new model.web.CompoundContext()
+            });
+        },
 
 
         /*====================================================================
@@ -517,16 +514,6 @@ function report_cuenta_resumen_dna(reporting){
         },
 
 
-        /*====================================================================
-            GET ACCOUNT INVOICE
-        ====================================================================*/
-        // getAccountInvoice: function (id) {
-        //   var self = this;
-        //   return _.filter(self.AccountInvoice,function (item) {
-        //     return item.journal_id[0] === id;
-        //   });
-        // },
-
         getAccountInvoice:function() {
             var self = this;
             var content = self.AccountInvoice;
@@ -689,7 +676,7 @@ function report_cuenta_resumen_dna(reporting){
                var AccountInvoiceLine = self.getAccountInvoiceLine(item2.id);
                _.each(AccountInvoiceLine, function(line_item){
                   description_product = description_product + " " + line_item.product_id.name
-              });
+               });
 
                     var partner= self.getResPartner(item2.partner_id[0]);
                     var currency = self.getResCurrency(item2.company_currency[0]).shift();
@@ -707,7 +694,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_due:  moment(item2.date_due).format('DD/MM/YYYY'),
+                        date_pay:  moment(item2.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),
@@ -719,9 +706,6 @@ function report_cuenta_resumen_dna(reporting){
                         user_id : self.valorNull(item2.user_id[0]),
                         user_name : item2.user_id[1],
 
-                        //VALORES SIN FORMATEAR
-
-
                         //TOTAL FOOTER CONFIGURATION
                         decimal_places : CurrencyBase.decimal_places,
                         thousands_separator: CurrencyBase.thousands_separator,
@@ -734,7 +718,6 @@ function report_cuenta_resumen_dna(reporting){
 
           self.content = data;
           self.loadTable(data);
-          console.log(data);
           self.$el.find('.report-form').css('display','block');
           self.$el.find('.search-form').unblock();
           self.$el.find('.report-form').unblock();
@@ -808,7 +791,7 @@ function report_cuenta_resumen_dna(reporting){
                   invoice_name : {columnWidth: 25, halign:'center'},
                   supplier_invoice_number : {columnWidth: 24, halign:'center'},
                   forma: forma,
-                  date_due: {columnWidth: 23, halign:'center'},
+                  date_pay: {columnWidth: 23, halign:'center'},
                   product_name: {columnWidth: 23, halign:'left'},
                   amount_total: {columnWidth: 20, halign:'right'},
                   amount_pagado : {columnWidth: 20, halign:'right'},

+ 1 - 1
static/src/reports/report_cuenta_resumen_dna.xml

@@ -110,7 +110,7 @@
                           <th data-field="invoice_name" data-align="center">Referencia</th>
                           <th data-field="supplier_invoice_number" data-align="center">Factura</th>
                           <th data-field="forma" data-align="center">Forma</th>
-                          <th data-field="date_due" data-align="center">Vence</th>
+                          <th data-field="date_pay" data-align="center">Fecha Pos.Pago</th>
                           <th data-field="product_name" data-align="center">Producto</th>
                           <th data-field="amount_total" data-footer-formatter="totalTotalFormatter" data-align="right">Monto Total</th>
                           <th data-field="amount_pagado" data-footer-formatter="totalPagadoFormatter" data-align="right">Monto Pagado</th>