getOrderItemsList function
dynamic
getOrderItemsList(
- dynamic datamodel,
- dynamic orderno,
- dynamic amount,
- dynamic amountpaid,
- dynamic isUser,
Implementation
getOrderItemsList(datamodel, orderno, amount, amountpaid, isUser) {
isUser = isUser ?? true;
amount = fromMoney(amount);
amountpaid = fromMoney(amountpaid);
var unpaid =
'${datamodel.getInt(datamodel.expressValue({}, '$amount-$amountpaid'))}';
Map itemList = {
100: {
gItem: {gType: '$gText$gValue', gLabel: 'Order #', gValue: orderno}
},
200: {
gItem: {gType: gSizedbox, gHeight: 15.0}
},
300: {
gItem: {
gType: '$gText$gValue',
gLabel: 'Total',
gValue: toMoney(amount),
gFontWeight: FontWeight.bold
}
},
400: {
gItem: {
gType: '$gText$gValue',
gLabel: 'Paid',
gValue: toMoney(amountpaid),
gFontWeight: FontWeight.bold
}
},
500: {
gItem: {
gType: gSizedbox,
gValue: 10.0,
}
},
600: {
gItem: {
gType: '$gText$gValue',
gLabel: 'Unpaid',
gValue: toMoney(unpaid),
gFontWeight: FontWeight.bold
}
},
700: {
gItem: {
gType: gSizedbox,
gValue: 20.0,
}
},
1000: {
gItem: {
gType: gBtn,
gLabel: 'Print receipt',
gFunction: 'thirdPrintReceipt$isUser',
gAfter: gPaid
}
},
1100: {
gItem: {
gType: gSizedbox,
gValue: 20.0,
}
},
1200: {
gItem: {
gType: gBtn,
gLabel: 'Cancel',
gFunction: 'thirdPrintReceiptCancel',
}
},
};
return itemList;
}