Преглед на файлове

Retocar informe de comision.

SEBAS преди 3 месеца
родител
ревизия
97cdc3cf5d

+ 9 - 3
static/src/js/reports/report_customer_payment.js

@@ -377,14 +377,17 @@ function report_customer_payment (reporting){
                             product_name : product_name,
                             amount_in: accounting.formatMoney(cobrado,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
                             total_comision: accounting.formatMoney(tcomision,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
+                            total_comision_vendedor: accounting.formatMoney(tcomision,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
                             date: item.date,
                             empl_name: self.valorNull(item.employee_id),
                             employee_name: self.valorNull(item.employee_id2),
                             journal_id: item.journal_id[0],
                             partner_id: item.partner_id[0],
-
+                            user_id : self.valorNull(item.user_id[0]),
+                            user_name : item.user_id[1],
                             in_amount: cobrado,
                             tcomision: tcomision,
+                            tcomision_vendedor: tcomision,
 
                             //TOTAL FOOTER CONFIGURATION
                             decimal_places : CurrencyBase.decimal_places,
@@ -429,11 +432,13 @@ function report_customer_payment (reporting){
 
             var total_price = totalPriceFormatter(row);
             var tcomision = totalUtilityFormatter(row);
+            var tcomision_vendedor = totalUtilityvenFormatter(row);
 
             row.push({
                 date_voucher: 'Totales',
                 total_price: total_price,
                 tcomision:tcomision,
+                tcomision_vendedor:tcomision_vendedor,
             })
 
             if (action === 'pdf') {
@@ -461,9 +466,10 @@ function report_customer_payment (reporting){
                   partner : {columnWidth: 21, halign:'left'},
                   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'},
+                  tcomision : {columnWidth: 18, halign:'right'},
+                  user_name : {columnWidth: 18, halign:'left'},
+                  tcomision_vendedor : {columnWidth: 18, halign:'right'},
                 };
                 /*
                 ============================================================

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

@@ -567,8 +567,8 @@ function report_sale_utility_vendor(reporting){
                   qty : line_item.quantity,
                   total_price : accounting.formatMoney(total_price,'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
                   tcomision : accounting.formatMoney((tcomision),'', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
-                  employee_id : self.valorNull(item2.employee_id[0]),
-                  employee_name : item2.employee_id[1],
+                  user_id : self.valorNull(item2.user_id[0]),
+                  user_name : item2.user_id[1],
 
                   //VALORES SIN FORMATEAR
                   item_price_no_format : total_sale,
@@ -661,7 +661,7 @@ function report_sale_utility_vendor(reporting){
                   qty : {columnWidth: 10, halign:'center'},
                   total_price : {columnWidth: 20, halign:'right'},
                   tcomision : {columnWidth: 18, halign:'right'},
-                  employee_name : {columnWidth: 22, halign:'left'},
+                  user_name : {columnWidth: 22, halign:'left'},
 
                 };
                 /*

+ 26 - 5
static/src/reports/report_customer_payment.xml

@@ -105,16 +105,20 @@
                                     data-align="right"
                                     data-footer-formatter="totalPriceFormatter"
                                     >Monto</th>
+                                <th data-field="employee_name"
+                                    data-align="left"
+                                    >Cobrador</th>
                                 <th data-field="tcomision"
                                     data-align="right"
                                     data-footer-formatter="totalUtilityFormatter"
                                     >Comisión</th>
-                                <!-- <th data-field="empl_name"
+                                <th data-field="user_name"
                                     data-align="left"
-                                    >Cob. Orig.</th> -->
-                                <th data-field="employee_name"
-                                    data-align="left"
-                                    >Cobrador</th>
+                                    >Vendedor</th>
+                                <th data-field="tcomision_vendedor"
+                                    data-align="right"
+                                    data-footer-formatter="totalUtilityvenFormatter"
+                                    >Comisión</th>
                             </tr>
                         </thead>
                     </table>
@@ -157,6 +161,23 @@
                     },0)
                     return accounting.formatNumber(amount,decimal_places,thousands_separator,decimal_separator);
                 }
+                function totalUtilityvenFormatter(rowsTable) {
+                    var decimal_places = 0;
+                    var thousands_separator = '.';
+                    var decimal_separator = ',';
+                    if(rowsTable.length > 0){
+                        decimal_places = rowsTable[0].decimal_places;
+                        thousands_separator = rowsTable[0].thousands_separator;
+                        decimal_separator = rowsTable[0].decimal_separator;
+                    }
+                    var amount =  _.reduce(_.map(rowsTable,function(item){
+                        return item.tcomision_vendedor;
+                    }), function(memo, num){
+                        return memo + num;
+                    },0)
+                    return accounting.formatNumber(amount,decimal_places,thousands_separator,decimal_separator);
+                }
+
 
 
                 <!--

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

@@ -105,7 +105,7 @@
                           <th data-field="qty" data-align="center">Cant.</th>
                           <th data-field="total_price" data-footer-formatter="totalPriceFormatter" data-align="right">Total Venta</th>
                           <th data-field="tcomision" data-footer-formatter="totalUtilityFormatter" data-align="right">Comisión</th>
-                          <th data-field="employee_name" data-align="left">Cobrador</th>
+                          <th data-field="user_name" data-align="left">Cobrador</th>
                         </tr>
                       </thead>