diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index d7af8b867c98..f267e9201cfa 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -172,6 +172,11 @@ class Vendor extends BaseModel return $this->company->company_key.'/'.$this->vendor_hash.'/'.$contact_key.'/purchase_orders/'; } + public function locale() + { + return $this->company->locale(); + } + public function country() { return $this->belongsTo(Country::class); diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index f7957b5439de..e0a49b57cd0b 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -55,7 +55,6 @@ class MarkPaid extends AbstractService $payment->amount = $this->invoice->balance; $payment->applied = $this->invoice->balance; - $payment->number = $this->getNextPaymentNumber($this->invoice->client, $payment); $payment->status_id = Payment::STATUS_COMPLETED; $payment->client_id = $this->invoice->client_id; $payment->transaction_reference = ctrans('texts.manual_entry'); @@ -74,6 +73,8 @@ class MarkPaid extends AbstractService $payment->saveQuietly(); + $payment->service()->applyNumber()->save(); + $this->setExchangeRate($payment); /* Create a payment relationship to the invoice entity */