Compare commits

..

1 Commits

Author SHA1 Message Date
Flatlogic Bot
b8fa163360 Forced merge: merge ai-dev into master 2025-04-13 07:22:11 +00:00
20 changed files with 126 additions and 278 deletions

View File

@ -25,7 +25,6 @@ module.exports = class ShipmentsDBApi {
customerCharge: data.customerCharge || null,
actualCharge: data.actualCharge || null,
businessname: data.businessname || null,
business: data.business || null,
importHash: data.importHash || null,
createdById: currentUser.id,
updatedById: currentUser.id,
@ -62,7 +61,6 @@ module.exports = class ShipmentsDBApi {
customerCharge: item.customerCharge || null,
actualCharge: item.actualCharge || null,
businessname: item.businessname || null,
business: item.business || null,
importHash: item.importHash || null,
createdById: currentUser.id,
updatedById: currentUser.id,
@ -111,8 +109,6 @@ module.exports = class ShipmentsDBApi {
if (data.businessname !== undefined)
updatePayload.businessname = data.businessname;
if (data.business !== undefined) updatePayload.business = data.business;
updatePayload.updatedById = currentUser.id;
await shipments.update(updatePayload, { transaction });
@ -319,13 +315,6 @@ module.exports = class ShipmentsDBApi {
};
}
if (filter.business) {
where = {
...where,
[Op.and]: Utils.ilike('shipments', 'business', filter.business),
};
}
if (filter.customerChargeRange) {
const [start, end] = filter.customerChargeRange;

View File

@ -12,7 +12,7 @@ module.exports = {
try {
await queryInterface.addColumn(
'shipments',
'business',
'businessname',
{
type: Sequelize.DataTypes.TEXT,
},
@ -36,7 +36,7 @@ module.exports = {
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.removeColumn('shipments', 'business', {
await queryInterface.removeColumn('shipments', 'businessname', {
transaction,
});

View File

@ -54,10 +54,6 @@ module.exports = function (sequelize, DataTypes) {
type: DataTypes.TEXT,
},
business: {
type: DataTypes.TEXT,
},
importHash: {
type: DataTypes.STRING(255),
allowNull: true,

View File

@ -9,7 +9,7 @@ const Shipments = db.shipments;
const ProductsData = [
{
productName: 'Emil Fischer',
productName: 'John Dalton',
// type code here for "images" field
@ -23,7 +23,7 @@ const ProductsData = [
},
{
productName: 'Claude Levi-Strauss',
productName: 'Edward Teller',
// type code here for "images" field
@ -37,7 +37,7 @@ const ProductsData = [
},
{
productName: 'Karl Landsteiner',
productName: 'Richard Feynman',
// type code here for "images" field
@ -49,51 +49,29 @@ const ProductsData = [
height: 5,
},
{
productName: 'Karl Landsteiner',
// type code here for "images" field
weight: 4,
length: 25,
width: 12,
height: 6,
},
];
const QuotesData = [
{
carrierName: 'Justus Liebig',
carrierName: 'Paul Dirac',
quotePrice: 20.13,
quotePrice: 78.38,
// type code here for "relation_one" field
},
{
carrierName: 'Sigmund Freud',
carrierName: 'Paul Ehrlich',
quotePrice: 56.18,
quotePrice: 99.12,
// type code here for "relation_one" field
},
{
carrierName: 'Galileo Galilei',
carrierName: 'Michael Faraday',
quotePrice: 25.93,
// type code here for "relation_one" field
},
{
carrierName: 'Edwin Hubble',
quotePrice: 48.31,
quotePrice: 93.69,
// type code here for "relation_one" field
},
@ -101,115 +79,81 @@ const QuotesData = [
const ShipmentsData = [
{
customer: 'Claude Levi-Strauss',
customer: 'Edward Teller',
phoneNumber: 'Alfred Wegener',
phoneNumber: 'Emil Kraepelin',
address: 'Rudolf Virchow',
address: 'Frederick Sanger',
address2: 'Carl Gauss (Karl Friedrich Gauss)',
address2: 'Anton van Leeuwenhoek',
zipCode: 'Franz Boas',
zipCode: 'Ernst Mayr',
city: 'Michael Faraday',
city: 'Stephen Hawking',
state: 'Christiaan Huygens',
state: 'Max Born',
// type code here for "relation_many" field
// type code here for "relation_one" field
customerCharge: 13.96,
customerCharge: 71.54,
actualCharge: 44.54,
actualCharge: 83.68,
businessname: 'Marcello Malpighi',
business: 'Max von Laue',
businessname: 'Willard Libby',
},
{
customer: 'Albert Einstein',
customer: 'Rudolf Virchow',
phoneNumber: 'Enrico Fermi',
phoneNumber: 'Comte de Buffon',
address: 'Robert Koch',
address: 'Hans Bethe',
address2: 'James Watson',
address2: 'Edward Teller',
zipCode: 'Pierre Simon de Laplace',
zipCode: 'Willard Libby',
city: 'Sheldon Glashow',
city: 'Ernst Mayr',
state: 'William Bayliss',
state: 'Joseph J. Thomson',
// type code here for "relation_many" field
// type code here for "relation_one" field
customerCharge: 14.11,
customerCharge: 38.34,
actualCharge: 66.43,
actualCharge: 45.04,
businessname: 'Karl Landsteiner',
business: 'Max Delbruck',
businessname: 'Frederick Sanger',
},
{
customer: 'Hans Bethe',
customer: 'James Clerk Maxwell',
phoneNumber: 'Sheldon Glashow',
phoneNumber: 'Charles Sherrington',
address: 'Leonard Euler',
address: 'Trofim Lysenko',
address2: 'Neils Bohr',
address2: 'Werner Heisenberg',
zipCode: 'Johannes Kepler',
zipCode: 'Charles Darwin',
city: 'Max Born',
city: 'Joseph J. Thomson',
state: 'J. Robert Oppenheimer',
state: 'Carl Gauss (Karl Friedrich Gauss)',
// type code here for "relation_many" field
// type code here for "relation_one" field
customerCharge: 87.48,
customerCharge: 43.34,
actualCharge: 66.23,
actualCharge: 10.66,
businessname: 'George Gaylord Simpson',
business: 'Arthur Eddington',
},
{
customer: 'Max Planck',
phoneNumber: 'Edward Teller',
address: 'Max Born',
address2: 'James Watson',
zipCode: 'Louis Victor de Broglie',
city: 'Konrad Lorenz',
state: 'Richard Feynman',
// type code here for "relation_many" field
// type code here for "relation_one" field
customerCharge: 49.33,
actualCharge: 50.57,
businessname: 'John von Neumann',
business: 'Max Delbruck',
businessname: 'James Clerk Maxwell',
},
];
@ -248,17 +192,6 @@ async function associateQuoteWithShipment() {
if (Quote2?.setShipment) {
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);
}
}
// Similar logic for "relation_many"
@ -296,17 +229,6 @@ async function associateShipmentWithQuote() {
if (Shipment2?.setQuote) {
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);
}
}
module.exports = {

View File

@ -44,9 +44,6 @@ router.use(checkCrudPermissions('shipments'));
* businessname:
* type: string
* default: businessname
* business:
* type: string
* default: business
* customerCharge:
* type: integer
@ -345,7 +342,6 @@ router.get(
'city',
'state',
'businessname',
'business',
'customerCharge',
'actualCharge',

View File

@ -63,8 +63,6 @@ module.exports = class SearchService {
'state',
'businessname',
'business',
],
};
const columnsInt = {

View File

@ -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`}
>
<Link
href={`/products/products-view/?id=${item.id}`}
href={`/products/products-edit/?id=${item.id}`}
className={'cursor-pointer'}
>
<ImageField

View File

@ -199,17 +199,6 @@ const CardShipments = ({
</div>
</dd>
</div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className=' text-gray-500 dark:text-dark-600'>
Business
</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{item.business}
</div>
</dd>
</div>
</dl>
</li>
))}

View File

@ -124,11 +124,6 @@ const ListShipments = ({
<p className={'text-xs text-gray-500 '}>Businessname</p>
<p className={'line-clamp-2'}>{item.businessname}</p>
</div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500 '}>Business</p>
<p className={'line-clamp-2'}>{item.business}</p>
</div>
</Link>
<ListActionsPopover
onDelete={onDelete}

View File

@ -39,28 +39,31 @@ export const loadColumns = async (
return [
{
field: 'createdAt',
headerName: 'Ship Date',
type: 'date',
flex: 1,
minWidth: 160,
valueFormatter: (params: GridValueGetterParams) => params.value ? new Date(params.value).toLocaleDateString() : '',
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
},
{
field: 'business',
headerName: 'Business',
field: 'businessname',
headerName: 'Business Name',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: 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,
@ -70,6 +73,7 @@ export const loadColumns = async (
headerName: 'State',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
@ -79,36 +83,32 @@ export const loadColumns = async (
headerName: 'Zip Code',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: hasUpdatePermission,
},
{
field: 'quote',
headerName: 'Quote',
field: 'customerCharge',
headerName: 'Customer Charge',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
valueGetter: (params: GridValueGetterParams) => params.row.quote?.quotePrice ?? '',
editable: hasUpdatePermission,
type: 'number',
},
{
type: 'actions',
field: 'actions',
headerName: 'Actions',
minWidth: 80,
field: 'actualCharge',
headerName: 'Actual Charge',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
getActions: (params: GridRowParams) => [
<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}
/>
],
editable: hasUpdatePermission,
type: 'number',
},
];
};

View File

@ -9,48 +9,40 @@ const menuAside: MenuAsideItem[] = [
},
{
href: '/shipments/shipments-list',
icon: icon.mdiTruck ? icon.mdiTruck : icon.mdiTable,
label: 'Shipments',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
icon: icon.mdiTruck || icon.mdiTable,
permissions: 'READ_SHIPMENTS',
},
{
href: '/products/products-list',
icon: icon.mdiPackageVariant ? icon.mdiPackageVariant : icon.mdiTable,
label: 'Products',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
icon: icon.mdiPackageVariant || icon.mdiTable,
permissions: 'READ_PRODUCTS',
},
{ divider: true },
{
href: '/users/users-list',
icon: icon.mdiAccountGroup ? icon.mdiAccountGroup : icon.mdiTable,
label: 'Users',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
icon: icon.mdiAccountGroup || icon.mdiTable,
permissions: 'READ_USERS',
},
{
href: '/roles/roles-list',
icon: icon.mdiShieldAccountVariantOutline ? icon.mdiShieldAccountVariantOutline : icon.mdiTable,
label: 'Roles',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
icon: icon.mdiShieldAccountVariantOutline || icon.mdiTable,
permissions: 'READ_ROLES',
},
{
href: '/permissions/permissions-list',
icon: icon.mdiShieldAccountOutline ? icon.mdiShieldAccountOutline : icon.mdiTable,
label: 'Permissions',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
icon: icon.mdiShieldAccountOutline || icon.mdiTable,
permissions: 'READ_PERMISSIONS',
},
{ divider: true },
{
href: '/profile',
label: 'Profile',
icon: icon.mdiAccountCircle,
label: 'Profile',
},
];

View File

@ -142,7 +142,7 @@ const Dashboard = () => {
)}
{rolesWidgets &&
rolesWidgets.filter((widget) => widget.label !== 'Product Shipment Counts').map((widget) => (
rolesWidgets.map((widget) => (
<SmartWidget
key={widget.id}
userId={currentUser?.id}

View File

@ -99,8 +99,6 @@ const QuotesView = () => {
<th>Actual Charge</th>
<th>Businessname</th>
<th>Business</th>
</tr>
</thead>
<tbody>
@ -136,8 +134,6 @@ const QuotesView = () => {
<td data-label='actualCharge'>{item.actualCharge}</td>
<td data-label='businessname'>{item.businessname}</td>
<td data-label='business'>{item.business}</td>
</tr>
))}
</tbody>

View File

@ -59,8 +59,6 @@ const EditShipments = () => {
actualCharge: '',
businessname: '',
business: '',
};
const [initialValues, setInitialValues] = useState(initVals);
@ -185,10 +183,6 @@ const EditShipments = () => {
<Field name='businessname' placeholder='Businessname' />
</FormField>
<FormField label='Business'>
<Field name='business' placeholder='Business' />
</FormField>
<BaseDivider />
<BaseButtons>
<BaseButton type='submit' color='info' label='Submit' />

View File

@ -59,8 +59,6 @@ const EditShipmentsPage = () => {
actualCharge: '',
businessname: '',
business: '',
};
const [initialValues, setInitialValues] = useState(initVals);
@ -183,10 +181,6 @@ const EditShipmentsPage = () => {
<Field name='businessname' placeholder='Businessname' />
</FormField>
<FormField label='Business'>
<Field name='business' placeholder='Business' />
</FormField>
<BaseDivider />
<BaseButtons>
<BaseButton type='submit' color='info' label='Submit' />

View File

@ -37,7 +37,6 @@ const ShipmentsTablesPage = () => {
{ label: 'City', title: 'city' },
{ label: 'State', title: 'state' },
{ label: 'Businessname', title: 'businessname' },
{ label: 'Business', title: 'business' },
{ label: 'Customer Charge', title: 'customerCharge', number: 'true' },
{ label: 'Actual Charge', title: 'actualCharge', number: 'true' },

View File

@ -56,8 +56,6 @@ const initialValues = {
actualCharge: '',
businessname: '',
business: '',
};
const ShipmentsNew = () => {
@ -155,10 +153,6 @@ const ShipmentsNew = () => {
<Field name='businessname' placeholder='Businessname' />
</FormField>
<FormField label='Business'>
<Field name='business' placeholder='Business' />
</FormField>
<BaseDivider />
<BaseButtons>
<BaseButton type='submit' color='info' label='Submit' />

View File

@ -37,7 +37,6 @@ const ShipmentsTablesPage = () => {
{ label: 'City', title: 'city' },
{ label: 'State', title: 'state' },
{ label: 'Businessname', title: 'businessname' },
{ label: 'Business', title: 'business' },
{ label: 'Customer Charge', title: 'customerCharge', number: 'true' },
{ label: 'Actual Charge', title: 'actualCharge', number: 'true' },

View File

@ -166,11 +166,6 @@ const ShipmentsView = () => {
<p>{shipments?.businessname}</p>
</div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Business</p>
<p>{shipments?.business}</p>
</div>
<>
<p className={'block font-bold mb-2'}>Quotes Shipment</p>
<CardBox

View File

@ -78,7 +78,7 @@ module.exports = {
diversityMain: '#5A7BEB',
diversityHeader: '#5A7BEB',
websiteBG: '#EDF2FA',
websiteBG: '#FFFFFF',
900: '#14142A',
800: '#DFE7F4',
},