Fixed double entry issue
This commit is contained in:
@@ -240,12 +240,16 @@ class _ProductListScreenState extends ConsumerState<ProductListScreen> {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
(p.currentStock != null)
|
||||
? 'Stock: ${p.currentStock ?? 0}'
|
||||
p.currentStock != null
|
||||
? (p.currentStock! > 0
|
||||
? 'Stock: ${p.currentStock! % 1 == 0 ? p.currentStock!.toInt() : p.currentStock}'
|
||||
: 'Out of Stock')
|
||||
: 'Untracked',
|
||||
style: TextStyle(
|
||||
color: (p.currentStock != null)
|
||||
? Colors.orange
|
||||
color: p.currentStock != null
|
||||
? (p.currentStock! > 0
|
||||
? const Color(0xFF10B981)
|
||||
: Colors.red)
|
||||
: Colors.grey,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -421,7 +421,10 @@ class _InvoiceBuilderScreenState extends ConsumerState<InvoiceBuilderScreen> {
|
||||
totalAmount: grandTotal,
|
||||
amountPaid: validAmountPaid,
|
||||
paymentMethod: validAmountPaid > 0 ? _paymentMethod : null,
|
||||
paymentWalletId: validAmountPaid > 0 ? (_selectedWalletId ?? ref.read(walletProvider).value?.firstOrNull?.id) : null,
|
||||
paymentWalletId: validAmountPaid > 0
|
||||
? (_selectedWalletId ??
|
||||
ref.read(walletProvider).value?.where((w) => w.nature == 'CASH' || w.nature == 'SAVINGS').firstOrNull?.id)
|
||||
: null,
|
||||
nextPaymentDate: balanceDue > 0.01 ? (_nextPaymentDate ?? DateTime.now().add(const Duration(days: 30))) : null,
|
||||
status: widget.existingInvoice != null
|
||||
? (isFullyPaid ? 'PAID' : (validAmountPaid > 0.01 ? 'PARTIAL' : widget.existingInvoice!.status))
|
||||
|
||||
Reference in New Issue
Block a user