Quellcode durchsuchen

Agregar nuevo informe de comisión por pagos.

sebas vor 3 Jahren
Ursprung
Commit
ce670180f5

+ 4 - 0
models.py

@@ -116,6 +116,10 @@ class AccountVoucher(models.Model):
 				'id': voucher.id,
 				'number':voucher.number,
 				'seq_invoice':voucher.seq_invoice,
+				'employee_id': [
+					voucher.employee_id.id,
+					voucher.employee_id.name
+				],
 				'employee_id2': [
 					voucher.employee_id2.id,
 					voucher.employee_id2.name

+ 4 - 2
static/src/js/reports/report_customer_payment.js

@@ -155,7 +155,7 @@ function report_customer_payment (reporting){
             var self = this;
             var defer = $.Deferred();
             var AccountVoucher = new model.web.Model('account.voucher');
-            AccountVoucher.query(['id', 'number','reference','seq_invoice','partner_id','employee_id2','journal_id','amount','date','number']).filter([['state', '=', 'posted']]).all().then(function(results){
+            AccountVoucher.query(['id', 'number','reference','seq_invoice','partner_id','employee_id', 'employee_id2','journal_id','amount','date','number']).filter([['state', '=', 'posted']]).all().then(function(results){
                 defer.resolve(results);
             });
             return defer;
@@ -173,7 +173,7 @@ function report_customer_payment (reporting){
             var self = this;
             var defer = $.Deferred();
             var domain = [
-                ['state', 'in',['open','paid']],
+                ['state', 'in',['paid']],
                 ['type', 'in', ['out_invoice','out_refund']],
             ];
             var AccountInvoice = new model.web.Model('account.invoice');
@@ -321,6 +321,7 @@ function report_customer_payment (reporting){
                             amount_in: accounting.formatMoney(total_price,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
                             total_comision: accounting.formatMoney(tcomision,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
                             date: item.date,
+                            // empl_name: item.employee_id[1],
                             employee_name: item.employee_id2[1],
                             journal_id: item.journal_id[0],
                             partner_id: item.partner_id[0],
@@ -404,6 +405,7 @@ function report_customer_payment (reporting){
                   product_name : {columnWidth: 20, halign:'left'},
                   amount_in : {columnWidth: 18, halign:'right'},
                   tcomision : {columnWidth: 18, halign:'right'},
+                  // empl_name: {columnWidth: 18, halign:'left'},
                   employee_name : {columnWidth: 18, halign:'left'},
                 };
                 /*

+ 1 - 1
static/src/js/reports/report_sale_utility_vendor.js

@@ -280,7 +280,7 @@ function report_sale_utility_vendor(reporting){
             }
 
             var domain = [
-                ['state', 'in',['open','paid']],
+                ['state', 'in',['paid']],
                 ['type', 'in', ['out_invoice','out_refund']],
                 ['journal_id','in',journal_ids],
             ];

+ 4 - 1
static/src/reports/report_customer_payment.xml

@@ -109,9 +109,12 @@
                                     data-align="right"
                                     data-footer-formatter="totalUtilityFormatter"
                                     >Comisión</th>
+                                <!-- <th data-field="empl_name"
+                                    data-align="left"
+                                    >Cob. Orig.</th> -->
                                 <th data-field="employee_name"
                                     data-align="left"
-                                    >Cobrador</th>
+                                    >Cob. Real</th>
                             </tr>
                         </thead>
                     </table>