diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index f3c23ab5b07f..654facfbc4f8 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -58,11 +58,17 @@ class MarkPaid extends AbstractService $payment->transaction_reference = ctrans('texts.manual_entry'); $payment->currency_id = $this->invoice->client->getSetting('currency_id'); $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(); $this->setExchangeRate($payment); + /* Create a payment relationship to the invoice entity */ $payment->invoices()->attach($this->invoice->id, [ 'amount' => $payment->amount, ]);