mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'master'
This commit is contained in:
@ -442,7 +442,7 @@ class Payment extends Model implements HasMedia
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
->setModel(new Payment())
|
||||
->setCompany(request()->header('company'))
|
||||
->setCompany($invoice->company_id)
|
||||
->setCustomer($invoice->customer_id)
|
||||
->setNextNumbers();
|
||||
|
||||
@ -455,7 +455,7 @@ class Payment extends Model implements HasMedia
|
||||
$data['exchange_rate'] = $invoice->exchange_rate;
|
||||
$data['base_amount'] = $data['amount'] * $data['exchange_rate'];
|
||||
$data['currency_id'] = $invoice->currency_id;
|
||||
$data['company_id'] = request()->header('company');
|
||||
$data['company_id'] = $invoice->company_id;
|
||||
$data['transaction_id'] = $transaction->id;
|
||||
|
||||
$payment = Payment::create($data);
|
||||
|
||||
@ -36,6 +36,11 @@ class PaymentMethod extends Model
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
public function scopeWhereCompanyId($query, $id)
|
||||
{
|
||||
$query->where('company_id', $id);
|
||||
}
|
||||
|
||||
public function scopeWhereCompany($query)
|
||||
{
|
||||
$query->where('company_id', request()->header('company'));
|
||||
@ -88,8 +93,7 @@ class PaymentMethod extends Model
|
||||
|
||||
public static function getSettings($id)
|
||||
{
|
||||
$settings = PaymentMethod::whereCompany()
|
||||
->find($id)
|
||||
$settings = PaymentMethod::find($id)
|
||||
->settings;
|
||||
|
||||
return $settings;
|
||||
|
||||
Reference in New Issue
Block a user