diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 8afd5cedfe..3597c3f477 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -11,6 +11,7 @@ use App\Ninja\Datatables\PaymentDatatable; use App\Ninja\Mailers\ContactMailer; use App\Ninja\Repositories\PaymentRepository; use App\Services\PaymentService; +use Auth; use Cache; use DropdownButton; use Input; @@ -93,6 +94,7 @@ class PaymentController extends BaseController ->orderBy('invoice_number')->get(); $data = [ + 'account' => Auth::user()->account, 'clientPublicId' => Input::old('client') ? Input::old('client') : ($request->client_id ?: 0), 'invoicePublicId' => Input::old('invoice') ? Input::old('invoice') : ($request->invoice_id ?: 0), 'invoice' => null, @@ -148,6 +150,7 @@ class PaymentController extends BaseController } $data = [ + 'account' => Auth::user()->account, 'client' => null, 'invoice' => null, 'invoices' => Invoice::scope() diff --git a/app/Models/Account.php b/app/Models/Account.php index 84e1156397..fb907d01c8 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -92,6 +92,7 @@ class Account extends Eloquent 'enable_email_markup', 'domain_id', 'payment_terms', + 'payment_type_id', ]; /** diff --git a/database/migrations/2017_02_23_095934_add_custom_product_fields.php b/database/migrations/2017_02_23_095934_add_custom_product_fields.php index e060f8be07..2d97141149 100644 --- a/database/migrations/2017_02_23_095934_add_custom_product_fields.php +++ b/database/migrations/2017_02_23_095934_add_custom_product_fields.php @@ -32,6 +32,7 @@ class AddCustomProductFields extends Migration Schema::table('accounts', function ($table) { $table->smallInteger('reset_counter_frequency_id')->nullable(); + $table->smallInteger('payment_type_id')->nullable(); }); DB::table('currencies')->where('code', '=', 'HKR')->update(['code' => 'HRK']); @@ -73,6 +74,7 @@ class AddCustomProductFields extends Migration Schema::table('accounts', function ($table) { $table->dropColumn('reset_counter_frequency_id'); + $table->dropColumn('payment_type_id'); }); DB::table('currencies')->where('code', '=', 'HRK')->update(['code' => 'HKR']); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 47443ab258..21eec3b8a5 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -614,7 +614,7 @@ $LANG = array( 'or' => 'or', 'email_error' => 'There was a problem sending the email', 'confirm_recurring_timing' => 'Note: emails are sent at the start of the hour.', - 'payment_terms_help' => 'Sets the default invoice due date', + 'payment_terms_help' => 'Sets the default invoice due date.', 'unlink_account' => 'Unlink Account', 'unlink' => 'Unlink', 'show_address' => 'Show Address', @@ -2378,7 +2378,9 @@ $LANG = array( 'custom_product_fields_help' => 'Add a field when creating a product or invoice and display the label and value on the PDF.', 'freq_two_months' => 'Two months', 'freq_yearly' => 'Annually', - + 'profile' => 'Profile', + 'payment_type_help' => 'Sets the default payment type.', + ); return $LANG; diff --git a/resources/views/accounts/details.blade.php b/resources/views/accounts/details.blade.php index 21b83738b2..d47dd2e14e 100644 --- a/resources/views/accounts/details.blade.php +++ b/resources/views/accounts/details.blade.php @@ -59,20 +59,6 @@ @endif - {!! Former::select('payment_terms') - ->addOption('','') - ->fromQuery(Cache::get('paymentTerms'), 'name', 'num_days') - ->help(trans('texts.payment_terms_help')) !!} - - {!! Former::select('size_id') - ->addOption('','') - ->fromQuery($sizes, 'name', 'id') !!} - - {!! Former::select('industry_id') - ->addOption('','') - ->fromQuery($industries, 'name', 'id') - ->help('texts.industry_help') !!} - @@ -96,14 +82,62 @@