This commit is contained in:
seb
2026-09-26 07:34:37 +02:00
parent 607e6cc0ac
commit e491ecfa47
24 changed files with 2162 additions and 1716 deletions

View File

@@ -1,7 +1,19 @@
export const CHECK_MANIFESTARTICLE_ACCESS = `
SELECT ma.id, ma.sku
SELECT
ma.id,
ma.sku,
ma.amount AS lineAmount,
ma.net,
ma.rebate,
ma.taxrate,
m.id AS manifestId,
m.number AS manifestNumber,
m.type AS manifestType,
m.external_number AS externalNumber,
e.name AS supplierName
FROM manifestarticle ma
INNER JOIN manifest m ON ma.manifest_id = m.id
LEFT JOIN entity e ON e.id = m.entity_id
WHERE ma.id = @manifestarticleId AND m.company_id = @companyId;
`;

View File

@@ -404,6 +404,7 @@ CREATE TABLE IF NOT EXISTS manifest (
entity_id INTEGER,
external_number TEXT,
"date" TEXT NOT NULL DEFAULT (${UTC_NOW}),
created_at TEXT NOT NULL DEFAULT (${UTC_NOW}),
FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE NO ACTION,
FOREIGN KEY (entity_id) REFERENCES entity(id) ON DELETE SET NULL
);