Compare commits

..

No commits in common. "0a347c1396bd99178479289df378e6276032ea61" and "76757998c81a55a09ac108bf9f20359728ab00d9" have entirely different histories.

12 changed files with 44 additions and 189 deletions

View File

@ -10,9 +10,6 @@ const NewCourierService = ({ onOk, defaultValues }) => {
defaultValues={{ defaultValues={{
active: true, active: true,
tracked: false, tracked: false,
cost: 0,
shippingCurrency: 'GBP',
international: false,
...defaultValues ...defaultValues
}} }}
> >

View File

@ -170,7 +170,6 @@ const HostInfo = () => {
isEditing={isEditing} isEditing={isEditing}
type='host' type='host'
objectData={objectData} objectData={objectData}
labelWidth='175px'
/> />
) )
}} }}

View File

@ -22,7 +22,6 @@ const NewListingVarient = ({ onOk, defaultValues }) => {
isEditing={true} isEditing={true}
required={true} required={true}
objectData={objectData} objectData={objectData}
labelWidth={105}
/> />
) )
}, },

View File

@ -175,7 +175,6 @@ const ListingInfo = () => {
loading={loading} loading={loading}
isEditing={isEditing} isEditing={isEditing}
type='listing' type='listing'
labelWidth={165}
objectData={objectData} objectData={objectData}
/> />
</InfoCollapse> </InfoCollapse>
@ -250,7 +249,7 @@ const ListingInfo = () => {
}} }}
reset={newListingVarientOpen} reset={newListingVarientOpen}
defaultValues={{ defaultValues={{
listing: objectFormState.objectData listing: { _id: listingId }
}} }}
/> />
</Modal> </Modal>

View File

@ -22,7 +22,6 @@ const NewListing = ({ onOk, defaultValues }) => {
isEditing={true} isEditing={true}
required={true} required={true}
objectData={objectData} objectData={objectData}
labelWidth={133}
/> />
) )
}, },

View File

