Browse Source

ADD FIX Actualización de eiru reporting totales en vista de reportes y agregar filtro de metodo de pago para restaurant

Sebas 7 years ago
parent
commit
e3d8a28524

+ 1 - 28
__openerp__.py

@@ -7,34 +7,7 @@
     'depends': ['base','eiru_assets'],
     'depends': ['base','eiru_assets'],
     'qweb': [
     'qweb': [
         'static/src/xml/*.xml',
         'static/src/xml/*.xml',
-        'static/src/reports/report_resumen_ingresos.xml',
-        'static/src/reports/report_resumen_egresos.xml',
-        'static/src/reports/report_crm.xml',
-        'static/src/reports/report_mensajecrm.xml',
-        'static/src/reports/report_phonecall.xml',
-        'static/src/reports/report_pos.xml',
-        'static/src/reports/report_stock_move.xml',
-        'static/src/reports/report_project.xml',
-        'static/src/reports/report_works.xml',
-        'static/src/reports/report_invoice_balance.xml',
-        'static/src/reports/report_ranking_pos_orders_customer.xml',
-        'static/src/reports/report_ranking_sales_orders_customer.xml',
-        'static/src/reports/report_ranking_purchases_orders_supplier.xml',
-        'static/src/reports/ranking_sales_orders_product_cy.xml',
-        'static/src/reports/report_vouchers.xml',
-        'static/src/reports/report_mrp.xml',
-        'static/src/reports/report_pos_orders.xml',
-        'static/src/reports/reporting_accountpending.xml',
-        'static/src/reports/reporting_account.xml',
-        'static/src/reports/report_sales_invoice_analysis.xml',
-        'static/src/reports/report_purchases_invoice_analysis.xml',
-        'static/src/reports/report_product_utility.xml',
-        'static/src/reports/report_utilidad_producto.xml',
-        'static/src/reports/ranking_pos_orders_product_cy.xml',
-        'static/src/reports/ranking_purchases_orders_product_cy.xml',
-        'static/src/reports/ranking_mrp_orders_product_cy.xml',
-        'static/src/reports/report_mrp.xml',
-        'static/src/reports/report_stock.xml'
+        'static/src/reports/*.xml'
     ],
     ],
     'data': [
     'data': [
         'templates.xml',
         'templates.xml',

+ 3 - 3
static/src/js/configuration_reporting.js

@@ -39,7 +39,7 @@ function configuration_reporting (instance, widget) {
                 action: 'RankingSalesOrdersProductcy'
                 action: 'RankingSalesOrdersProductcy'
             },
             },
             {
             {
-                title: 'Ranking de Clientes (Sale Order)',
+                title: 'Ranking de Clientes (Ventas)',
                 description: 'Permite visualizar el ranking de clientes.',
                 description: 'Permite visualizar el ranking de clientes.',
                 action: 'ReportRankingSalesOrdersCustomer'
                 action: 'ReportRankingSalesOrdersCustomer'
             },
             },
@@ -59,7 +59,7 @@ function configuration_reporting (instance, widget) {
                 action: 'RankingPosOrdersProductcy'
                 action: 'RankingPosOrdersProductcy'
             },
             },
             {
             {
-                title: 'Ranking de Clientes (PointOfSale)',
+                title: 'Ranking de Clientes (Punto de Venta)',
                 description: 'Permite visualizar el ranking de clientes.',
                 description: 'Permite visualizar el ranking de clientes.',
                 action: 'ReportRankingPosOrdersCustomer'
                 action: 'ReportRankingPosOrdersCustomer'
             },
             },
@@ -74,7 +74,7 @@ function configuration_reporting (instance, widget) {
                 action: 'RankingPurchasesOrdersProductcy'
                 action: 'RankingPurchasesOrdersProductcy'
             },
             },
             {
             {
-                title: 'Ranking de Proveedores (Purchase Order)',
+                title: 'Ranking de Proveedores (Compras)',
                 description: 'Permite visualizar el ranking de proveedores.',
                 description: 'Permite visualizar el ranking de proveedores.',
                 action: 'ReportRankingPurchasesOrdersSupplier'
                 action: 'ReportRankingPurchasesOrdersSupplier'
             },
             },

+ 0 - 12
static/src/js/reports/ranking_purchases_orders_product_cy.js

@@ -341,20 +341,8 @@ function ranking_purchases_orders_product_cy (reporting) {
                 return b.qty - a.qty
                 return b.qty - a.qty
             });
             });
 
 
