diff --git a/app/Http/Controllers/Customers/Payments.php b/app/Http/Controllers/Customers/Payments.php index f908a29e4..8ddadde3e 100644 --- a/app/Http/Controllers/Customers/Payments.php +++ b/app/Http/Controllers/Customers/Payments.php @@ -23,7 +23,7 @@ class Payments extends Controller { $payments = Payment::with(['account', 'category'])->where('customer_id', '=', Auth::user()->customer->id)->paginate(); - $payment_methods = Modules::getPaymentMethods(); + $payment_methods = Modules::getPaymentMethods('all'); $categories = collect(Category::enabled()->type('income')->pluck('name', 'id')) ->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), ''); diff --git a/app/Http/Controllers/Expenses/Vendors.php b/app/Http/Controllers/Expenses/Vendors.php index 829f6682c..6b06d28be 100644 --- a/app/Http/Controllers/Expenses/Vendors.php +++ b/app/Http/Controllers/Expenses/Vendors.php @@ -166,4 +166,11 @@ class Vendors extends Controller return response()->json($vendor); } + + public function vendor(Request $request) + { + $vendor = Vendor::create($request->all()); + + return response()->json($vendor); + } } diff --git a/app/Http/Controllers/Incomes/Customers.php b/app/Http/Controllers/Incomes/Customers.php index dc0e3841c..8ed42c8aa 100644 --- a/app/Http/Controllers/Incomes/Customers.php +++ b/app/Http/Controllers/Incomes/Customers.php @@ -213,4 +213,11 @@ class Customers extends Controller return response()->json($customer); } + + public function customer(Request $request) + { + $customer = Customer::create($request->all()); + + return response()->json($customer); + } } diff --git a/app/Utilities/Modules.php b/app/Utilities/Modules.php index 9d773da17..f36adb8ce 100644 --- a/app/Utilities/Modules.php +++ b/app/Utilities/Modules.php @@ -11,14 +11,14 @@ use App\Events\PaymentGatewayListing; class Modules { - public static function getPaymentMethods() + public static function getPaymentMethods($type = null) { $payment_methods = Cache::get('payment_methods.admin'); $customer = auth()->user()->customer; - if ($customer) { + if ($customer && $type != 'all') { $payment_methods = Cache::get('payment_methods.customer'); } @@ -38,7 +38,7 @@ class Modules continue; } - if ($customer && empty($gateway['customer'])) { + if (($customer && empty($gateway['customer'])) && $type != 'all') { continue; } diff --git a/modules/OfflinePayment/Resources/lang/en-GB/offlinepayment.php b/modules/OfflinePayment/Resources/lang/en-GB/offlinepayment.php index 9b702ed82..541a5c57c 100644 --- a/modules/OfflinePayment/Resources/lang/en-GB/offlinepayment.php +++ b/modules/OfflinePayment/Resources/lang/en-GB/offlinepayment.php @@ -10,4 +10,7 @@ return [ 'order' => 'Order', 'payment_gateways' => 'Offline Payment Methods', + 'confirm' => 'Confirm', + 'loading' => 'Loading', + ]; diff --git a/resources/lang/en-GB/bills.php b/resources/lang/en-GB/bills.php index 407cfc8e5..60a32652f 100644 --- a/resources/lang/en-GB/bills.php +++ b/resources/lang/en-GB/bills.php @@ -27,6 +27,8 @@ return [ 'download_pdf' => 'Download PDF', 'send_mail' => 'Send Email', + 'create_vendor' => 'Vendor Create', + 'status' => [ 'draft' => 'Draft', 'received' => 'Received', diff --git a/resources/lang/en-GB/invoices.php b/resources/lang/en-GB/invoices.php index 7f52a170f..3aa7bc692 100644 --- a/resources/lang/en-GB/invoices.php +++ b/resources/lang/en-GB/invoices.php @@ -27,6 +27,8 @@ return [ 'download_pdf' => 'Download PDF', 'send_mail' => 'Send Email', + 'create_customer' => 'Customer Create', + 'status' => [ 'draft' => 'Draft', 'sent' => 'Sent', diff --git a/resources/views/customers/invoices/show.blade.php b/resources/views/customers/invoices/show.blade.php index c4a9cf3be..f693346b7 100644 --- a/resources/views/customers/invoices/show.blade.php +++ b/resources/views/customers/invoices/show.blade.php @@ -142,17 +142,20 @@
:message
') !!} +' + error.responseJSON.name + '
'); + } + + if (error.responseJSON.email) { + $("input[name='email']").parent().parent().addClass('has-error'); + $("input[name='email']").parent().after('' + error.responseJSON.email + '
'); + } + + if (error.responseJSON.currency_code) { + $("select[name='currency_code']").parent().parent().addClass('has-error'); + $("select[name='currency_code']").parent().after('' + error.responseJSON.currency_code + '
'); + } + } + }); + }); @endpush diff --git a/resources/views/expenses/bills/show.blade.php b/resources/views/expenses/bills/show.blade.php index a4a288a7d..f2c735d33 100644 --- a/resources/views/expenses/bills/show.blade.php +++ b/resources/views/expenses/bills/show.blade.php @@ -170,89 +170,91 @@{{ trans('general.date') }} | -{{ trans_choice('general.statuses', 1) }} | -{{ trans('general.description') }} | -
---|
{{ Date::parse($bill->created_at)->format($date_format) }} | -{{ $bill->status->name }} | -{{ $bill->description }} | +{{ trans('general.date') }} | +{{ trans_choice('general.statuses', 1) }} | +{{ trans('general.description') }} |
---|
{{ trans('general.date') }} | -{{ trans('general.amount') }} | -{{ trans_choice('general.accounts', 1) }} | -{{ trans('general.actions') }} | -
---|
{{ Date::parse($payment->paid_at)->format($date_format) }} | -@money($payment->amount, $payment->currency_code, true) | -{{ $payment->account->name }} | -- {{ trans('general.show') }} - {{ trans('general.edit') }} - {!! Form::open([ - 'id' => 'bill-payment-' . $payment->id, - 'method' => 'DELETE', - 'url' => ['expenses/bills/payment', $payment->id], - 'style' => 'display:inline' - ]) !!} - {!! Form::button(' ' . trans('general.delete'), array( - 'type' => 'button', - 'class' => 'btn btn-danger btn-xs', - 'title' => trans('general.delete'), - 'onclick' => 'confirmDelete("' . '#bill-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' - )) !!} - {!! Form::close() !!} - | +{{ trans('general.date') }} | +{{ trans('general.amount') }} | +{{ trans_choice('general.accounts', 1) }} | +{{ trans('general.actions') }} |
---|
:message
') !!} +' + error.responseJSON.name + '
'); + } + + if (error.responseJSON.email) { + $("input[name='email']").parent().parent().addClass('has-error'); + $("input[name='email']").parent().after('' + error.responseJSON.email + '
'); + } + + if (error.responseJSON.currency_code) { + $("select[name='currency_code']").parent().parent().addClass('has-error'); + $("select[name='currency_code']").parent().after('' + error.responseJSON.currency_code + '
'); + } + } + }); + }); @endpush diff --git a/resources/views/incomes/invoices/show.blade.php b/resources/views/incomes/invoices/show.blade.php index afce0396c..88744dc1f 100644 --- a/resources/views/incomes/invoices/show.blade.php +++ b/resources/views/incomes/invoices/show.blade.php @@ -175,89 +175,91 @@{{ trans('general.date') }} | -{{ trans_choice('general.statuses', 1) }} | -{{ trans('general.description') }} | -
---|
{{ Date::parse($history->created_at)->format($date_format) }} | -{{ $history->status->name }} | -{{ $history->description }} | +{{ trans('general.date') }} | +{{ trans_choice('general.statuses', 1) }} | +{{ trans('general.description') }} |
---|
{{ trans('general.date') }} | -{{ trans('general.amount') }} | -{{ trans_choice('general.accounts', 1) }} | -{{ trans('general.actions') }} | -
---|
{{ Date::parse($payment->paid_at)->format($date_format) }} | -@money($payment->amount, $payment->currency_code, true) | -{{ $payment->account->name }} | -- {{ trans('general.show') }} - {{ trans('general.edit') }} - {!! Form::open([ - 'id' => 'invoice-payment-' . $payment->id, - 'method' => 'DELETE', - 'url' => ['incomes/invoices/payment', $payment->id], - 'style' => 'display:inline' - ]) !!} - {!! Form::button(' ' . trans('general.delete'), array( - 'type' => 'button', - 'class' => 'btn btn-danger btn-xs', - 'title' => trans('general.delete'), - 'onclick' => 'confirmDelete("' . '#invoice-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' - )) !!} - {!! Form::close() !!} - | +{{ trans('general.date') }} | +{{ trans('general.amount') }} | +{{ trans_choice('general.accounts', 1) }} | +{{ trans('general.actions') }} |
---|
- {{ trans('modules.no_apps') }} -
-- {!! trans('modules.developer') !!} -
-+ {{ trans('modules.no_apps') }} +
++ {!! trans('modules.developer') !!} +
+