|
@@ -51,10 +51,10 @@
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0 overflow-hidden text-nowrap">{{ $formB['FormVars']['Title']['AutoSlipNo'] }}</label>
|
|
<label class="m-0 overflow-hidden text-nowrap">{{ $formB['FormVars']['Title']['AutoSlipNo'] }}</label>
|
|
<div class="col-12 d-flex p-0">
|
|
<div class="col-12 d-flex p-0">
|
|
- <button id="auto-slip-no-btn" class="btn-dark border-white rounded overflow-hidden col-3 text-center text-white text-nowrap radius-r0"
|
|
|
|
- onclick="get_last_slip_no(this)">
|
|
|
|
- <span class="icon-cogs"></span>
|
|
|
|
- </button>
|
|
|
|
|
|
+ {{-- <button id="auto-slip-no-btn" class="btn-dark border-white rounded overflow-hidden col-3 text-center text-white text-nowrap radius-r0"--}}
|
|
|
|
+ {{-- onclick="get_last_slip_no(this)">--}}
|
|
|
|
+ {{-- <span class="icon-cogs"></span>--}}
|
|
|
|
+ {{-- </button> --}}
|
|
<input type="text" id="auto-slip-no-txt" class="rounded w-100 radius-l0" autocomplete="off" disabled
|
|
<input type="text" id="auto-slip-no-txt" class="rounded w-100 radius-l0" autocomplete="off" disabled
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['AutoSlipNo'] }}"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['AutoSlipNo'] }}"
|
|
{{ $formB['FormVars']['Required']['AutoSlipNo'] }}>
|
|
{{ $formB['FormVars']['Required']['AutoSlipNo'] }}>
|
|
@@ -73,16 +73,20 @@
|
|
{{ $formB['FormVars']['Required']['StockDate'] }}>
|
|
{{ $formB['FormVars']['Required']['StockDate'] }}>
|
|
</div>
|
|
</div>
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
- <label class="m-0">{{ $formB['FormVars']['Title']['SorderNo'] }}</label>
|
|
|
|
- <input class="rounded w-100" type="text" id="sorder-no-txt" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['SorderNo'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['SorderNo'] }}>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group d-flex flex-column">
|
|
|
|
- <label class="m-0">{{ $formB['FormVars']['Title']['Status'] }}</label>
|
|
|
|
- <input type="text" id="status-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['Status'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['Status'] }}>
|
|
|
|
|
|
+ <label class="m-0 ">{{ $formB['FormVars']['Title']['Supplier'] }}</label>
|
|
|
|
+ <div class="d-flex">
|
|
|
|
+ <input type="text" id="supplier-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off"
|
|
|
|
+ onkeydown="company_model_show_cell_enter_key(event, 'BB')"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['Supplier'] }}"
|
|
|
|
+ {{ $formB['FormVars']['Required']['Supplier'] }}>
|
|
|
|
+ <button type="button"
|
|
|
|
+ class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 window company-modal-btn"
|
|
|
|
+ data-target="company"
|
|
|
|
+ data-clicked="get_override_supplier_id"
|
|
|
|
+ data-variable="companyModal">
|
|
|
|
+ <i class="icon-folder-open"></i>
|
|
|
|
+ </button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -93,41 +97,37 @@
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="card-body">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
- <label class="m-0">{{ $formB['FormVars']['Title']['DealType'] }}</label>
|
|
|
|
- <input type="text" id="deal-type-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['DealType'] }}"
|
|
|
|
|
|
+ <label class="m-0 ">{{ $formB['FormVars']['Title']['DealType'] }}</label>
|
|
|
|
+ <select class="rounded w-100" id="deal-type-select"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['DealType'] }}"
|
|
{{ $formB['FormVars']['Required']['DealType'] }}>
|
|
{{ $formB['FormVars']['Required']['DealType'] }}>
|
|
- {{-- <select class="rounded w-100" id="deal-type-select" disabled>
|
|
|
|
- <option value=""></option>
|
|
|
|
- </select> --}}
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group d-flex flex-column mb-2">
|
|
|
|
- <label class="m-0 ">{{ $formB['FormVars']['Title']['Supplier'] }}</label>
|
|
|
|
- <input type="text" id="supplier-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['Supplier'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['Supplier'] }}>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group d-flex flex-column mb-2">
|
|
|
|
- <label class="m-0">{{ $formB['FormVars']['Title']['Contact'] }}</label>
|
|
|
|
- <input class="rounded w-100" id="supplier-contact-txt" type="text" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['Contact'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['Contact'] }}>
|
|
|
|
|
|
+ </select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['VatType'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['VatType'] }}</label>
|
|
- <input type="text" id="vat-type-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['VatType'] }}"
|
|
|
|
|
|
+ <select class="rounded w-100" id="vat-type-select" onchange="set_vat_type_rate(this)"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['VatType'] }}"
|
|
{{ $formB['FormVars']['Required']['VatType'] }}>
|
|
{{ $formB['FormVars']['Required']['VatType'] }}>
|
|
- <select class="rounded w-100" id="vat-type-select" onchange="set_vat_type_rate(this)" hidden disabled>
|
|
|
|
- <option value=""></option>
|
|
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
- <div class="form-group d-flex flex-column">
|
|
|
|
|
|
+ <div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['VatTypeRate'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['VatTypeRate'] }}</label>
|
|
<input type="text" id="vat-type-rate-text" class="rounded w-100" autocomplete="off" value="" disabled
|
|
<input type="text" id="vat-type-rate-text" class="rounded w-100" autocomplete="off" value="" disabled
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['VatTypeRate'] }}"
|
|
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['VatTypeRate'] }}"
|
|
{{ $formB['FormVars']['Required']['VatTypeRate'] }}>
|
|
{{ $formB['FormVars']['Required']['VatTypeRate'] }}>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="form-group d-flex flex-column mb-2">
|
|
|
|
+ <label class="m-0">{{ $formB['FormVars']['Title']['Status'] }}</label>
|
|
|
|
+ <select class="rounded w-100" data-closed="0" id="status-select" onchange="Btype.set_is_closed_val(this)"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['Status'] }}"
|
|
|
|
+ {{ $formB['FormVars']['Required']['Status'] }}>
|
|
|
|
+ @foreach ($codeTitle['status']['sales'] as $key => $status)
|
|
|
|
+ <option value="{{ $status['Code'] }}">
|
|
|
|
+ {{ $status['Title'] }}
|
|
|
|
+ </option>
|
|
|
|
+ @endforeach
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -140,49 +140,40 @@
|
|
|
|
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Delivery'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Delivery'] }}</label>
|
|
- <input type="text" id="delivery-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['Delivery'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['Delivery'] }}>
|
|
|
|
- {{-- <select class="rounded w-100" id="delivery-select" disabled>
|
|
|
|
- <option value=""></option>
|
|
|
|
- </select> --}}
|
|
|
|
|
|
+ <select class="rounded w-100" id="delivery-select"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['Delivery'] }}"
|
|
|
|
+ {{ $formB['FormVars']['Required']['Delivery'] }}></select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['PayTerms'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['PayTerms'] }}</label>
|
|
- <input type="text" id="payTerms-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['PayTerms'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['PayTerms'] }}>
|
|
|
|
- {{-- <select class="rounded w-100" id="payTerms-select" disabled>
|
|
|
|
- <option value=""></option>
|
|
|
|
- </select> --}}
|
|
|
|
|
|
+ <select class="rounded w-100" id="payTerms-select"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['PayTerms'] }}"
|
|
|
|
+ {{ $formB['FormVars']['Required']['PayTerms'] }}></select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Destination'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Destination'] }}</label>
|
|
- <input type="text" id="destination-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['Destination'] }}"
|
|
|
|
- {{ $formB['FormVars']['Required']['Destination'] }}>
|
|
|
|
- {{-- <select class="rounded w-100" id="destination-select" disabled>
|
|
|
|
- <option value=""></option>
|
|
|
|
- </select> --}}
|
|
|
|
|
|
+ <select class="rounded w-100" id="destination-select"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['Destination'] }}"
|
|
|
|
+ {{ $formB['FormVars']['Required']['Destination'] }}></select>
|
|
</div>
|
|
</div>
|
|
- <div class="form-group d-flex flex-column mb-2">
|
|
|
|
|
|
+ {{--<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Column1'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Column1'] }}</label>
|
|
<input type="text" id="column1-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
<input type="text" id="column1-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['Column1'] }}"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['Column1'] }}"
|
|
{{ $formB['FormVars']['Required']['Column1'] }}>
|
|
{{ $formB['FormVars']['Required']['Column1'] }}>
|
|
- {{-- <select class="rounded w-100" id="column1-select" disabled>
|
|
|
|
|
|
+ <select class="rounded w-100" id="column1-select" disabled>
|
|
<option value=""></option>
|
|
<option value=""></option>
|
|
- </select> --}}
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group d-flex flex-column">
|
|
|
|
|
|
+ </select>
|
|
|
|
+ </div>--}}
|
|
|
|
+ {{--<div class="form-group d-flex flex-column">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Column2'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['Column2'] }}</label>
|
|
<input type="text" id="column2-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
<input type="text" id="column2-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['Column2'] }}"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['Column2'] }}"
|
|
{{ $formB['FormVars']['Required']['Column2'] }}>
|
|
{{ $formB['FormVars']['Required']['Column2'] }}>
|
|
- {{-- <select class="rounded w-100" id="column2-select" disabled>
|
|
|
|
|
|
+ <select class="rounded w-100" id="column2-select" disabled>
|
|
<option value=""></option>
|
|
<option value=""></option>
|
|
- </select> --}}
|
|
|
|
- </div>
|
|
|
|
|
|
+ </select>
|
|
|
|
+ </div>--}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -199,7 +190,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="form-group d-flex flex-column">
|
|
<div class="form-group d-flex flex-column">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['IsClosed'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['IsClosed'] }}</label>
|
|
- <input class="rounded" type="checkbox" id="is-closed-check" value="1" disabled
|
|
|
|
|
|
+ <input class="rounded" type="checkbox" id="is-closed-check" value="1"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['IsClosed'] }}"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['IsClosed'] }}"
|
|
{{ $formB['FormVars']['Required']['IsClosed'] }}>
|
|
{{ $formB['FormVars']['Required']['IsClosed'] }}>
|
|
</div>
|
|
</div>
|
|
@@ -213,12 +204,11 @@
|
|
<div class="card-body">
|
|
<div class="card-body">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['SgroupName'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['SgroupName'] }}</label>
|
|
- <input type="text" id="sgroup-name-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off" disabled
|
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['SgroupName'] }}"
|
|
|
|
|
|
+ {{ $formB['FormVars']['Required']['SgroupName'] }}
|
|
|
|
+ <select class="rounded w-100" data-closed="0" id="sgroup-id-select"
|
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['SgroupName'] }}"
|
|
{{ $formB['FormVars']['Required']['SgroupName'] }}>
|
|
{{ $formB['FormVars']['Required']['SgroupName'] }}>
|
|
- {{-- <select class="rounded w-100" data-closed="0" id="sgroup-id-select" disabled>
|
|
|
|
- <option value=""></option>
|
|
|
|
- </select> --}}
|
|
|
|
|
|
+ </select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['UserName'] }}</label>
|
|
<label class="m-0">{{ $formB['FormVars']['Title']['UserName'] }}</label>
|
|
@@ -371,24 +361,61 @@
|
|
<script>
|
|
<script>
|
|
window.onload = async function () {
|
|
window.onload = async function () {
|
|
make_dynamic_table_css('.sales-table', make_dynamic_table_px(formB['ListVars']['Size']))
|
|
make_dynamic_table_css('.sales-table', make_dynamic_table_px(formB['ListVars']['Size']))
|
|
|
|
+
|
|
|
|
+ var test = Btype.get_storage_name_and_branch_name()
|
|
|
|
+ console.log();
|
|
|
|
+ // let sgroup_pick = await get_api_data('sgroup-pick', { Page: [ { Id: parseInt(window.User['SgroupId']) } ] });
|
|
|
|
+ // window.User['SgroupName'] = sgroup_pick['data']['Page'][0]['SgroupName'];
|
|
|
|
+ // console.log('sgroup_pick : ', sgroup_pick);
|
|
|
|
+
|
|
|
|
+ slipInit = await Btype.get_slip_form_init()
|
|
|
|
+ // slipInit = @json($slipFormInitCacheData);
|
|
|
|
+ formB['SlipCommonSetup'] = slipInit['SlipCommonSetup']
|
|
|
|
+ await Btype.create_deal_type_select_box_options(slipInit.DealTypePage)
|
|
|
|
+ await Btype.create_vat_type_select_box_options(slipInit.VatRatePage)
|
|
|
|
+ await Btype.create_sgroup_select_box_options(slipInit.SgroupPage)
|
|
|
|
+ await create_etc_select_box_options(slipInit)
|
|
|
|
+ $('#user-txt').val(window.User['NickName'])
|
|
|
|
+
|
|
|
|
+ if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
|
|
|
|
+ $('.is-new-rec-auto-slip-no').text('자동채번')
|
|
|
|
+ $('#auto-slip-no-txt').prop('disabled', true)
|
|
|
|
+ // get_last_slip_no()
|
|
|
|
+ }
|
|
|
|
+
|
|
// slip-search cache 사용
|
|
// slip-search cache 사용
|
|
|
|
+ if (formB['SlipCommonSetup']['IsLastSlipGet']) {
|
|
|
|
+ console.log('여기 체크');
|
|
|
|
+ // slip-search cache 사용
|
|
|
|
+ Btype.set_slip_cache_data();
|
|
|
|
+
|
|
|
|
+ if (! isEmpty(pickCacheData['query'])) {
|
|
|
|
+ let query = JSON.parse(pickCacheData['query'])
|
|
|
|
+ await Btype.fetch_slip_form_book(query['QueryVars']['FilterValue']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// Btype.set_slip_cache_data();
|
|
// Btype.set_slip_cache_data();
|
|
|
|
|
|
|
|
+
|
|
|
|
+ $('#sales-table-body').on('click', 'tr', function() {
|
|
|
|
+ // Find the input element with name="bd-cursor-state" within the clicked row
|
|
|
|
+ const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
|
|
|
|
+ if ($bdCursorStateInput.length) {
|
|
|
|
+ $($bdCursorStateInput).prop('checked', true)
|
|
|
|
+ Btype.bd_cursor_click($bdCursorStateInput)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
Btype.set_slip_no_btn_disabled()
|
|
Btype.set_slip_no_btn_disabled()
|
|
$('#sales-date').val(date_to_sting(new Date()))
|
|
$('#sales-date').val(date_to_sting(new Date()))
|
|
$('#stock-date').val(date_to_sting(new Date()))
|
|
$('#stock-date').val(date_to_sting(new Date()))
|
|
|
|
|
|
- // if (! isEmpty(pickCacheData['query'])) {
|
|
|
|
- // let query = JSON.parse(pickCacheData['query'])
|
|
|
|
- // await Btype.fetch_slip_form_book(query['QueryVars']['FilterValue']);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
$('.sales-act').on('click', function () {
|
|
$('.sales-act').on('click', function () {
|
|
// console.log($(this).data('value'))
|
|
// console.log($(this).data('value'))
|
|
switch( $(this).data('value') ) {
|
|
switch( $(this).data('value') ) {
|
|
case 'save': Btype.btn_act_save('#sales-form #frm'); break;
|
|
case 'save': Btype.btn_act_save('#sales-form #frm'); break;
|
|
- // case 'new': btn_act_new(); break;
|
|
|
|
- // case 'save-and-new': Btype.btn_act_save_and_new(); break;
|
|
|
|
|
|
+ case 'new': btn_act_new(); break;
|
|
|
|
+ case 'save-and-new': Btype.btn_act_save_and_new(); break;
|
|
case 'copy-to-another': btn_act_copy_to_another(str_replace_hyphen($(this).data('parameter'), '/')); break;
|
|
case 'copy-to-another': btn_act_copy_to_another(str_replace_hyphen($(this).data('parameter'), '/')); break;
|
|
case 'delete': Btype.btn_act_del('#sales-form #frm'); break;
|
|
case 'delete': Btype.btn_act_del('#sales-form #frm'); break;
|
|
case 'rpt-print': Btype.rpt_print(); break;
|
|
case 'rpt-print': Btype.rpt_print(); break;
|
|
@@ -445,6 +472,17 @@
|
|
$('#up-btn').prop('disabled', false);
|
|
$('#up-btn').prop('disabled', false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ function save_data_when_entering_text() {
|
|
|
|
+ let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
|
|
|
|
+ let index = $(tr).prevAll().length
|
|
|
|
+
|
|
|
|
+ bd_page[index].ConfirmDate = $(tr).children('td:eq(12)').find('input').val()
|
|
|
|
+ bd_page[index].DeliDate = $(tr).children('td:eq(13)').find('input').val()
|
|
|
|
+ bd_page[index].Ref1 = $(tr).children('td:eq(14)').find('input').val()
|
|
|
|
+ bd_page[index].Ref2 = $(tr).children('td:eq(15)').find('input').val()
|
|
|
|
+ }
|
|
|
|
+
|
|
// start body act btn
|
|
// start body act btn
|
|
function override_btn_bd_act_multi_update() {
|
|
function override_btn_bd_act_multi_update() {
|
|
Btype.btn_bd_act_multi_update('.sales-table')
|
|
Btype.btn_bd_act_multi_update('.sales-table')
|
|
@@ -456,6 +494,7 @@
|
|
|
|
|
|
|
|
|
|
async function btn_bd_act_add() {
|
|
async function btn_bd_act_add() {
|
|
|
|
+ console.log('btn_bd_act_add');
|
|
if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
|
|
if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
|
|
iziToast.error({
|
|
iziToast.error({
|
|
title: 'Error',
|
|
title: 'Error',
|
|
@@ -489,60 +528,12 @@
|
|
}
|
|
}
|
|
|
|
|
|
function btn_act_new() {
|
|
function btn_act_new() {
|
|
- bd_page = [];
|
|
|
|
- $(`#frm`).find(`input[name="Id"]`).val(0)
|
|
|
|
- $('.save-button').prop('disabled', false)
|
|
|
|
|
|
+ console.log('btn_act_new');
|
|
|
|
+ data_init()
|
|
|
|
|
|
- $('#auto-slip-no-txt').val('')
|
|
|
|
- // Btype.set_slip_no_btn_abled()
|
|
|
|
- $('#sales-date').val(date_to_sting(new Date()))
|
|
|
|
- $('#stock-date').val(date_to_sting(new Date()))
|
|
|
|
- $('#sorder-no-txt').val('')
|
|
|
|
- $('#sorder-no-txt').data('id', 0)
|
|
|
|
- $('#status-txt').val('')
|
|
|
|
-
|
|
|
|
- // select_box_first_selected('#deal-type-select')
|
|
|
|
- $('#deal-type-txt').val('')
|
|
|
|
- $('#supplier-txt').val('')
|
|
|
|
- $('#supplier-txt').data('id', 0)
|
|
|
|
- $('#supplier-txt').data('contact', '')
|
|
|
|
- $('#supplier-contact-txt').val('')
|
|
|
|
- $('#vat-type-txt').val('')
|
|
|
|
- $('#vat-type-select').html(`<option value=""></option>`);
|
|
|
|
- $('#vat-type-rate-text').val('')
|
|
|
|
-
|
|
|
|
- $('#delivery-txt').val('')
|
|
|
|
- $('#payTerms-txt').val('')
|
|
|
|
- $('#destination-txt').val('')
|
|
|
|
- $('#column1-txt').val('')
|
|
|
|
- $('#column2-txt').val('')
|
|
|
|
- // select_box_first_selected('#delivery-select')
|
|
|
|
- // select_box_first_selected('#payTerms-select')
|
|
|
|
- // select_box_first_selected('#destination-select')
|
|
|
|
- // select_box_first_selected('#column1-select')
|
|
|
|
- // select_box_first_selected('#column2-select')
|
|
|
|
-
|
|
|
|
- $('#remarks-txt-area').val('')
|
|
|
|
- $('#remarks-preview').html('')
|
|
|
|
- $('#is-closed-check').prop('checked', false)
|
|
|
|
-
|
|
|
|
- $('#sgroup-name-txt').val('')
|
|
|
|
- // select_box_first_selected('#sgroup-name-select')
|
|
|
|
- $('#user-txt').val('')
|
|
|
|
- // select_box_first_selected('#our-contact-select')
|
|
|
|
-
|
|
|
|
- $('#StorageName').val('')
|
|
|
|
- $('#BranchName').val('')
|
|
|
|
-
|
|
|
|
- // table body 초기화
|
|
|
|
- table_head_check_box_reset('#sales-table-head')
|
|
|
|
- $('#sales-table-body').html('');
|
|
|
|
-
|
|
|
|
- // footer 합계 초기화
|
|
|
|
- $('#QtyTotal').val('')
|
|
|
|
- $('#SupplyTotal').val('')
|
|
|
|
- $('#VatTotal').val('')
|
|
|
|
- $('#SumTotal').val('')
|
|
|
|
|
|
+ // if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
|
|
|
|
+ get_last_slip_no()
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
function btn_act_copy_to_another(parameter_name) {
|
|
function btn_act_copy_to_another(parameter_name) {
|
|
@@ -556,7 +547,60 @@
|
|
$('.revenue').find('.modal-btn').trigger('click')
|
|
$('.revenue').find('.modal-btn').trigger('click')
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function bd_update_due_to_vat_rate_change() {
|
|
|
|
+ let data = [];
|
|
|
|
+
|
|
|
|
+ bd_page = bd_page.filter(function (bd) {
|
|
|
|
+ return bd.Id != 0;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ bd_page.forEach(bd => {
|
|
|
|
+ let supply_amt, vat_amt, sum_amt;
|
|
|
|
+ [supply_amt, vat_amt, sum_amt] = Btype.amt_calc({ pquote_prc: parseFloat(bd.SquotePrc), pquote_qty: parseFloat(bd.SquoteQty) },
|
|
|
|
+ parseFloat($('#vat-type-select').find('option:selected').data('vatrate')));
|
|
|
|
+ bd.SquoteSupply = supply_amt;
|
|
|
|
+ bd.SquoteVat = vat_amt;
|
|
|
|
+ bd.SquoteSum = sum_amt;
|
|
|
|
+
|
|
|
|
+ data.push({
|
|
|
|
+ Id: parseInt(bd.Id),
|
|
|
|
+ SquoteSupply: String(bd.SquoteSupply),
|
|
|
|
+ SquoteVat: String(bd.SquoteVat),
|
|
|
|
+ SquoteSum: String(bd.SquoteSum),
|
|
|
|
+ Ip: window.User['Ip']
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
function get_parameter() {
|
|
function get_parameter() {
|
|
|
|
+ const deal_name = slipInit['DealTypePage'].filter(page => page['Id'] === Number($('#deal-type-select').val()))[0]['DealName']
|
|
|
|
+ const vat_rate = $('#vat-type-select').find('option:selected').data('vatrate')
|
|
|
|
+ const vat_name = slipInit['VatRatePage'].filter(page => page['Id'] === Number($('#vat-type-select').val()))[0]['VatName']
|
|
|
|
+
|
|
|
|
+ let first_item = ''
|
|
|
|
+ let first_thumb = ''
|
|
|
|
+ if (bd_page.length > 0) {
|
|
|
|
+ const first_sales = bd_page[0]
|
|
|
|
+ first_item = first_sales['ItemCode'] + '_' + first_sales['ItemName']
|
|
|
|
+ if (first_sales['SubName']) {
|
|
|
|
+ first_item += '_' + first_sales['SubName']
|
|
|
|
+ }
|
|
|
|
+ first_item += '(' + bd_page.length + ')'
|
|
|
|
+
|
|
|
|
+ if(first_sales['TurboThumb']){
|
|
|
|
+ first_thumb = first_sales['TurboThumb']
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // console.log('first_sales : ', bd_page[0]);
|
|
|
|
+ const itmtot_amt = bd_page.reduce((accumulator, bd) => {
|
|
|
|
+ // return accumulator + parseFloat(bd.SalesSupply) + parseFloat(bd.SalesVat) // 합계금액 (공급가액 + 세액)
|
|
|
|
+ return accumulator + parseFloat(bd.SalesSupply)
|
|
|
|
+ }, 0)
|
|
|
|
+
|
|
|
|
+ // const total_qty = bd_page.reduce((accumulator, bd) => {
|
|
|
|
+ // return accumulator + parseFloat(bd.PorderQty)
|
|
|
|
+ // }, 0)
|
|
let id = parseInt($(`#frm`).find(`input[name="Id"]`).val());
|
|
let id = parseInt($(`#frm`).find(`input[name="Id"]`).val());
|
|
let parameter = {
|
|
let parameter = {
|
|
Id: id,
|
|
Id: id,
|
|
@@ -566,9 +610,32 @@
|
|
SalesNo: $('#auto-slip-no-txt').val(),
|
|
SalesNo: $('#auto-slip-no-txt').val(),
|
|
SalesDate: moment(new Date($('#sales-date').val())).format('YYYYMMDD'),
|
|
SalesDate: moment(new Date($('#sales-date').val())).format('YYYYMMDD'),
|
|
StockDate: moment(new Date($('#stock-date').val())).format('YYYYMMDD'),
|
|
StockDate: moment(new Date($('#stock-date').val())).format('YYYYMMDD'),
|
|
|
|
+ DealTypeId: parseInt($('#deal-type-select').val()),
|
|
|
|
+ SgroupId: parseInt($('#sgroup-id-select').val()),
|
|
|
|
+ BranchId: window.User['BranchId'],
|
|
|
|
+ StorageId: window.User['StorageId'],
|
|
|
|
+ BuyerId: parseInt($('#supplier-txt').data('id')),
|
|
|
|
+ VatRateId: parseInt($('#vat-type-select').val()),
|
|
|
|
+ BuyerContact: $('#supplier-txt').data('contact'),
|
|
|
|
+ PayTerms: $('#payTerms-select').val(),
|
|
|
|
+ Destination: $('#destination-select').val(),
|
|
|
|
+ Delivery: $('#delivery-select').val(),
|
|
|
|
+ Status: $('#status-select').val(),
|
|
|
|
+ IsClosed: $('#is-closed-check:checked').val() ?? '0',
|
|
UserId: window.User['UserId'],
|
|
UserId: window.User['UserId'],
|
|
Remarks: $('#remarks-txt-area').val(),
|
|
Remarks: $('#remarks-txt-area').val(),
|
|
- Ip: window.User['Ip']
|
|
|
|
|
|
+ Ip: window.User['Ip'],
|
|
|
|
+
|
|
|
|
+ FirstItem: first_item,
|
|
|
|
+ ItmtotAmt: String(itmtot_amt),
|
|
|
|
+ // DiscountAmt: '0',
|
|
|
|
+ TotalAmt: String(Number(itmtot_amt) - 0),
|
|
|
|
+ DealName: deal_name,
|
|
|
|
+ VatRate: vat_rate,
|
|
|
|
+ VatName: vat_name,
|
|
|
|
+ SgroupName: window.User['SgroupName'],
|
|
|
|
+ //TotalQty : String(Number(total_qty) - 0),
|
|
|
|
+ FirstThumb : first_thumb
|
|
}
|
|
}
|
|
if (id < 0) {
|
|
if (id < 0) {
|
|
parameter = { Id: id }
|
|
parameter = { Id: id }
|
|
@@ -578,9 +645,55 @@
|
|
delete parameter.UpdatedOn;
|
|
delete parameter.UpdatedOn;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ console.log('save : ', parameter);
|
|
|
|
+
|
|
return parameter;
|
|
return parameter;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function data_init() {
|
|
|
|
+ bd_page = [];
|
|
|
|
+ $(`#frm`).find(`input[name="Id"]`).val(0)
|
|
|
|
+ $('.save-button').prop('disabled', false)
|
|
|
|
+
|
|
|
|
+ $('#auto-slip-no-txt').val('')
|
|
|
|
+ Btype.set_slip_no_btn_abled()
|
|
|
|
+ $('#sales-date').val(date_to_sting(new Date()))
|
|
|
|
+ $('#supplier-txt').val('')
|
|
|
|
+ $('#supplier-txt').data('id', 0)
|
|
|
|
+ $('#supplier-txt').data('contact', '')
|
|
|
|
+ $('#supplier-contact-txt').val('')
|
|
|
|
+
|
|
|
|
+ select_box_first_selected('#deal-type-select')
|
|
|
|
+ select_box_first_selected('#vat-type-select')
|
|
|
|
+ $('#vat-type-select').trigger('change');
|
|
|
|
+ select_box_first_selected('#status-select')
|
|
|
|
+ $('#status-select').data('closed', 0)
|
|
|
|
+
|
|
|
|
+ select_box_first_selected('#sgroup-id-select')
|
|
|
|
+ select_box_first_selected('#delivery-select')
|
|
|
|
+ select_box_first_selected('#payTerms-select')
|
|
|
|
+ select_box_first_selected('#destination-select')
|
|
|
|
+ $('#ref-no-txt').val('')
|
|
|
|
+
|
|
|
|
+ $('#remarks-txt-area').val('')
|
|
|
|
+ $('#remarks-preview').html('')
|
|
|
|
+ $('#sorder-no-txt').val('')
|
|
|
|
+ $('#is-closed-check').prop('checked', false)
|
|
|
|
+ // select_box_first_selected('#is-closed-select')
|
|
|
|
+
|
|
|
|
+ select_box_first_selected('#our-contact-select')
|
|
|
|
+
|
|
|
|
+ // table body 초기화
|
|
|
|
+ table_head_check_box_reset('#sales-table-head')
|
|
|
|
+ $('#sales-table-body').html('');
|
|
|
|
+
|
|
|
|
+ // footer 합계 초기화
|
|
|
|
+ $('#QtyTotal').val('')
|
|
|
|
+ $('#SupplyTotal').val('')
|
|
|
|
+ $('#VatTotal').val('')
|
|
|
|
+ $('#SumTotal').val('')
|
|
|
|
+ }
|
|
|
|
+
|
|
async function get_last_slip_no($this) {
|
|
async function get_last_slip_no($this) {
|
|
Btype.set_slip_no_btn_disabled()
|
|
Btype.set_slip_no_btn_disabled()
|
|
let response = await Btype.get_last_slip_no(formB['QueryVars']['QueryName']);
|
|
let response = await Btype.get_last_slip_no(formB['QueryVars']['QueryName']);
|
|
@@ -592,11 +705,45 @@
|
|
$('#supplier-contact-txt').val($('#supplier-txt').data('contact'))
|
|
$('#supplier-contact-txt').val($('#supplier-txt').data('contact'))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ async function create_etc_select_box_options(data) {
|
|
|
|
+ // let delivery = create_options(await get_select_box_options_data('etc-page', 'select_name="납품기한"'))
|
|
|
|
+ // let payTerms = create_options(await get_select_box_options_data('etc-page', 'select_name="지불조건"'))
|
|
|
|
+ // let destination = create_options(await get_select_box_options_data('etc-page', 'select_name="납품장소"'))
|
|
|
|
+ // let our_contact = create_options(await get_select_box_options_data('etc-page', 'select_name="발주담당자"'))
|
|
|
|
+
|
|
|
|
+ let delivery = create_options(data.EtcDeliveryPage)
|
|
|
|
+ let payTerms = create_options(data.EtcPayTermPage)
|
|
|
|
+ let destination = create_options(data.EtcDestinationPage)
|
|
|
|
+ let our_contact = create_options(data.EtcOurContactPage)
|
|
|
|
+
|
|
|
|
+ $('#delivery-select').html(delivery);
|
|
|
|
+ $('#payTerms-select').html(payTerms);
|
|
|
|
+ $('#destination-select').html(destination);
|
|
|
|
+ $('#our-contact-select').html(our_contact);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // function set_vat_type_rate($this, msg = true) {
|
|
|
|
+ // let vate_rate = $($this).find('option:selected').data('viewvatrate');
|
|
|
|
+ // console.log('vate_rate : ', vate_rate);
|
|
|
|
+ // $('#vat-type-rate-text').val(vate_rate + '%')
|
|
|
|
+
|
|
|
|
+ // if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 || ! msg) return;
|
|
|
|
+ // }
|
|
|
|
+
|
|
function set_vat_type_rate($this, msg = true) {
|
|
function set_vat_type_rate($this, msg = true) {
|
|
let vate_rate = $($this).find('option:selected').data('viewvatrate');
|
|
let vate_rate = $($this).find('option:selected').data('viewvatrate');
|
|
$('#vat-type-rate-text').val(vate_rate + '%')
|
|
$('#vat-type-rate-text').val(vate_rate + '%')
|
|
|
|
|
|
if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 || ! msg) return;
|
|
if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 || ! msg) return;
|
|
|
|
+ Btype.call_act_api(get_parameter(), function() { });
|
|
|
|
+
|
|
|
|
+ if (isEmpty(bd_page)) return;
|
|
|
|
+
|
|
|
|
+ let data = bd_update_due_to_vat_rate_change();
|
|
|
|
+ Btype.call_bd_act_api(data, function() {
|
|
|
|
+ create_bd_page();
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
function get_bd_parameter(bd) {
|
|
function get_bd_parameter(bd) {
|
|
@@ -613,7 +760,8 @@
|
|
SalesVat: String(bd.SalesVat),
|
|
SalesVat: String(bd.SalesVat),
|
|
SalesSum: String(bd.SalesSum),
|
|
SalesSum: String(bd.SalesSum),
|
|
CostPrc: String(bd.CostPrc),
|
|
CostPrc: String(bd.CostPrc),
|
|
- Ip: window.User['Ip']
|
|
|
|
|
|
+ Ip: window.User['Ip'],
|
|
|
|
+ FirstThumb: bd.TurboThumb
|
|
}
|
|
}
|
|
|
|
|
|
if (id < 0) {
|
|
if (id < 0) {
|
|
@@ -644,36 +792,37 @@
|
|
}
|
|
}
|
|
|
|
|
|
async function add_td_last_tap_out($this, id) {
|
|
async function add_td_last_tap_out($this, id) {
|
|
- let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
|
|
|
|
- let index = $(tr).prevAll().length
|
|
|
|
-
|
|
|
|
- if (bd_page[index].SorderBdId == 0) {
|
|
|
|
- iziToast.error({
|
|
|
|
- title: 'Error',
|
|
|
|
- message: @json(_e('Action failed')),
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
|
|
|
|
- if (! dom_required_check($(tr).find(`input`))) {
|
|
|
|
- if ($($this).data('last')) {
|
|
|
|
- let seq_no = await Btype.get_last_seq_no('sales', $('#auto-slip-no-txt').val())
|
|
|
|
- bd_page[index].SeqNo = seq_no;
|
|
|
|
|
|
+ Btype.btn_act_save('#sales-form #frm', async function () {
|
|
|
|
+ let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
|
|
|
|
+ let index = $(tr).prevAll().length
|
|
|
|
+
|
|
|
|
+ if (bd_page[index].SorderBdId == 0) {
|
|
|
|
+ iziToast.error({
|
|
|
|
+ title: 'Error',
|
|
|
|
+ message: @json(_e('Action failed')),
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
|
|
|
|
+ if (! dom_required_check($(tr).find(`input`))) {
|
|
|
|
+ if ($($this).data('last')) {
|
|
|
|
+ let seq_no = await Btype.get_last_seq_no('sales', $('#auto-slip-no-txt').val())
|
|
|
|
+ bd_page[index].SeqNo = seq_no;
|
|
|
|
+ }
|
|
|
|
+ Btype.call_bd_act_api([ get_bd_parameter(bd_page[index]) ], function (page) {
|
|
|
|
+ bd_page[index].Id = page[0].Id;
|
|
|
|
+
|
|
|
|
+ body_act_success_callback($this, tr);
|
|
|
|
+ Btype.check_the_checkbox_when_changing($this, false)
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ iziToast.error({
|
|
|
|
+ title: 'Error',
|
|
|
|
+ message: @json(_e('(*)Required item(s) omitted')),
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-
|
|
|
|
- Btype.call_bd_act_api([ get_bd_parameter(bd_page[index]) ], function (page) {
|
|
|
|
- bd_page[index].Id = page[0].Id;
|
|
|
|
-
|
|
|
|
- body_act_success_callback($this, tr);
|
|
|
|
- Btype.check_the_checkbox_when_changing($this, false)
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- iziToast.error({
|
|
|
|
- title: 'Error',
|
|
|
|
- message: @json(_e('(*)Required item(s) omitted')),
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
function body_act_success_callback($this, tr) {
|
|
function body_act_success_callback($this, tr) {
|
|
@@ -741,6 +890,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
function create_bd_page() {
|
|
function create_bd_page() {
|
|
|
|
+ console.log('create_bd_page()');
|
|
let html = []
|
|
let html = []
|
|
let qty_total = 0, supply_total = 0, vat_amt_vat_total = 0, sum_total = 0;
|
|
let qty_total = 0, supply_total = 0, vat_amt_vat_total = 0, sum_total = 0;
|
|
bd_page.forEach(bd => {
|
|
bd_page.forEach(bd => {
|
|
@@ -752,7 +902,7 @@
|
|
// 품목코드, 수량, 단가, 공급가액, 세액, 합계금액
|
|
// 품목코드, 수량, 단가, 공급가액, 세액, 합계금액
|
|
html.push (
|
|
html.push (
|
|
`<tr>
|
|
`<tr>
|
|
- <td class="text-${formB.ListVars['Align'].$Radio} px-import-0">
|
|
|
|
|
|
+ <td class="text-${formB.ListVars['Align'].$Radio} px-import-0" ${formB.ListVars['Hidden'].$Radio}>
|
|
<input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
|
|
<input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
|
|
class="text-${formB.ListVars['Align'].$Radio}"
|
|
class="text-${formB.ListVars['Align'].$Radio}"
|
|
onclick="Btype.bd_cursor_click(this)">
|
|
onclick="Btype.bd_cursor_click(this)">
|
|
@@ -764,11 +914,14 @@
|
|
<td onkeydown="Btype.enterPressedinCell(event)"
|
|
<td onkeydown="Btype.enterPressedinCell(event)"
|
|
class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
|
|
class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" value="${bd.ItemCode}" disabled
|
|
|
|
- onchange="Btype.check_the_checkbox_when_changing(this)">
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" value="${bd.ItemCode}" readonly
|
|
|
|
+ onchange="Btype.check_the_checkbox_when_changing(this)" required>
|
|
</td>
|
|
</td>
|
|
- <td
|
|
|
|
- class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}>${bd.ItemName}
|
|
|
|
|
|
+ <td onkeydown="Btype.enterPressedinCell(event, 2)"
|
|
|
|
+ class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
|
|
|
|
+ >
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" value="${bd.ItemName}" readonly
|
|
|
|
+ onchange="Btype.check_the_checkbox_when_changing(this)" required>
|
|
</td>
|
|
</td>
|
|
<td
|
|
<td
|
|
class="text-${formB.ListVars['Align'].SubName}" ${formB.ListVars['Hidden'].SubName}>${bd.SubName}
|
|
class="text-${formB.ListVars['Align'].SubName}" ${formB.ListVars['Hidden'].SubName}>${bd.SubName}
|
|
@@ -779,7 +932,7 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].SalesQty}" ${formB.ListVars['Hidden'].SalesQty}
|
|
class="text-${formB.ListVars['Align'].SalesQty}" ${formB.ListVars['Hidden'].SalesQty}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SalesQty} border-0 bg-white" value="${format_conver_for(bd.SalesQty, formB.ListVars['Format'].SalesQty)}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SalesQty} border-0 bg-white" value="${format_conver_for(bd.SalesQty, formB.ListVars['Format'].SalesQty)}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_amt_calc_txt_is_changed()"
|
|
onfocusout="override_amt_calc_txt_is_changed()"
|
|
required>
|
|
required>
|
|
@@ -787,14 +940,15 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].SorderPrc}" ${formB.ListVars['Hidden'].SorderPrc}
|
|
class="text-${formB.ListVars['Align'].SorderPrc}" ${formB.ListVars['Hidden'].SorderPrc}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SorderPrc} border-0 bg-white" value="${format_conver_for(bd.SorderPrc, formB.ListVars['Format'].SorderPrc)}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SorderPrc} border-0 bg-white" value="${format_conver_for(bd.SorderPrc, formB.ListVars['Format'].SorderPrc)}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
- onfocusout="override_amt_calc_txt_is_changed()">
|
|
|
|
|
|
+ onfocusout="override_amt_calc_txt_is_changed()"
|
|
|
|
+ require>
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
|
|
class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" value="${format_conver_for(bd.SalesSupply, formB.ListVars['Format'].SupplyAmt)}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" value="${format_conver_for(bd.SalesSupply, formB.ListVars['Format'].SupplyAmt)}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
required>
|
|
required>
|
|
@@ -802,16 +956,15 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
|
|
class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" value="${format_conver_for(bd.SalesVat, formB.ListVars['Format'].VatAmt)}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" value="${format_conver_for(bd.SalesVat, formB.ListVars['Format'].VatAmt)}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
required>
|
|
required>
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
- onfocusout="add_td_last_tap_out(this, ${bd.Id})"
|
|
|
|
class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
|
|
class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white" value="${format_conver_for(bd.SalesSum, formB.ListVars['Format'].SumAmt)}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white" value="${format_conver_for(bd.SorderSum, formB.ListVars['Format'].SumAmt)}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_custom_sum_amt()"
|
|
onfocusout="override_custom_sum_amt()"
|
|
required>
|
|
required>
|
|
@@ -823,26 +976,30 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].DeliDate}" ${formB.ListVars['Hidden'].DeliDate}
|
|
class="text-${formB.ListVars['Align'].DeliDate}" ${formB.ListVars['Hidden'].DeliDate}
|
|
>
|
|
>
|
|
- <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white" value="${isEmpty(bd.DeliDate) ? '' : moment(bd.DeliDate).format(formB.ListVars['Format'].DeliDate)}" disabled
|
|
|
|
|
|
+ <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white" value="${isEmpty(bd.DeliDate) ? '' : moment(bd.DeliDate).format('YYYY-MM-DD')}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
- onfocusout="save_data_when_entering_text()">
|
|
|
|
|
|
+ onfocusout="save_data_when_entering_text()"
|
|
|
|
+ required>
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
|
|
class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white" value="${bd.Ref1}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white" value="${bd.Ref1}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="save_data_when_entering_text()">
|
|
onfocusout="save_data_when_entering_text()">
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
|
|
+ onfocusout="add_td_last_tap_out(this, ${bd.Id})"
|
|
class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
|
|
class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white" value="${bd.Ref2}" disabled
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white" value="${bd.Ref2}" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="save_data_when_entering_text()">
|
|
onfocusout="save_data_when_entering_text()">
|
|
</td>
|
|
</td>
|
|
<td
|
|
<td
|
|
- class="text-${formB.ListVars['Align'].SorderMemo}" ${formB.ListVars['Hidden'].SorderMemo}>${bd.SorderMemo}
|
|
|
|
|
|
+ class="text-${formB.ListVars['Align'].SorderMemo}" ${formB.ListVars['Hidden'].SordderMemo}>
|
|
|
|
+ <textarea style="max-height: 30px;" class="rounded w-100 bg-white memo-textarea" id="memo-textarea-${bd.Id}"
|
|
|
|
+ ondblclick="Btype.dblclick_memo_textarea(this, ${bd.Id})" role="button" readonly>${bd.SorderMemo}</textarea>
|
|
</td>
|
|
</td>
|
|
</tr>` )
|
|
</tr>` )
|
|
});
|
|
});
|
|
@@ -864,7 +1021,7 @@
|
|
|
|
|
|
let html =
|
|
let html =
|
|
`<tr>
|
|
`<tr>
|
|
- <td class="text-${formB.ListVars['Align'].$Radio} px-import-0">
|
|
|
|
|
|
+ <td class="text-${formB.ListVars['Align'].$Radio} px-import-0" ${formB.ListVars['Hidden'].$Radio}>
|
|
<input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
|
|
<input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
|
|
class="text-${formB.ListVars['Align'].$Radio}"
|
|
class="text-${formB.ListVars['Align'].$Radio}"
|
|
id="bd-cursor-state-${last_bd_id_inc}"
|
|
id="bd-cursor-state-${last_bd_id_inc}"
|
|
@@ -877,12 +1034,15 @@
|
|
<td onkeydown="Btype.enterPressedinCell(event)"
|
|
<td onkeydown="Btype.enterPressedinCell(event)"
|
|
class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
|
|
class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" value=""
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
- id="item-code-${last_bd_id_inc}">
|
|
|
|
|
|
+ id="item-code-${last_bd_id_inc}" required>
|
|
</td>
|
|
</td>
|
|
- <td
|
|
|
|
- class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}>
|
|
|
|
|
|
+ <td onkeydown="Btype.enterPressedinCell(event, 2)"
|
|
|
|
+ class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
|
|
|
|
+ >
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" readonly
|
|
|
|
+ onchange="Btype.check_the_checkbox_when_changing(this)" required>
|
|
</td>
|
|
</td>
|
|
<td
|
|
<td
|
|
class="text-${formB.ListVars['Align'].SubName}" ${formB.ListVars['Hidden'].SubName}>
|
|
class="text-${formB.ListVars['Align'].SubName}" ${formB.ListVars['Hidden'].SubName}>
|
|
@@ -893,7 +1053,7 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].SalesQty}" ${formB.ListVars['Hidden'].SalesQty}
|
|
class="text-${formB.ListVars['Align'].SalesQty}" ${formB.ListVars['Hidden'].SalesQty}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SalesQty} border-0 bg-white"
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SalesQty} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_amt_calc_txt_is_changed()"
|
|
onfocusout="override_amt_calc_txt_is_changed()"
|
|
required>
|
|
required>
|
|
@@ -901,14 +1061,15 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].SorderPrc}" ${formB.ListVars['Hidden'].SorderPrc}
|
|
class="text-${formB.ListVars['Align'].SorderPrc}" ${formB.ListVars['Hidden'].SorderPrc}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SorderPrc} border-0 bg-white"
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SorderPrc} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
- onfocusout="override_amt_calc_txt_is_changed()">
|
|
|
|
|
|
+ onfocusout="override_amt_calc_txt_is_changed()"
|
|
|
|
+ required>
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
|
|
class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white"
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
required>
|
|
required>
|
|
@@ -916,14 +1077,13 @@
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
|
|
class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white"
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
onfocusout="override_custom_supply_amt_or_vat_amt()"
|
|
required>
|
|
required>
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
- data-last=true onfocusout="add_td_last_tap_out(this, ${last_bd_id_inc})"
|
|
|
|
- class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
|
|
|
|
|
|
+ class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt} readonly
|
|
>
|
|
>
|
|
<input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white"
|
|
<input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
@@ -933,25 +1093,26 @@
|
|
<td
|
|
<td
|
|
class="text-${formB.ListVars['Align'].StdSalesPrc}" ${formB.ListVars['Hidden'].StdSalesPrc}>
|
|
class="text-${formB.ListVars['Align'].StdSalesPrc}" ${formB.ListVars['Hidden'].StdSalesPrc}>
|
|
</td>
|
|
</td>
|
|
-
|
|
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].DeliDate}" ${formB.ListVars['Hidden'].DeliDate}
|
|
class="text-${formB.ListVars['Align'].DeliDate}" ${formB.ListVars['Hidden'].DeliDate}
|
|
>
|
|
>
|
|
- <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white"
|
|
|
|
|
|
+ <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white" readonly
|
|
|
|
+ value="${moment().format('YYYY-MM-DD')}"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
- onfocusout="save_data_when_entering_text()">
|
|
|
|
|
|
+ onfocusout="save_data_when_entering_text()"
|
|
|
|
+ required>
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
|
|
class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white"
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="save_data_when_entering_text()">
|
|
onfocusout="save_data_when_entering_text()">
|
|
</td>
|
|
</td>
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
<td onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
|
|
class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
|
|
>
|
|
>
|
|
- <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white"
|
|
|
|
|
|
+ <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white" readonly
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onchange="Btype.check_the_checkbox_when_changing(this)"
|
|
onfocusout="save_data_when_entering_text()">
|
|
onfocusout="save_data_when_entering_text()">
|
|
</td>
|
|
</td>
|
|
@@ -991,8 +1152,38 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function set_item_data_to_textbox(item) {
|
|
|
|
+ console.log('item : ', item);
|
|
|
|
+ let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
|
|
|
|
+ // $(tr).children('td:eq(2)').find('input').val(item.ItemCode)
|
|
|
|
+ // $(tr).children('td:eq(3)').find('input').val(item.ItemName)
|
|
|
|
+ // $(tr).children('td:eq(4)').text(item.SubName)
|
|
|
|
+ // $(tr).children('td:eq(5)').text(item.CountUnit)
|
|
|
|
+ // $(tr).children('td:eq(6)').find('input').val()
|
|
|
|
+ // $(tr).children('td:eq(7)').find('input').val(parseFloat(item.PurchPrc).toFixed(window.User['PurchPrcPoint']))
|
|
|
|
+ // $(tr).children('td:eq(11)').text(parseFloat(item.PurchPrc).toFixed(window.User['PurchPrcPoint']))
|
|
|
|
+ // let index = $(tr).prevAll().length;
|
|
|
|
+ // bd_page[index].ItemId = item.Id
|
|
|
|
+ // bd_page[index].ItemCode = item.ItemCode
|
|
|
|
+ // bd_page[index].ItemName = item.ItemName
|
|
|
|
+ // bd_page[index].SubName = item.SubName
|
|
|
|
+ // bd_page[index].CountUnit = item.CountUnit
|
|
|
|
+ // bd_page[index].StdSalesPrc = item.PurchPrc
|
|
|
|
+ // bd_page[index].StdPurchPrc = item.PurchPrc// override_amt_calc_txt_is_changed();
|
|
|
|
+ // bd_page[index].TurboThumb = item.TurboThumb
|
|
|
|
+
|
|
|
|
+ // if (bd_page[index].Id === 0) {
|
|
|
|
+ // $(tr).children('td:eq(16)').find('textarea').val(item.ItemMemo)
|
|
|
|
+ // bd_page[index].PorderMemo = item.ItemMemo
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ return $(tr).children('td:eq(6)').find('input')
|
|
|
|
+ }
|
|
|
|
+
|
|
function update_hd_ui(response) {
|
|
function update_hd_ui(response) {
|
|
|
|
+ console.log('update_hd_ui');
|
|
if (isEmpty(response.data) || response.data.apiStatus) {
|
|
if (isEmpty(response.data) || response.data.apiStatus) {
|
|
|
|
+ console.log('isEmpty(response.data) || response.data.apiStatus');
|
|
$('#modal-slip').modal('hide');
|
|
$('#modal-slip').modal('hide');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -1000,7 +1191,7 @@
|
|
|
|
|
|
let hd_page = response.data.HdPage[0]
|
|
let hd_page = response.data.HdPage[0]
|
|
bd_page = response.data.BdPage ?? []
|
|
bd_page = response.data.BdPage ?? []
|
|
-
|
|
|
|
|
|
+ console.log('response : ', response);
|
|
$('#Id').val(hd_page.Id)
|
|
$('#Id').val(hd_page.Id)
|
|
$('#auto-slip-no-txt').val(hd_page.SalesNo)
|
|
$('#auto-slip-no-txt').val(hd_page.SalesNo)
|
|
$('#sales-date').val(moment(to_date(hd_page.SalesDate)).format('YYYY-MM-DD'))
|
|
$('#sales-date').val(moment(to_date(hd_page.SalesDate)).format('YYYY-MM-DD'))
|
|
@@ -1015,17 +1206,17 @@
|
|
$('#supplier-txt').data('contact', hd_page.BuyerContact)
|
|
$('#supplier-txt').data('contact', hd_page.BuyerContact)
|
|
$('#supplier-contact-txt').val(hd_page.BuyerContact)
|
|
$('#supplier-contact-txt').val(hd_page.BuyerContact)
|
|
|
|
|
|
- let html = `<option value="${hd_page.VatRateId}" data-vatrate="${hd_page.VatRate}" data-viewvatrate="${hd_page.VatRate * 100}">${hd_page.VatName}</option>`
|
|
|
|
- $('#vat-type-select').html(html);
|
|
|
|
|
|
+ // let html = `<option value="${hd_page.VatRateId}" data-vatrate="${hd_page.VatRate}" data-viewvatrate="${hd_page.VatRate * 100}">${hd_page.VatName}</option>`
|
|
|
|
+ // $('#vat-type-select').html(html);
|
|
|
|
+ // $('#vat-type-txt').val(hd_page.VatName)
|
|
$('#vat-type-select').val(hd_page.VatRateId)
|
|
$('#vat-type-select').val(hd_page.VatRateId)
|
|
- $('#vat-type-txt').val(hd_page.VatName)
|
|
|
|
set_vat_type_rate('#vat-type-select', false);
|
|
set_vat_type_rate('#vat-type-select', false);
|
|
|
|
|
|
- $('#delivery-txt').val(hd_page.Delivery)
|
|
|
|
- $('#payTerms-txt').val(hd_page.PayTerms)
|
|
|
|
- $('#destination-txt').val(hd_page.Destination)
|
|
|
|
- $('#column1-txt').val(hd_page.Column1)
|
|
|
|
- $('#column2-txt').val(hd_page.Column2)
|
|
|
|
|
|
+ // $('#delivery-txt').val(hd_page.Delivery)
|
|
|
|
+ // $('#payTerms-txt').val(hd_page.PayTerms)
|
|
|
|
+ // $('#destination-txt').val(hd_page.Destination)
|
|
|
|
+ // $('#column1-txt').val(hd_page.Column1)
|
|
|
|
+ // $('#column2-txt').val(hd_page.Column2)
|
|
|
|
|
|
$('#remarks-txt-area').val(hd_page.Remarks)
|
|
$('#remarks-txt-area').val(hd_page.Remarks)
|
|
$('#remarks-preview').html(hd_page.Remarks)
|
|
$('#remarks-preview').html(hd_page.Remarks)
|
|
@@ -1056,5 +1247,6 @@
|
|
const pickCacheData = {!! json_encode($pickCacheData) !!};
|
|
const pickCacheData = {!! json_encode($pickCacheData) !!};
|
|
var formB = {!! json_encode($formB) !!};
|
|
var formB = {!! json_encode($formB) !!};
|
|
var bd_page = [];
|
|
var bd_page = [];
|
|
|
|
+ let slipInit = null;
|
|
</script>
|
|
</script>
|
|
@endsection
|
|
@endsection
|