close #727 Fixed: Invoice/Bill new tax added get not selected
This commit is contained in:
		| @@ -389,7 +389,7 @@ | ||||
|                 url: '{{ url("modals/taxes/create") }}', | ||||
|                 type: 'GET', | ||||
|                 dataType: 'JSON', | ||||
|                 data: {name: tax_name}, | ||||
|                 data: {name: tax_name, tax_selector: '.tax-select2'}, | ||||
|                 success: function(json) { | ||||
|                     if (json['success']) { | ||||
|                         $('body').append(json['html']); | ||||
|   | ||||
| @@ -387,7 +387,7 @@ | ||||
|                 url: '{{ url("modals/taxes/create") }}', | ||||
|                 type: 'GET', | ||||
|                 dataType: 'JSON', | ||||
|                 data: {name: tax_name}, | ||||
|                 data: {name: tax_name, tax_selector: '.tax-select2'}, | ||||
|                 success: function(json) { | ||||
|                     if (json['success']) { | ||||
|                         $('body').append(json['html']); | ||||
|   | ||||
| @@ -389,7 +389,7 @@ | ||||
|                 url: '{{ url("modals/taxes/create") }}', | ||||
|                 type: 'GET', | ||||
|                 dataType: 'JSON', | ||||
|                 data: {name: tax_name}, | ||||
|                 data: {name: tax_name, tax_selector: '.tax-select2'}, | ||||
|                 success: function(json) { | ||||
|                     if (json['success']) { | ||||
|                         $('body').append(json['html']); | ||||
|   | ||||
| @@ -387,7 +387,7 @@ | ||||
|                 url: '{{ url("modals/taxes/create") }}', | ||||
|                 type: 'GET', | ||||
|                 dataType: 'JSON', | ||||
|                 data: {name: tax_name}, | ||||
|                 data: {name: tax_name, tax_selector: '.tax-select2'}, | ||||
|                 success: function(json) { | ||||
|                     if (json['success']) { | ||||
|                         $('body').append(json['html']); | ||||
|   | ||||
| @@ -65,6 +65,12 @@ | ||||
|                 $("#tax_id").append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>'); | ||||
|                 $('#tax_id').trigger('change'); | ||||
|                 $("#tax_id").select2('refresh'); | ||||
|  | ||||
|                 @if ($tax_selector) | ||||
|                 $("{{ $tax_selector }}").append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>'); | ||||
|                 $('{{ $tax_selector }}').trigger('change'); | ||||
|                 $("{{ $tax_selector }}").select2('refresh'); | ||||
|                 @endif | ||||
|             }, | ||||
|             error: function(error, textStatus, errorThrown) { | ||||
|                 $('#span-loading').remove(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user