|
@@ -126,9 +126,11 @@
|
|
<select class="rounded w-100" data-closed="0" id="status-select" onchange="Btype.set_is_closed_val(this)"
|
|
<select class="rounded w-100" data-closed="0" id="status-select" onchange="Btype.set_is_closed_val(this)"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['Status'] }}"
|
|
maxlength="{{ $formB['FormVars']['MaxLength']['Status'] }}"
|
|
{{ $formB['FormVars']['Required']['Status'] }}>
|
|
{{ $formB['FormVars']['Required']['Status'] }}>
|
|
- <option value=""></option>
|
|
|
|
- <option value="{{ $formB['StatusOptions'][0]['Value'] }}">{{ $formB['StatusOptions'][0]['Caption'] }}</option>
|
|
|
|
- <option value="{{ $formB['StatusOptions'][1]['Value'] }}">{{ $formB['StatusOptions'][1]['Caption'] }}</option>
|
|
|
|
|
|
+ @foreach ($codeTitle['status']['porder'] as $key => $status)
|
|
|
|
+ <option value="{{ $status['Code'] }}">
|
|
|
|
+ {{ $status['Title'] }}
|
|
|
|
+ </option>
|
|
|
|
+ @endforeach
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -348,7 +350,7 @@
|
|
<script src="{{ csset('/js/modals-controller/b-type/common.js') }}"></script>
|
|
<script src="{{ csset('/js/modals-controller/b-type/common.js') }}"></script>
|
|
<script>
|
|
<script>
|
|
window.onload = async function () {
|
|
window.onload = async function () {
|
|
- hdPage = [];
|
|
|
|
|
|
+ ThumbArr = [];
|
|
make_dynamic_table_css('.porder-table', make_dynamic_table_px(formB['ListVars']['Size']))
|
|
make_dynamic_table_css('.porder-table', make_dynamic_table_px(formB['ListVars']['Size']))
|
|
|
|
|
|
$('#porder-date').val(date_to_sting(new Date()))
|
|
$('#porder-date').val(date_to_sting(new Date()))
|
|
@@ -491,7 +493,7 @@
|
|
SeqNo: bd.SeqNo,
|
|
SeqNo: bd.SeqNo,
|
|
ItemId: parseInt(bd.ItemId),
|
|
ItemId: parseInt(bd.ItemId),
|
|
PorderQty: String(bd.PorderQty),
|
|
PorderQty: String(bd.PorderQty),
|
|
- PurchBalQty: String(bd.PorderQty),
|
|
|
|
|
|
+ PurchBalQty : String(bd.PorderQty),
|
|
PorderPrc: String(bd.PorderPrc),
|
|
PorderPrc: String(bd.PorderPrc),
|
|
PorderSupply: String(bd.PorderSupply),
|
|
PorderSupply: String(bd.PorderSupply),
|
|
PorderVat: String(bd.PorderVat),
|
|
PorderVat: String(bd.PorderVat),
|
|
@@ -506,7 +508,6 @@
|
|
IsEnd: parseInt(bd.IsEnd),
|
|
IsEnd: parseInt(bd.IsEnd),
|
|
Ip: window.User['Ip']
|
|
Ip: window.User['Ip']
|
|
}
|
|
}
|
|
-
|
|
|
|
if (id < 0) {
|
|
if (id < 0) {
|
|
parameter = { Id: id }
|
|
parameter = { Id: id }
|
|
} else if (id > 0) {
|
|
} else if (id > 0) {
|
|
@@ -534,37 +535,31 @@
|
|
}
|
|
}
|
|
|
|
|
|
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
|
|
|
|
-
|
|
|
|
- // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
|
|
|
|
- if (bd_page[index].ItemId != 0 && ! dom_required_check($(tr).find(`input`))) {
|
|
|
|
- if ($($this).data('last')) {
|
|
|
|
- let seq_no = await Btype.get_last_seq_no('porder', $('#auto-slip-no-txt').val())
|
|
|
|
- bd_page[index].SeqNo = seq_no;
|
|
|
|
|
|
+ Btype.btn_act_save('#porder-form #frm', async function () {
|
|
|
|
+ let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
|
|
|
|
+ let index = $(tr).prevAll().length
|
|
|
|
+
|
|
|
|
+ // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
|
|
|
|
+ if (bd_page[index].ItemId != 0 && ! dom_required_check($(tr).find(`input`))) {
|
|
|
|
+ if ($($this).data('last')) {
|
|
|
|
+ let seq_no = await Btype.get_last_seq_no('porder', $('#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;
|
|
|
|
+
|
|
|
|
+ Btype.body_act_success_callback($this, tr);
|
|
|
|
+ Btype.check_the_checkbox_when_changing($this, false)
|
|
|
|
+ // Btype.btn_act_save('#porder-form #frm');
|
|
|
|
+ });
|
|
|
|
+ } 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;
|
|
|
|
-
|
|
|
|
- Btype.body_act_success_callback($this, tr);
|
|
|
|
- Btype.check_the_checkbox_when_changing($this, false)
|
|
|
|
- Btype.btn_act_save('#porder-form #frm');
|
|
|
|
- });
|
|
|
|
- let itemCodeInput = $(tr).find(`input[type="text"]`).first();
|
|
|
|
- let itemNameInput = $(tr).find(`input[type="text"]`).eq(1);
|
|
|
|
- if (itemCodeInput.length > 0) {
|
|
|
|
- Btype.set_slip_no_btn_disabled(itemCodeInput)
|
|
|
|
- Btype.set_slip_no_btn_disabled(itemNameInput)
|
|
|
|
- // $(firstTextInput).addClass('border-0 bg-white')
|
|
|
|
- // $(firstTextInput).prop('readonly', true)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- iziToast.error({
|
|
|
|
- title: 'Error',
|
|
|
|
- message: @json(_e('(*)Required item(s) omitted')),
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
// start body act btn
|
|
// start body act btn
|
|
@@ -676,8 +671,10 @@
|
|
first_item += '_' + first_porder['SubName']
|
|
first_item += '_' + first_porder['SubName']
|
|
}
|
|
}
|
|
first_item += '(' + bd_page.length + ')'
|
|
first_item += '(' + bd_page.length + ')'
|
|
- first_thumb = first_porder['TurboThumb']
|
|
|
|
|
|
|
|
|
|
+ if(first_porder['TurboThumb']){
|
|
|
|
+ first_thumb = first_porder['TurboThumb']
|
|
|
|
+ }
|
|
}
|
|
}
|
|
const itmtot_amt = bd_page.reduce((accumulator, bd) => {
|
|
const itmtot_amt = bd_page.reduce((accumulator, bd) => {
|
|
return accumulator + parseFloat(bd.PorderSupply) + parseFloat(bd.PorderVat) // 합계금액 (공급가액 + 세액)
|
|
return accumulator + parseFloat(bd.PorderSupply) + parseFloat(bd.PorderVat) // 합계금액 (공급가액 + 세액)
|
|
@@ -723,8 +720,7 @@
|
|
VatRate: vat_rate,
|
|
VatRate: vat_rate,
|
|
VatName: vat_name,
|
|
VatName: vat_name,
|
|
SgroupName: window.User['SgroupName'],
|
|
SgroupName: window.User['SgroupName'],
|
|
- TotalQty : String(Number(total_qty) - 0),
|
|
|
|
- // FirstThumb : first_thumb
|
|
|
|
|
|
+ TotalQty : String(Number(total_qty) - 0)
|
|
}
|
|
}
|
|
|
|
|
|
if (typeof first_thumb !== 'undefined') {
|
|
if (typeof first_thumb !== 'undefined') {
|
|
@@ -1088,14 +1084,14 @@
|
|
data-last=true onfocusout="add_td_last_tap_out(this, ${last_bd_id_inc})"
|
|
data-last=true onfocusout="add_td_last_tap_out(this, ${last_bd_id_inc})"
|
|
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"readonly
|
|
|
|
|
|
+ <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>
|
|
<td
|
|
<td
|
|
class="text-${formB.ListVars['Align'].PorderMemo}" ${formB.ListVars['Hidden'].PorderMemo}>
|
|
class="text-${formB.ListVars['Align'].PorderMemo}" ${formB.ListVars['Hidden'].PorderMemo}>
|
|
<textarea style="max-height: 30px;" class="rounded w-100 bg-white memo-textarea"
|
|
<textarea style="max-height: 30px;" class="rounded w-100 bg-white memo-textarea"
|
|
- ondblclick="Btype.dblclick_memo_textarea(this, ${last_bd_id_inc})" id="memo-textarea-${last_bd_id_inc}" role="button" readonly></textarea>
|
|
|
|
|
|
+ ondblclick="Btype.dblclick_memo_textarea(this, ${last_bd_id_inc})" id="memo-textarea-${last_bd_id_inc}" role="button"></textarea>
|
|
</td>
|
|
</td>
|
|
</tr>`;
|
|
</tr>`;
|
|
|
|
|
|
@@ -1148,7 +1144,9 @@
|
|
bd_page[index].CountUnit = item.CountUnit
|
|
bd_page[index].CountUnit = item.CountUnit
|
|
bd_page[index].PorderPrc = item.PurchPrc
|
|
bd_page[index].PorderPrc = item.PurchPrc
|
|
bd_page[index].StdPurchPrc = item.PurchPrc// override_amt_calc_txt_is_changed();
|
|
bd_page[index].StdPurchPrc = item.PurchPrc// override_amt_calc_txt_is_changed();
|
|
- if (hdPage['FirstThumb'] == '') {
|
|
|
|
|
|
+ bd_page[index].TurboThumb = item.TurboThumb
|
|
|
|
+
|
|
|
|
+ if (!ThumbArr) { // item 받아왔을 때만 bd_page에 TurboThumb 저장
|
|
bd_page[index].TurboThumb = item.TurboThumb
|
|
bd_page[index].TurboThumb = item.TurboThumb
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1169,9 +1167,14 @@
|
|
Btype.set_slip_no_btn_disabled()
|
|
Btype.set_slip_no_btn_disabled()
|
|
|
|
|
|
let hd_page = response.data.HdPage[0]
|
|
let hd_page = response.data.HdPage[0]
|
|
- hdPage = hd_page;
|
|
|
|
bd_page = response.data.BdPage ?? []
|
|
bd_page = response.data.BdPage ?? []
|
|
|
|
|
|
|
|
+ let thumb = response.data.HdPage[0]['FirstThumb']
|
|
|
|
+
|
|
|
|
+ if(!thumb){
|
|
|
|
+ ThumbArr = thumb;
|
|
|
|
+ }
|
|
|
|
+
|
|
$('#Id').val(hd_page.Id)
|
|
$('#Id').val(hd_page.Id)
|
|
$('#auto-slip-no-txt').val(hd_page.PorderNo)
|
|
$('#auto-slip-no-txt').val(hd_page.PorderNo)
|
|
$('#porder-date').val(moment(to_date(hd_page.PorderDate)).format('YYYY-MM-DD'))
|
|
$('#porder-date').val(moment(to_date(hd_page.PorderDate)).format('YYYY-MM-DD'))
|