|
@@ -73,12 +73,6 @@
|
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['StockDate'] }}"
|
|
|
{{ $formB['FormVars']['Required']['StockDate'] }}>
|
|
|
</div>
|
|
|
- {{-- <div class="form-group d-flex flex-column mb-2">
|
|
|
- <label class="m-0">{{ $formB['FormVars']['Title']['PorderNo'] }}</label>
|
|
|
- <input class="rounded w-100" type="text" id="porder-no-txt" disabled
|
|
|
- maxlength="{{ $formB['FormVars']['MaxLength']['PorderNo'] }}"
|
|
|
- {{ $formB['FormVars']['Required']['PorderNo'] }}>
|
|
|
- </div>--}}
|
|
|
|
|
|
<div class="form-group d-flex flex-column mb-2">
|
|
|
<label class="m-0 ">{{ $formB['FormVars']['Title']['Supplier'] }}</label>
|
|
@@ -98,17 +92,21 @@
|
|
|
</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']['porder'] as $key => $status)
|
|
|
- <option value="{{ $status['Code'] }}">
|
|
|
- {{ $status['Title'] }}
|
|
|
- </option>
|
|
|
- @endforeach
|
|
|
- </select>
|
|
|
+ <label class="m-0">{{ $formB['FormVars']['Title']['PorderNo'] }}</label>
|
|
|
+ <div class="d-flex">
|
|
|
+ <input type="text" class="rounded w-100 radius-r0" id="porder-no-txt"
|
|
|
+ maxlength="{{ $formB['FormVars']['MaxLength']['PorderNo'] }}"
|
|
|
+ {{ $formB['FormVars']['Required']['PorderNo'] }}>
|
|
|
+ <button type="button"
|
|
|
+ class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 window sorder-modal-btn"
|
|
|
+ data-target="slip"
|
|
|
+ data-clicked="get_porder_no"
|
|
|
+ data-variable="porderModal">
|
|
|
+ <i class="icon-folder-open"></i>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -139,12 +137,27 @@
|
|
|
{{ $formB['FormVars']['Required']['VatType'] }}>
|
|
|
</select>
|
|
|
</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>
|
|
|
<input type="text" id="vat-type-rate-text" class="rounded w-100" autocomplete="off" value="" disabled
|
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['VatTypeRate'] }}"
|
|
|
{{ $formB['FormVars']['Required']['VatTypeRate'] }}>
|
|
|
</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']['porder'] as $key => $status)
|
|
|
+ <option value="{{ $status['Code'] }}">
|
|
|
+ {{ $status['Title'] }}
|
|
|
+ </option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -385,6 +398,7 @@
|
|
|
|
|
|
@section('modal')
|
|
|
@include('front.outline.static.slip', ['moealSetFile' => $purchModal])
|
|
|
+ @include('front.outline.static.slip', ['moealSetFile' => $porderModal])
|
|
|
@include('front.outline.static.company', ['moealSetFile' => $companyModal])
|
|
|
@include('front.outline.static.item', ['moealSetFile' => $itemModal])
|
|
|
@include('front.outline.static.memo2')
|
|
@@ -404,32 +418,29 @@
|
|
|
// 매입일자, 수불일자 가져오기
|
|
|
$('#purch-date').val(date_to_sting(new Date()))
|
|
|
$('#stock-date').val(date_to_sting(new Date()))
|
|
|
-
|
|
|
- let sgroup_pick = await get_api_data('sgroup-pick', { Page: [ { Id: parseInt(window.User['SgroupId']) } ] });
|
|
|
- window.User['SgroupName'] = sgroup_pick['data']['Page'][0]['SgroupName'];
|
|
|
-
|
|
|
//storage_name, branch_name 받아오기
|
|
|
Btype.get_storage_name_and_branch_name()
|
|
|
+ slipInit = await Btype.get_slip_form_init()
|
|
|
+ // slipInit = @json($slipFormInitCacheData);
|
|
|
+ formB['SlipCommonSetup'] = slipInit['SlipCommonSetup']
|
|
|
+ console.log('slipInit : ', slipInit);
|
|
|
|
|
|
- // 백엔드 작업완료시 주석 해제
|
|
|
- // slipInit = await Btype.get_slip_form_init()
|
|
|
- // slipInit = @json($slipFormInitCacheData);
|
|
|
- // formB['SlipCommonSetup'] = slipInit['SlipCommonSetup']
|
|
|
- // console.log('slipInit : ', slipInit);
|
|
|
- // 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)
|
|
|
- // 백엔드 작업완료시 주석 해제
|
|
|
+ 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'])
|
|
|
+ console.log('NickName: ', window.User['NickName']);
|
|
|
|
|
|
- // if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
|
|
|
+ let sgroup_pick = await get_api_data('sgroup-pick', { Page: [ { Id: parseInt(window.User['SgroupId']) } ] });
|
|
|
+ window.User['SgroupName'] = sgroup_pick['data']['Page'][0]['SgroupName'];
|
|
|
+
|
|
|
+ if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
|
|
|
$('.is-new-rec-auto-slip-no').text('자동채번')
|
|
|
$('#auto-slip-no-txt').prop('disabled', true)
|
|
|
// get_last_slip_no()
|
|
|
- // }
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
if (! isEmpty(pickCacheData['query'])) {
|
|
|
let query = JSON.parse(pickCacheData['query'])
|
|
@@ -437,11 +448,10 @@
|
|
|
}
|
|
|
|
|
|
$('.purch-act').on('click', function () {
|
|
|
- // console.log($(this).data('value'))
|
|
|
switch( $(this).data('value') ) {
|
|
|
case 'save': Btype.btn_act_save('#purch-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 'delete': Btype.btn_act_del('#purch-form #frm'); break;
|
|
|
}
|
|
@@ -507,16 +517,24 @@
|
|
|
|
|
|
|
|
|
async function btn_bd_act_add() {
|
|
|
- if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
|
|
|
- iziToast.error({
|
|
|
- title: 'Error',
|
|
|
- message: @json(_e('Action failed')),
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- if (! Btype.last_item_added_check('#purch-table-body')) {
|
|
|
- add_tr();
|
|
|
- }
|
|
|
+ Btype.btn_act_save('#sales-form #frm', async function () {
|
|
|
+ if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
|
|
|
+ iziToast.error({
|
|
|
+ title: 'Error',
|
|
|
+ message: @json(_e('Action failed')),
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (! Btype.last_item_added_check('#sales-table-body')) {
|
|
|
+ add_tr();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 발주번호 찾기 -> 발주번호 입력
|
|
|
+ function get_porder_no(id){
|
|
|
+ $('#porder-no-txt').val(id)
|
|
|
+ $('#modal-slip').modal('hide');
|
|
|
}
|
|
|
|
|
|
function btn_bd_act_body_copy(parameter_name) {
|
|
@@ -540,63 +558,10 @@
|
|
|
}
|
|
|
|
|
|
function btn_act_new() {
|
|
|
- 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()
|
|
|
- $('#purch-date').val(date_to_sting(new Date()))
|
|
|
- $('#stock-date').val(date_to_sting(new Date()))
|
|
|
- $('#porder-no-txt').val('')
|
|
|
- $('#porder-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('')
|
|
|
- $('#ref-no-txt').val('')
|
|
|
- $('#is-not-stock-io-txt').val('')
|
|
|
- $('#is-closed-check').prop('checked', false)
|
|
|
-
|
|
|
- $('#sgroup-name-txt').val('')
|
|
|
- // select_box_first_selected('#sgroup-name-select')
|
|
|
- $('#user-txt').val('')
|
|
|
- $('#our-contact-txt').val('')
|
|
|
- // select_box_first_selected('#our-contact-select')
|
|
|
-
|
|
|
- $('#StorageName').val('')
|
|
|
- $('#BranchName').val('')
|
|
|
-
|
|
|
- // table body 초기화
|
|
|
- table_head_check_box_reset('#purch-table-head')
|
|
|
- $('#purch-table-body').html('');
|
|
|
-
|
|
|
- // footer 합계 초기화
|
|
|
- $('#QtyTotal').val('')
|
|
|
- $('#SupplyTotal').val('')
|
|
|
- $('#VatTotal').val('')
|
|
|
- $('#SumTotal').val('')
|
|
|
+ data_init()
|
|
|
+ if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
|
|
|
+ get_last_slip_no()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function btn_act_copy_to_another(parameter_name) {
|
|
@@ -611,10 +576,12 @@
|
|
|
}
|
|
|
|
|
|
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']
|
|
|
-
|
|
|
+ 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']
|
|
|
+ console.log('deal_name : ', deal_name);
|
|
|
+ console.log('vat_rate : ', vat_rate);
|
|
|
+ console.log('vat_name : ', vat_name);
|
|
|
let first_item = ''
|
|
|
let first_thumb = ''
|
|
|
if (bd_page.length > 0) {
|
|
@@ -649,19 +616,18 @@
|
|
|
// UserId: window.User['UserId'],
|
|
|
// Remarks: $('#remarks-txt-area').val(),
|
|
|
// Ip: window.User['Ip'],
|
|
|
- // IsNotStockIo: $('#is-not-stock-io-txt').val(),
|
|
|
Id: id,
|
|
|
CreatedOn: get_now_time_stamp(),
|
|
|
UpdatedOn: get_now_time_stamp(),
|
|
|
SorderId: parseInt($('#sorder-no-txt').data('id')),
|
|
|
PurchNo: $('#auto-slip-no-txt').val(),
|
|
|
- PurchDate: moment(new Date($('#sales-date').val())).format('YYYYMMDD'),
|
|
|
+ PurchDate: moment(new Date($('#purch-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')),
|
|
|
+ SupplierId: parseInt($('#supplier-txt').data('id')),
|
|
|
VatRateId: parseInt($('#vat-type-select').val()),
|
|
|
BuyerContact: $('#supplier-txt').data('contact'),
|
|
|
PayTerms: $('#payTerms-select').val(),
|
|
@@ -674,7 +640,6 @@
|
|
|
Ip: window.User['Ip'],
|
|
|
IsNotStockIo: $('#is-not-stock-io-txt').val(),
|
|
|
|
|
|
-
|
|
|
FirstItem: first_item,
|
|
|
ItmtotAmt: String(itmtot_amt),
|
|
|
// DiscountAmt: '0',
|
|
@@ -683,9 +648,13 @@
|
|
|
VatRate: vat_rate,
|
|
|
VatName: vat_name,
|
|
|
SgroupName: window.User['SgroupName'],
|
|
|
- // FirstThumb : first_thumb,
|
|
|
TotalQty : String(Number(total_qty) - 0)
|
|
|
}
|
|
|
+
|
|
|
+ if (typeof first_thumb !== 'undefined') {
|
|
|
+ parameter.FirstThumb = first_thumb;
|
|
|
+ }
|
|
|
+
|
|
|
if (id < 0) {
|
|
|
parameter = { Id: id }
|
|
|
} else if (id > 0) {
|
|
@@ -697,6 +666,74 @@
|
|
|
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()
|
|
|
+ $('#purch-date').val(date_to_sting(new Date()))
|
|
|
+ $('#stock-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('')
|
|
|
+ $('#porder-no-txt').val('')
|
|
|
+ $('#porder-no-txt').data('id', 0)
|
|
|
+ $('#is-closed-check').prop('checked', false)
|
|
|
+
|
|
|
+ $('#status-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('#column1-select')
|
|
|
+ // select_box_first_selected('#column2-select')
|
|
|
+ $('#is-not-stock-io-txt').val('')
|
|
|
+
|
|
|
+
|
|
|
+ $('#sgroup-name-txt').val('')
|
|
|
+ select_box_first_selected('#sgroup-name-select')
|
|
|
+ // $('#user-txt').val('')
|
|
|
+ $('#our-contact-txt').val('')
|
|
|
+ select_box_first_selected('#our-contact-select')
|
|
|
+
|
|
|
+ $('#StorageName').val('')
|
|
|
+ $('#BranchName').val('')
|
|
|
+
|
|
|
+ // table body 초기화
|
|
|
+ table_head_check_box_reset('#purch-table-head')
|
|
|
+ $('#purch-table-body').html('');
|
|
|
+
|
|
|
+ // footer 합계 초기화
|
|
|
+ $('#QtyTotal').val('')
|
|
|
+ $('#SupplyTotal').val('')
|
|
|
+ $('#VatTotal').val('')
|
|
|
+ $('#SumTotal').val('')
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
async function get_last_slip_no($this) {
|
|
|
Btype.set_slip_no_btn_disabled()
|
|
|
let response = await Btype.get_last_slip_no('purch');
|
|
@@ -708,14 +745,14 @@
|
|
|
$('#supplier-contact-txt').val($('#supplier-txt').data('contact'))
|
|
|
}
|
|
|
|
|
|
- async function create_etc_select_box_options() {
|
|
|
+ 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 column1 = create_options(await get_select_box_options_data('etc-page', 'select_name="공란1"'))
|
|
|
// let column2 = create_options(await get_select_box_options_data('etc-page', 'select_name="공란2"'))
|
|
|
-
|
|
|
+ console.log
|
|
|
let delivery = create_options(data.EtcDeliveryPage)
|
|
|
let payTerms = create_options(data.EtcPayTermPage)
|
|
|
let destination = create_options(data.EtcDestinationPage)
|
|
@@ -731,17 +768,18 @@
|
|
|
|
|
|
function set_vat_type_rate($this, msg = true) {
|
|
|
let vate_rate = $($this).find('option:selected').data('viewvatrate');
|
|
|
+ console.log();
|
|
|
$('#vat-type-rate-text').val(vate_rate + '%')
|
|
|
|
|
|
if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 || ! msg) return;
|
|
|
- // call_act_api(get_parameter(), function() { });
|
|
|
+ Btype.call_act_api(get_parameter(), function() { });
|
|
|
|
|
|
- // if (isEmpty(bd_page)) return;
|
|
|
+ if (isEmpty(bd_page)) return;
|
|
|
|
|
|
- // let data = bd_update_due_to_vat_rate_change();
|
|
|
- // Btype.call_bd_act_api(data, function() {
|
|
|
- // create_bd_page();
|
|
|
- // })
|
|
|
+ let data = bd_update_due_to_vat_rate_change();
|
|
|
+ Btype.call_bd_act_api(data, function() {
|
|
|
+ create_bd_page();
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function get_bd_parameter(bd) {
|
|
@@ -841,6 +879,32 @@
|
|
|
message: @json(_e('(*)Required item(s) omitted')),
|
|
|
});
|
|
|
}
|
|
|
+ scrollToTop();
|
|
|
+ }
|
|
|
+
|
|
|
+ function body_act_success_callback($this, tr) {
|
|
|
+ // 합계 계산
|
|
|
+ amt_total_calc();
|
|
|
+
|
|
|
+ let qty = $(tr).children('td:eq(6)').find('input')
|
|
|
+ let prc = $(tr).children('td:eq(7)').find('input')
|
|
|
+ let supply_amt = $(tr).children('td:eq(8)').find('input')
|
|
|
+ let vat_amt = $(tr).children('td:eq(9)').find('input')
|
|
|
+ let sum_amt = $(tr).children('td:eq(10)').find('input')
|
|
|
+ let std_sales_price = $(tr).children('td:eq(11)')
|
|
|
+
|
|
|
+ $(qty).val( format_conver_for(minusComma($(qty).val()), formB.ListVars['Format'].SalesQty) )
|
|
|
+ $(prc).val( format_conver_for(minusComma($(prc).val()), formB.ListVars['Format'].SorderPrc) ) // 수주단가
|
|
|
+ $(supply_amt).val( format_conver_for(minusComma($(supply_amt).val()), formB.ListVars['Format'].SupplyAmt) )
|
|
|
+ $(vat_amt).val( format_conver_for(minusComma($(vat_amt).val()), formB.ListVars['Format'].VatAmt) )
|
|
|
+ $(sum_amt).val( format_conver_for(minusComma($(sum_amt).val()), formB.ListVars['Format'].SumAmt) )
|
|
|
+ $(std_sales_price).text( format_conver_for(minusComma($(std_sales_price).text()), formB.ListVars['Format'].SorderPrc) ) // 표준 매출가
|
|
|
+
|
|
|
+ if ($($this).data('last')) {
|
|
|
+ add_tr();
|
|
|
+ $($this).data('last', false)
|
|
|
+ }
|
|
|
+ iziToast.success({ title: 'Success', message: $('#action-completed').text() });
|
|
|
}
|
|
|
|
|
|
function override_amt_calc_txt_is_changed() {
|
|
@@ -907,7 +971,7 @@
|
|
|
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}" readonly
|
|
|
- onchange="Btype.check_the_checkbox_when_changing(this)">
|
|
|
+ onchange="Btype.check_the_checkbox_when_changing(this)" required>
|
|
|
</td>
|
|
|
<td onkeydown="Btype.enterPressedinCell(event, 2)"
|
|
|
class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
|
|
@@ -934,7 +998,8 @@
|
|
|
>
|
|
|
<input type="text" class="text-${formB.ListVars['Align'].PorderPrc} border-0 bg-white" value="${format_conver_for(bd.PorderPrc, formB.ListVars['Format'].PorderPrc)}" readonly
|
|
|
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 onkeydown="Btype.handleEnterPressedinTabCell(event)"
|
|
|
class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
|
|
@@ -1187,7 +1252,7 @@
|
|
|
return;
|
|
|
}
|
|
|
Btype.set_slip_no_btn_disabled()
|
|
|
-
|
|
|
+ console.log(response);
|
|
|
let hd_page = response.data.HdPage[0]
|
|
|
bd_page = response.data.BdPage ?? []
|
|
|
let thumb = response.data.HdPage[0]['FirstThumb']
|
|
@@ -1211,17 +1276,17 @@
|
|
|
$('#supplier-txt').data('contact', hd_page.SupplierContact)
|
|
|
$('#supplier-contact-txt').val(hd_page.SupplierContact)
|
|
|
|
|
|
- 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-txt').val(hd_page.VatName)
|
|
|
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-preview').html(hd_page.Remarks)
|
|
@@ -1249,7 +1314,13 @@
|
|
|
$('#modal-slip').modal('hide');
|
|
|
}
|
|
|
|
|
|
+ function scrollToTop() {
|
|
|
+ var scrollArea = document.getElementById("scroll-area");
|
|
|
+ scrollArea.scrollTop = 0;
|
|
|
+ }
|
|
|
+
|
|
|
const purchModal = {!! json_encode($purchModal) !!};
|
|
|
+ const porderModal = {!! json_encode($porderModal) !!};
|
|
|
const companyModal = {!! json_encode($companyModal) !!};
|
|
|
const itemModal = {!! json_encode($itemModal) !!};
|
|
|
const slipCacheData = {!! json_encode($slipCacheData) !!};
|