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