fix: print

This commit is contained in:
efrilm
2025-08-07 14:28:52 +07:00
parent d0e1f9a5b6
commit 9d78c9dcce
5 changed files with 31 additions and 11 deletions
@@ -1005,10 +1005,11 @@ class _SuccessOrderPageState extends State<SuccessOrderPage>
context,
order: widget.order,
paymentMethod: widget.paymentMethod,
nominalBayar: widget.nominalBayar,
nominalBayar: widget.paymentMethod == "Cash"
? widget.nominalBayar
: widget.order.totalAmount ?? 0,
kembalian: widget.nominalBayar -
(widget.order.totalAmount ?? 0),
taxPercentage: widget.taxPercentage,
);
onPrint(
context,
@@ -14,8 +14,15 @@ import 'package:flutter_bloc/flutter_bloc.dart';
class SuccessPaymentPage extends StatefulWidget {
final List<ProductQuantity> productQuantity;
final PaymentData payment;
const SuccessPaymentPage(
{super.key, required this.payment, required this.productQuantity});
final String paymentMethod;
final int nominalBayar;
const SuccessPaymentPage({
super.key,
required this.payment,
required this.productQuantity,
required this.paymentMethod,
required this.nominalBayar,
});
@override
State<SuccessPaymentPage> createState() => _SuccessPaymentPageState();
@@ -781,10 +788,15 @@ class _SuccessPaymentPageState extends State<SuccessPaymentPage> {
child: InkWell(
borderRadius: BorderRadius.circular(16),
onTap: () async {
onPrint(
onPrintRecipt(
context,
productQuantity: widget.productQuantity,
order: order,
paymentMethod: widget.paymentMethod,
nominalBayar: widget.paymentMethod == "Cash"
? widget.nominalBayar
: order.totalAmount ?? 0,
kembalian:
widget.nominalBayar - (order.totalAmount ?? 0),
);
},
child: const Row(