fix: print split bill
This commit is contained in:
@@ -751,6 +751,7 @@ class PrintDataoutputs {
|
||||
int paper,
|
||||
String orderType,
|
||||
Outlet outlet,
|
||||
List<ProductQuantity> products,
|
||||
) async {
|
||||
List<int> bytes = [];
|
||||
|
||||
@@ -865,15 +866,16 @@ class PrintDataoutputs {
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
for (final product in (order.orderItems ?? <OrderItem>[])) {
|
||||
for (final product in (products ?? <ProductQuantity>[])) {
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: '${product.quantity} x ${product.productName}',
|
||||
text: '${product.quantity} x ${product.product.name}',
|
||||
width: 8,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (product.totalPrice ?? 0).currencyFormatRpV2,
|
||||
text: (((product.product.price ?? 0) * product.quantity))
|
||||
.currencyFormatRpV2,
|
||||
width: 4,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.right),
|
||||
),
|
||||
@@ -887,7 +889,7 @@ class PrintDataoutputs {
|
||||
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Subtotal ${order.orderItems?.length ?? "0"} Product',
|
||||
text: 'Subtotal ${products.length} Product',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user