refs #1480 Invoice/Bill payment show error issue solved
This commit is contained in:
		
							
								
								
									
										9
									
								
								resources/assets/js/views/purchases/bills.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								resources/assets/js/views/purchases/bills.js
									
									
									
									
										vendored
									
									
								
							| @@ -336,7 +336,7 @@ const app = new Vue({ | ||||
|  | ||||
|                 this.component = Vue.component('add-new-component', (resolve, reject) => { | ||||
|                     resolve({ | ||||
|                         template: '<div id="dynamic-component"><akaunting-modal-add-new :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>', | ||||
|                         template: '<div id="dynamic-component"><akaunting-modal-add-new modal-dialog-class="modal-md" :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>', | ||||
|  | ||||
|                         mixins: [ | ||||
|                             Global | ||||
| @@ -352,6 +352,7 @@ const app = new Vue({ | ||||
|                         methods: { | ||||
|                             onSubmit(event) { | ||||
|                                 this.form = event; | ||||
|                                 this.form.response = {}; | ||||
|  | ||||
|                                 this.loading = true; | ||||
|  | ||||
| @@ -396,6 +397,12 @@ const app = new Vue({ | ||||
|                                             window.location.href = response.data.redirect; | ||||
|                                         } | ||||
|                                     } | ||||
|  | ||||
|                                     if (response.data.error) { | ||||
|                                         this.form.loading = false; | ||||
|  | ||||
|                                         this.form.response = response.data; | ||||
|                                     } | ||||
|                                 }) | ||||
|                                 .catch(error => { | ||||
|                                     this.form.loading = false; | ||||
|   | ||||
							
								
								
									
										9
									
								
								resources/assets/js/views/sales/invoices.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								resources/assets/js/views/sales/invoices.js
									
									
									
									
										vendored
									
									
								
							| @@ -337,7 +337,7 @@ const app = new Vue({ | ||||
|  | ||||
|                 this.component = Vue.component('add-new-component', (resolve, reject) => { | ||||
|                     resolve({ | ||||
|                         template: '<div id="dynamic-component"><akaunting-modal-add-new :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>', | ||||
|                         template: '<div id="dynamic-component"><akaunting-modal-add-new modal-dialog-class="modal-md" :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>', | ||||
|  | ||||
|                         mixins: [ | ||||
|                             Global | ||||
| @@ -353,6 +353,7 @@ const app = new Vue({ | ||||
|                         methods: { | ||||
|                             onSubmit(event) { | ||||
|                                 this.form = event; | ||||
|                                 this.form.response = {}; | ||||
|  | ||||
|                                 this.loading = true; | ||||
|  | ||||
| @@ -397,6 +398,12 @@ const app = new Vue({ | ||||
|                                             window.location.href = response.data.redirect; | ||||
|                                         } | ||||
|                                     } | ||||
|  | ||||
|                                     if (response.data.error) { | ||||
|                                         this.form.loading = false; | ||||
|  | ||||
|                                         this.form.response = response.data; | ||||
|                                     } | ||||
|                                 }) | ||||
|                                 .catch(error => { | ||||
|                                     this.form.loading = false; | ||||
|   | ||||
| @@ -7,9 +7,9 @@ | ||||
|     'route' => ['modals.bills.bill.transactions.store', $bill->id], | ||||
|     'novalidate' => true | ||||
| ]) !!} | ||||
|     <div class="row"> | ||||
|         <base-alert type="warning" v-if="typeof form.response !== 'undefined' && form.response.error" v-html="form.response.message"></base-alert> | ||||
|     <base-alert type="warning" v-if="typeof form.response !== 'undefined' && form.response.error" v-html="form.response.message"></base-alert> | ||||
|  | ||||
|     <div class="row"> | ||||
|         {{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }} | ||||
|  | ||||
|         {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency, 'dynamic-currency' => 'currency'], $bill->grand_total) }} | ||||
|   | ||||
| @@ -7,9 +7,9 @@ | ||||
|     'route' => ['modals.invoices.invoice.transactions.store', $invoice->id], | ||||
|     'novalidate' => true | ||||
| ]) !!} | ||||
|     <div class="row"> | ||||
|         <base-alert type="warning" v-if="typeof form.response !== 'undefined' && form.response.error" v-html="form.response.message"></base-alert> | ||||
|     <base-alert type="warning" v-if="typeof form.response !== 'undefined' && form.response.error" v-html="form.response.message"></base-alert> | ||||
|  | ||||
|     <div class="row"> | ||||
|         {{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }} | ||||
|  | ||||
|         {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency, 'dynamic-currency' => 'currency'], $invoice->grand_total) }} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user