Updated models.

This commit is contained in:
Tom Butcher 2025-12-13 21:06:01 +00:00
parent bbadede777
commit a4e68b5088
3 changed files with 60 additions and 7 deletions

View File

@ -130,7 +130,40 @@ export const Filament = {
label: 'Cost',
columnWidth: 150,
required: true,
type: 'currency'
type: 'number',
prefix: '£'
},
{
name: 'costWithTax',
label: 'Cost w/ Tax',
columnWidth: 150,
required: true,
readOnly: true,
type: 'number',
prefix: '£',
value: (objectData) => {
if (objectData?.costTaxRate?.rateType == 'percentage') {
return (
(
objectData?.cost *
(1 + objectData?.costTaxRate?.rate / 100)
).toFixed(2) || undefined
)
} else if (objectData?.costTaxRate?.rateType == 'amount') {
return (
(objectData?.cost + objectData?.costTaxRate?.rate).toFixed(2) ||
undefined
)
}
}
},
{
name: 'costTaxRate',
label: 'Cost Tax Rate',
required: true,
type: 'object',
objectType: 'taxRate',
showHyperlink: true
},
{
name: 'color',

View File

@ -82,11 +82,19 @@ export const OrderItem = {
},
required: true
},
{
name: 'shipment',
label: 'Shipment',
type: 'object',
objectType: 'shipment',
showHyperlink: true,
required: true
},
{
name: 'itemType',
label: 'Item Type',
type: 'objectType',
masterFilter: ['part', 'packaging'],
masterFilter: ['part', 'packaging', 'filament'],
required: true,
columnWidth: 125
},

View File

@ -71,12 +71,24 @@ export const PurchaseOrder = {
showHyperlink: true
},
{
name: 'cost',
label: 'Cost',
type: 'netGross',
name: 'totalAmount',
label: 'Total Amount',
type: 'number',
prefix: '£',
readOnly: true
},
{
name: 'totalAmountWithTax',
label: 'Total Amount w/ Tax',
type: 'number',
prefix: '£',
readOnly: true
},
{
name: 'totalTaxAmount',
label: 'Total Tax Amount',
type: 'number',
prefix: '£',
min: 0,
step: 0.01,
readOnly: true
}
]