-            var amount_total_total = _.reduce(_.map(ranking,function(map){
-                return(map.qty);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            ranking.push({
-                product: "Total",
-                countPurchasesOrder: accounting.formatNumber((amount_total_total),0,".",","),
-            });
-
             self.content = ranking;
             self.content = ranking;
             this.loadTable(ranking);
             this.loadTable(ranking);
-
         },
         },
 
 
         factSearch: function(){
         factSearch: function(){

+ 34 - 0
static/src/js/reports/report_invoice_balance.js

@@ -331,6 +331,40 @@ function report_invoice_balance (reporting){
                     return inv.partner_id == partner[0];
                     return inv.partner_id == partner[0];
                 });
                 });
             }
             }
+
+            var amount_entry_num = _.reduce(_.map(content,function(map){
+                return(map.entry_num);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            var amount_egress_num = _.reduce(_.map(content,function(map){
+                return(map.egress_num);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            var amount_to_receive_num = _.reduce(_.map(content,function(map){
+                return(map.to_receive_num);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            var amount_to_pay_num = _.reduce(_.map(content,function(map){
+                return(map.to_pay_num);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                number: "Total",
+                entry: accounting.formatNumber(amount_entry_num,0,".",","),
+                egress: accounting.formatNumber(amount_egress_num,0,".",","),
+                to_receive: accounting.formatNumber(amount_to_receive_num,0,".",","),
+                to_pay: accounting.formatNumber(amount_to_pay_num,0,".",","),
+            });
+
+
             self.loadTable(content)
             self.loadTable(content)
         },
         },
         loadTable:function(rowsTable){
         loadTable:function(rowsTable){

+ 12 - 25
static/src/js/reports/report_pos.js

@@ -296,17 +296,6 @@ function report_pos(reporting){
                 });
                 });
             });
             });
 
 
-            var amount_total_total = _.reduce(_.map(data,function(map){
-                return(map.amount);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            data.push({
-                number: "Total",
-                amount_total: accounting.formatNumber((amount_total_total),0,".",","),
-            });
-
             self.content = data;
             self.content = data;
             this.loadTable(data);
             this.loadTable(data);
         },
         },
@@ -391,6 +380,18 @@ function report_pos(reporting){
                     return inv.partner_id == partner[0];
                     return inv.partner_id == partner[0];
                 });
                 });
             }
             }
+
+            var amount_total_total = _.reduce(_.map(content,function(map){
+                return(map.amount);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                number: "Total",
+                amount_total: accounting.formatNumber((amount_total_total),0,".",","),
+            });
+
             self.loadTable(content)
             self.loadTable(content)
         },
         },
 
 
@@ -405,20 +406,6 @@ function report_pos(reporting){
             var self = this;
             var self = this;
             var rows=self.rowsData;
             var rows=self.rowsData;
 
 
-            var amount = _.reduce(_.map(rows,function(map){
-                return(map.amount);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            // if (rows.length > 0){
-            //     rows.push({
-            //         number: "Total",
-            //         amount_total: accounting.formatNumber((amount),0,".",","),
-            //
-            //     });
-            // }
-
             return rows;
             return rows;
         },
         },
 
 

+ 22 - 10
static/src/js/reports/report_pos_orders.js

@@ -279,16 +279,16 @@ function report_pos_orders(reporting){
                 });
                 });
             });
             });
 
 
-            var amount_total_total = _.reduce(_.map(data,function(map){
-                return(map.price_subtotal_total);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            data.push({
-                order_name: "Total",
-                price_subtotal_incl: accounting.formatNumber((amount_total_total),0,".",","),
-            });
+            // var amount_total_total = _.reduce(_.map(data,function(map){
+            //     return(map.price_subtotal_total);
+            // }),function(memo, num){
+            //     return memo + num;
+            // },0);
+            //
+            // data.push({
+            //     order_name: "Total",
+            //     price_subtotal_incl: accounting.formatNumber((amount_total_total),0,".",","),
+            // });
 
 
             self.content = data;
             self.content = data;
             self.loadTable(data)
             self.loadTable(data)
@@ -368,6 +368,18 @@ function report_pos_orders(reporting){
                     return inv.product_id == product[0];
                     return inv.product_id == product[0];
                 });
                 });
             }
             }
+
+            var amount_total_total = _.reduce(_.map(content,function(map){
+                return(map.amount);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                order_name: "Total",
+                price_subtotal_incl: accounting.formatNumber((amount_total_total),0,".",","),
+            });
+
             self.loadTable(content);
             self.loadTable(content);
         },
         },
 
 

+ 12 - 11
static/src/js/reports/report_puchases.js

@@ -263,17 +263,6 @@ function report_puchases (reporting){
                     });
                     });
             });
             });
 
 
-            var amount_total_total = _.reduce(_.map(data,function(map){
-                return(map.amount);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            data.push({
-                number: "Total",
-                amount_total: accounting.formatNumber((amount_total_total),0,".",","),
-            });
-
             self.newInvoice = data;
             self.newInvoice = data;
             this.loadTable(data);
             this.loadTable(data);
         },
         },
@@ -318,6 +307,18 @@ function report_puchases (reporting){
                     return inv.partner_id == prov[0];
                     return inv.partner_id == prov[0];
                 });
                 });
             }
             }
