Compare commits
2 Commits
8568a8a8ce
...
2177870fc9
| Author | SHA1 | Date | |
|---|---|---|---|
| 2177870fc9 | |||
| 0e8f4506cc |
@ -8,7 +8,11 @@ const NewFilamentSku = ({ onOk, reset, defaultValues }) => {
|
|||||||
<NewObjectForm
|
<NewObjectForm
|
||||||
type='filamentSku'
|
type='filamentSku'
|
||||||
reset={reset}
|
reset={reset}
|
||||||
defaultValues={defaultValues}
|
defaultValues={{
|
||||||
|
overrideCost: false,
|
||||||
|
color: '#ff0000',
|
||||||
|
...defaultValues
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{({ handleSubmit, submitLoading, objectData, formValid }) => {
|
{({ handleSubmit, submitLoading, objectData, formValid }) => {
|
||||||
const steps = [
|
const steps = [
|
||||||
@ -19,7 +23,7 @@ const NewFilamentSku = ({ onOk, reset, defaultValues }) => {
|
|||||||
<ObjectInfo
|
<ObjectInfo
|
||||||
type='filamentSku'
|
type='filamentSku'
|
||||||
column={1}
|
column={1}
|
||||||
labelWidth={70}
|
labelWidth={80}
|
||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={true}
|
required={true}
|
||||||
@ -29,27 +33,26 @@ const NewFilamentSku = ({ onOk, reset, defaultValues }) => {
|
|||||||
cost: false,
|
cost: false,
|
||||||
costWithTax: false,
|
costWithTax: false,
|
||||||
costTaxRate: false,
|
costTaxRate: false,
|
||||||
|
overrideCost: false,
|
||||||
vendor: false
|
vendor: false
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Color & Cost',
|
title: 'Cost',
|
||||||
key: 'colorCost',
|
key: 'cost',
|
||||||
content: (
|
content: (
|
||||||
<ObjectInfo
|
<ObjectInfo
|
||||||
type='filamentSku'
|
type='filamentSku'
|
||||||
column={1}
|
column={1}
|
||||||
labelWidth={100}
|
labelWidth={120}
|
||||||
|
required={true}
|
||||||
visibleProperties={{
|
visibleProperties={{
|
||||||
_id: false,
|
overrideCost: true,
|
||||||
createdAt: false,
|
cost: true,
|
||||||
updatedAt: false,
|
costTaxRate: true,
|
||||||
barcode: false,
|
costWithTax: true
|
||||||
filament: false,
|
|
||||||
name: false,
|
|
||||||
description: false
|
|
||||||
}}
|
}}
|
||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
@ -64,7 +67,7 @@ const NewFilamentSku = ({ onOk, reset, defaultValues }) => {
|
|||||||
<ObjectInfo
|
<ObjectInfo
|
||||||
type='filamentSku'
|
type='filamentSku'
|
||||||
column={1}
|
column={1}
|
||||||
labelWidth={100}
|
labelWidth={110}
|
||||||
visibleProperties={{
|
visibleProperties={{
|
||||||
barcode: true,
|
barcode: true,
|
||||||
description: true
|
description: true
|
||||||
@ -88,9 +91,9 @@ const NewFilamentSku = ({ onOk, reset, defaultValues }) => {
|
|||||||
_id: false,
|
_id: false,
|
||||||
_reference: false
|
_reference: false
|
||||||
}}
|
}}
|
||||||
labelWidth={100}
|
|
||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={false}
|
isEditing={false}
|
||||||
|
labelWidth={120}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -238,7 +238,7 @@ const FilamentInfo = () => {
|
|||||||
}}
|
}}
|
||||||
reset={newFilamentSkuOpen}
|
reset={newFilamentSkuOpen}
|
||||||
defaultValues={{
|
defaultValues={{
|
||||||
filament: filamentId ? { _id: filamentId } : undefined
|
filament: objectFormState?.objectData || undefined
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@ -18,7 +18,33 @@ const NewFilament = ({ onOk }) => {
|
|||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={true}
|
required={true}
|
||||||
|
labelWidth={120}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
|
visibleProperties={{
|
||||||
|
cost: false,
|
||||||
|
costTaxRate: false,
|
||||||
|
costWithTax: false
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Cost',
|
||||||
|
key: 'cost',
|
||||||
|
content: (
|
||||||
|
<ObjectInfo
|
||||||
|
type='filament'
|
||||||
|
column={1}
|
||||||
|
bordered={false}
|
||||||
|
isEditing={true}
|
||||||
|
required={true}
|
||||||
|
labelWidth={120}
|
||||||
|
objectData={objectData}
|
||||||
|
visibleProperties={{
|
||||||
|
cost: true,
|
||||||
|
costTaxRate: true,
|
||||||
|
costWithTax: true
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -32,6 +58,7 @@ const NewFilament = ({ onOk }) => {
|
|||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={false}
|
required={false}
|
||||||
|
labelWidth={90}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -50,6 +77,7 @@ const NewFilament = ({ onOk }) => {
|
|||||||
createdAt: false,
|
createdAt: false,
|
||||||
updatedAt: false
|
updatedAt: false
|
||||||
}}
|
}}
|
||||||
|
labelWidth={120}
|
||||||
isEditing={false}
|
isEditing={false}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ const NewPart = ({ onOk, defaultValues }) => {
|
|||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={true}
|
required={true}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
|
labelWidth={70}
|
||||||
visibleProperties={{
|
visibleProperties={{
|
||||||
file: false,
|
file: false,
|
||||||
priceMode: false,
|
priceMode: false,
|
||||||
@ -51,6 +52,7 @@ const NewPart = ({ onOk, defaultValues }) => {
|
|||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={true}
|
required={true}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
|
labelWidth={120}
|
||||||
visibleProperties={{
|
visibleProperties={{
|
||||||
priceMode: true,
|
priceMode: true,
|
||||||
margin: true,
|
margin: true,
|
||||||
@ -74,6 +76,7 @@ const NewPart = ({ onOk, defaultValues }) => {
|
|||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={false}
|
required={false}
|
||||||
|
labelWidth={50}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -225,7 +225,7 @@ const DashboardNavigation = () => {
|
|||||||
align='center'
|
align='center'
|
||||||
style={{ marginTop: '-2px', marginRight: '6px' }}
|
style={{ marginTop: '-2px', marginRight: '6px' }}
|
||||||
>
|
>
|
||||||
<Space style={{ paddingTop: '2px' }}>
|
<Space style={{ paddingTop: '2px', marginRight: '8px' }}>
|
||||||
<WebAppSwitcher />
|
<WebAppSwitcher />
|
||||||
<KeyboardShortcut
|
<KeyboardShortcut
|
||||||
shortcut='alt+q'
|
shortcut='alt+q'
|
||||||
|
|||||||
@ -88,7 +88,14 @@ export const Filament = {
|
|||||||
'updatedAt'
|
'updatedAt'
|
||||||
],
|
],
|
||||||
filters: ['_id', 'name', 'material', 'cost', 'costWithTax'],
|
filters: ['_id', 'name', 'material', 'cost', 'costWithTax'],
|
||||||
sorters: ['name', 'createdAt', 'material', 'cost', 'costWithTax', 'updatedAt'],
|
sorters: [
|
||||||
|
'name',
|
||||||
|
'createdAt',
|
||||||
|
'material',
|
||||||
|
'cost',
|
||||||
|
'costWithTax',
|
||||||
|
'updatedAt'
|
||||||
|
],
|
||||||
group: ['diameter', 'material'],
|
group: ['diameter', 'material'],
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
@ -168,7 +175,7 @@ export const Filament = {
|
|||||||
{
|
{
|
||||||
name: 'cost',
|
name: 'cost',
|
||||||
label: 'Cost',
|
label: 'Cost',
|
||||||
required: false,
|
required: true,
|
||||||
columnWidth: 100,
|
columnWidth: 100,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
prefix: '£',
|
prefix: '£',
|
||||||
@ -178,7 +185,7 @@ export const Filament = {
|
|||||||
{
|
{
|
||||||
name: 'costWithTax',
|
name: 'costWithTax',
|
||||||
label: 'Cost w/ Tax',
|
label: 'Cost w/ Tax',
|
||||||
required: false,
|
required: true,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
prefix: '£',
|
prefix: '£',
|
||||||
@ -201,7 +208,7 @@ export const Filament = {
|
|||||||
{
|
{
|
||||||
name: 'costTaxRate',
|
name: 'costTaxRate',
|
||||||
label: 'Cost Tax Rate',
|
label: 'Cost Tax Rate',
|
||||||
required: false,
|
required: true,
|
||||||
type: 'object',
|
type: 'object',
|
||||||
objectType: 'taxRate',
|
objectType: 'taxRate',
|
||||||
showHyperlink: true,
|
showHyperlink: true,
|
||||||
|
|||||||
@ -170,36 +170,42 @@ export const FilamentSku = {
|
|||||||
{
|
{
|
||||||
name: 'overrideCost',
|
name: 'overrideCost',
|
||||||
label: 'Override Cost',
|
label: 'Override Cost',
|
||||||
required: false,
|
required: true,
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
value: (objectData) => objectData?.overrideCost ?? false,
|
|
||||||
columnWidth: 150
|
columnWidth: 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cost',
|
name: 'cost',
|
||||||
label: 'Cost',
|
label: 'Cost',
|
||||||
required: false,
|
required: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
prefix: '£',
|
prefix: '£',
|
||||||
min: 0,
|
min: 0,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
disabled: (objectData) => !objectData?.overrideCost,
|
visible: (objectData) => {
|
||||||
|
return objectData?.overrideCost
|
||||||
|
},
|
||||||
value: (objectData) =>
|
value: (objectData) =>
|
||||||
objectData?.overrideCost ? objectData?.cost : undefined,
|
objectData?.overrideCost
|
||||||
|
? objectData?.cost
|
||||||
|
: objectData?.filament?.cost,
|
||||||
columnWidth: 100
|
columnWidth: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'costWithTax',
|
name: 'costWithTax',
|
||||||
label: 'Cost w/ Tax',
|
label: 'Cost w/ Tax',
|
||||||
required: false,
|
required: true,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
prefix: '£',
|
prefix: '£',
|
||||||
min: 0,
|
min: 0,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
disabled: (objectData) => !objectData?.overrideCost,
|
visible: (objectData) => {
|
||||||
|
return objectData?.overrideCost
|
||||||
|
},
|
||||||
value: (objectData) => {
|
value: (objectData) => {
|
||||||
if (!objectData?.overrideCost) return undefined
|
if (!objectData?.overrideCost)
|
||||||
|
return objectData?.filament?.costWithTax || undefined
|
||||||
const cost = objectData?.cost
|
const cost = objectData?.cost
|
||||||
const taxRate = objectData?.costTaxRate
|
const taxRate = objectData?.costTaxRate
|
||||||
if (!cost) return 0
|
if (!cost) return 0
|
||||||
@ -215,13 +221,17 @@ export const FilamentSku = {
|
|||||||
{
|
{
|
||||||
name: 'costTaxRate',
|
name: 'costTaxRate',
|
||||||
label: 'Cost Tax Rate',
|
label: 'Cost Tax Rate',
|
||||||
required: false,
|
required: true,
|
||||||
type: 'object',
|
type: 'object',
|
||||||
objectType: 'taxRate',
|
objectType: 'taxRate',
|
||||||
showHyperlink: true,
|
showHyperlink: true,
|
||||||
disabled: (objectData) => !objectData?.overrideCost,
|
visible: (objectData) => {
|
||||||
|
return objectData?.overrideCost
|
||||||
|
},
|
||||||
value: (objectData) =>
|
value: (objectData) =>
|
||||||
objectData?.overrideCost ? objectData?.costTaxRate : undefined,
|
objectData?.overrideCost
|
||||||
|
? objectData?.costTaxRate
|
||||||
|
: objectData?.filament?.costTaxRate,
|
||||||
columnWidth: 150
|
columnWidth: 150
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user