mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-19 05:11:41 -06:00
* Bug fix for sales order pricing
- Clear sale price field if no pricing
* Adjust playwright tests
(cherry picked from commit d06d80fb99)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
committed by
GitHub
parent
974a7d5510
commit
a585f5407a
@@ -125,8 +125,11 @@ export function useSalesOrderLineItemFields({
|
||||
)
|
||||
.sort((a: any, b: any) => a.quantity - b.quantity);
|
||||
|
||||
if (applicablePriceBreaks.length)
|
||||
if (applicablePriceBreaks.length) {
|
||||
setSalePrice(applicablePriceBreaks[0].price);
|
||||
} else {
|
||||
setSalePrice('');
|
||||
}
|
||||
}, [part, quantity, partCurrency, create]);
|
||||
|
||||
return useMemo(() => {
|
||||
|
||||
@@ -404,12 +404,10 @@ test('Parts - Pricing (Variant)', async ({ browser }) => {
|
||||
await loadTab(page, 'Part Pricing');
|
||||
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
|
||||
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
|
||||
await page.getByText('Last Updated').waitFor();
|
||||
await page.getByRole('button', { name: 'Internal Pricing' }).isDisabled();
|
||||
await page.getByText('Last Updated').first().waitFor();
|
||||
await page.getByRole('button', { name: 'Internal Pricing' }).isEnabled();
|
||||
await page.getByRole('button', { name: 'BOM Pricing' }).isEnabled();
|
||||
await page.getByRole('button', { name: 'Variant Pricing' }).isEnabled();
|
||||
await page.getByRole('button', { name: 'Sale Pricing' }).isDisabled();
|
||||
await page.getByRole('button', { name: 'Sale History' }).isDisabled();
|
||||
|
||||
// Variant Pricing
|
||||
await page.getByRole('button', { name: 'Variant Pricing' }).click();
|
||||
@@ -552,7 +550,7 @@ test('Parts - Parameter Filtering', async ({ browser }) => {
|
||||
await clearTableFilters(page);
|
||||
|
||||
// All parts should be available (no filters applied)
|
||||
await page.getByText('/ 425').waitFor();
|
||||
await page.getByText(/\/ 42\d/).waitFor();
|
||||
|
||||
const clickOnParamFilter = async (name: string) => {
|
||||
const button = await page
|
||||
@@ -580,7 +578,7 @@ test('Parts - Parameter Filtering', async ({ browser }) => {
|
||||
// Reset the filter
|
||||
await clearParamFilter('Color');
|
||||
|
||||
await page.getByText('/ 425').waitFor();
|
||||
await page.getByText(/\/ 42\d/).waitFor();
|
||||
});
|
||||
|
||||
test('Parts - Notes', async ({ browser }) => {
|
||||
@@ -620,7 +618,7 @@ test('Parts - Revision', async ({ browser }) => {
|
||||
.getByText('Green Round Table (revision B) | B', { exact: true })
|
||||
.click();
|
||||
await page
|
||||
.getByRole('option', { name: 'Thumbnail Green Round Table Virtual' })
|
||||
.getByRole('option', { name: 'Thumbnail Green Round Table No stock' })
|
||||
.click();
|
||||
|
||||
await page.waitForURL('**/web/part/101/**');
|
||||
|
||||
Reference in New Issue
Block a user