@ -90,8 +90,7 @@ export const Courier = {
columnFixed: 'left', columnFixed: 'left',
objectType: 'courier', objectType: 'courier',
showCopy: true, showCopy: true,
readOnly: false, readOnly: true,
required: true,
columnWidth: 180 columnWidth: 180
}, },
{ {

View File

@ -69,27 +69,14 @@ export const CourierService = {
'courier', 'courier',
'tracked', 'tracked',
'deliveryTime', 'deliveryTime',
'cost',
'costWithTax',
'active' 'active'
], ],
filters: [ filters: ['name', '_id', 'courier', 'active', 'deliveryTime', 'tracked'],
'name',
'_id',
'courier',
'active',
'deliveryTime',
'tracked',
'cost',
'costWithTax'
],
sorters: [ sorters: [
'name', 'name',
'courier', 'courier',
'active', 'active',
'tracked', 'tracked',
'cost',
'costWithTax',
'estimatedDeliveryTime', 'estimatedDeliveryTime',
'createdAt', 'createdAt',
'_id' '_id'
@ -151,7 +138,7 @@ export const CourierService = {
label: 'Delivery Time', label: 'Delivery Time',
type: 'number', type: 'number',
readOnly: false, readOnly: false,
required: true, required: false,
suffix: 'days', suffix: 'days',
columnWidth: 175 columnWidth: 175
}, },
@ -163,99 +150,6 @@ export const CourierService = {
required: true, required: true,
columnWidth: 125 columnWidth: 125
}, },
{
name: 'cost',
label: 'Cost',
type: 'number',
prefix: '£',
min: 0,
step: 0.01,
readOnly: false,
required: true,
columnWidth: 150
},
{
name: 'costWithTax',
label: 'Cost w/ Tax',
type: 'number',
prefix: '£',
min: 0,
step: 0.01,
readOnly: true,
required: true,
columnWidth: 150,
value: (objectData) => {
const cost = objectData?.cost
if (cost == null) return 0
if (objectData?.costTaxRate?.rateType == 'percentage') {
return (
(cost * (1 + objectData.costTaxRate.rate / 100)).toFixed(2) || 0
)
} else if (objectData?.costTaxRate?.rateType == 'amount') {
return (cost + objectData.costTaxRate.rate).toFixed(2) || 0
}
return cost
}
},
{
name: 'costTaxRate',
label: 'Cost Tax Rate',
required: true,
type: 'object',
objectType: 'taxRate',
showHyperlink: true,
columnWidth: 150
},
{
name: 'additionalCost',
label: 'Additional Item Cost',
type: 'number',
prefix: '£',
min: 0,
step: 0.01,
readOnly: false,
required: false,
columnWidth: 220
},
{
name: 'additionalCostWithTax',
label: 'Additional Item Cost w/ Tax',
type: 'number',
prefix: '£',
min: 0,
step: 0.01,
readOnly: true,
required: false,
columnWidth: 220,
value: (objectData) => {
const cost = objectData?.additionalCost
if (cost == null) return undefined
if (objectData?.costTaxRate?.rateType == 'percentage') {
return (
(cost * (1 + objectData.costTaxRate.rate / 100)).toFixed(2) || 0
)
} else if (objectData?.costTaxRate?.rateType == 'amount') {
return (cost + objectData.costTaxRate.rate).toFixed(2) || 0
}
return cost
}
},
{
name: 'shippingCurrency',
label: 'Shipping Currency',
type: 'text',
readOnly: false,
required: true,
columnWidth: 160
},
{
name: 'international',
label: 'International Service',
type: 'bool',
readOnly: false,
required: true,
columnWidth: 170
},
{ {
name: 'tracked', name: 'tracked',
label: 'Tracked', label: 'Tracked',

View File

@ -103,13 +103,6 @@ export const Host = {
readOnly: true, readOnly: true,
columnWidth: 180 columnWidth: 180
}, },
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 175
},
{ {
name: 'name', name: 'name',
label: 'Name', label: 'Name',
@ -119,8 +112,8 @@ export const Host = {
columnFixed: 'left' columnFixed: 'left'
}, },
{ {
name: 'connectedAt', name: 'updatedAt',
label: 'Connected At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 175
@ -134,6 +127,13 @@ export const Host = {
readOnly: true, readOnly: true,
columnWidth: 250 columnWidth: 250
}, },
{
name: 'connectedAt',
label: 'Connected At',
type: 'dateTime',
readOnly: true,
columnWidth: 175
},
{ {
name: 'online', name: 'online',
label: 'Online', label: 'Online',

View File

@ -103,7 +103,6 @@ export const Listing = {
'vendor', 'vendor',
'stockLocation', 'stockLocation',
'marketplace', 'marketplace',
'courierServices',
'state', 'state',
'price', 'price',
'currency', 'currency',
@ -118,7 +117,6 @@ export const Listing = {
'vendor', 'vendor',
'stockLocation', 'stockLocation',
'marketplace', 'marketplace',
'courierServices',
'state', 'state',
'createdAt', 'createdAt',
'updatedAt' 'updatedAt'
@ -133,13 +131,7 @@ export const Listing = {
'updatedAt', 'updatedAt',
'_id' '_id'
], ],
group: [ group: ['marketplace', 'product', 'vendor', 'stockLocation'],
'marketplace',
'product',
'vendor',
'stockLocation',
'courierServices'
],
properties: [ properties: [
{ {
name: '_id', name: '_id',
@ -180,14 +172,8 @@ export const Listing = {
columnFixed: 'left', columnFixed: 'left',
type: 'text', type: 'text',
readOnly: false, readOnly: false,
required: true, required: false,
columnWidth: 250, columnWidth: 250
value: (objectData) => {
if (objectData?.title == undefined) {
return objectData?.product?.name
}
return objectData?.title
}
}, },
{ {
name: 'lastSyncedAt', name: 'lastSyncedAt',
@ -203,7 +189,7 @@ export const Listing = {
objectType: 'product', objectType: 'product',
showHyperlink: true, showHyperlink: true,
readOnly: false, readOnly: false,
required: true, required: false,
columnWidth: 200 columnWidth: 200
}, },
{ {
@ -214,12 +200,6 @@ export const Listing = {
showHyperlink: true, showHyperlink: true,
readOnly: false, readOnly: false,
required: true, required: true,
value: (objectData) => {
if (objectData?.vendor == undefined) {
return objectData?.product?.vendor
}
return objectData?.vendor
},
columnWidth: 200 columnWidth: 200
}, },
{ {
@ -276,16 +256,6 @@ export const Listing = {
readOnly: true, readOnly: true,
required: false, required: false,
columnWidth: 250 columnWidth: 250
},
{
name: 'courierServices',
label: 'Courier Services',
type: 'objectList',
multiple: true,
objectType: 'courierService',
readOnly: false,
required: true,
columnWidth: 250
} }
] ]
} }

View File

@ -18,8 +18,7 @@ export const ListingVarient = {
default: true, default: true,
row: true, row: true,
icon: InfoCircleIcon, icon: InfoCircleIcon,
url: (_id) => url: (_id) => `/dashboard/sales/listingvarients/info?listingVarientId=${_id}`
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}`
}, },
{ {
name: 'edit', name: 'edit',
@ -107,7 +106,14 @@ export const ListingVarient = {
'createdAt', 'createdAt',
'updatedAt' 'updatedAt'
], ],
sorters: ['state', 'price', 'lastSyncedAt', 'createdAt', 'updatedAt', '_id'], sorters: [
'state',
'price',
'lastSyncedAt',
'createdAt',
'updatedAt',
'_id'
],
group: ['listing', 'state'], group: ['listing', 'state'],
properties: [ properties: [
{ {
@ -159,12 +165,8 @@ export const ListingVarient = {
type: 'object', type: 'object',
objectType: 'product', objectType: 'product',
showHyperlink: true, showHyperlink: true,
readOnly: true, readOnly: false,
value: (objectData) => { required: false,
console.log('listing product id', objectData?.listing?.product?._id)
return objectData?.listing?.product
},
required: true,
columnWidth: 200 columnWidth: 200
}, },
{ {
@ -174,11 +176,8 @@ export const ListingVarient = {
objectType: 'productSku', objectType: 'productSku',
showHyperlink: true, showHyperlink: true,
readOnly: false, readOnly: false,
required: true, required: false,
columnWidth: 200, columnWidth: 200
masterFilter: (objectData) => {
return { product: objectData?.listing?.product?._id }
}
}, },
{ {
name: 'state', name: 'state',

View File

@ -124,13 +124,6 @@ export const Part = {
readOnly: true, readOnly: true,
columnWidth: 180 columnWidth: 180
}, },
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 175
},
{ {
name: 'name', name: 'name',
label: 'Name', label: 'Name',
@ -139,6 +132,13 @@ export const Part = {
type: 'text', type: 'text',
columnWidth: 200 columnWidth: 200
}, },
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 175
},
{ {
name: 'file', name: 'file',
label: 'File', label: 'File',

View File

@ -125,13 +125,6 @@ export const PartSku = {
readOnly: true, readOnly: true,
columnWidth: 180 columnWidth: 180
}, },
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 175
},
{ {
name: 'name', name: 'name',
label: 'Name', label: 'Name',
@ -140,6 +133,13 @@ export const PartSku = {
columnWidth: 200, columnWidth: 200,
columnFixed: 'left' columnFixed: 'left'
}, },
{
name: 'updatedAt',
label: 'Updated At',
type: 'dateTime',
readOnly: true,
columnWidth: 175
},
{ {
name: 'part', name: 'part',
label: 'Part', label: 'Part',