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