|
@@ -326,10 +326,12 @@ function report_customer_payment (reporting){
|
|
var invoice;
|
|
var invoice;
|
|
var amount_in;
|
|
var amount_in;
|
|
_.each(AccountVoucher, function(item){
|
|
_.each(AccountVoucher, function(item){
|
|
|
|
+
|
|
var total_price = 0;
|
|
var total_price = 0;
|
|
var total_comision = 0;
|
|
var total_comision = 0;
|
|
var tcomision = 0;
|
|
var tcomision = 0;
|
|
var total_sale = 0;
|
|
var total_sale = 0;
|
|
|
|
+ total_sale = (item.amount);
|
|
var AccountInvoice = self.getAccountInvoice(item.reference);
|
|
var AccountInvoice = self.getAccountInvoice(item.reference);
|
|
_.each(AccountInvoice,function(item2) {
|
|
_.each(AccountInvoice,function(item2) {
|
|
var AccountInvoiceLine = self.getAccountInvoiceLine(item2.id);
|
|
var AccountInvoiceLine = self.getAccountInvoiceLine(item2.id);
|
|
@@ -337,13 +339,13 @@ function report_customer_payment (reporting){
|
|
|
|
|
|
if(item2.type == 'out_invoice'){
|
|
if(item2.type == 'out_invoice'){
|
|
total_comision = line_item.product_id.comision_vendedor;
|
|
total_comision = line_item.product_id.comision_vendedor;
|
|
- total_sale = (line_item.price_unit);
|
|
|
|
|
|
+
|
|
total_price = total_sale * line_item.quantity;
|
|
total_price = total_sale * line_item.quantity;
|
|
tcomision = (total_price*total_comision)/100;
|
|
tcomision = (total_price*total_comision)/100;
|
|
}
|
|
}
|
|
if(item2.type == 'out_refund'){
|
|
if(item2.type == 'out_refund'){
|
|
total_comision = line_item.product_id.comision_vendedor;
|
|
total_comision = line_item.product_id.comision_vendedor;
|
|
- total_sale = (line_item.price_unit);
|
|
|
|
|
|
+
|
|
total_price = -(total_sale * line_item.quantity);
|
|
total_price = -(total_sale * line_item.quantity);
|
|
tcomision = - ((total_price*total_comision)/100);
|
|
tcomision = - ((total_price*total_comision)/100);
|
|
}
|
|
}
|