This commit is contained in:
seb
2026-10-21 03:31:52 +02:00
parent e3761bc48b
commit e9e98d041c
14 changed files with 72 additions and 35 deletions

View File

@@ -55,6 +55,7 @@ SELECT
ma.net,
ma.rebate,
ma.taxrate,
ma.shippable,
ma.comment
FROM manifestarticle ma
WHERE ma.manifest_id IN (SELECT CAST(value AS INT) FROM OPENJSON(@manifestIdsJson))
@@ -86,6 +87,7 @@ SELECT
ma.net,
ma.rebate,
ma.taxrate,
ma.shippable,
ma.comment
FROM manifestarticle ma
WHERE ma.manifest_id = @manifestId
@@ -133,7 +135,8 @@ INSERT INTO manifestarticle (
net,
comment,
rebate,
taxrate
taxrate,
shippable
)
OUTPUT INSERTED.id
VALUES (
@@ -145,7 +148,8 @@ VALUES (
@net,
@comment,
@rebate,
@taxrate
@taxrate,
@shippable
)
`;

View File

@@ -7,7 +7,7 @@ WHERE id = @orderId AND company_id = @companyId AND [type] = 'order';
`;
export const GET_ORDER_LINES = `
SELECT id, sku, name, pu, amount, net, rebate, taxrate, comment
SELECT id, sku, name, pu, amount, net, rebate, taxrate, shippable, comment
FROM manifestarticle
WHERE manifest_id = @orderId
ORDER BY id ASC;
@@ -31,7 +31,7 @@ ORDER BY m.id ASC;
`;
export const GET_SHIPPED_AMOUNTS_BY_ORDER_PATTERN = `
SELECT ma.sku, SUM(ma.amount) AS shippedAmount
SELECT ma.sku, ma.name, SUM(ma.amount) AS shippedAmount
FROM manifest m
INNER JOIN manifestarticle ma ON ma.manifest_id = m.id
LEFT JOIN shipmentsummary ss ON ss.manifest_id = m.id
@@ -40,7 +40,7 @@ WHERE m.company_id = @companyId
AND m.[number] LIKE @pattern
AND (@excludeShipmentId IS NULL OR m.id != @excludeShipmentId)
AND (ss.state IS NULL OR ss.state != 'cancelled')
GROUP BY ma.sku;
GROUP BY ma.sku, ma.name;
`;
export const GET_SHIPMENT_HEADER = `