Keep self-serve invoice billing customer authoritative
This commit is contained in:
@@ -224,7 +224,7 @@ trait selfserve_lane_invoice_t
|
||||
$billing_customer_number = $this->getCustomerNumber();
|
||||
$draft_customer_number = (new economic())->getTransactionDraftCustomerNumber();
|
||||
$order = (new orders_o())->add(
|
||||
$draft_customer_number ?? $billing_customer_number,
|
||||
$billing_customer_number,
|
||||
self::INVOICE_SYSTEM_USER_ID,
|
||||
'',
|
||||
'',
|
||||
|
||||
@@ -41,7 +41,7 @@ it('creates a comprehensive self-serve API scenario with demo relays', function
|
||||
->and($session['reg'])->toBe($scenario['vehicle']['reg']);
|
||||
});
|
||||
|
||||
it('creates self-serve invoice orders on the draft customer with original customer and driver metadata attached', function (): void {
|
||||
it('creates self-serve invoice orders for the lane customer with draft customer and driver metadata attached', function (): void {
|
||||
selfserve_fixture_ensure_legacy_redis_constant();
|
||||
|
||||
$draftCustomer = api_fixtures()->createUser(['display_name' => 'Self-Serve Draft Customer']);
|
||||
@@ -82,7 +82,7 @@ it('creates self-serve invoice orders on the draft customer with original custom
|
||||
api_fixtures()->cleanupDeleteWhere('object_attachments', ['object_type' => $attachmentObjectType, 'object_id' => $orderId]);
|
||||
|
||||
expect($order)->not->toBeNull()
|
||||
->and((int)$order['customer_id'])->toBe((int)$draftCustomer['customer_number'])
|
||||
->and((int)$order['customer_id'])->toBe((int)$scenario['customer']['customer_number'])
|
||||
->and((int)$order['department_id'])->toBe((int)$scenario['department']['id'])
|
||||
->and((string)$order['reg_1'])->toBe((string)$scenario['vehicle']['reg'])
|
||||
->and((int)$order['lane'])->toBe((int)$scenario['lane']['id'])
|
||||
|
||||
Reference in New Issue
Block a user