|
@@ -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'},
|