mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Move payment numbering into service
This commit is contained in:
parent
e976a4d8fb
commit
0c05370686
@ -172,6 +172,11 @@ class Vendor extends BaseModel
|
|||||||
return $this->company->company_key.'/'.$this->vendor_hash.'/'.$contact_key.'/purchase_orders/';
|
return $this->company->company_key.'/'.$this->vendor_hash.'/'.$contact_key.'/purchase_orders/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function locale()
|
||||||
|
{
|
||||||
|
return $this->company->locale();
|
||||||
|
}
|
||||||
|
|
||||||
public function country()
|
public function country()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Country::class);
|
return $this->belongsTo(Country::class);
|
||||||
|
@ -55,7 +55,6 @@ class MarkPaid extends AbstractService
|
|||||||
|
|
||||||
$payment->amount = $this->invoice->balance;
|
$payment->amount = $this->invoice->balance;
|
||||||
$payment->applied = $this->invoice->balance;
|
$payment->applied = $this->invoice->balance;
|
||||||
$payment->number = $this->getNextPaymentNumber($this->invoice->client, $payment);
|
|
||||||
$payment->status_id = Payment::STATUS_COMPLETED;
|
$payment->status_id = Payment::STATUS_COMPLETED;
|
||||||
$payment->client_id = $this->invoice->client_id;
|
$payment->client_id = $this->invoice->client_id;
|
||||||
$payment->transaction_reference = ctrans('texts.manual_entry');
|
$payment->transaction_reference = ctrans('texts.manual_entry');
|
||||||
@ -74,6 +73,8 @@ class MarkPaid extends AbstractService
|
|||||||
|
|
||||||
$payment->saveQuietly();
|
$payment->saveQuietly();
|
||||||
|
|
||||||
|
$payment->service()->applyNumber()->save();
|
||||||
|
|
||||||
$this->setExchangeRate($payment);
|
$this->setExchangeRate($payment);
|
||||||
|
|
||||||
/* Create a payment relationship to the invoice entity */
|
/* Create a payment relationship to the invoice entity */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user