feat: syn product
This commit is contained in:
@@ -60,12 +60,12 @@ class PrintDataoutputs {
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text:
|
||||
'${product.product.price!.toIntegerFromText.currencyFormatRp} x ${product.quantity}',
|
||||
'${product.product.price!.currencyFormatRp} x ${product.quantity}',
|
||||
width: 8,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: '${product.product.price!.toIntegerFromText * product.quantity}'
|
||||
text: '${product.product.price! * product.quantity}'
|
||||
.toIntegerFromText
|
||||
.currencyFormatRp,
|
||||
width: 4,
|
||||
@@ -328,8 +328,7 @@ class PrintDataoutputs {
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (product.product.price!.toIntegerFromText * product.quantity)
|
||||
.currencyFormatRp,
|
||||
text: (product.product.price! * product.quantity).currencyFormatRp,
|
||||
width: 4,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
@@ -398,8 +397,7 @@ class PrintDataoutputs {
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (products[0].product.price!.toIntegerFromText *
|
||||
products[0].quantity)
|
||||
text: (products[0].product.price! * products[0].quantity)
|
||||
.currencyFormatRp,
|
||||
width: 4,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
@@ -430,8 +428,7 @@ class PrintDataoutputs {
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (products[0].product.price!.toIntegerFromText *
|
||||
products[0].quantity)
|
||||
text: (products[0].product.price! * products[0].quantity)
|
||||
.currencyFormatRp,
|
||||
width: 4,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
@@ -610,8 +607,8 @@ class PrintDataoutputs {
|
||||
styles: const PosStyles(bold: true, align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: '${product.product.price!.toIntegerFromText * product.quantity}'
|
||||
.currencyFormatRpV2,
|
||||
text:
|
||||
'${product.product.price! * product.quantity}'.currencyFormatRpV2,
|
||||
width: 4,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.right),
|
||||
),
|
||||
@@ -626,8 +623,7 @@ class PrintDataoutputs {
|
||||
final subTotalPrice = products.fold<int>(
|
||||
0,
|
||||
(previousValue, element) =>
|
||||
previousValue +
|
||||
(element.product.price!.toIntegerFromText * element.quantity));
|
||||
previousValue + (element.product.price! * element.quantity));
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Subtotal $totalQuantity Product',
|
||||
@@ -995,27 +991,27 @@ class PrintDataoutputs {
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
bytes += generator.feed(1);
|
||||
final kitchenProducts =
|
||||
products.where((p) => p.product.printerType == 'kitchen');
|
||||
for (final product in kitchenProducts) {
|
||||
bytes += generator.text('${product.quantity} x ${product.product.name}',
|
||||
styles: const PosStyles(
|
||||
align: PosAlign.left,
|
||||
bold: false,
|
||||
height: PosTextSize.size2,
|
||||
width: PosTextSize.size1,
|
||||
));
|
||||
if (product.notes.isNotEmpty) {
|
||||
bytes += generator.text(' Notes: ${product.notes}',
|
||||
styles: const PosStyles(
|
||||
align: PosAlign.left,
|
||||
bold: false,
|
||||
height: PosTextSize.size1,
|
||||
width: PosTextSize.size1,
|
||||
fontType: PosFontType.fontA,
|
||||
));
|
||||
}
|
||||
}
|
||||
// final kitchenProducts =
|
||||
// products.where((p) => p.product.printerType == 'kitchen');
|
||||
// for (final product in kitchenProducts) {
|
||||
// bytes += generator.text('${product.quantity} x ${product.product.name}',
|
||||
// styles: const PosStyles(
|
||||
// align: PosAlign.left,
|
||||
// bold: false,
|
||||
// height: PosTextSize.size2,
|
||||
// width: PosTextSize.size1,
|
||||
// ));
|
||||
// if (product.notes.isNotEmpty) {
|
||||
// bytes += generator.text(' Notes: ${product.notes}',
|
||||
// styles: const PosStyles(
|
||||
// align: PosAlign.left,
|
||||
// bold: false,
|
||||
// height: PosTextSize.size1,
|
||||
// width: PosTextSize.size1,
|
||||
// fontType: PosFontType.fontA,
|
||||
// ));
|
||||
// }
|
||||
// }
|
||||
|
||||
bytes += generator.feed(1);
|
||||
bytes += generator.text(
|
||||
@@ -1109,26 +1105,26 @@ class PrintDataoutputs {
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
bytes += generator.feed(1);
|
||||
final barProducts = products.where((p) => p.product.printerType == 'bar');
|
||||
for (final product in barProducts) {
|
||||
bytes += generator.text('${product.quantity} x ${product.product.name}',
|
||||
styles: const PosStyles(
|
||||
align: PosAlign.left,
|
||||
bold: false,
|
||||
height: PosTextSize.size2,
|
||||
width: PosTextSize.size1,
|
||||
));
|
||||
if (product.notes.isNotEmpty) {
|
||||
bytes += generator.text(' Notes: ${product.notes}',
|
||||
styles: const PosStyles(
|
||||
align: PosAlign.left,
|
||||
bold: false,
|
||||
height: PosTextSize.size1,
|
||||
width: PosTextSize.size1,
|
||||
fontType: PosFontType.fontA,
|
||||
));
|
||||
}
|
||||
}
|
||||
// final barProducts = products.where((p) => p.product.printerType == 'bar');
|
||||
// for (final product in barProducts) {
|
||||
// bytes += generator.text('${product.quantity} x ${product.product.name}',
|
||||
// styles: const PosStyles(
|
||||
// align: PosAlign.left,
|
||||
// bold: false,
|
||||
// height: PosTextSize.size2,
|
||||
// width: PosTextSize.size1,
|
||||
// ));
|
||||
// if (product.notes.isNotEmpty) {
|
||||
// bytes += generator.text(' Notes: ${product.notes}',
|
||||
// styles: const PosStyles(
|
||||
// align: PosAlign.left,
|
||||
// bold: false,
|
||||
// height: PosTextSize.size1,
|
||||
// width: PosTextSize.size1,
|
||||
// fontType: PosFontType.fontA,
|
||||
// ));
|
||||
// }
|
||||
// }
|
||||
|
||||
bytes += generator.feed(1);
|
||||
bytes += generator.text(
|
||||
|
||||
Reference in New Issue
Block a user