update
This commit is contained in:
parent
c45848bcf2
commit
539c70be17
@ -201,31 +201,36 @@ class PrintUi {
|
|||||||
for (final item in order.orderItems) {
|
for (final item in order.orderItems) {
|
||||||
bytes += generator.reset();
|
bytes += generator.reset();
|
||||||
|
|
||||||
|
// Header
|
||||||
|
bytes += builder.textCenter('Bar', bold: true);
|
||||||
bytes += builder.separator();
|
bytes += builder.separator();
|
||||||
bytes += builder.printerType(printerType: 'BAR');
|
bytes += builder.textCenter(
|
||||||
|
'Table : ${order.tableNumber.isNotEmpty ? order.tableNumber : '-'}',
|
||||||
|
bold: true,
|
||||||
|
);
|
||||||
bytes += builder.separator();
|
bytes += builder.separator();
|
||||||
bytes += builder.dateTime(DateTime.now());
|
|
||||||
bytes += builder.orderInfo(
|
// Order info
|
||||||
|
bytes += builder.orderInfoSimple(
|
||||||
orderNumber: order.orderNumber,
|
orderNumber: order.orderNumber,
|
||||||
customerName: order.metadata['customer_name'] ?? '-',
|
orderType: order.orderType,
|
||||||
cashierName: cashierName,
|
cashierName: cashierName,
|
||||||
tableNumber: order.tableNumber,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
bytes += builder.separator();
|
bytes += builder.separator();
|
||||||
bytes += builder.emptyLines(1);
|
|
||||||
|
|
||||||
bytes += builder.orderItem(
|
// Single item
|
||||||
productName: item.productName,
|
final name = item.productName.toUpperCase();
|
||||||
quantity: item.quantity,
|
bytes += builder.itemText('${item.quantity} $name');
|
||||||
unitPrice: item.unitPrice.currencyFormatRpV2,
|
if (item.productVariantName.isNotEmpty) {
|
||||||
totalPrice: item.totalPrice.currencyFormatRpV2,
|
bytes += builder.itemText(' ${item.productVariantName.toUpperCase()}', bold: false);
|
||||||
variantName: item.productVariantName,
|
}
|
||||||
notes: item.notes,
|
if (item.notes.isNotEmpty) {
|
||||||
);
|
bytes += builder.itemText(' *${item.notes}', bold: false);
|
||||||
|
}
|
||||||
|
|
||||||
bytes += builder.separator();
|
bytes += builder.separator();
|
||||||
bytes += builder.footer();
|
bytes += builder.cutOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user