|
@@ -353,11 +353,14 @@
|
|
Btype.get_storage_name_and_branch_name()
|
|
Btype.get_storage_name_and_branch_name()
|
|
let data = await Btype.get_slip_form_init()
|
|
let data = await Btype.get_slip_form_init()
|
|
// console.log(data)
|
|
// console.log(data)
|
|
- formB['SlipCommonSetup'] = data['SlipCommonSetup']
|
|
|
|
- await Btype.create_deal_type_select_box_options(data.DealTypePage)
|
|
|
|
- await Btype.create_vat_type_select_box_options(data.VatRatePage)
|
|
|
|
- await Btype.create_sgroup_select_box_options(data.SgroupPage)
|
|
|
|
- await create_etc_select_box_options(data)
|
|
|
|
|
|
+
|
|
|
|
+ slipInit = await Btype.get_slip_form_init()
|
|
|
|
+ // formB['SlipCommonSetup'] = data['SlipCommonSetup']
|
|
|
|
+ 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'])
|
|
$('#user-txt').val(window.User['NickName'])
|
|
|
|
|
|
if (formB['SlipCommonSetup']['IsLastSlipGet']) {
|
|
if (formB['SlipCommonSetup']['IsLastSlipGet']) {
|
|
@@ -373,7 +376,6 @@
|
|
$('#porder-table-body').on('click', 'tr', function() {
|
|
$('#porder-table-body').on('click', 'tr', function() {
|
|
// Find the input element with name="bd-cursor-state" within the clicked row
|
|
// Find the input element with name="bd-cursor-state" within the clicked row
|
|
const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
|
|
const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
|
|
- console.log('bdCursorStateInput : ', $bdCursorStateInput)
|
|
|
|
if ($bdCursorStateInput.length) {
|
|
if ($bdCursorStateInput.length) {
|
|
$($bdCursorStateInput).prop('checked', true)
|
|
$($bdCursorStateInput).prop('checked', true)
|
|
Btype.bd_cursor_click($bdCursorStateInput)
|
|
Btype.bd_cursor_click($bdCursorStateInput)
|
|
@@ -656,6 +658,21 @@
|
|
}
|
|
}
|
|
|
|
|
|
function get_parameter() {
|
|
function get_parameter() {
|
|
|
|
+ console.log('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 = ''
|
|
|
|
+
|
|
|
|
+ if (bd_page.length > 0) {
|
|
|
|
+ const first_porder = bd_page[0]
|
|
|
|
+ first_item = first_porder['ItemCode'] + '_' + first_porder['ItemName']
|
|
|
|
+ if (first_porder['SubName']) {
|
|
|
|
+ first_item += '_' + first_porder['SubName']
|
|
|
|
+ }
|
|
|
|
+ first_item += '(' + bd_page.length + ')'
|
|
|
|
+ }
|
|
|
|
+
|
|
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,
|
|
@@ -682,8 +699,19 @@
|
|
// Remarks: $('#remarks-preview').html(),
|
|
// Remarks: $('#remarks-preview').html(),
|
|
Remarks: $('#remarks-txt-area').val(),
|
|
Remarks: $('#remarks-txt-area').val(),
|
|
PayPeriod: '',
|
|
PayPeriod: '',
|
|
- 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']
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ console.log('parameter : ', parameter);
|
|
if (id < 0) {
|
|
if (id < 0) {
|
|
parameter = { Id: id }
|
|
parameter = { Id: id }
|
|
} else if (id > 0) {
|
|
} else if (id > 0) {
|
|
@@ -750,6 +778,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
function set_vat_type_rate($this, msg = true) {
|
|
function set_vat_type_rate($this, msg = true) {
|
|
|
|
+ console.log('set_vat_type_rate');
|
|
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 + '%')
|
|
|
|
|
|
@@ -1168,5 +1197,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
|