close #466 Fixed: Bill Payment Problem
This commit is contained in:
parent
37f9fbe622
commit
3589a0b5fc
@ -74,7 +74,7 @@ class Bills extends Controller
|
||||
$default_amount = $item->amount;
|
||||
|
||||
if ($bill->currency_code != $item->currency_code) {
|
||||
$default_amount_model = new InvoicePayment();
|
||||
$default_amount_model = new BillPayment();
|
||||
|
||||
$default_amount_model->default_currency_code = $bill->currency_code;
|
||||
$default_amount_model->amount = $default_amount;
|
||||
@ -84,7 +84,7 @@ class Bills extends Controller
|
||||
$default_amount = (double) $default_amount_model->getDivideConvertedAmount();
|
||||
}
|
||||
|
||||
$convert_amount = new InvoicePayment();
|
||||
$convert_amount = new BillPayment();
|
||||
|
||||
$convert_amount->default_currency_code = $item->currency_code;
|
||||
$convert_amount->amount = $default_amount;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace App\Http\Controllers\Modals;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Expsense\BillPayment as Request;
|
||||
use App\Http\Requests\Expense\BillPayment as Request;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Banking\Account;
|
||||
use App\Models\Expense\BillPayment;
|
||||
|
@ -101,4 +101,9 @@ class BillPayment extends Model
|
||||
|
||||
return $this->getMedia('attachment')->last();
|
||||
}
|
||||
|
||||
public function getDivideConvertedAmount($format = false)
|
||||
{
|
||||
return $this->divide($this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||
}
|
||||
}
|
||||
|
@ -373,6 +373,11 @@
|
||||
$('#currency_rate').val(data.currency_rate);
|
||||
|
||||
$('.input-price').each(function(){
|
||||
input_price_id = $(this).attr('id');
|
||||
input_currency_id = input_price_id.replace('price', 'currency');
|
||||
|
||||
$('#' + input_currency_id).val(data.currency_code);
|
||||
|
||||
amount = $(this).maskMoney('unmasked')[0];
|
||||
|
||||
$(this).maskMoney({
|
||||
|
@ -381,6 +381,11 @@
|
||||
$('#currency_rate').val(data.currency_rate);
|
||||
|
||||
$('.input-price').each(function(){
|
||||
input_price_id = $(this).attr('id');
|
||||
input_currency_id = input_price_id.replace('price', 'currency');
|
||||
|
||||
$('#' + input_currency_id).val(data.currency_code);
|
||||
|
||||
amount = $(this).maskMoney('unmasked')[0];
|
||||
|
||||
$(this).maskMoney({
|
||||
|
@ -24,7 +24,7 @@
|
||||
@stack('price_td_start')
|
||||
<td>
|
||||
@stack('price_input_start')
|
||||
<input value="{{ empty($item) ? '' : $item->price }}" class="form-control text-right" required="required" name="item[{{ $item_row }}][price]" type="text" id="item-price-{{ $item_row }}">
|
||||
<input value="{{ empty($item) ? '' : $item->price }}" class="form-control text-right input-price" required="required" name="item[{{ $item_row }}][price]" type="text" id="item-price-{{ $item_row }}">
|
||||
<input value="{{ $currency->code }}" name="item[{{ $item_row }}][currency]" type="hidden" id="item-currency-{{ $item_row }}">
|
||||
@stack('price_input_end')
|
||||
</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user