fix: print
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:enaklo_pos/core/utils/printer_service.dart';
|
||||
import 'package:enaklo_pos/data/dataoutputs/print_dataoutputs.dart';
|
||||
import 'package:enaklo_pos/data/datasources/auth_local_datasource.dart';
|
||||
import 'package:enaklo_pos/data/datasources/product_local_datasource.dart';
|
||||
import 'package:enaklo_pos/data/datasources/settings_local_datasource.dart';
|
||||
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
||||
import 'package:enaklo_pos/presentation/home/models/product_quantity.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -21,6 +22,8 @@ Future<void> onPrint(
|
||||
final barPrinter =
|
||||
await ProductLocalDatasource.instance.getPrinterByCode('bar');
|
||||
|
||||
final authData = await AuthLocalDataSource().getAuthData();
|
||||
|
||||
// Checker printer
|
||||
if (checkerPrinter != null) {
|
||||
try {
|
||||
@@ -28,7 +31,7 @@ Future<void> onPrint(
|
||||
productQuantity,
|
||||
order.tableNumber ?? "",
|
||||
order.orderNumber ?? "",
|
||||
'kasir',
|
||||
authData.user?.name ?? "",
|
||||
checkerPrinter.paper.toIntegerFromText,
|
||||
order.orderType ?? "",
|
||||
);
|
||||
@@ -51,7 +54,7 @@ Future<void> onPrint(
|
||||
productQuantity,
|
||||
order.tableNumber!,
|
||||
order.orderNumber ?? "",
|
||||
'kasir',
|
||||
authData.user?.name ?? "",
|
||||
kitchenPrinter.paper.toIntegerFromText,
|
||||
order.orderType ?? "",
|
||||
);
|
||||
@@ -73,7 +76,7 @@ Future<void> onPrint(
|
||||
productQuantity,
|
||||
order.tableNumber ?? "",
|
||||
order.orderNumber ?? "",
|
||||
'kasir',
|
||||
authData.user?.name ?? "",
|
||||
barPrinter.paper.toIntegerFromText,
|
||||
order.orderType ?? "",
|
||||
);
|
||||
@@ -94,11 +97,11 @@ Future<void> onPrintRecipt(
|
||||
required String paymentMethod,
|
||||
required int nominalBayar,
|
||||
required int kembalian,
|
||||
required int taxPercentage,
|
||||
}) async {
|
||||
final receiptPrinter =
|
||||
await ProductLocalDatasource.instance.getPrinterByCode('receipt');
|
||||
final authData = await AuthLocalDataSource().getAuthData();
|
||||
final settings = await SettingsLocalDatasource().getTax();
|
||||
|
||||
if (receiptPrinter != null) {
|
||||
try {
|
||||
@@ -108,7 +111,7 @@ Future<void> onPrintRecipt(
|
||||
paymentMethod,
|
||||
nominalBayar,
|
||||
kembalian,
|
||||
taxPercentage,
|
||||
settings.value,
|
||||
receiptPrinter.paper.toIntegerFromText,
|
||||
);
|
||||
await PrinterService()
|
||||
|
||||
Reference in New Issue
Block a user