mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 10:54:30 -04:00
Working on gateway fees
This commit is contained in:
parent
fa2e50f15c
commit
0791e6fbc5
@ -1019,15 +1019,15 @@ class InvoiceRepository extends BaseRepository
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $invoice->relationLoaded('invoice_items')) {
|
||||||
|
$invoice->load('invoice_items');
|
||||||
|
}
|
||||||
|
|
||||||
// once an invoice with fee surcharge has been paid don't clear it
|
// once an invoice with fee surcharge has been paid don't clear it
|
||||||
if (($location == FEE_LOCATION_CHARGE1 || $location == FEE_LOCATION_CHARGE2) && $invoice->amount != $invoice->balance) {
|
if (($location == FEE_LOCATION_CHARGE1 || $location == FEE_LOCATION_CHARGE2) && $invoice->amount != $invoice->balance) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $invoice->relationLoaded('invoice_items')) {
|
|
||||||
$invoice->load('invoice_items');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($location == FEE_LOCATION_ITEM) {
|
if ($location == FEE_LOCATION_ITEM) {
|
||||||
$data = $invoice->toArray();
|
$data = $invoice->toArray();
|
||||||
foreach ($data['invoice_items'] as $key => $item) {
|
foreach ($data['invoice_items'] as $key => $item) {
|
||||||
@ -1066,7 +1066,7 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$data = $invoice->toArray();
|
$data = $invoice->toArray();
|
||||||
|
|
||||||
if ($location == FEE_LOCATION_ITEM) {
|
if ($location == FEE_LOCATION_ITEM) {
|
||||||
$fee = $invoice->calcGatewayFee($gatewayTypeId, false);
|
$fee = $invoice->calcGatewayFee($gatewayTypeId);
|
||||||
|
|
||||||
$item = [];
|
$item = [];
|
||||||
$item['product_key'] = trans('texts.surcharge');
|
$item['product_key'] = trans('texts.surcharge');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user