Browse Source

Change partner_id options based on in_out selection

pull/33/head
Nafies Luthfi 7 years ago
parent
commit
b2cdda251d
  1. 3
      resources/lang/de/customer.php
  2. 1
      resources/lang/de/vendor.php
  3. 3
      resources/lang/en/customer.php
  4. 1
      resources/lang/en/vendor.php
  5. 3
      resources/lang/id/customer.php
  6. 1
      resources/lang/id/vendor.php
  7. 30
      resources/views/payments/edit.blade.php

3
resources/lang/de/customer.php

@ -4,12 +4,13 @@ return [
// Labels // Labels
'customer' => 'Kunde', 'customer' => 'Kunde',
'list' => 'Kundenliste', 'list' => 'Kundenliste',
'detail' => 'Kundendetails',
'search' => 'Kundensuche', 'search' => 'Kundensuche',
'select' => 'Select Customer',
'not_found' => 'Kunde nicht gefunden.', 'not_found' => 'Kunde nicht gefunden.',
'empty' => 'Kunde ist leer.', 'empty' => 'Kunde ist leer.',
'back_to_show' => 'Zurück zu Kundendetails', 'back_to_show' => 'Zurück zu Kundendetails',
'back_to_index' => 'Zurück zur Kundennliste', 'back_to_index' => 'Zurück zur Kundennliste',
'detail' => 'Kundendetails',
'contact' => 'Kundenkontakt', 'contact' => 'Kundenkontakt',
// Actions // Actions

1
resources/lang/de/vendor.php

@ -6,6 +6,7 @@ return [
'list' => 'Hersteller Liste', 'list' => 'Hersteller Liste',
'detail' => 'Vendor Detail', 'detail' => 'Vendor Detail',
'search' => 'Hersteller suchen', 'search' => 'Hersteller suchen',
'select' => 'Select Vendor',
'not_found' => 'Hersteller nicht gefunden.', 'not_found' => 'Hersteller nicht gefunden.',
'empty' => 'Hersteller Liste ist leer.', 'empty' => 'Hersteller Liste ist leer.',
'back_to_show' => 'Zurück zu Herstellerdetails', 'back_to_show' => 'Zurück zu Herstellerdetails',

3
resources/lang/en/customer.php

@ -4,12 +4,13 @@ return [
// Labels // Labels
'customer' => 'Customer', 'customer' => 'Customer',
'list' => 'Customer List', 'list' => 'Customer List',
'detail' => 'Customer Detail',
'search' => 'Search Customer', 'search' => 'Search Customer',
'select' => 'Select Customer',
'not_found' => 'Customer not found.', 'not_found' => 'Customer not found.',
'empty' => 'Customer is empty.', 'empty' => 'Customer is empty.',
'back_to_show' => 'Back to Customer Detail', 'back_to_show' => 'Back to Customer Detail',
'back_to_index' => 'Back to Customer List', 'back_to_index' => 'Back to Customer List',
'detail' => 'Customer Detail',
'contact' => 'Customer Contact', 'contact' => 'Customer Contact',
// Actions // Actions

1
resources/lang/en/vendor.php

@ -6,6 +6,7 @@ return [
'list' => 'Vendor List', 'list' => 'Vendor List',
'detail' => 'Vendor Detail', 'detail' => 'Vendor Detail',
'search' => 'Search Vendor', 'search' => 'Search Vendor',
'select' => 'Select Vendor',
'not_found' => 'Vendor not found.', 'not_found' => 'Vendor not found.',
'empty' => 'Vendor list is empty.', 'empty' => 'Vendor list is empty.',
'back_to_show' => 'Back to Vendor Detail', 'back_to_show' => 'Back to Vendor Detail',

3
resources/lang/id/customer.php

@ -4,12 +4,13 @@ return [
// Labels // Labels
'customer' => 'Customer', 'customer' => 'Customer',
'list' => 'Daftar Customer', 'list' => 'Daftar Customer',
'detail' => 'Detail Customer',
'search' => 'Cari Customer', 'search' => 'Cari Customer',
'select' => 'Pilih Customer',
'not_found' => 'Customer tidak ditemukan', 'not_found' => 'Customer tidak ditemukan',
'empty' => 'Belum ada Customer', 'empty' => 'Belum ada Customer',
'back_to_show' => 'Kembali ke detail Customer', 'back_to_show' => 'Kembali ke detail Customer',
'back_to_index' => 'Kembali ke daftar Customer', 'back_to_index' => 'Kembali ke daftar Customer',
'detail' => 'Detail Customer',
'contact' => 'Kontak Customer', 'contact' => 'Kontak Customer',
// Actions // Actions

1
resources/lang/id/vendor.php

@ -6,6 +6,7 @@ return [
'list' => 'Daftar Vendor', 'list' => 'Daftar Vendor',
'detail' => 'Detail Vendor', 'detail' => 'Detail Vendor',
'search' => 'Cari Vendor', 'search' => 'Cari Vendor',
'select' => 'Pilih Vendor',
'not_found' => 'Vendor tidak ditemukan', 'not_found' => 'Vendor tidak ditemukan',
'empty' => 'Belum ada Vendor', 'empty' => 'Belum ada Vendor',
'back_to_show' => 'Kembali ke detail Vendor', 'back_to_show' => 'Kembali ke detail Vendor',

30
resources/views/payments/edit.blade.php

@ -34,11 +34,9 @@
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
@if ($payment->partner_type == 'App\Entities\Users\User') @if ($payment->partner_type == 'App\Entities\Users\User')
{!! FormField::select('partner_id', $partners, ['label'=> __('payment.customer')]) !!}
{{ Form::hidden('partner_type', 'users') }} {{ Form::hidden('partner_type', 'users') }}
@else
{!! FormField::select('partner_id', $partners, ['label'=> __('payment.customer')]) !!}
@endif @endif
{!! FormField::select('partner_id', $partners, ['label'=> __('payment.customer')]) !!}
</div> </div>
</div> </div>
{!! FormField::textarea('description', ['label'=> __('payment.description')]) !!} {!! FormField::textarea('description', ['label'=> __('payment.description')]) !!}
@ -72,6 +70,32 @@
closeOnDateSelect: true, closeOnDateSelect: true,
scrollInput: false scrollInput: false
}); });
$('#in_out_0').click(function() {
$.post("{{ route('api.vendors.index') }}", {},
function(data) {
var string = '<option value="">-- {{ __('vendor.select') }} --</option>';
string = string + `<optgroup label="Vendor">`;
$.each(data, function(index, value) {
string = string + `<option value="` + index + `">` + value + `</option>`;
});
string = string + `</optgroup>`;
$("#partner_id").html(string);
}
);
});
$('#in_out_1').click(function() {
$.post("{{ route('api.customers.index') }}", {},
function(data) {
var string = '<option value="">-- {{ __('customer.select') }} --</option>';
string = string + `<optgroup label="Customer">`;
$.each(data, function(index, value) {
string = string + `<option value="` + index + `">` + value + `</option>`;
});
string = string + `</optgroup>`;
$("#partner_id").html(string);
}
);
});
})(); })();
</script> </script>
@endsection @endsection
Loading…
Cancel
Save