Skip to content

Commit

Permalink
Merge branch 'master' into build-line-filter-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Oct 23, 2024
2 parents bcbbd24 + a6bba14 commit 4244195
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 114 deletions.
212 changes: 111 additions & 101 deletions contrib/container/requirements.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/backend/InvenTree/templates/js/translated/company.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function supplierPartFields(options={}) {
icon: 'fa-box',
},
pack_quantity: {},
active: {},
};

if (options.part) {
Expand Down
4 changes: 1 addition & 3 deletions src/backend/InvenTree/templates/js/translated/pricing.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,10 @@ function loadPurchasePriceHistoryTable(options={}) {
}

var html = '';
var supplier = row.supplier_part_detail.supplier_detail;

html += imageHoverIcon(supplier.thumbnail || supplier.image);
html += renderLink(order.reference, `/order/purchase-order/${order.pk}/`);
html += ' - ';
html += renderLink(supplier.name, `/company/${supplier.pk}/`);
html += renderLink(order.supplier_name, `/company/${order.supplier}/`);

return html;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
{
sortable: true,
sortName: 'MPN',
field: 'supplier_part_detail.manufacturer_part_detail.MPN',
field: 'mpn',
title: '{% trans "MPN" %}',
formatter: function(value, row, index, field) {
if (row.supplier_part_detail && row.supplier_part_detail.manufacturer_part) {
Expand Down
10 changes: 7 additions & 3 deletions src/frontend/src/pages/part/pricing/PurchaseHistoryPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@ export default function PurchaseHistoryPanel({
currency: record.purchase_price_currency
});

let units = record.supplier_part_detail?.pack_quantity;
let packQuatity = record.supplier_part_detail?.pack_quantity;
let hasPackQuantity =
!!packQuatity &&
record.supplier_part_detail?.pack_quantity_native != 1;

return (
<Group justify="space-between" gap="xs">
<Text>{price}</Text>
{units && <Text size="xs">[{units}]</Text>}
{hasPackQuantity && <Text size="xs">[{packQuatity}]</Text>}
</Group>
);
}
Expand All @@ -74,11 +77,12 @@ export default function PurchaseHistoryPanel({
});

let units = record.part_detail?.units;
let hasUnits = !!units && units !== 1;

return (
<Group justify="space-between" gap="xs">
<Text>{price}</Text>
{units && <Text size="xs">[{units}]</Text>}
{hasUnits && <Text size="xs">[{units}]</Text>}
</Group>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export function PurchaseOrderLineItemTable({
title: t`Pack Quantity`
},
{
accessor: 'supplier_part_detail.SKU',
accessor: 'sku',
title: t`Supplier Code`,
switchable: false,
sortable: true,
Expand All @@ -213,12 +213,10 @@ export function PurchaseOrderLineItemTable({
sortable: false
}),
{
accessor: 'MPN',
accessor: 'mpn',
ordering: 'MPN',
title: t`Manufacturer Code`,
sortable: true,

render: (record: any) =>
record?.supplier_part_detail?.manufacturer_part_detail?.MPN
sortable: true
},
CurrencyColumn({
accessor: 'purchase_price',
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/tests/pages/pui_stock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ test('Stock - Serial Numbers', async ({ page }) => {

// Now, with correct quantity
await page.getByLabel('number-field-quantity').fill('51');
await page.waitForTimeout(250);
await page.getByRole('button', { name: 'Submit' }).click();
await page.waitForTimeout(250);

await page
.getByText(
/The following serial numbers already exist or are invalid : 200,201,202,203,204/
Expand Down

0 comments on commit 4244195

Please sign in to comment.