mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
1ba1b1b1a3
commit
7de0cd99f1
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -223,6 +223,7 @@ class MultiPaymentDeleteTest extends TestCase
|
||||
|
||||
$data = [
|
||||
'amount' => 162.0,
|
||||
'transaction_reference' => 'something',
|
||||
'client_id' => $this->encodePrimaryKey($client->id),
|
||||
'invoices' => [
|
||||
[
|
||||
|
@ -83,7 +83,7 @@ class PaymentTest extends TestCase
|
||||
],
|
||||
],
|
||||
'date' => '2020/12/11',
|
||||
'idempotency_key' => 'dsjafhajklsfhlaksjdhlkajsdjdfjdfljasdfhkjlsafhljfkfhsjlfhiuwayerfiuwaskjgbzmvnjzxnjcbgfkjhdgfoiwwrasdfasdfkashjdfkaskfjdasfda'
|
||||
'idempotency_key' => sha1(time()).\Illuminate\Support\Str::uuid()->toString()
|
||||
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user