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