mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 11:24:28 -04:00
Set default payment type if none defined
This commit is contained in:
parent
d9b7ffe9f1
commit
c4f09c23ba
@ -58,11 +58,17 @@ class MarkPaid extends AbstractService
|
|||||||
$payment->transaction_reference = ctrans('texts.manual_entry');
|
$payment->transaction_reference = ctrans('texts.manual_entry');
|
||||||
$payment->currency_id = $this->invoice->client->getSetting('currency_id');
|
$payment->currency_id = $this->invoice->client->getSetting('currency_id');
|
||||||
$payment->is_manual = true;
|
$payment->is_manual = true;
|
||||||
/* Create a payment relationship to the invoice entity */
|
|
||||||
|
$payment_type_id = $this->invoice->client->getSetting('payment_type_id');
|
||||||
|
|
||||||
|
if((int)$payment_type_id > 0)
|
||||||
|
$payment->type_id = (int)$payment_type_id;
|
||||||
|
|
||||||
$payment->save();
|
$payment->save();
|
||||||
|
|
||||||
$this->setExchangeRate($payment);
|
$this->setExchangeRate($payment);
|
||||||
|
|
||||||
|
/* Create a payment relationship to the invoice entity */
|
||||||
$payment->invoices()->attach($this->invoice->id, [
|
$payment->invoices()->attach($this->invoice->id, [
|
||||||
'amount' => $payment->amount,
|
'amount' => $payment->amount,
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user