Fixed an issue where branch and warehouse select fields were not displaying
saved values when editing existing transactions. The useSetPrimaryBranchToForm
and useSetPrimaryWarehouseToForm hooks were overwriting saved values with
primary defaults on every form load.
Changes:
- Added isNewMode check to useSetPrimaryBranchToForm hook
- Added isNewMode check to useSetPrimaryWarehouseToForm hook
- Updated InvoiceFormProvider to expose isNewMode in context
Affected forms:
- Sales: Invoice, Estimate, Receipt, CreditNote, PaymentReceived
- Purchases: Bill, VendorCredit, PaymentMade
- Expense
- MakeJournal (Manual Journal)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Implemented discount and adjustment fields in Bill, Credit Note, Estimate, Invoice, and Receipt forms.
- Created new components for displaying discount and adjustment totals, improving clarity in financial documents.
- Updated utility functions to format discount and adjustment amounts consistently across various forms.
- Enhanced user experience by integrating discount functionality into the form context, allowing for better data management and display.
This update improves the overall functionality and user experience related to discounts in financial transactions.