+
+            var amount_total_total = _.reduce(_.map(newInvoice,function(map){
+                return(map.amount);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            newInvoice.push({
+                number: "Total",
+                amount_total: accounting.formatNumber((amount_total_total),0,".",","),
+            });
+
             self.loadTable(newInvoice)
             self.loadTable(newInvoice)
         },
         },
         // cargara la tabla
         // cargara la tabla

+ 12 - 11
static/src/js/reports/report_purchases_invoice_analysis.js

@@ -293,17 +293,6 @@ function report_purchases_invoice_analysis (reporting){
                 });
                 });
             });
             });
 
 
-            var amount_total_total = _.reduce(_.map(data,function(map){
-                return(map.amount);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            data.push({
-                number: "Total",
-                standar_tot: accounting.formatNumber((amount_total_total),2,".",","),
-            });
-
             self.rowsData=data;
             self.rowsData=data;
             self.rowOrigin=data;
             self.rowOrigin=data;
             self.loadTable(data)
             self.loadTable(data)
@@ -400,6 +389,18 @@ function report_purchases_invoice_analysis (reporting){
                     return inv.id_product == product[0];
                     return inv.id_product == product[0];
                 });
                 });
             }
             }
+
+            var amount_total_total = _.reduce(_.map(self.rowsData,function(map){
+                return(map.amount);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            self.rowsData.push({
+                number: "Total",
+                standar_tot: accounting.formatNumber((amount_total_total),2,".",","),
+            });
+
             self.loadTable(self.rowsData);
             self.loadTable(self.rowsData);
         },
         },
         search: function () {
         search: function () {

+ 0 - 12
static/src/js/reports/report_ranking_pos_orders_customer.js

@@ -330,22 +330,10 @@ function report_ranking_pos_orders_customer (reporting) {
                 }
                 }
             }
             }
 
 
-            var amount_total_total = _.reduce(_.map(data,function(map){
-                return(map.countPosTotal);
-            }),function(memo, num){
-                return memo + num;
-            },0);
-
-            data.push({
-                name: "Total",
-                quantity: accounting.formatNumber((amount_total_total),0,".",","),
-            });
-
             data.sort(function (a, b) {
             data.sort(function (a, b) {
                 return b.countPosOrder - a.countPosOrder
                 return b.countPosOrder - a.countPosOrder
             });
             });
 
 
-
             self.content = data;
             self.content = data;
             self.loadTable(data);
             self.loadTable(data);
         },
         },

+ 19 - 0
static/src/js/reports/report_vouchers.js

@@ -327,6 +327,25 @@ function report_vouchers (reporting){
                     return inv.partner_id == partner[0];
                     return inv.partner_id == partner[0];
                 });
                 });
             }
             }
+
+            var amount_in_amount = _.reduce(_.map(content,function(map){
+                return(map.in_amount);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            var amount_out_amount = _.reduce(_.map(content,function(map){
+                return(map.out_amount);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                number: "Total",
+                amount_in: accounting.formatNumber((amount_in_amount),0,".",","),
+                amount_out: accounting.formatNumber((amount_out_amount),0,".",","),
+            });
+
             self.loadTable(content)
             self.loadTable(content)
         },
         },
         loadTable:function(rowsTable){
         loadTable:function(rowsTable){

+ 11 - 0
static/src/js/reports/reporting_account.js

@@ -326,6 +326,17 @@ function reporting_account (reporting){
                 });
                 });
             }
             }
 
 
+            var amount_total_amount = _.reduce(_.map(content,function(map){
+                return(map.total_residual);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                reference: "Total",
+                amount_residual: accounting.formatNumber((amount_total_amount),0,".",","),
+            });
+
             self.loadTable(content)
             self.loadTable(content)
         },
         },
 
 

+ 12 - 0
static/src/js/reports/reporting_accountpending.js

@@ -324,6 +324,18 @@ function reporting_accountpending (reporting){
                     return inv.partner_id == partner[0];
                     return inv.partner_id == partner[0];
                 });
                 });
             }
             }
+
+            var amount_total_amount = _.reduce(_.map(content,function(map){
+                return(map.total_residual);
+            }),function(memo, num){
+                return memo + num;
+            },0);
+
+            content.push({
+                reference: "Total",
+                amount_residual: accounting.formatNumber((amount_total_amount),0,".",","),
+            });
+            
             self.loadTable(content)
             self.loadTable(content)
         },
         },
         loadTable:function(rowsTable){
         loadTable:function(rowsTable){