Prechádzať zdrojové kódy

Retocar informes de resumen de ventas Dna

root 2 rokov pred
rodič
commit
55fac6ac82

+ 1 - 0
__openerp__.py

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

+ 1 - 0
models.py

@@ -58,6 +58,7 @@ class AccountInvoice(models.Model):
 				'reference': invoice.reference,
                 'amount_untaxed': invoice.amount_untaxed,
                 'residual': invoice.residual,
+				'is_anticipo': invoice.is_anticipo,
                 'amount_tax': invoice.amount_tax,
 				'amount_total': invoice.amount_total,
 				'amount_untaxed_currency': invoice.amount_untaxed * (invoice.company_id.currency_id.rate / invoice.currency_id.rate),

BIN
models.pyc


+ 2 - 0
static/src/js/reports/report_cuenta_resumen_dna.js

@@ -480,6 +480,7 @@ function report_cuenta_resumen_dna(reporting){
 
             var AccountInvoice = self.getAccountInvoice(item.id);
             _.each(AccountInvoice,function(item2) {
+              if(item2.is_anticipo == false){
               var total_sale = 0;
               var partner= self.getResPartner(item2.partner_id[0]);
               var currency = self.getResCurrency(item2.company_currency[0]).shift();
@@ -516,6 +517,7 @@ function report_cuenta_resumen_dna(reporting){
                   decimal_separator: CurrencyBase.decimal_separator,
 
                 });
+              }  
             });
           });
 

+ 65 - 64
static/src/js/reports/report_sale_resumen_dna.js

@@ -571,73 +571,74 @@ function report_sale_resumen_dna(reporting){
           var AccountJournal = self.AccountJournal;
           _.each(AccountJournal,function(item) {
 
-            var total_price = 0;
-            var price_unit = 0;
-
-            var payment_type = '';
-
-            var AccountInvoice = self.getAccountInvoice(item.id);
-            _.each(AccountInvoice,function(item2) {
-              var total_sale = 0;
-              var partner= self.getResPartner(item2.partner_id[0]);
-              var AccountInvoiceLine = self.getAccountInvoiceLine(item2.id);
-              _.each(AccountInvoiceLine, function(line_item){
-
-                if(item2.type == 'out_invoice'){
-                    if(line_item.product_id.standard_price >= 0){
+                  var total_price = 0;
+                  var price_unit = 0;
+
+                  var payment_type = '';
+
+                  var AccountInvoice = self.getAccountInvoice(item.id);
+                  _.each(AccountInvoice,function(item2) {
+                    var total_sale = 0;
+                    var partner= self.getResPartner(item2.partner_id[0]);
+                    var AccountInvoiceLine = self.getAccountInvoiceLine(item2.id);
+                    _.each(AccountInvoiceLine, function(line_item){
+                     if(item2.is_anticipo == false){
+                      if(item2.type == 'out_invoice'){
+                          if(line_item.product_id.standard_price >= 0){
+                                  total_sale = (line_item.price_unit);
+                                  total_price = total_sale * line_item.quantity;
+                          }else{
+                            price_unit = 0;
                             total_sale = (line_item.price_unit);
                             total_price = total_sale * line_item.quantity;
-                    }else{
-                      price_unit = 0;
-                      total_sale = (line_item.price_unit);
-                      total_price = total_sale * line_item.quantity;
-                    }
-                }
-                if(item2.type == 'out_refund'){
-                    if(line_item.product_id.standard_price >= 0){
-                        total_sale = (line_item.price_unit);
-                        total_price = -(total_sale * line_item.quantity);
-                    }else{
-                      total_sale = (line_item.price_unit);
-                      total_price = -(total_sale * line_item.quantity);
-                    }
-                }
-                data.push({
-                  //IDS
-                  id: line_item.id,
-                  product_id : line_item.product_id.id,
-                  invoice_id : item2.id,
-
-                  //DATAS
-                  product_brand_id : self.valorNull(line_item.product_id.product_brand_id),
-                  date_invoice: moment(item2.date_invoice).format('DD/MM/YYYY'),
-                  partner_id : item2.partner_id[0],
-                  partner_name : item2.partner_id[1],
-                  ruc: self.valorNull(item2.partner_id[2]),
-                  partner_email: self.valorNull(item2.partner_id[3]),
-                  partner_mobile: self.valorNull(item2.partner_id[4]),
-                  invoice_name : self.valorNull(item2.number),
-                  supplier_invoice_number: item2.supplier_invoice_number,
-                  product_code : self.valorNull(line_item.product_id.default_code),
-                  barcode : self.valorNull(line_item.product_id.ean13),
-                  product_name : line_item.product_id.name,
-                  item_price : accounting.formatMoney(total_sale,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
-                  qty : line_item.quantity,
-                  total_price : accounting.formatMoney(total_price,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
-                  user_id : self.valorNull(item2.user_id[0]),
-                  user_name : item2.user_id[1],
-
-                  //VALORES SIN FORMATEAR
-                  item_price_no_format : total_sale,
-                  total_price_no_format : total_price,
-
-                  //TOTAL FOOTER CONFIGURATION
-                  decimal_places : CurrencyBase.decimal_places,
-                  thousands_separator: CurrencyBase.thousands_separator,
-                  decimal_separator: CurrencyBase.decimal_separator,
+                          }
+                      }
+                      if(item2.type == 'out_refund'){
+                          if(line_item.product_id.standard_price >= 0){
+                              total_sale = (line_item.price_unit);
+                              total_price = -(total_sale * line_item.quantity);
+                          }else{
+                            total_sale = (line_item.price_unit);
+                            total_price = -(total_sale * line_item.quantity);
+                          }
+                      }
+                      data.push({
+                        //IDS
+                        id: line_item.id,
+                        product_id : line_item.product_id.id,
+                        invoice_id : item2.id,
+
+                        //DATAS
+                        product_brand_id : self.valorNull(line_item.product_id.product_brand_id),
+                        date_invoice: moment(item2.date_invoice).format('DD/MM/YYYY'),
+                        partner_id : item2.partner_id[0],
+                        partner_name : item2.partner_id[1],
+                        ruc: self.valorNull(item2.partner_id[2]),
+                        partner_email: self.valorNull(item2.partner_id[3]),
+                        partner_mobile: self.valorNull(item2.partner_id[4]),
+                        invoice_name : self.valorNull(item2.number),
+                        supplier_invoice_number: self.valorNull(item2.supplier_invoice_number),
+                        product_code : self.valorNull(line_item.product_id.default_code),
+                        barcode : self.valorNull(line_item.product_id.ean13),
+                        product_name : line_item.product_id.name,
+                        item_price : accounting.formatMoney(total_sale,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
+                        qty : line_item.quantity,
+                        total_price : accounting.formatMoney(total_price,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
+                        user_id : self.valorNull(item2.user_id[0]),
+                        user_name : item2.user_id[1],
+
+                        //VALORES SIN FORMATEAR
+                        item_price_no_format : total_sale,
+                        total_price_no_format : total_price,
+
+                        //TOTAL FOOTER CONFIGURATION
+                        decimal_places : CurrencyBase.decimal_places,
+                        thousands_separator: CurrencyBase.thousands_separator,
+                        decimal_separator: CurrencyBase.decimal_separator,
 
-                });
-              });
+                      });
+                    }
+                  });
             });
           });