Compare commits
No commits in common. "0a347c1396bd99178479289df378e6276032ea61" and "76757998c81a55a09ac108bf9f20359728ab00d9" have entirely different histories.
0a347c1396
...
76757998c8
@ -10,9 +10,6 @@ const NewCourierService = ({ onOk, defaultValues }) => {
|
||||
defaultValues={{
|
||||
active: true,
|
||||
tracked: false,
|
||||
cost: 0,
|
||||
shippingCurrency: 'GBP',
|
||||
international: false,
|
||||
...defaultValues
|
||||
}}
|
||||
>
|
||||
|
||||
@ -170,7 +170,6 @@ const HostInfo = () => {
|
||||
isEditing={isEditing}
|
||||
type='host'
|
||||
objectData={objectData}
|
||||
labelWidth='175px'
|
||||
/>
|
||||
)
|
||||
}}
|
||||
|
||||
@ -22,7 +22,6 @@ const NewListingVarient = ({ onOk, defaultValues }) => {
|
||||
isEditing={true}
|
||||
required={true}
|
||||
objectData={objectData}
|
||||
labelWidth={105}
|
||||
/>
|
||||
)
|
||||
},
|
||||
|
||||
@ -175,7 +175,6 @@ const ListingInfo = () => {
|
||||
loading={loading}
|
||||
isEditing={isEditing}
|
||||
type='listing'
|
||||
labelWidth={165}
|
||||
objectData={objectData}
|
||||
/>
|
||||
</InfoCollapse>
|
||||
@ -250,7 +249,7 @@ const ListingInfo = () => {
|
||||
}}
|
||||
reset={newListingVarientOpen}
|
||||
defaultValues={{
|
||||
listing: objectFormState.objectData
|
||||
listing: { _id: listingId }
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
@ -22,7 +22,6 @@ const NewListing = ({ onOk, defaultValues }) => {
|
||||
isEditing={true}
|
||||
required={true}
|
||||
objectData={objectData}
|
||||
labelWidth={133}
|
||||
/>
|
||||
)
|
||||
},
|
||||
|
||||
@ -90,8 +90,7 @@ export const Courier = {
|
||||
columnFixed: 'left',
|
||||
objectType: 'courier',
|
||||
showCopy: true,
|
||||
readOnly: false,
|
||||
required: true,
|
||||
readOnly: true,
|
||||
columnWidth: 180
|
||||
},
|
||||
{
|
||||
|
||||
@ -69,27 +69,14 @@ export const CourierService = {
|
||||
'courier',
|
||||
'tracked',
|
||||
'deliveryTime',
|
||||
'cost',
|
||||
'costWithTax',
|
||||
'active'
|
||||
],
|
||||
filters: [
|
||||
'name',
|
||||
'_id',
|
||||
'courier',
|
||||
'active',
|
||||
'deliveryTime',
|
||||
'tracked',
|
||||
'cost',
|
||||
'costWithTax'
|
||||
],
|
||||
filters: ['name', '_id', 'courier', 'active', 'deliveryTime', 'tracked'],
|
||||
sorters: [
|
||||
'name',
|
||||
'courier',
|
||||
'active',
|
||||
'tracked',
|
||||
'cost',
|
||||
'costWithTax',
|
||||
'estimatedDeliveryTime',
|
||||
'createdAt',
|
||||
'_id'
|
||||
@ -151,7 +138,7 @@ export const CourierService = {
|
||||
label: 'Delivery Time',
|
||||
type: 'number',
|
||||
readOnly: false,
|
||||
required: true,
|
||||
required: false,
|
||||
suffix: 'days',
|
||||
columnWidth: 175
|
||||
},
|
||||
@ -163,99 +150,6 @@ export const CourierService = {
|
||||
required: true,
|
||||
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',
|
||||
label: 'Tracked',
|
||||
|
||||
@ -103,13 +103,6 @@ export const Host = {
|
||||
readOnly: true,
|
||||
columnWidth: 180
|
||||
},
|
||||
{
|
||||
name: 'updatedAt',
|
||||
label: 'Updated At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
},
|
||||
{
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
@ -119,8 +112,8 @@ export const Host = {
|
||||
columnFixed: 'left'
|
||||
},
|
||||
{
|
||||
name: 'connectedAt',
|
||||
label: 'Connected At',
|
||||
name: 'updatedAt',
|
||||
label: 'Updated At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
@ -134,6 +127,13 @@ export const Host = {
|
||||
readOnly: true,
|
||||
columnWidth: 250
|
||||
},
|
||||
{
|
||||
name: 'connectedAt',
|
||||
label: 'Connected At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
},
|
||||
{
|
||||
name: 'online',
|
||||
label: 'Online',
|
||||
|
||||
@ -103,7 +103,6 @@ export const Listing = {
|
||||
'vendor',
|
||||
'stockLocation',
|
||||
'marketplace',
|
||||
'courierServices',
|
||||
'state',
|
||||
'price',
|
||||
'currency',
|
||||
@ -118,7 +117,6 @@ export const Listing = {
|
||||
'vendor',
|
||||
'stockLocation',
|
||||
'marketplace',
|
||||
'courierServices',
|
||||
'state',
|
||||
'createdAt',
|
||||
'updatedAt'
|
||||
@ -133,13 +131,7 @@ export const Listing = {
|
||||
'updatedAt',
|
||||
'_id'
|
||||
],
|
||||
group: [
|
||||
'marketplace',
|
||||
'product',
|
||||
'vendor',
|
||||
'stockLocation',
|
||||
'courierServices'
|
||||
],
|
||||
group: ['marketplace', 'product', 'vendor', 'stockLocation'],
|
||||
properties: [
|
||||
{
|
||||
name: '_id',
|
||||
@ -180,14 +172,8 @@ export const Listing = {
|
||||
columnFixed: 'left',
|
||||
type: 'text',
|
||||
readOnly: false,
|
||||
required: true,
|
||||
columnWidth: 250,
|
||||
value: (objectData) => {
|
||||
if (objectData?.title == undefined) {
|
||||
return objectData?.product?.name
|
||||
}
|
||||
return objectData?.title
|
||||
}
|
||||
required: false,
|
||||
columnWidth: 250
|
||||
},
|
||||
{
|
||||
name: 'lastSyncedAt',
|
||||
@ -203,7 +189,7 @@ export const Listing = {
|
||||
objectType: 'product',
|
||||
showHyperlink: true,
|
||||
readOnly: false,
|
||||
required: true,
|
||||
required: false,
|
||||
columnWidth: 200
|
||||
},
|
||||
{
|
||||
@ -214,12 +200,6 @@ export const Listing = {
|
||||
showHyperlink: true,
|
||||
readOnly: false,
|
||||
required: true,
|
||||
value: (objectData) => {
|
||||
if (objectData?.vendor == undefined) {
|
||||
return objectData?.product?.vendor
|
||||
}
|
||||
return objectData?.vendor
|
||||
},
|
||||
columnWidth: 200
|
||||
},
|
||||
{
|
||||
@ -276,16 +256,6 @@ export const Listing = {
|
||||
readOnly: true,
|
||||
required: false,
|
||||
columnWidth: 250
|
||||
},
|
||||
{
|
||||
name: 'courierServices',
|
||||
label: 'Courier Services',
|
||||
type: 'objectList',
|
||||
multiple: true,
|
||||
objectType: 'courierService',
|
||||
readOnly: false,
|
||||
required: true,
|
||||
columnWidth: 250
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -18,8 +18,7 @@ export const ListingVarient = {
|
||||
default: true,
|
||||
row: true,
|
||||
icon: InfoCircleIcon,
|
||||
url: (_id) =>
|
||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}`
|
||||
url: (_id) => `/dashboard/sales/listingvarients/info?listingVarientId=${_id}`
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
@ -107,7 +106,14 @@ export const ListingVarient = {
|
||||
'createdAt',
|
||||
'updatedAt'
|
||||
],
|
||||
sorters: ['state', 'price', 'lastSyncedAt', 'createdAt', 'updatedAt', '_id'],
|
||||
sorters: [
|
||||
'state',
|
||||
'price',
|
||||
'lastSyncedAt',
|
||||
'createdAt',
|
||||
'updatedAt',
|
||||
'_id'
|
||||
],
|
||||
group: ['listing', 'state'],
|
||||
properties: [
|
||||
{
|
||||
@ -159,12 +165,8 @@ export const ListingVarient = {
|
||||
type: 'object',
|
||||
objectType: 'product',
|
||||
showHyperlink: true,
|
||||
readOnly: true,
|
||||
value: (objectData) => {
|
||||
console.log('listing product id', objectData?.listing?.product?._id)
|
||||
return objectData?.listing?.product
|
||||
},
|
||||
required: true,
|
||||
readOnly: false,
|
||||
required: false,
|
||||
columnWidth: 200
|
||||
},
|
||||
{
|
||||
@ -174,11 +176,8 @@ export const ListingVarient = {
|
||||
objectType: 'productSku',
|
||||
showHyperlink: true,
|
||||
readOnly: false,
|
||||
required: true,
|
||||
columnWidth: 200,
|
||||
masterFilter: (objectData) => {
|
||||
return { product: objectData?.listing?.product?._id }
|
||||
}
|
||||
required: false,
|
||||
columnWidth: 200
|
||||
},
|
||||
{
|
||||
name: 'state',
|
||||
|
||||
@ -124,13 +124,6 @@ export const Part = {
|
||||
readOnly: true,
|
||||
columnWidth: 180
|
||||
},
|
||||
{
|
||||
name: 'updatedAt',
|
||||
label: 'Updated At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
},
|
||||
{
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
@ -139,6 +132,13 @@ export const Part = {
|
||||
type: 'text',
|
||||
columnWidth: 200
|
||||
},
|
||||
{
|
||||
name: 'updatedAt',
|
||||
label: 'Updated At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
},
|
||||
{
|
||||
name: 'file',
|
||||
label: 'File',
|
||||
|
||||
@ -125,13 +125,6 @@ export const PartSku = {
|
||||
readOnly: true,
|
||||
columnWidth: 180
|
||||
},
|
||||
{
|
||||
name: 'updatedAt',
|
||||
label: 'Updated At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
},
|
||||
{
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
@ -140,6 +133,13 @@ export const PartSku = {
|
||||
columnWidth: 200,
|
||||
columnFixed: 'left'
|
||||
},
|
||||
{
|
||||
name: 'updatedAt',
|
||||
label: 'Updated At',
|
||||
type: 'dateTime',
|
||||
readOnly: true,
|
||||
columnWidth: 175
|
||||
},
|
||||
{
|
||||
name: 'part',
|
||||
label: 'Part',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user