diff --git a/app/Constants.php b/app/Constants.php index bf89dd6066c5..a2b8eb97139d 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -394,10 +394,6 @@ if (! defined('APP_NAME')) { define('GATEWAY_TYPE_CUSTOM', 6); define('GATEWAY_TYPE_TOKEN', 'token'); - define('FEE_LOCATION_CHARGE1', 'custom_value1'); - define('FEE_LOCATION_CHARGE2', 'custom_value2'); - define('FEE_LOCATION_ITEM', 'invoice_item'); - define('REMINDER1', 'reminder1'); define('REMINDER2', 'reminder2'); define('REMINDER3', 'reminder3'); diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 2d329182437f..442eceae839d 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -1189,7 +1189,7 @@ class AccountController extends BaseController $account = Auth::user()->account; $account->token_billing_type_id = Input::get('token_billing_type_id'); $account->auto_bill_on_due_date = boolval(Input::get('auto_bill_on_due_date')); - $account->gateway_fee_location = Input::get('gateway_fee_location') ?: null; + $account->gateway_fee_enabled = boolval(Input::get('gateway_fee_enabled')); $account->save(); diff --git a/app/Models/Account.php b/app/Models/Account.php index 8de6b4c45660..ccf0e93bb098 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -171,7 +171,7 @@ class Account extends Eloquent 'payment_terms', 'reset_counter_frequency_id', 'payment_type_id', - 'gateway_fee_location', + 'gateway_fee_enabled', 'reset_counter_date', ]; @@ -475,11 +475,6 @@ class Account extends Eloquent return $this->invoice_number_prefix != $this->quote_number_prefix; } - public function hasGatewayFeeSurcharge() - { - return $this->gateway_fee_location == FEE_LOCATION_CHARGE1 || $this->gateway_fee_location == FEE_LOCATION_CHARGE2; - } - /** * @return mixed */ diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 9ea12d04a0e7..170e8b660ee9 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -591,7 +591,7 @@ class Invoice extends EntityModel implements BalanceAffecting $this->save(); // mark fees as paid - if ($balanceAdjustment != 0 && $this->account->gateway_fee_location == FEE_LOCATION_ITEM) { + if ($balanceAdjustment != 0 && $this->account->gateway_fee_enabled) { if ($invoiceItem = $this->getGatewayFeeItem()) { $invoiceItem->markFeePaid(); } @@ -769,7 +769,7 @@ class Invoice extends EntityModel implements BalanceAffecting public function getRequestedAmount() { $fee = 0; - if ($this->account->gateway_fee_location) { + if ($this->account->gateway_fee_enabled) { $fee = $this->getGatewayFee(); } diff --git a/app/Models/Traits/ChargesFees.php b/app/Models/Traits/ChargesFees.php index ecea2a314158..710f84215f69 100644 --- a/app/Models/Traits/ChargesFees.php +++ b/app/Models/Traits/ChargesFees.php @@ -15,11 +15,9 @@ trait ChargesFees { $account = $this->account; $settings = $account->getGatewaySettings($gatewayTypeId); - $location = $account->gateway_fee_location; - $taxField = $location == FEE_LOCATION_CHARGE1 ? 'custom_taxes1' : 'custom_taxes1'; $fee = 0; - if (! $settings) { + if (! $account->gateway_fee_enabled) { return false; } @@ -34,24 +32,14 @@ trait ChargesFees // calculate final amount with tax if ($includeTax) { - if ($location == FEE_LOCATION_ITEM) { - $preTaxFee = $fee; + $preTaxFee = $fee; - if ($settings->fee_tax_rate1) { - $fee += $preTaxFee * $settings->fee_tax_rate1 / 100; - } + if ($settings->fee_tax_rate1) { + $fee += $preTaxFee * $settings->fee_tax_rate1 / 100; + } - if ($settings->fee_tax_rate2) { - $fee += $preTaxFee * $settings->fee_tax_rate2 / 100; - } - } elseif ($this->$taxField) { - $preTaxFee = $fee; - if (floatval($this->tax_rate1)) { - $fee += round($preTaxFee * $this->tax_rate1 / 100, 2); - } - if (floatval($this->tax_rate2)) { - $fee += round($preTaxFee * $this->tax_rate2 / 100, 2); - } + if ($settings->fee_tax_rate2) { + $fee += $preTaxFee * $settings->fee_tax_rate2 / 100; } } @@ -61,18 +49,13 @@ trait ChargesFees public function getGatewayFee() { $account = $this->account; - $location = $account->gateway_fee_location; - if (! $location) { + if (! $account->gateway_fee_enabled) { return 0; } - if ($location == FEE_LOCATION_ITEM) { - $item = $this->getGatewayFeeItem(); - return $item ? $item->amount() : 0; - } else { - return $this->$location; - } + $item = $this->getGatewayFeeItem(); + return $item ? $item->amount() : 0; } public function getGatewayFeeItem() diff --git a/app/Ninja/Datatables/AccountGatewayDatatable.php b/app/Ninja/Datatables/AccountGatewayDatatable.php index bbd93e390873..e427ed5e17b1 100644 --- a/app/Ninja/Datatables/AccountGatewayDatatable.php +++ b/app/Ninja/Datatables/AccountGatewayDatatable.php @@ -97,7 +97,7 @@ class AccountGatewayDatatable extends EntityDatatable [ 'fees', function ($model) { - if (! $feeLocation = $model->gateway_fee_location) { + if (! $model->gateway_fee_enabled) { return trans('texts.fees_disabled'); } @@ -119,15 +119,8 @@ class AccountGatewayDatatable extends EntityDatatable } $html .= $accountGatewaySettings->feesToString(); - if ($feeLocation == FEE_LOCATION_ITEM) { - if ($accountGatewaySettings->hasTaxes()) { - $html .= ' + ' . trans('texts.tax'); - } - } else { - $field = ($feeLocation == FEE_LOCATION_CHARGE1 ? 'custom_invoice_taxes1' : 'custom_invoice_taxes1'); - if (\Auth::user()->account->$field) { - $html .= ' + ' . trans('texts.tax'); - } + if ($accountGatewaySettings->hasTaxes()) { + $html .= ' + ' . trans('texts.tax'); } }; return $html ?: trans('texts.no_fees'); diff --git a/app/Ninja/Presenters/InvoicePresenter.php b/app/Ninja/Presenters/InvoicePresenter.php index f2a63df788de..246cb6df37ff 100644 --- a/app/Ninja/Presenters/InvoicePresenter.php +++ b/app/Ninja/Presenters/InvoicePresenter.php @@ -258,7 +258,7 @@ class InvoicePresenter extends EntityPresenter $invoice = $this->entity; $account = $invoice->account; - if (! $account->gateway_fee_location) { + if (! $account->gateway_fee_enabled) { return ''; } diff --git a/app/Ninja/Repositories/AccountGatewayRepository.php b/app/Ninja/Repositories/AccountGatewayRepository.php index 08babd3228b7..e047bf162c68 100644 --- a/app/Ninja/Repositories/AccountGatewayRepository.php +++ b/app/Ninja/Repositories/AccountGatewayRepository.php @@ -26,6 +26,6 @@ class AccountGatewayRepository extends BaseRepository 'gateways.name as gateway', 'account_gateways.deleted_at', 'account_gateways.gateway_id', - 'accounts.gateway_fee_location'); + 'accounts.gateway_fee_enabled'); } } diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 13efd56e7274..0758fb0ba657 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -1015,37 +1015,18 @@ class InvoiceRepository extends BaseRepository public function clearGatewayFee($invoice) { $account = $invoice->account; - $location = $account->gateway_fee_location; - - if (! $location) { - return false; - } if (! $invoice->relationLoaded('invoice_items')) { $invoice->load('invoice_items'); } - // once an invoice with fee surcharge has been paid don't clear it - if ($account->hasGatewayFeeSurcharge() && $invoice->amount != $invoice->balance) { - return false; - } - - if ($location == FEE_LOCATION_ITEM) { - $data = $invoice->toArray(); - foreach ($data['invoice_items'] as $key => $item) { - if ($item['invoice_item_type_id'] == INVOICE_ITEM_TYPE_PENDING_GATEWAY_FEE) { - unset($data['invoice_items'][$key]); - $this->save($data, $invoice); - $invoice->load('invoice_items'); - break; - } - } - } else { - if ($invoice->$location != 0) { - $data = $invoice->toArray(); - $data[$location] = 0; + $data = $invoice->toArray(); + foreach ($data['invoice_items'] as $key => $item) { + if ($item['invoice_item_type_id'] == INVOICE_ITEM_TYPE_PENDING_GATEWAY_FEE) { + unset($data['invoice_items'][$key]); $this->save($data, $invoice); $invoice->load('invoice_items'); + break; } } } @@ -1053,13 +1034,12 @@ class InvoiceRepository extends BaseRepository public function setGatewayFee($invoice, $gatewayTypeId) { $account = $invoice->account; - $location = $account->gateway_fee_location; - $settings = $account->getGatewaySettings($gatewayTypeId); - if (! $location) { + if (! $account->gateway_fee_enabled) { return; } + $settings = $account->getGatewaySettings($gatewayTypeId); $this->clearGatewayFee($invoice); if (! $settings) { @@ -1067,27 +1047,19 @@ class InvoiceRepository extends BaseRepository } $data = $invoice->toArray(); + $fee = $invoice->calcGatewayFee($gatewayTypeId); - if ($location == FEE_LOCATION_ITEM) { - $fee = $invoice->calcGatewayFee($gatewayTypeId); - - $item = []; - $item['product_key'] = $fee >= 0 ? trans('texts.surcharge') : trans('texts.discount'); - $item['notes'] = $fee >= 0 ? trans('texts.online_payment_surcharge') : trans('texts.online_payment_discount'); - $item['qty'] = 1; - $item['cost'] = $fee; - $item['tax_rate1'] = $settings->fee_tax_rate1; - $item['tax_name1'] = $settings->fee_tax_name1; - $item['tax_rate2'] = $settings->fee_tax_rate2; - $item['tax_name2'] = $settings->fee_tax_name2; - $item['invoice_item_type_id'] = INVOICE_ITEM_TYPE_PENDING_GATEWAY_FEE; - - $data['invoice_items'][] = $item; - } else { - $fee = $invoice->calcGatewayFee($gatewayTypeId); - - $data[$location] = $fee; - } + $item = []; + $item['product_key'] = $fee >= 0 ? trans('texts.surcharge') : trans('texts.discount'); + $item['notes'] = $fee >= 0 ? trans('texts.online_payment_surcharge') : trans('texts.online_payment_discount'); + $item['qty'] = 1; + $item['cost'] = $fee; + $item['tax_rate1'] = $settings->fee_tax_rate1; + $item['tax_name1'] = $settings->fee_tax_name1; + $item['tax_rate2'] = $settings->fee_tax_rate2; + $item['tax_name2'] = $settings->fee_tax_name2; + $item['invoice_item_type_id'] = INVOICE_ITEM_TYPE_PENDING_GATEWAY_FEE; + $data['invoice_items'][] = $item; $this->save($data, $invoice); $invoice->load('invoice_items'); diff --git a/app/Ninja/Transformers/AccountTransformer.php b/app/Ninja/Transformers/AccountTransformer.php index ef4d6ca4335f..84994c797b87 100644 --- a/app/Ninja/Transformers/AccountTransformer.php +++ b/app/Ninja/Transformers/AccountTransformer.php @@ -263,7 +263,7 @@ class AccountTransformer extends EntityTransformer 'payment_terms' => (int) $account->payment_terms, 'reset_counter_frequency_id' => (int) $account->reset_counter_frequency_id, 'payment_type_id' => (int) $account->payment_type_id, - 'gateway_fee_location' => $account->gateway_fee_location, + 'gateway_fee_enabled' => (bool) $account->gateway_fee_enabled, 'reset_counter_date' => $account->reset_counter_date, ]; } diff --git a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php index 68c2427a9d9f..396addb245ae 100644 --- a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php +++ b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php @@ -15,7 +15,7 @@ class AddGatewayFeeLocation extends Migration Schema::table('accounts', function ($table) { $table->dropColumn('auto_wrap'); $table->dropColumn('utf8_invoices'); - $table->enum('gateway_fee_location', [FEE_LOCATION_CHARGE1, FEE_LOCATION_CHARGE2, FEE_LOCATION_ITEM])->nullable(); + $table->boolean('gateway_fee_enabled')->default(0); $table->date('reset_counter_date')->nullable(); }); } @@ -28,7 +28,7 @@ class AddGatewayFeeLocation extends Migration public function down() { Schema::table('accounts', function ($table) { - $table->dropColumn('gateway_fee_location'); + $table->dropColumn('gateway_fee_enabled'); $table->dropColumn('reset_counter_date'); }); } diff --git a/database/setup.sql b/database/setup.sql index a450ab26a222..6ca856328164 100644 --- a/database/setup.sql +++ b/database/setup.sql @@ -323,7 +323,7 @@ CREATE TABLE `accounts` ( `payment_terms` tinyint(4) DEFAULT NULL, `reset_counter_frequency_id` smallint(6) DEFAULT NULL, `payment_type_id` smallint(6) DEFAULT NULL, - `gateway_fee_location` enum('custom_value1','custom_value2','invoice_item') COLLATE utf8_unicode_ci DEFAULT NULL, + `gateway_fee_enabled` tinyint(1) NOT NULL DEFAULT '0', `reset_counter_date` date DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `accounts_account_key_unique` (`account_key`), @@ -1145,7 +1145,7 @@ CREATE TABLE `gateways` ( LOCK TABLES `gateways` WRITE; /*!40000 ALTER TABLE `gateways` DISABLE KEYS */; -INSERT INTO `gateways` VALUES (1,'2017-03-23 07:12:22','2017-03-23 07:12:22','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-03-23 07:12:22','2017-03-23 07:12:22','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-03-23 07:12:22','2017-03-23 07:12:22','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-03-23 07:12:22','2017-03-23 07:12:22','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-03-23 07:12:22','2017-03-23 07:12:22','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-03-23 07:12:22','2017-03-23 07:12:22','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-03-23 07:12:22','2017-03-23 07:12:22','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-03-23 07:12:22','2017-03-23 07:12:22','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-03-23 07:12:22','2017-03-23 07:12:22','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-03-23 07:12:22','2017-03-23 07:12:22','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-03-23 07:12:22','2017-03-23 07:12:22','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-03-23 07:12:22','2017-03-23 07:12:22','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-03-23 07:12:22','2017-03-23 07:12:22','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-03-23 07:12:22','2017-03-23 07:12:22','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-03-23 07:12:22','2017-03-23 07:12:22','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-03-23 07:12:22','2017-03-23 07:12:22','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-03-23 07:12:22','2017-03-23 07:12:22','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-03-23 07:12:22','2017-03-23 07:12:22','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-03-23 07:12:22','2017-03-23 07:12:22','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-03-23 07:12:22','2017-03-23 07:12:22','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-03-23 07:12:22','2017-03-23 07:12:22','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-03-23 07:12:22','2017-03-23 07:12:22','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-03-23 07:12:22','2017-03-23 07:12:22','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-03-23 07:12:22','2017-03-23 07:12:22','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-03-23 07:12:22','2017-03-23 07:12:22','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-03-23 07:12:22','2017-03-23 07:12:22','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-03-23 07:12:22','2017-03-23 07:12:22','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-03-23 07:12:22','2017-03-23 07:12:22','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-03-23 07:12:22','2017-03-23 07:12:22','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-03-23 07:12:22','2017-03-23 07:12:22','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-03-23 07:12:22','2017-03-23 07:12:22','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-03-23 07:12:22','2017-03-23 07:12:22','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-03-23 07:12:22','2017-03-23 07:12:22','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-03-23 07:12:22','2017-03-23 07:12:22','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-03-23 07:12:22','2017-03-23 07:12:22','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-03-23 07:12:22','2017-03-23 07:12:22','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-03-23 07:12:22','2017-03-23 07:12:22','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-03-23 07:12:22','2017-03-23 07:12:22','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-03-23 07:12:22','2017-03-23 07:12:22','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-03-23 07:12:22','2017-03-23 07:12:22','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-03-23 07:12:22','2017-03-23 07:12:22','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-03-23 07:12:22','2017-03-23 07:12:22','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-03-23 07:12:22','2017-03-23 07:12:22','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-03-23 07:12:22','2017-03-23 07:12:22','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-03-23 07:12:22','2017-03-23 07:12:22','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-03-23 07:12:22','2017-03-23 07:12:22','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-03-23 07:12:22','2017-03-23 07:12:22','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-03-23 07:12:22','2017-03-23 07:12:22','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-03-23 07:12:22','2017-03-23 07:12:22','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-03-23 07:12:22','2017-03-23 07:12:22','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-03-23 07:12:22','2017-03-23 07:12:22','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-03-23 07:12:22','2017-03-23 07:12:22','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-03-23 07:12:22','2017-03-23 07:12:22','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-03-23 07:12:22','2017-03-23 07:12:22','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-03-23 07:12:22','2017-03-23 07:12:22','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-03-23 07:12:22','2017-03-23 07:12:22','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-03-23 07:12:22','2017-03-23 07:12:22','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-03-23 07:12:22','2017-03-23 07:12:22','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-03-23 07:12:22','2017-03-23 07:12:22','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-03-23 07:12:22','2017-03-23 07:12:22','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-03-23 07:12:22','2017-03-23 07:12:22','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-03-23 07:12:22','2017-03-23 07:12:22','Custom','Custom',1,1,8,0,NULL,1,0); +INSERT INTO `gateways` VALUES (1,'2017-03-26 03:54:02','2017-03-26 03:54:02','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-03-26 03:54:02','2017-03-26 03:54:02','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-03-26 03:54:02','2017-03-26 03:54:02','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-03-26 03:54:02','2017-03-26 03:54:02','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-03-26 03:54:02','2017-03-26 03:54:02','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-03-26 03:54:02','2017-03-26 03:54:02','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-03-26 03:54:02','2017-03-26 03:54:02','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-03-26 03:54:02','2017-03-26 03:54:02','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-03-26 03:54:02','2017-03-26 03:54:02','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-03-26 03:54:02','2017-03-26 03:54:02','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-03-26 03:54:02','2017-03-26 03:54:02','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-03-26 03:54:02','2017-03-26 03:54:02','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-03-26 03:54:02','2017-03-26 03:54:02','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-03-26 03:54:02','2017-03-26 03:54:02','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-03-26 03:54:02','2017-03-26 03:54:02','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-03-26 03:54:02','2017-03-26 03:54:02','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-03-26 03:54:02','2017-03-26 03:54:02','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-03-26 03:54:02','2017-03-26 03:54:02','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-03-26 03:54:02','2017-03-26 03:54:02','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-03-26 03:54:02','2017-03-26 03:54:02','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-03-26 03:54:02','2017-03-26 03:54:02','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-03-26 03:54:02','2017-03-26 03:54:02','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-03-26 03:54:02','2017-03-26 03:54:02','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-03-26 03:54:02','2017-03-26 03:54:02','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-03-26 03:54:02','2017-03-26 03:54:02','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-03-26 03:54:02','2017-03-26 03:54:02','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-03-26 03:54:02','2017-03-26 03:54:02','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-03-26 03:54:02','2017-03-26 03:54:02','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-03-26 03:54:02','2017-03-26 03:54:02','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-03-26 03:54:02','2017-03-26 03:54:02','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-03-26 03:54:02','2017-03-26 03:54:02','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-03-26 03:54:02','2017-03-26 03:54:02','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-03-26 03:54:02','2017-03-26 03:54:02','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-03-26 03:54:02','2017-03-26 03:54:02','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-03-26 03:54:02','2017-03-26 03:54:02','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-03-26 03:54:02','2017-03-26 03:54:02','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-03-26 03:54:02','2017-03-26 03:54:02','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-03-26 03:54:02','2017-03-26 03:54:02','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-03-26 03:54:02','2017-03-26 03:54:02','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-03-26 03:54:02','2017-03-26 03:54:02','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-03-26 03:54:02','2017-03-26 03:54:02','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-03-26 03:54:02','2017-03-26 03:54:02','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-03-26 03:54:02','2017-03-26 03:54:02','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-03-26 03:54:02','2017-03-26 03:54:02','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-03-26 03:54:02','2017-03-26 03:54:02','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-03-26 03:54:02','2017-03-26 03:54:02','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-03-26 03:54:02','2017-03-26 03:54:02','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-03-26 03:54:02','2017-03-26 03:54:02','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-03-26 03:54:02','2017-03-26 03:54:02','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-03-26 03:54:02','2017-03-26 03:54:02','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-03-26 03:54:02','2017-03-26 03:54:02','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-03-26 03:54:02','2017-03-26 03:54:02','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-03-26 03:54:02','2017-03-26 03:54:02','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-03-26 03:54:02','2017-03-26 03:54:02','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-03-26 03:54:02','2017-03-26 03:54:02','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-03-26 03:54:02','2017-03-26 03:54:02','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-03-26 03:54:02','2017-03-26 03:54:02','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-03-26 03:54:02','2017-03-26 03:54:02','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-03-26 03:54:02','2017-03-26 03:54:02','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-03-26 03:54:02','2017-03-26 03:54:02','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-03-26 03:54:02','2017-03-26 03:54:02','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-03-26 03:54:02','2017-03-26 03:54:02','Custom','Custom',1,1,8,0,NULL,1,0); /*!40000 ALTER TABLE `gateways` ENABLE KEYS */; UNLOCK TABLES; @@ -1563,7 +1563,7 @@ CREATE TABLE `payment_libraries` ( LOCK TABLES `payment_libraries` WRITE; /*!40000 ALTER TABLE `payment_libraries` DISABLE KEYS */; -INSERT INTO `payment_libraries` VALUES (1,'2017-03-23 07:12:21','2017-03-23 07:12:21','Omnipay',1),(2,'2017-03-23 07:12:21','2017-03-23 07:12:21','PHP-Payments [Deprecated]',1); +INSERT INTO `payment_libraries` VALUES (1,'2017-03-26 03:54:01','2017-03-26 03:54:01','Omnipay',1),(2,'2017-03-26 03:54:01','2017-03-26 03:54:01','PHP-Payments [Deprecated]',1); /*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */; UNLOCK TABLES; @@ -1673,7 +1673,7 @@ CREATE TABLE `payment_terms` ( LOCK TABLES `payment_terms` WRITE; /*!40000 ALTER TABLE `payment_terms` DISABLE KEYS */; -INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,1),(2,10,'Net 10','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,2),(3,14,'Net 14','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,3),(4,15,'Net 15','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,4),(5,30,'Net 30','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,5),(6,60,'Net 60','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,6),(7,90,'Net 90','2017-03-23 07:12:21','2017-03-23 07:12:21',NULL,0,0,7),(8,-1,'Net 0','2017-03-23 07:12:24','2017-03-23 07:12:24',NULL,0,0,0); +INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,1),(2,10,'Net 10','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,2),(3,14,'Net 14','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,3),(4,15,'Net 15','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,4),(5,30,'Net 30','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,5),(6,60,'Net 60','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,6),(7,90,'Net 90','2017-03-26 03:54:01','2017-03-26 03:54:01',NULL,0,0,7),(8,-1,'Net 0','2017-03-26 03:54:04','2017-03-26 03:54:04',NULL,0,0,0); /*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */; UNLOCK TABLES; @@ -2268,4 +2268,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-03-23 11:12:24 +-- Dump completed on 2017-03-26 9:54:05 diff --git a/resources/views/accounts/invoice_settings.blade.php b/resources/views/accounts/invoice_settings.blade.php index b807676bba1c..5c99b06a3e42 100644 --- a/resources/views/accounts/invoice_settings.blade.php +++ b/resources/views/accounts/invoice_settings.blade.php @@ -256,7 +256,6 @@ {!! Former::text('custom_invoice_label1') ->label(trans('texts.field_label')) - ->placeholder($account->gateway_fee_location == FEE_LOCATION_CHARGE1 ? trans('texts.surcharge') : ' ') ->addGroupClass('pad-checkbox') ->append(Former::checkbox('custom_invoice_taxes1') ->value(1) @@ -264,7 +263,6 @@ {!! Former::text('custom_invoice_label2') ->label(trans('texts.field_label')) - ->placeholder($account->gateway_fee_location == FEE_LOCATION_CHARGE2 ? trans('texts.surcharge') : ' ') ->addGroupClass('pad-checkbox') ->append(Former::checkbox('custom_invoice_taxes2') ->value(1) diff --git a/resources/views/accounts/payments.blade.php b/resources/views/accounts/payments.blade.php index 289f39543698..8a9aa05c9219 100644 --- a/resources/views/accounts/payments.blade.php +++ b/resources/views/accounts/payments.blade.php @@ -8,7 +8,7 @@ {!! Former::open()->addClass('warn-on-exit') !!} {!! Former::populateField('token_billing_type_id', $account->token_billing_type_id) !!} {!! Former::populateField('auto_bill_on_due_date', $account->auto_bill_on_due_date) !!} - {!! Former::populateField('gateway_fee_location', $account->gateway_fee_location) !!} + {!! Former::populateField('gateway_fee_enabled', $account->gateway_fee_enabled) !!}