close #412 Fixed: Invoice add payment problem
This commit is contained in:
parent
7641d7e315
commit
6405aafef9
@ -617,7 +617,20 @@ class Bills extends Controller
|
||||
|
||||
$bill->save();
|
||||
|
||||
$bill_payment = BillPayment::create($request->input());
|
||||
$bill_payment_request = [
|
||||
'company_id' => $request['company_id'],
|
||||
'bill_id' => $request['bill_id'],
|
||||
'account_id' => $request['account_id'],
|
||||
'paid_at' => $request['paid_at'],
|
||||
'amount' => $request['amount'],
|
||||
'currency_code' => $request['currency_code'],
|
||||
'currency_rate' => $request['currency_rate'],
|
||||
'description' => $request['description'],
|
||||
'payment_method' => $request['payment_method'],
|
||||
'reference' => $request['reference']
|
||||
];
|
||||
|
||||
$bill_payment = BillPayment::create($bill_payment_request);
|
||||
|
||||
// Upload attachment
|
||||
if ($request->file('attachment')) {
|
||||
|
@ -754,7 +754,20 @@ class Invoices extends Controller
|
||||
|
||||
$invoice->save();
|
||||
|
||||
$invoice_payment = InvoicePayment::create($request->input());
|
||||
$invoice_payment_request = [
|
||||
'company_id' => $request['company_id'],
|
||||
'invoice_id' => $request['invoice_id'],
|
||||
'account_id' => $request['account_id'],
|
||||
'paid_at' => $request['paid_at'],
|
||||
'amount' => $request['amount'],
|
||||
'currency_code' => $request['currency_code'],
|
||||
'currency_rate' => $request['currency_rate'],
|
||||
'description' => $request['description'],
|
||||
'payment_method' => $request['payment_method'],
|
||||
'reference' => $request['reference']
|
||||
];
|
||||
|
||||
$invoice_payment = InvoicePayment::create($invoice_payment_request);
|
||||
|
||||
// Upload attachment
|
||||
if ($request->file('attachment')) {
|
||||
|
@ -144,7 +144,7 @@ class Bill extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->attributes['currency_code'])->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ class BillItem extends Model
|
||||
*/
|
||||
public function setPriceAttribute($value)
|
||||
{
|
||||
$this->attributes['price'] = (double) $value;
|
||||
$this->attributes['price'] = (double) money($value, $this->bill->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,6 +53,17 @@ class BillItem extends Model
|
||||
*/
|
||||
public function setTotalAttribute($value)
|
||||
{
|
||||
$this->attributes['total'] = (double) $value;
|
||||
$this->attributes['total'] = (double) money($value, $this->bill->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert tax to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setTaxAttribute($value)
|
||||
{
|
||||
$this->attributes['tax'] = (double) money($value, $this->bill->currency_code)->getAmount();
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class BillPayment extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->account->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,7 @@ class BillTotal extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->bill->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ class Payment extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->attributes['currency_code'])->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,7 +146,7 @@ class Invoice extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->attributes['currency_code'])->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ class InvoiceItem extends Model
|
||||
*/
|
||||
public function setPriceAttribute($value)
|
||||
{
|
||||
$this->attributes['price'] = (double) $value;
|
||||
$this->attributes['price'] = (double) money($value, $this->invoice->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,6 +53,17 @@ class InvoiceItem extends Model
|
||||
*/
|
||||
public function setTotalAttribute($value)
|
||||
{
|
||||
$this->attributes['total'] = (double) $value;
|
||||
$this->attributes['total'] = (double) money($value, $this->invoice->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert tax to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setTaxAttribute($value)
|
||||
{
|
||||
$this->attributes['tax'] = (double) money($value, $this->invoice->currency_code)->getAmount();
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class InvoicePayment extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->account->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,7 @@ class InvoiceTotal extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->invoice->currency_code)->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,7 +118,7 @@ class Revenue extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
$this->attributes['amount'] = (double) money($value, $this->attributes['currency_code'])->getAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
4
public/css/app.css
vendored
4
public/css/app.css
vendored
@ -642,12 +642,12 @@ input[type="number"] {
|
||||
right: 0;
|
||||
margin-right: 100px;
|
||||
z-index: 999;
|
||||
margin-top: -50px;
|
||||
margin-top: -43px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 25px solid transparent;
|
||||
border-right: 25px solid transparent;
|
||||
border-bottom: 25px solid #ecf0f5;
|
||||
border-bottom: 19px solid #ecf0f5;
|
||||
}
|
||||
|
||||
#badge .arrow-right {
|
||||
|
Loading…
x
Reference in New Issue
Block a user