Link OTC sales to market days
This commit is contained in:
1 parent
759e337976
commit
47c09a3e4c
6 files changed
+167
-9
No files matched your search
@@ -146,10 +146,12 @@ function create_direct_sales_order(PDO $pdo, array $fields): array
|
||||
$stmt = $pdo->prepare(
|
||||
'INSERT INTO sales_order (
|
||||
id, external_ref, party_id, order_source, order_date, order_status, payment_status, payment_method_id,
|
||||
amount_net, amount_shipping, amount_tax, amount_discount, total_amount, currency, imported_at, created_at, updated_at
|
||||
amount_net, amount_shipping, amount_tax, amount_discount, total_amount, currency,
|
||||
market_occurrence_id, market_occurrence_day_id, imported_at, created_at, updated_at
|
||||
) VALUES (
|
||||
:id, :external_ref, :party_id, \'direct\', :order_date, \'imported\', \'paid\', :payment_method_id,
|
||||
:amount_net, 0, 0, 0, :total_amount, \'CHF\', NOW(), NOW(), NOW()
|
||||
:amount_net, 0, 0, 0, :total_amount, \'CHF\',
|
||||
:market_occurrence_id, :market_occurrence_day_id, NOW(), NOW(), NOW()
|
||||
)
|
||||
RETURNING id, external_ref'
|
||||
);
|
||||
@@ -161,6 +163,8 @@ function create_direct_sales_order(PDO $pdo, array $fields): array
|
||||
':payment_method_id' => $fields[':payment_method_id'] ?? null,
|
||||
':amount_net' => $fields[':amount_net'] ?? null,
|
||||
':total_amount' => $fields[':total_amount'] ?? null,
|
||||
':market_occurrence_id' => $fields[':market_occurrence_id'] ?? null,
|
||||
':market_occurrence_day_id' => $fields[':market_occurrence_day_id'] ?? null,
|
||||
]);
|
||||
|
||||
$row = $stmt->fetch();
|
||||
|
||||
Reference in new issue
Block a user