|
@@ -367,7 +367,7 @@ function report_mrp_mrp(reporting) {
|
|
|
BuildTable: function() {
|
|
|
var self = this;
|
|
|
var data = [];
|
|
|
-
|
|
|
+ var CurrencyBase = self.ResCompany[0].currency_id;
|
|
|
var ResMrp = self.ResMrp;
|
|
|
_.each(ResMrp, function(item) {
|
|
|
if (item.state == 'confirmed') {
|
|
@@ -390,9 +390,9 @@ function report_mrp_mrp(reporting) {
|
|
|
id: item.id,
|
|
|
name: self.valorNull(item.name),
|
|
|
product: item.product_id[1],
|
|
|
- prod_price_unit: item.prod_price_unit,
|
|
|
- product_qty: item.product_qty,
|
|
|
- product_price: item.product_price,
|
|
|
+ prod_price_unit: accounting.formatMoney(item.prod_price_unit, '', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
|
|
|
+ product_qty: accounting.formatNumber(item.product_qty,2,'.',','),
|
|
|
+ product_price: accounting.formatMoney(item.product_price, '', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
|
|
|
date_planned: moment(item.date_planned).format("DD/MM/YYYY"),
|
|
|
date_from: moment(item.date_from).format("DD/MM/YYYY"),
|
|
|
date_to: moment(item.date_to).format("DD/MM/YYYY"),
|
|
@@ -400,6 +400,11 @@ function report_mrp_mrp(reporting) {
|
|
|
user: item.user_id[1],
|
|
|
state: state,
|
|
|
product_id: item.product_id[0],
|
|
|
+ quantity_no_format:item.product_qty,
|
|
|
+ total_no_format:item.product_price,
|
|
|
+ decimal_places: CurrencyBase.decimal_places,
|
|
|
+ thousands_separator: CurrencyBase.thousands_separator,
|
|
|
+ decimal_separator: CurrencyBase.decimal_separator,
|
|
|
});
|
|
|
});
|
|
|
self.content = data;
|
|
@@ -433,7 +438,16 @@ function report_mrp_mrp(reporting) {
|
|
|
var column = table.bootstrapTable('getVisibleColumns');
|
|
|
var row = table.bootstrapTable('getData');
|
|
|
|
|
|
- row.push({});
|
|
|
+ var product_qty = QuantityFooter(row);
|
|
|
+ var product_price = TotalFooter(row);
|
|
|
+
|
|
|
+ row.push({
|
|
|
+ date_planned : 'Totales',
|
|
|
+ product_qty : product_qty,
|
|
|
+ product_price : product_price,
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
if (action === 'pdf') {
|
|
|
var data = _.map(column, function(val) {
|
|
|
return val.field
|