Fixes for tests

This commit is contained in:
David Bomba 2023-11-07 17:39:56 +11:00
parent 1ba1b1b1a3
commit 7de0cd99f1
4 changed files with 7 additions and 2 deletions

View File

@ -97,7 +97,7 @@ class StorePaymentRequest extends Request
}
if (! isset($input['idempotency_key'])) {
$input['idempotency_key'] = substr(sha1(json_encode($input)).time()."{$input['date']}{$input['amount']}{$input['client_id']}{$user->id}",0,64);
$input['idempotency_key'] = substr(sha1(json_encode($input)).time()."{$input['date']}{$input['amount']}{$user->id}",0,64);
}
$this->replace($input);

View File

@ -45,6 +45,10 @@ class UpdateLedger implements ShouldQueue
MultiDB::setDb($this->db);
$cl = CompanyLedger::find($this->company_ledger_id);
if(!$cl)
return;
$entity = $cl->company_ledgerable;
$balance = $entity->calc()->getBalance();
$cl->adjustment = $balance - $this->start_amount;

View File

@ -223,6 +223,7 @@ class MultiPaymentDeleteTest extends TestCase
$data = [
'amount' => 162.0,
'transaction_reference' => 'something',
'client_id' => $this->encodePrimaryKey($client->id),
'invoices' => [
[

View File

@ -83,7 +83,7 @@ class PaymentTest extends TestCase
],
],
'date' => '2020/12/11',
'idempotency_key' => 'dsjafhajklsfhlaksjdhlkajsdjdfjdfljasdfhkjlsafhljfkfhsjlfhiuwayerfiuwaskjgbzmvnjzxnjcbgfkjhdgfoiwwrasdfasdfkashjdfkaskfjdasfda'
'idempotency_key' => sha1(time()).\Illuminate\Support\Str::uuid()->toString()
];