Fix stock quantity column in product report
This commit is contained in:
parent
b9cf440c6c
commit
5693ece1a3
|
|
@ -105,7 +105,10 @@ class EntityPresenter {
|
||||||
].contains(field);
|
].contains(field);
|
||||||
|
|
||||||
static bool isFieldAmount(String field) {
|
static bool isFieldAmount(String field) {
|
||||||
return ['quantity'].contains(field);
|
return [
|
||||||
|
'quantity',
|
||||||
|
'stock_quantity',
|
||||||
|
].contains(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isFieldNumeric(String field) {
|
static bool isFieldNumeric(String field) {
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ ReportResult productReport(
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case ProductReportFields.stock_quantity:
|
case ProductReportFields.stock_quantity:
|
||||||
value = product.stockQuantity;
|
value = product.stockQuantity.toDouble();
|
||||||
break;
|
break;
|
||||||
case ProductReportFields.notification_threshold:
|
case ProductReportFields.notification_threshold:
|
||||||
value = productNotificationThreshold(
|
value = productNotificationThreshold(
|
||||||
|
|
@ -174,7 +174,10 @@ ReportResult productReport(
|
||||||
|
|
||||||
if (value.runtimeType == bool) {
|
if (value.runtimeType == bool) {
|
||||||
row.add(product.getReportBool(value: value));
|
row.add(product.getReportBool(value: value));
|
||||||
} else if (column == ProductReportFields.quantity) {
|
} else if ([
|
||||||
|
ProductReportFields.quantity,
|
||||||
|
ProductReportFields.stock_quantity
|
||||||
|
].contains(column)) {
|
||||||
row.add(product.getReportDouble(
|
row.add(product.getReportDouble(
|
||||||
value: value,
|
value: value,
|
||||||
currencyId: userCompany.company.currencyId,
|
currencyId: userCompany.company.currencyId,
|
||||||
|
|
|
||||||
|
|
@ -1355,7 +1355,7 @@ class ReportResult {
|
||||||
} else if (columnType == ReportColumnType.number) {
|
} else if (columnType == ReportColumnType.number) {
|
||||||
final currencyId = values['${column}_currency_id'];
|
final currencyId = values['${column}_currency_id'];
|
||||||
value = formatNumber(values[column], context,
|
value = formatNumber(values[column], context,
|
||||||
formatNumberType: column == 'quantity'
|
formatNumberType: column.toLowerCase().contains('quantity')
|
||||||
? FormatNumberType.double
|
? FormatNumberType.double
|
||||||
: FormatNumberType.money,
|
: FormatNumberType.money,
|
||||||
currencyId:
|
currencyId:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue