From 6b983ca873848409d7d73bdd2831f9e21e0a9816 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 28 Dec 2025 01:10:26 +0000 Subject: [PATCH] Enhance Shipment model and NewShipment component with invoicing fields - Added new invoicing fields: invoicedAmount, invoicedAmountWithTax, invoicedAmountRemaining, and invoicedAmountWithTaxRemaining to the Shipment model. - Updated NewShipment component to include the new invoicing fields in its initial state configuration for better shipment tracking and management. --- .../Inventory/Shipments/NewShipment.jsx | 6 ++- src/database/models/Shipment.js | 52 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/components/Dashboard/Inventory/Shipments/NewShipment.jsx b/src/components/Dashboard/Inventory/Shipments/NewShipment.jsx index e34b5b6..90800a2 100644 --- a/src/components/Dashboard/Inventory/Shipments/NewShipment.jsx +++ b/src/components/Dashboard/Inventory/Shipments/NewShipment.jsx @@ -85,7 +85,11 @@ const NewShipment = ({ onOk, reset, defaultValues }) => { shippedAt: false, expectedAt: false, deliveredAt: false, - taxRecord: false + taxRecord: false, + invoicedAmount: false, + invoicedAmountWithTax: false, + invoicedAmountRemaining: false, + invoicedAmountWithTaxRemaining: false }} isEditing={false} objectData={objectData} diff --git a/src/database/models/Shipment.js b/src/database/models/Shipment.js index d068f7e..897a9f0 100644 --- a/src/database/models/Shipment.js +++ b/src/database/models/Shipment.js @@ -131,6 +131,10 @@ export const Shipment = { 'amountWithTax', 'taxRate', 'taxAmount', + 'invoicedAmount', + 'invoicedAmountWithTax', + 'invoicedAmountRemaining', + 'invoicedAmountWithTaxRemaining', 'trackingNumber', 'shippedAt', 'expectedAt', @@ -288,6 +292,54 @@ export const Shipment = { } return 0 } + }, + { + name: 'invoicedAmount', + label: 'Invoiced Amount', + type: 'number', + required: false, + readOnly: true, + prefix: '£', + fixedNumber: 2, + min: 0, + step: 0.01, + columnWidth: 150 + }, + { + name: 'invoicedAmountWithTax', + label: 'Invoiced Amount w/ Tax', + type: 'number', + required: false, + readOnly: true, + prefix: '£', + fixedNumber: 2, + min: 0, + step: 0.01, + columnWidth: 200 + }, + { + name: 'invoicedAmountRemaining', + label: 'Remaining Invoiced Amount', + type: 'number', + required: false, + readOnly: true, + prefix: '£', + min: 0, + step: 0.01, + columnWidth: 225, + fixedNumber: 2 + }, + { + name: 'invoicedAmountWithTaxRemaining', + label: 'Remaining Invoiced Amount w/ Tax', + type: 'number', + required: false, + readOnly: true, + prefix: '£', + min: 0, + fixedNumber: 2, + step: 0.01, + columnWidth: 275 } ] }