1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Add currencies to payments by default

This commit is contained in:
David Bomba 2021-07-30 08:11:40 +10:00
parent f0b5891327
commit 055e40ccc6

View File

@ -100,6 +100,11 @@ class PaymentMigrationRepository extends BaseRepository
$payment->deleted_at = $data['deleted_at'] ?: null;
$payment->save();
if(array_key_exists('currency_id', $data) && $data['currency_id'] == 0){
$payment->currency_id = $payment->company->settings->currency_id;
$payment->save();
}
/*Ensure payment number generated*/
if (! $payment->number || strlen($payment->number) == 0) {
$payment->number = $payment->client->getNextPaymentNumber($payment->client);