Revert to version 761fe36
This commit is contained in:
parent
322ff0671f
commit
b48264df80
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,8 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
*/node_modules/
|
*/node_modules/
|
||||||
*/build/
|
*/build/
|
||||||
|
|
||||||
**/node_modules/
|
|
||||||
**/build/
|
|
||||||
.DS_Store
|
|
||||||
.env
|
|
||||||
@ -24,7 +24,6 @@ module.exports = class ShipmentsDBApi {
|
|||||||
state: data.state || null,
|
state: data.state || null,
|
||||||
customerCharge: data.customerCharge || null,
|
customerCharge: data.customerCharge || null,
|
||||||
actualCharge: data.actualCharge || null,
|
actualCharge: data.actualCharge || null,
|
||||||
businessname: data.businessname || null,
|
|
||||||
importHash: data.importHash || null,
|
importHash: data.importHash || null,
|
||||||
createdById: currentUser.id,
|
createdById: currentUser.id,
|
||||||
updatedById: currentUser.id,
|
updatedById: currentUser.id,
|
||||||
@ -60,7 +59,6 @@ module.exports = class ShipmentsDBApi {
|
|||||||
state: item.state || null,
|
state: item.state || null,
|
||||||
customerCharge: item.customerCharge || null,
|
customerCharge: item.customerCharge || null,
|
||||||
actualCharge: item.actualCharge || null,
|
actualCharge: item.actualCharge || null,
|
||||||
businessname: item.businessname || null,
|
|
||||||
importHash: item.importHash || null,
|
importHash: item.importHash || null,
|
||||||
createdById: currentUser.id,
|
createdById: currentUser.id,
|
||||||
updatedById: currentUser.id,
|
updatedById: currentUser.id,
|
||||||
@ -106,9 +104,6 @@ module.exports = class ShipmentsDBApi {
|
|||||||
if (data.actualCharge !== undefined)
|
if (data.actualCharge !== undefined)
|
||||||
updatePayload.actualCharge = data.actualCharge;
|
updatePayload.actualCharge = data.actualCharge;
|
||||||
|
|
||||||
if (data.businessname !== undefined)
|
|
||||||
updatePayload.businessname = data.businessname;
|
|
||||||
|
|
||||||
updatePayload.updatedById = currentUser.id;
|
updatePayload.updatedById = currentUser.id;
|
||||||
|
|
||||||
await shipments.update(updatePayload, { transaction });
|
await shipments.update(updatePayload, { transaction });
|
||||||
@ -304,17 +299,6 @@ module.exports = class ShipmentsDBApi {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter.businessname) {
|
|
||||||
where = {
|
|
||||||
...where,
|
|
||||||
[Op.and]: Utils.ilike(
|
|
||||||
'shipments',
|
|
||||||
'businessname',
|
|
||||||
filter.businessname,
|
|
||||||
),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filter.customerChargeRange) {
|
if (filter.customerChargeRange) {
|
||||||
const [start, end] = filter.customerChargeRange;
|
const [start, end] = filter.customerChargeRange;
|
||||||
|
|
||||||
|
|||||||
@ -1,49 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
/**
|
|
||||||
* @param {QueryInterface} queryInterface
|
|
||||||
* @param {Sequelize} Sequelize
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
async up(queryInterface, Sequelize) {
|
|
||||||
/**
|
|
||||||
* @type {Transaction}
|
|
||||||
*/
|
|
||||||
const transaction = await queryInterface.sequelize.transaction();
|
|
||||||
try {
|
|
||||||
await queryInterface.addColumn(
|
|
||||||
'shipments',
|
|
||||||
'businessname',
|
|
||||||
{
|
|
||||||
type: Sequelize.DataTypes.TEXT,
|
|
||||||
},
|
|
||||||
{ transaction },
|
|
||||||
);
|
|
||||||
|
|
||||||
await transaction.commit();
|
|
||||||
} catch (err) {
|
|
||||||
await transaction.rollback();
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @param {QueryInterface} queryInterface
|
|
||||||
* @param {Sequelize} Sequelize
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
async down(queryInterface, Sequelize) {
|
|
||||||
/**
|
|
||||||
* @type {Transaction}
|
|
||||||
*/
|
|
||||||
const transaction = await queryInterface.sequelize.transaction();
|
|
||||||
try {
|
|
||||||
await queryInterface.removeColumn('shipments', 'businessname', {
|
|
||||||
transaction,
|
|
||||||
});
|
|
||||||
|
|
||||||
await transaction.commit();
|
|
||||||
} catch (err) {
|
|
||||||
await transaction.rollback();
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -50,10 +50,6 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
type: DataTypes.DECIMAL,
|
type: DataTypes.DECIMAL,
|
||||||
},
|
},
|
||||||
|
|
||||||
businessname: {
|
|
||||||
type: DataTypes.TEXT,
|
|
||||||
},
|
|
||||||
|
|
||||||
importHash: {
|
importHash: {
|
||||||
type: DataTypes.STRING(255),
|
type: DataTypes.STRING(255),
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ const Shipments = db.shipments;
|
|||||||
|
|
||||||
const ProductsData = [
|
const ProductsData = [
|
||||||
{
|
{
|
||||||
productName: 'John Dalton',
|
productName: 'Andreas Vesalius',
|
||||||
|
|
||||||
// type code here for "images" field
|
// type code here for "images" field
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ const ProductsData = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
productName: 'Edward Teller',
|
productName: 'Thomas Hunt Morgan',
|
||||||
|
|
||||||
// type code here for "images" field
|
// type code here for "images" field
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ const ProductsData = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
productName: 'Richard Feynman',
|
productName: 'Willard Libby',
|
||||||
|
|
||||||
// type code here for "images" field
|
// type code here for "images" field
|
||||||
|
|
||||||
@ -49,29 +49,73 @@ const ProductsData = [
|
|||||||
|
|
||||||
height: 5,
|
height: 5,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
productName: 'Theodosius Dobzhansky',
|
||||||
|
|
||||||
|
// type code here for "images" field
|
||||||
|
|
||||||
|
weight: 4,
|
||||||
|
|
||||||
|
length: 25,
|
||||||
|
|
||||||
|
width: 12,
|
||||||
|
|
||||||
|
height: 6,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
productName: 'Gertrude Belle Elion',
|
||||||
|
|
||||||
|
// type code here for "images" field
|
||||||
|
|
||||||
|
weight: 5,
|
||||||
|
|
||||||
|
length: 30,
|
||||||
|
|
||||||
|
width: 15,
|
||||||
|
|
||||||
|
height: 8,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const QuotesData = [
|
const QuotesData = [
|
||||||
{
|
{
|
||||||
carrierName: 'Paul Dirac',
|
carrierName: 'Rudolf Virchow',
|
||||||
|
|
||||||
quotePrice: 78.38,
|
quotePrice: 51.15,
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
carrierName: 'Paul Ehrlich',
|
carrierName: 'Tycho Brahe',
|
||||||
|
|
||||||
quotePrice: 99.12,
|
quotePrice: 62.23,
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
carrierName: 'Michael Faraday',
|
carrierName: 'Karl Landsteiner',
|
||||||
|
|
||||||
quotePrice: 93.69,
|
quotePrice: 48.62,
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
carrierName: 'Jean Baptiste Lamarck',
|
||||||
|
|
||||||
|
quotePrice: 52.37,
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
carrierName: 'Sheldon Glashow',
|
||||||
|
|
||||||
|
quotePrice: 43.24,
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
},
|
},
|
||||||
@ -79,81 +123,123 @@ const QuotesData = [
|
|||||||
|
|
||||||
const ShipmentsData = [
|
const ShipmentsData = [
|
||||||
{
|
{
|
||||||
customer: 'Edward Teller',
|
customer: 'Alfred Wegener',
|
||||||
|
|
||||||
phoneNumber: 'Emil Kraepelin',
|
|
||||||
|
|
||||||
address: 'Frederick Sanger',
|
|
||||||
|
|
||||||
address2: 'Anton van Leeuwenhoek',
|
|
||||||
|
|
||||||
zipCode: 'Ernst Mayr',
|
|
||||||
|
|
||||||
city: 'Stephen Hawking',
|
|
||||||
|
|
||||||
state: 'Max Born',
|
|
||||||
|
|
||||||
// type code here for "relation_many" field
|
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
|
||||||
|
|
||||||
customerCharge: 71.54,
|
|
||||||
|
|
||||||
actualCharge: 83.68,
|
|
||||||
|
|
||||||
businessname: 'Willard Libby',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
customer: 'Rudolf Virchow',
|
|
||||||
|
|
||||||
phoneNumber: 'Comte de Buffon',
|
|
||||||
|
|
||||||
address: 'Hans Bethe',
|
|
||||||
|
|
||||||
address2: 'Edward Teller',
|
|
||||||
|
|
||||||
zipCode: 'Willard Libby',
|
|
||||||
|
|
||||||
city: 'Ernst Mayr',
|
|
||||||
|
|
||||||
state: 'Joseph J. Thomson',
|
|
||||||
|
|
||||||
// type code here for "relation_many" field
|
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
|
||||||
|
|
||||||
customerCharge: 38.34,
|
|
||||||
|
|
||||||
actualCharge: 45.04,
|
|
||||||
|
|
||||||
businessname: 'Frederick Sanger',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
customer: 'James Clerk Maxwell',
|
|
||||||
|
|
||||||
phoneNumber: 'Charles Sherrington',
|
phoneNumber: 'Charles Sherrington',
|
||||||
|
|
||||||
address: 'Trofim Lysenko',
|
address: 'Heike Kamerlingh Onnes',
|
||||||
|
|
||||||
address2: 'Werner Heisenberg',
|
address2: 'Konrad Lorenz',
|
||||||
|
|
||||||
zipCode: 'Charles Darwin',
|
zipCode: 'Frederick Gowland Hopkins',
|
||||||
|
|
||||||
city: 'Joseph J. Thomson',
|
city: 'Nicolaus Copernicus',
|
||||||
|
|
||||||
state: 'Carl Gauss (Karl Friedrich Gauss)',
|
state: 'Edward O. Wilson',
|
||||||
|
|
||||||
// type code here for "relation_many" field
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
customerCharge: 43.34,
|
customerCharge: 30.03,
|
||||||
|
|
||||||
actualCharge: 10.66,
|
actualCharge: 95.91,
|
||||||
|
},
|
||||||
|
|
||||||
businessname: 'James Clerk Maxwell',
|
{
|
||||||
|
customer: 'Hermann von Helmholtz',
|
||||||
|
|
||||||
|
phoneNumber: 'Justus Liebig',
|
||||||
|
|
||||||
|
address: 'Marie Curie',
|
||||||
|
|
||||||
|
address2: 'Alfred Wegener',
|
||||||
|
|
||||||
|
zipCode: 'Hans Bethe',
|
||||||
|
|
||||||
|
city: 'Enrico Fermi',
|
||||||
|
|
||||||
|
state: 'Sigmund Freud',
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
customerCharge: 53.43,
|
||||||
|
|
||||||
|
actualCharge: 58.21,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
customer: 'B. F. Skinner',
|
||||||
|
|
||||||
|
phoneNumber: 'Gregor Mendel',
|
||||||
|
|
||||||
|
address: 'Carl Gauss (Karl Friedrich Gauss)',
|
||||||
|
|
||||||
|
address2: 'Alfred Wegener',
|
||||||
|
|
||||||
|
zipCode: 'Frederick Sanger',
|
||||||
|
|
||||||
|
city: 'Galileo Galilei',
|
||||||
|
|
||||||
|
state: 'James Watson',
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
customerCharge: 13.46,
|
||||||
|
|
||||||
|
actualCharge: 92.16,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
customer: 'Ernest Rutherford',
|
||||||
|
|
||||||
|
phoneNumber: 'Carl Gauss (Karl Friedrich Gauss)',
|
||||||
|
|
||||||
|
address: 'John von Neumann',
|
||||||
|
|
||||||
|
address2: 'Jonas Salk',
|
||||||
|
|
||||||
|
zipCode: 'Leonard Euler',
|
||||||
|
|
||||||
|
city: 'Claude Levi-Strauss',
|
||||||
|
|
||||||
|
state: 'Pierre Simon de Laplace',
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
customerCharge: 35.87,
|
||||||
|
|
||||||
|
actualCharge: 33.48,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
customer: 'Arthur Eddington',
|
||||||
|
|
||||||
|
phoneNumber: 'J. Robert Oppenheimer',
|
||||||
|
|
||||||
|
address: 'Francis Crick',
|
||||||
|
|
||||||
|
address2: 'Anton van Leeuwenhoek',
|
||||||
|
|
||||||
|
zipCode: 'George Gaylord Simpson',
|
||||||
|
|
||||||
|
city: 'Claude Levi-Strauss',
|
||||||
|
|
||||||
|
state: 'Nicolaus Copernicus',
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
customerCharge: 57.76,
|
||||||
|
|
||||||
|
actualCharge: 52.63,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -192,6 +278,28 @@ async function associateQuoteWithShipment() {
|
|||||||
if (Quote2?.setShipment) {
|
if (Quote2?.setShipment) {
|
||||||
await Quote2.setShipment(relatedShipment2);
|
await Quote2.setShipment(relatedShipment2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedShipment3 = await Shipments.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Shipments.count())),
|
||||||
|
});
|
||||||
|
const Quote3 = await Quotes.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Quote3?.setShipment) {
|
||||||
|
await Quote3.setShipment(relatedShipment3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedShipment4 = await Shipments.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Shipments.count())),
|
||||||
|
});
|
||||||
|
const Quote4 = await Quotes.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Quote4?.setShipment) {
|
||||||
|
await Quote4.setShipment(relatedShipment4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similar logic for "relation_many"
|
// Similar logic for "relation_many"
|
||||||
@ -229,6 +337,28 @@ async function associateShipmentWithQuote() {
|
|||||||
if (Shipment2?.setQuote) {
|
if (Shipment2?.setQuote) {
|
||||||
await Shipment2.setQuote(relatedQuote2);
|
await Shipment2.setQuote(relatedQuote2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedQuote3 = await Quotes.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Quotes.count())),
|
||||||
|
});
|
||||||
|
const Shipment3 = await Shipments.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Shipment3?.setQuote) {
|
||||||
|
await Shipment3.setQuote(relatedQuote3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedQuote4 = await Quotes.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Quotes.count())),
|
||||||
|
});
|
||||||
|
const Shipment4 = await Shipments.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Shipment4?.setQuote) {
|
||||||
|
await Shipment4.setQuote(relatedQuote4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@ -41,9 +41,6 @@ router.use(checkCrudPermissions('shipments'));
|
|||||||
* state:
|
* state:
|
||||||
* type: string
|
* type: string
|
||||||
* default: state
|
* default: state
|
||||||
* businessname:
|
|
||||||
* type: string
|
|
||||||
* default: businessname
|
|
||||||
|
|
||||||
* customerCharge:
|
* customerCharge:
|
||||||
* type: integer
|
* type: integer
|
||||||
@ -341,7 +338,6 @@ router.get(
|
|||||||
'zipCode',
|
'zipCode',
|
||||||
'city',
|
'city',
|
||||||
'state',
|
'state',
|
||||||
'businessname',
|
|
||||||
|
|
||||||
'customerCharge',
|
'customerCharge',
|
||||||
'actualCharge',
|
'actualCharge',
|
||||||
|
|||||||
@ -61,8 +61,6 @@ module.exports = class SearchService {
|
|||||||
'city',
|
'city',
|
||||||
|
|
||||||
'state',
|
'state',
|
||||||
|
|
||||||
'businessname',
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
const columnsInt = {
|
const columnsInt = {
|
||||||
|
|||||||
@ -59,7 +59,7 @@ const CardProducts = ({
|
|||||||
className={`flex items-center ${bgColor} p-6 md:p-0 md:block gap-x-4 border-b border-gray-900/5 bg-gray-50 dark:bg-dark-800 relative`}
|
className={`flex items-center ${bgColor} p-6 md:p-0 md:block gap-x-4 border-b border-gray-900/5 bg-gray-50 dark:bg-dark-800 relative`}
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
href={`/products/products-edit/?id=${item.id}`}
|
href={`/products/products-view/?id=${item.id}`}
|
||||||
className={'cursor-pointer'}
|
className={'cursor-pointer'}
|
||||||
>
|
>
|
||||||
<ImageField
|
<ImageField
|
||||||
|
|||||||
@ -188,17 +188,6 @@ const CardShipments = ({
|
|||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex justify-between gap-x-4 py-3'>
|
|
||||||
<dt className=' text-gray-500 dark:text-dark-600'>
|
|
||||||
Businessname
|
|
||||||
</dt>
|
|
||||||
<dd className='flex items-start gap-x-2'>
|
|
||||||
<div className='font-medium line-clamp-4'>
|
|
||||||
{item.businessname}
|
|
||||||
</div>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -119,11 +119,6 @@ const ListShipments = ({
|
|||||||
<p className={'text-xs text-gray-500 '}>Actual Charge</p>
|
<p className={'text-xs text-gray-500 '}>Actual Charge</p>
|
||||||
<p className={'line-clamp-2'}>{item.actualCharge}</p>
|
<p className={'line-clamp-2'}>{item.actualCharge}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'flex-1 px-3'}>
|
|
||||||
<p className={'text-xs text-gray-500 '}>Businessname</p>
|
|
||||||
<p className={'line-clamp-2'}>{item.businessname}</p>
|
|
||||||
</div>
|
|
||||||
</Link>
|
</Link>
|
||||||
<ListActionsPopover
|
<ListActionsPopover
|
||||||
onDelete={onDelete}
|
onDelete={onDelete}
|
||||||
|
|||||||
@ -37,78 +37,176 @@ export const loadColumns = async (
|
|||||||
|
|
||||||
const hasUpdatePermission = hasPermission(user, 'UPDATE_SHIPMENTS');
|
const hasUpdatePermission = hasPermission(user, 'UPDATE_SHIPMENTS');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
field: 'businessname',
|
field: 'customer',
|
||||||
headerName: 'Business Name',
|
headerName: 'Customer',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
filterable: false,
|
filterable: false,
|
||||||
headerClassName: 'datagrid--header',
|
headerClassName: 'datagrid--header',
|
||||||
cellClassName: 'datagrid--cell',
|
cellClassName: 'datagrid--cell',
|
||||||
editable: hasUpdatePermission,
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'phoneNumber',
|
||||||
|
headerName: 'Phone Number',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'address',
|
||||||
|
headerName: 'Address',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'address2',
|
||||||
|
headerName: 'Address 2',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'zipCode',
|
||||||
|
headerName: 'Zip Code',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'city',
|
||||||
|
headerName: 'City',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'state',
|
||||||
|
headerName: 'State',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'products',
|
||||||
|
headerName: 'Products',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: false,
|
||||||
|
sortable: false,
|
||||||
|
type: 'singleSelect',
|
||||||
|
valueFormatter: ({ value }) =>
|
||||||
|
dataFormatter.productsManyListFormatter(value).join(', '),
|
||||||
|
renderEditCell: (params) => (
|
||||||
|
<DataGridMultiSelect {...params} entityName={'products'} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'quote',
|
||||||
|
headerName: 'Quote',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
|
||||||
|
sortable: false,
|
||||||
|
type: 'singleSelect',
|
||||||
|
getOptionValue: (value: any) => value?.id,
|
||||||
|
getOptionLabel: (value: any) => value?.label,
|
||||||
|
valueOptions: await callOptionsApi('quotes'),
|
||||||
|
valueGetter: (params: GridValueGetterParams) =>
|
||||||
|
params?.value?.id ?? params?.value,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'customerCharge',
|
||||||
|
headerName: 'Customer Charge',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'actualCharge',
|
||||||
|
headerName: 'Actual Charge',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'actions',
|
||||||
|
type: 'actions',
|
||||||
|
minWidth: 30,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
getActions: (params: GridRowParams) => {
|
||||||
|
return [
|
||||||
|
<ListActionsPopover
|
||||||
|
onDelete={onDelete}
|
||||||
|
itemId={params?.row?.id}
|
||||||
|
pathEdit={`/shipments/shipments-edit/?id=${params?.row?.id}`}
|
||||||
|
pathView={`/shipments/shipments-view/?id=${params?.row?.id}`}
|
||||||
|
key={1}
|
||||||
|
hasUpdatePermission={hasUpdatePermission}
|
||||||
|
/>,
|
||||||
|
];
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
field: 'customer',
|
];
|
||||||
headerName: 'Customer',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'address',
|
|
||||||
headerName: 'Address',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'state',
|
|
||||||
headerName: 'State',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'zipCode',
|
|
||||||
headerName: 'Zip Code',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'customerCharge',
|
|
||||||
headerName: 'Customer Charge',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'actualCharge',
|
|
||||||
headerName: 'Actual Charge',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
type: 'number',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,42 +7,71 @@ const menuAside: MenuAsideItem[] = [
|
|||||||
icon: icon.mdiViewDashboardOutline,
|
icon: icon.mdiViewDashboardOutline,
|
||||||
label: 'Dashboard',
|
label: 'Dashboard',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
href: '/shipments/shipments-list',
|
|
||||||
icon: icon.mdiTruck ? icon.mdiTruck : icon.mdiTable,
|
|
||||||
label: 'Shipments',
|
|
||||||
permissions: 'READ_SHIPMENTS',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: '/products/products-list',
|
|
||||||
icon: icon.mdiPackageVariant ? icon.mdiPackageVariant : icon.mdiTable,
|
|
||||||
label: 'Products',
|
|
||||||
permissions: 'READ_PRODUCTS',
|
|
||||||
},
|
|
||||||
{ divider: true },
|
|
||||||
{
|
{
|
||||||
href: '/users/users-list',
|
href: '/users/users-list',
|
||||||
icon: icon.mdiAccountGroup ? icon.mdiAccountGroup : icon.mdiTable,
|
|
||||||
label: 'Users',
|
label: 'Users',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiAccountGroup ? icon.mdiAccountGroup : icon.mdiTable,
|
||||||
permissions: 'READ_USERS',
|
permissions: 'READ_USERS',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
href: '/products/products-list',
|
||||||
|
label: 'Products',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiPackageVariant ? icon.mdiPackageVariant : icon.mdiTable,
|
||||||
|
permissions: 'READ_PRODUCTS',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/quotes/quotes-list',
|
||||||
|
label: 'Quotes',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiCurrencyUsd ? icon.mdiCurrencyUsd : icon.mdiTable,
|
||||||
|
permissions: 'READ_QUOTES',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/shipments/shipments-list',
|
||||||
|
label: 'Shipments',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiTruck ? icon.mdiTruck : icon.mdiTable,
|
||||||
|
permissions: 'READ_SHIPMENTS',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
href: '/roles/roles-list',
|
href: '/roles/roles-list',
|
||||||
icon: icon.mdiShieldAccountVariantOutline ? icon.mdiShieldAccountVariantOutline : icon.mdiTable,
|
|
||||||
label: 'Roles',
|
label: 'Roles',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiShieldAccountVariantOutline
|
||||||
|
? icon.mdiShieldAccountVariantOutline
|
||||||
|
: icon.mdiTable,
|
||||||
permissions: 'READ_ROLES',
|
permissions: 'READ_ROLES',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/permissions/permissions-list',
|
href: '/permissions/permissions-list',
|
||||||
icon: icon.mdiShieldAccountOutline ? icon.mdiShieldAccountOutline : icon.mdiTable,
|
|
||||||
label: 'Permissions',
|
label: 'Permissions',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
icon: icon.mdiShieldAccountOutline
|
||||||
|
? icon.mdiShieldAccountOutline
|
||||||
|
: icon.mdiTable,
|
||||||
permissions: 'READ_PERMISSIONS',
|
permissions: 'READ_PERMISSIONS',
|
||||||
},
|
},
|
||||||
{ divider: true },
|
|
||||||
{
|
{
|
||||||
href: '/profile',
|
href: '/profile',
|
||||||
icon: icon.mdiAccountCircle,
|
|
||||||
label: 'Profile',
|
label: 'Profile',
|
||||||
|
icon: icon.mdiAccountCircle,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
href: '/api-docs',
|
||||||
|
target: '_blank',
|
||||||
|
label: 'Swagger API',
|
||||||
|
icon: icon.mdiFileCode,
|
||||||
|
permissions: 'READ_API_DOCS',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -97,8 +97,6 @@ const QuotesView = () => {
|
|||||||
<th>Customer Charge</th>
|
<th>Customer Charge</th>
|
||||||
|
|
||||||
<th>Actual Charge</th>
|
<th>Actual Charge</th>
|
||||||
|
|
||||||
<th>Businessname</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -132,8 +130,6 @@ const QuotesView = () => {
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td data-label='actualCharge'>{item.actualCharge}</td>
|
<td data-label='actualCharge'>{item.actualCharge}</td>
|
||||||
|
|
||||||
<td data-label='businessname'>{item.businessname}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -57,8 +57,6 @@ const EditShipments = () => {
|
|||||||
customerCharge: '',
|
customerCharge: '',
|
||||||
|
|
||||||
actualCharge: '',
|
actualCharge: '',
|
||||||
|
|
||||||
businessname: '',
|
|
||||||
};
|
};
|
||||||
const [initialValues, setInitialValues] = useState(initVals);
|
const [initialValues, setInitialValues] = useState(initVals);
|
||||||
|
|
||||||
@ -179,10 +177,6 @@ const EditShipments = () => {
|
|||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
<FormField label='Businessname'>
|
|
||||||
<Field name='businessname' placeholder='Businessname' />
|
|
||||||
</FormField>
|
|
||||||
|
|
||||||
<BaseDivider />
|
<BaseDivider />
|
||||||
<BaseButtons>
|
<BaseButtons>
|
||||||
<BaseButton type='submit' color='info' label='Submit' />
|
<BaseButton type='submit' color='info' label='Submit' />
|
||||||
|
|||||||
@ -57,8 +57,6 @@ const EditShipmentsPage = () => {
|
|||||||
customerCharge: '',
|
customerCharge: '',
|
||||||
|
|
||||||
actualCharge: '',
|
actualCharge: '',
|
||||||
|
|
||||||
businessname: '',
|
|
||||||
};
|
};
|
||||||
const [initialValues, setInitialValues] = useState(initVals);
|
const [initialValues, setInitialValues] = useState(initVals);
|
||||||
|
|
||||||
@ -177,10 +175,6 @@ const EditShipmentsPage = () => {
|
|||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
<FormField label='Businessname'>
|
|
||||||
<Field name='businessname' placeholder='Businessname' />
|
|
||||||
</FormField>
|
|
||||||
|
|
||||||
<BaseDivider />
|
<BaseDivider />
|
||||||
<BaseButtons>
|
<BaseButtons>
|
||||||
<BaseButton type='submit' color='info' label='Submit' />
|
<BaseButton type='submit' color='info' label='Submit' />
|
||||||
|
|||||||
@ -36,7 +36,6 @@ const ShipmentsTablesPage = () => {
|
|||||||
{ label: 'Zip Code', title: 'zipCode' },
|
{ label: 'Zip Code', title: 'zipCode' },
|
||||||
{ label: 'City', title: 'city' },
|
{ label: 'City', title: 'city' },
|
||||||
{ label: 'State', title: 'state' },
|
{ label: 'State', title: 'state' },
|
||||||
{ label: 'Businessname', title: 'businessname' },
|
|
||||||
|
|
||||||
{ label: 'Customer Charge', title: 'customerCharge', number: 'true' },
|
{ label: 'Customer Charge', title: 'customerCharge', number: 'true' },
|
||||||
{ label: 'Actual Charge', title: 'actualCharge', number: 'true' },
|
{ label: 'Actual Charge', title: 'actualCharge', number: 'true' },
|
||||||
|
|||||||
@ -54,8 +54,6 @@ const initialValues = {
|
|||||||
customerCharge: '',
|
customerCharge: '',
|
||||||
|
|
||||||
actualCharge: '',
|
actualCharge: '',
|
||||||
|
|
||||||
businessname: '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ShipmentsNew = () => {
|
const ShipmentsNew = () => {
|
||||||
@ -149,10 +147,6 @@ const ShipmentsNew = () => {
|
|||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
<FormField label='Businessname'>
|
|
||||||
<Field name='businessname' placeholder='Businessname' />
|
|
||||||
</FormField>
|
|
||||||
|
|
||||||
<BaseDivider />
|
<BaseDivider />
|
||||||
<BaseButtons>
|
<BaseButtons>
|
||||||
<BaseButton type='submit' color='info' label='Submit' />
|
<BaseButton type='submit' color='info' label='Submit' />
|
||||||
|
|||||||
@ -36,7 +36,6 @@ const ShipmentsTablesPage = () => {
|
|||||||
{ label: 'Zip Code', title: 'zipCode' },
|
{ label: 'Zip Code', title: 'zipCode' },
|
||||||
{ label: 'City', title: 'city' },
|
{ label: 'City', title: 'city' },
|
||||||
{ label: 'State', title: 'state' },
|
{ label: 'State', title: 'state' },
|
||||||
{ label: 'Businessname', title: 'businessname' },
|
|
||||||
|
|
||||||
{ label: 'Customer Charge', title: 'customerCharge', number: 'true' },
|
{ label: 'Customer Charge', title: 'customerCharge', number: 'true' },
|
||||||
{ label: 'Actual Charge', title: 'actualCharge', number: 'true' },
|
{ label: 'Actual Charge', title: 'actualCharge', number: 'true' },
|
||||||
|
|||||||
@ -161,11 +161,6 @@ const ShipmentsView = () => {
|
|||||||
<p>{shipments?.actualCharge || 'No data'}</p>
|
<p>{shipments?.actualCharge || 'No data'}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'mb-4'}>
|
|
||||||
<p className={'block font-bold mb-2'}>Businessname</p>
|
|
||||||
<p>{shipments?.businessname}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<>
|
<>
|
||||||
<p className={'block font-bold mb-2'}>Quotes Shipment</p>
|
<p className={'block font-bold mb-2'}>Quotes Shipment</p>
|
||||||
<CardBox
|
<CardBox
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user