diff --git a/test/vuex/acc-beginning-balance/api/balance.js b/test/vuex/acc-beginning-balance/api/balance.js
new file mode 100644
index 0000000..13be0d6
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/api/balance.js
@@ -0,0 +1,164 @@
+const URL = "/one-api/mockup/masterdata/accounting/Beginingbalance";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + '/getPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function save(prm) {
+ try {
+ var resp = await axios.post(URL + '/save', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function addData(prm) {
+ try {
+ var resp = await axios.post(URL + '/addData', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function search(prm) {
+ try {
+ var resp = await axios.post(URL + '/search', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function cek(prm) {
+ try {
+ var resp = await axios.post(URL + '/cek', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function updateData(prm) {
+ try {
+ var resp = await axios.post(URL + '/updateData', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function deleteData(prm) {
+ try {
+ var resp = await axios.post(URL + '/delete', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoa(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function postData(prm) {
+ try {
+ var resp = await axios.post(URL + '/postData', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-beginning-balance/api/patient.js b/test/vuex/acc-beginning-balance/api/patient.js
new file mode 100644
index 0000000..918af7a
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/api/patient.js
@@ -0,0 +1,347 @@
+const URL = "/one-api/mockup/mcuoffline/";
+
+export async function search(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/search', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function generatesetup(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/generatesetup', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getsexreg(token) {
+ try {
+ var resp = await axios.post(URL + 'preregister/getsexreg',{token:token});
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function save(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/save',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function newpatient(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/newpatient',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function xdelete(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/deletepatient',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getaddress(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/getaddress',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchcity(token,prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/searchcity',{token:token,search:prm});
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
+
+ export async function getdistrict(token,prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/getdistrict',{id:prm.M_CityID,token:token});
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
+
+ export async function getkelurahan(token,prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/getkelurahan',{token:token,id:prm.M_DistrictID});
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
+
+
+export async function savenewaddress(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/savenewaddress',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function saveeditaddress(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/saveeditaddress',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function deleteaddress(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/deleteaddress',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+
+export async function searchdoctor(prm) {
+ try {
+ console.log('aye')
+ console.log(prm)
+ var resp = await axios.post(URL + 'preregister/searchdoctor',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
+
+ export async function searchcompany(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/searchcompany',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getmou(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/getmou',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
+
+ export async function savepreregister(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/savepreregister',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
+
+ export async function gotoreg(prm) {
+ try {
+ var resp = await axios.post(URL + 'preregister/gotoreg',prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch(e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+ }
\ No newline at end of file
diff --git a/test/vuex/acc-beginning-balance/components/VueCsvImport.vue b/test/vuex/acc-beginning-balance/components/VueCsvImport.vue
new file mode 100644
index 0000000..30a5058
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/components/VueCsvImport.vue
@@ -0,0 +1,293 @@
+
+
+
+
+
diff --git a/test/vuex/acc-beginning-balance/components/oneBalance.vue b/test/vuex/acc-beginning-balance/components/oneBalance.vue
new file mode 100644
index 0000000..73eee61
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/components/oneBalance.vue
@@ -0,0 +1,856 @@
+
+
+
+ {{ snackbar.msg }}
+
+ Close
+
+
+
+
+
+ ADD BEGINNING BALANCE
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+ Simpan
+
+
+
+
+
+
+
+ UPLOAD FILE BEGINNING BALANCE
+
+
+
+
+
+
+ load file
+
+
+
+
+
+
+
+
+ Cancel
+
+
+ Upload
+
+
+
+
+
+
+
+ {{ selectedData.keterangan }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Simpan
+
+
+
+
+
+ BEGINNING BALANCE
+
+
+
+ file_upload
+
+
+
+
+ add_box
+
+ POST DATA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Download template
+
+
+ file_download
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.number }}
+ {{ props.item.keterangan }}
+
+
+ {{ formatCurrency(props.item.value) }}
+
+
+ Rp. 0,00
+
+
+
+
+ {{ formatCurrency(props.item.value) }}
+
+
+ Rp. 0,00
+
+
+
+
+ edit
+
+
+ delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Total
+
+
+ {{ formatCurrency(summary.debit) }}
+
+
+ {{ formatCurrency(summary.credit) }}
+
+
+
+
+ Balance
+
+
+ {{ formatCurrency(summary.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-beginning-balance/components/oneMdPatientAddress.vue b/test/vuex/acc-beginning-balance/components/oneMdPatientAddress.vue
new file mode 100644
index 0000000..6b33d32
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/components/oneMdPatientAddress.vue
@@ -0,0 +1,397 @@
+
+
+
+
+
+ Konfirmasi
+
+
+ {{msgconfirmationdeleteaddr}}
+
+
+
+ Hapus
+ Batal
+
+
+
+
+
+
+ Form Alamat Pasien
+
+
+
+
+
+ Jangan kosong dong
+ Biarkan jadi yang utama
+
+
+
+
+
+
+
+
+
+
+
+ Jangan kosong dong
+
+
+
+ Jangan kosong dong
+
+
+
+ Jangan kosong dong
+
+
+
+
+
+ Jangan kosong dong
+
+
+
+
+
+
+ Tutup
+ Simpan
+ Simpan
+
+
+
+
+
+
+ ALAMAT PASIEN
+
+ Baru
+
+
+
+
+
+
+
+
+ delete
+ edit
+
+ {{ props.item.M_PatientAddressNote}}
+ {{ props.item.M_PatientAddressDescription}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-beginning-balance/components/oneMdPatientDetail.vue b/test/vuex/acc-beginning-balance/components/oneMdPatientDetail.vue
new file mode 100644
index 0000000..03055fd
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/components/oneMdPatientDetail.vue
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.Mcu_PreregisterDetailsPatientName }}
+ {{ props.item.dob }}
+ {{ props.item.Mcu_PreregisterDetailsM_SexCode }}
+ {{ props.item.Mcu_PreregisterDetailsNIK }}
+ {{ props.item.Mcu_PreregisterDetailsJabatan }}
+
+ DAFTARKAN
+ SEDANG DIPROSES
+ TELAH SELESAI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-beginning-balance/components/oneMdPatientList.vue b/test/vuex/acc-beginning-balance/components/oneMdPatientList.vue
new file mode 100644
index 0000000..f80d992
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/components/oneMdPatientList.vue
@@ -0,0 +1,543 @@
+
+
+
+
+ Berhasil !
+
+ {{ msgsuccess }}
+
+
+
+ OK
+
+
+
+
+
+
+
+
+
+
+
+
+
+ system_update_alt
+
+
+
+
+
+
+
+
+
+
+ SETUP : {{ xsetup.McuOfflinePrepareCode }}
+
+
+
+
+
+ {{ xsetup.M_CompanyName }}
+
+
+
+
+
+ Periode : {{ xsetup.start_date }} -
+ {{ xsetup.end_date }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AGREEMENT
+
+
+
+
+
+
+
+
+ {{ agreement.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JANJI HASIL
+
+
+
+ {{ xsetup.promise_date }} {{ xsetup.promise_time }}
+
+
+
+
+
+
+
+
+
+ download
+
+
+
+
+
+
+
+
+
+
+ silahkan download template di
+ sini
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-beginning-balance/csv-mcu.csv b/test/vuex/acc-beginning-balance/csv-mcu.csv
new file mode 100644
index 0000000..50c9710
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/csv-mcu.csv
@@ -0,0 +1,3 @@
+PID,NAMA,TANGGAL_LAHIR,JENIS_KELAMIN,NIK,JABATAN,EMAIL,HP,LOKASI,JOB,KEDUDUKAN
+,AA,12-09-2001,P,,GURU,,,,,
+,BB,14-01-1994,L,12.14.44.55,DIRKEU,,,,,
diff --git a/test/vuex/acc-beginning-balance/csv-mcu.xls b/test/vuex/acc-beginning-balance/csv-mcu.xls
new file mode 100644
index 0000000..83a809e
Binary files /dev/null and b/test/vuex/acc-beginning-balance/csv-mcu.xls differ
diff --git a/test/vuex/acc-beginning-balance/csv-mcu.xlsx b/test/vuex/acc-beginning-balance/csv-mcu.xlsx
new file mode 100644
index 0000000..b131b5a
Binary files /dev/null and b/test/vuex/acc-beginning-balance/csv-mcu.xlsx differ
diff --git a/test/vuex/acc-beginning-balance/index.php b/test/vuex/acc-beginning-balance/index.php
new file mode 100644
index 0000000..a384804
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/index.php
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-beginning-balance/modules/balance.js b/test/vuex/acc-beginning-balance/modules/balance.js
new file mode 100644
index 0000000..9781938
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/modules/balance.js
@@ -0,0 +1,411 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/balance.js"
+
+export default {
+ namespaced: true,
+ state: {
+ last_id: -1,
+ loading: false,
+ cek: false,
+ dataUpload: [],
+ status: 'N',
+ snackbar: {
+ state: false,
+ color: 'success',
+ msg: ''
+ },
+ periodeList: [
+ {
+ "id": '1', "name": "periode Januari", "periode": '01-01-2024 - 31-01-2024'
+ },
+ {
+ "id": '2', "name": "periode Februari", "periode": '01-02-2024 - 31-02-2024'
+ }
+ ],
+ selectedPeriode: {},
+ data: [
+ {
+ "number": '101101001',
+ "keterangan": 'Bank BCA 742-599-268899',
+ "value": '1500000',
+ "type": 'DB',
+ "input": 1
+ },
+ {
+ "number": '101101002',
+ "keterangan": 'Bank',
+ "value": '1500000',
+ "type": 'CR',
+ "input": 1
+ },
+ ],
+ summary: { debit: "1500000", credit: "1500000", balance: "1500000" },
+ dialogEdit: false,
+ dialogImport: false,
+ dialogAdd: false,
+ loadingAutocomplete: false,
+ coaList: [],
+ selectedCoa: {},
+ searchCoa: ''
+ },
+ mutations: {
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_selectedPeriode(state, val) {
+ state.selectedPeriode = val
+ },
+ update_data(state, val) {
+ state.data = val
+ },
+ update_dialogEdit(state, val) {
+ state.dialogEdit = val
+ },
+ update_dialogImport(state, val) {
+ state.dialogImport = val
+ },
+ update_summary(state, val) {
+ state.summary = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_cek(state, val) {
+ state.cek = val
+ },
+ update_dataUpload(state, val) {
+ state.dataUpload = val
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val
+ },
+ update_coaList(state, val) {
+ state.coaList = val
+ },
+ update_selectedCoa(state, val) {
+ state.selectedCoa = val
+ },
+ update_searchCoa(state, val) {
+ state.searchCoa = val
+ },
+ update_dialogAdd(state, val) {
+ state.dialogAdd = val
+ },
+ update_status(state, val) {
+ state.status = val
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let resp = await api.getPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ } else {
+ context.commit("update_loading", false)
+ context.commit("update_periodeList", resp.data)
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async addData(context, prm) {
+ context.commit("update_loading", true)
+ try {
+ prm.periode = context.state.selectedPeriode;
+ prm.token = one_token()
+ let resp = await api.addData(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.commit("update_loading", false)
+ context.dispatch("search");
+ context.commit("update_dialogAdd", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error add data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error add data')
+ }
+ },
+ async save(context, prm) {
+ context.commit("update_loading", true)
+ try {
+ prm.periode = context.state.selectedPeriode;
+ prm.token = one_token()
+ let resp = await api.save(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.commit("update_loading", false)
+ context.dispatch("search");
+ context.commit("update_dialogImport", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil simpan data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: "Error save"
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(e)
+ }
+ },
+ async postData(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let resp = await api.postData(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ context.commit("update_loading", false)
+ context.dispatch("search");
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil post data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: "Error post data"
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(e)
+ }
+ },
+ async search(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ context.commit("update_data", resp.data.data)
+ context.commit("update_summary", resp.data.total)
+ context.commit("update_selectedPeriode", resp.data.periode)
+ context.commit("update_status", resp.data.status)
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: "Error Search"
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(e)
+ }
+ },
+ async cek(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let resp = await api.cek(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let cek = 0;
+ if (parseInt(resp.data) > 0) {
+ cek = true
+ }
+ context.commit("update_cek", cek)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async updateData(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.updateData(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ // context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.dispatch("search")
+ context.commit("update_dialogEdit", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil update data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: "Error update data"
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(e)
+ }
+ },
+ async deleteData(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.deleteData(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ // context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil hapus data'
+ }
+ context.commit("update_snackbar", snackbar)
+ context.dispatch("search")
+ // context.commit("update_dialogEdit", false)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: "Error delete data"
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(e)
+ }
+ },
+ async searchCoa(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoa;
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+
+ context.commit("update_coaList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-beginning-balance/modules/patient.js b/test/vuex/acc-beginning-balance/modules/patient.js
new file mode 100644
index 0000000..6d8c114
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/modules/patient.js
@@ -0,0 +1,740 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/patient.js"
+
+export default {
+ namespaced: true,
+ state: {
+ last_id: -1,
+ last_saved_id: -1,
+ x_addr_id: 0,
+ act: 'edit',
+ act_addr: 'new',
+ get_data_status: 0,
+ search_patient: 0,
+ search_status: 0,
+ search_error_message: '',
+ norm: '',
+ patient_prefix: '',
+ patient_name: '',
+ patient_suffix: '',
+ titles: [],
+ selected_title: {},
+ dob: '',
+ patients: [],
+ total_patients: 0,
+ patient_address: [],
+ sexes: [],
+ selected_sex: {},
+ religions: [],
+ selected_religion: {},
+ phone: '',
+ hp: '',
+ email: '',
+ pob: '',
+ kartuidentitass: [],
+ selected_kartuidentitas: {},
+ noidentitas: '',
+ note: '',
+ nik: '',
+ jabatan: '',
+ kedudukan: '',
+ pj: '',
+ location: '',
+ job: '',
+ total_patient: 0,
+ selected_patient: {},
+ save_status: 0,
+ btn_save_seen: true,
+ pgrs_save: false,
+ save_error_message: '',
+ no_save: 0,
+ open_alert_confirmation: false,
+ alert_success: false,
+ msg_success: "",
+ dialog_success: false,
+ dialog_confirmation_delete: false,
+ msg_confirmation_delete: "",
+ dialog_confirmation_delete_addr: false,
+ msg_confirmation_delete_addr: "",
+ autocomplete_status: 0,
+ dialog_form_address: false,
+ label_address: '',
+ addresses: [],
+ cities: [],
+ city_address: {},
+ companies:[],
+ company:{},
+ mous:[],
+ mou:{},
+ doctors:[],
+ doctor:{},
+ districts: [],
+ district_address: {},
+ kelurahans: [],
+ kelurahan_address: {},
+ description_address: '',
+ errors: [],
+ current_page:1,
+ autocomplete_status:0,
+ status:{id:"N",name:"Belum di download"},
+ start_date:moment(new Date()).format('YYYY-MM-DD'),
+ end_date:moment(new Date()).format('YYYY-MM-DD'),
+ selected_mous:[],
+ selected_doctors:[],
+ xid:-1,
+ csv_json:[],
+ data_setup:{},
+ default_mu :{},
+ default_doctor:{},
+ setupcode:'',
+ search:''
+ },
+ mutations: {
+ update_search(state,val){
+ state.search = val
+ },
+ update_setupcode(state,val){
+ state.setupcode = val
+ },
+ update_default_mu(state,val){
+ state.default_mu = val
+ },
+ update_default_doctor(state,val){
+ state.default_doctor = val
+ },
+ update_data_setup(state,val){
+ state.data_setup = val
+ },
+ update_csv_json(state,val){
+ state.csv_json = val
+ },
+ update_xid(state,val){
+ state.xid = val
+ },
+ update_selected_doctors(state,val){
+ state.selected_doctors = val
+ },
+ update_selected_mous(state,val){
+ state.selected_mous = val
+ },
+ update_companies(state,val){
+ state.companies = val
+ },
+ update_company(state,val){
+ state.company = val
+ },
+ update_mous(state,val){
+ state.mous = val
+ },
+ update_mou(state,val){
+ state.mou = val
+ },
+ update_doctors(state,val){
+ state.doctors = val
+ },
+ update_doctor(state,val){
+ state.doctor = val
+ },
+ update_autocomplete_status(state,val){
+ state.autocomplete_status = val
+ },
+ update_start_date(state, val) {
+ state.start_date = val
+ },
+ update_end_date(state, val) {
+ state.end_date = val
+ },
+ update_status(state, val) {
+ state.status = val
+ },
+ update_current_page(state, val) {
+ state.current_page = val
+ },
+ update_x_addr_id(state, val) {
+ state.x_addr_id = val
+ },
+ update_last_id(state, val) {
+ state.last_id = val
+ },
+ update_last_saved_id(state, val) {
+ state.last_saved_id = val
+ },
+ update_act(state, val) {
+ state.act = val
+ },
+ update_act_addr(state, val) {
+ state.act_addr = val
+ },
+ update_get_data_status(state, val) {
+ state.get_data_status = val
+ },
+ update_search_error_message(state, patient) {
+ state.search_error_message = patient
+ },
+ update_search_patient(state, patient) {
+ state.search_patient = patient
+ },
+ update_dob(state, val) {
+ state.dob = val
+ },
+ update_patient_prefix(state, val) {
+ state.patient_prefix= val
+ },
+ update_patient_name(state, val) {
+ state.patient_name = val
+ },
+ update_patient_suffix(state, val) {
+ state.patient_suffix = val
+ },
+ update_norm(state, val) {
+ state.norm = val
+ },
+ update_titles(state, val) {
+ state.titles = val
+ },
+ update_selected_title(state, val) {
+ state.selected_title = val
+ },
+ update_patients(state, data) {
+ state.patients = data
+ },
+ update_selected_patient(state, val) {
+ state.selected_patient = val
+ },
+ update_sexes(state, val) {
+ state.sexes = val
+ },
+ update_selected_sex(state, val) {
+ state.selected_sex = val
+ },
+ update_religions(state, val) {
+ state.religions = val
+ },
+ update_selected_religion(state, val) {
+ state.selected_religion = val
+ },
+ update_phone(state, val) {
+ state.phone = val
+ },
+ update_email(state, val) {
+ state.email = val
+ },
+ update_pob(state, val) {
+ state.pob = val
+ },
+ update_hp(state, val) {
+ state.hp = val
+ },
+ update_kartuidentitass(state, val) {
+ state.kartuidentitass = val
+ },
+ update_selected_kartuidentitas(state, val) {
+ state.selected_kartuidentitas = val
+ },
+ update_noidentitas(state, val) {
+ state.noidentitas = val
+ },
+ update_note(state, val) {
+ state.note = val
+ },
+ update_nik(state, val) {
+ state.nik = val
+ },
+ update_jabatan(state, val) {
+ state.jabatan = val
+ },
+ update_kedudukan(state, val) {
+ state.kedudukan = val
+ },
+ update_pj(state, val) {
+ state.pj = val
+ },
+ update_location(state, val) {
+ state.location = val
+ },
+ update_job(state, val) {
+ state.job = val
+ },
+ update_save_status(state, val) {
+ state.save_status = val
+ },
+ update_btn_save_seen(state, val) {
+ state.btn_save_seen = val
+ },
+ update_pgrs_save(state, val) {
+ state.pgrs_save = val
+ },
+ update_save_error_message(state, msg) {
+ state.save_error_message = ''
+ },
+ update_no_save(state, val) {
+ state.no_save = val
+ },
+ update_open_alert_confirmation(state, val) {
+ state.open_alert_confirmation = val
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val
+ },
+ update_dialog_success(state, val) {
+ state.dialog_success = val
+ },
+ update_dialog_confirmation_delete(state, val) {
+ state.dialog_confirmation_delete = val
+ },
+ update_msg_confirmation_delete(state, val) {
+ state.msg_confirmation_delete = val
+ },
+ update_dialog_confirmation_delete_addr(state, val) {
+ state.dialog_confirmation_delete_addr = val
+ },
+ update_msg_confirmation_delete_addr(state, val) {
+ state.msg_confirmation_delete_addr = val
+ },
+ update_addresses(state, val) {
+ state.addresses = val
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val
+ },
+ update_dialog_form_address(state, val) {
+ state.dialog_form_address = val
+ },
+ update_label_address(state, val) {
+ state.label_address = val
+ },
+ update_cities(state, val) {
+ state.cities = val
+ },
+ update_city_address(state, val) {
+ state.city_address = val
+ },
+ update_districts(state, val) {
+ state.districts = val
+ },
+ update_district_address(state, val) {
+ state.district_address = val
+ },
+ update_kelurahans(state, val) {
+ state.kelurahans = val
+ },
+ update_kelurahan_address(state, val) {
+ state.kelurahan_address = val
+ },
+ update_description_address(state, val) {
+ state.description_address = val
+ },
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_errors(state, val) {
+ state.errors = val
+ },
+ update_total_patients(state, val) {
+ state.total_patients = val
+ },
+ update_total_patient(state, val) {
+ state.total_patient = val
+ }
+ },
+ actions: {
+ async generatesetup(context,prm) {
+ context.commit("update_get_data_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.generatesetup(prm)
+ if (resp.status != "OK") {
+ context.commit("update_get_data_status", 3)
+ } else {
+ context.commit("update_get_data_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ console.log(resp.data.records)
+ context.commit("update_data_setup", resp.data.records)
+ context.commit("update_setupcode", '')
+ context.commit("update_current_page", 1)
+ //context.commit("update_patients", data.records['patients'])
+ context.dispatch("search", {
+ search:'',
+ xid:context.state.data_setup.McuOfflinePrepareID,
+ current_page: 1,
+ lastid: -1
+ })
+ }
+ } catch (e) {
+ context.commit("update_get_data_status", 3)
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_patient", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_patient", 3)
+ context.commit("update_search_error_message", resp.message)
+ } else {
+ context.commit("update_search_patient", 2)
+ context.commit("update_search_error_message", "")
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_patients", data.records)
+ context.commit("update_total_patient", data.total)
+ context.commit("update_no_save", 0)
+
+ //context.commit("update_data_setup", resp.data.setup)
+
+ }
+ } catch (e) {
+ context.commit("update_search_patient", 3)
+ context.commit("update_search_error_message", e.message)
+ console.log(e)
+ }
+ },
+ async getsexreg(context) {
+ context.commit("update_get_data_status", 1)
+ try {
+ let resp = await api.getsexreg(one_token())
+ if (resp.status != "OK") {
+ context.commit("update_get_data_status", 3)
+ } else {
+ context.commit("update_get_data_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_sexes", data.records.sexes)
+ context.commit("update_religions", data.records.religions)
+ context.commit("update_titles", data.records.titles)
+ context.commit("update_kartuidentitass", data.records.kartuidentitass)
+ }
+ } catch (e) {
+ context.commit("update_get_data_status", 3)
+ }
+ },
+ async savecsv(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.save(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ //location.reload()
+ context.dispatch("search", {
+ search:'',
+ xid:context.state.data_setup.McuOfflinePrepareID,
+ current_page: 1,
+ lastid: -1
+ })
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async gotoreg(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.gotoreg(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ var pre_id = prm.Mcu_PreregisterDetailsID
+ location.replace("/one-ui/test/vuex/one-fo-registration-v8/" + "?pre_id=" +pre_id)
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async newpatient(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.newpatient(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ console.log(resp.data.id)
+ context.commit("update_last_id", resp.data.id)
+ context.commit("update_dialog_success", true)
+ var msg = "Data pasien " + prm.M_PatientName + " sudah tersimpan dong ..."
+ context.commit("update_msg_success", msg)
+
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async delete(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.xdelete(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_last_id", 0)
+ context.commit("update_dialog_confirmation_delete", false)
+ context.commit("update_dialog_success", true)
+ var msg = "Data setup " + prm.code + " sudah dihapus dong ..."
+ context.commit("update_msg_success", msg)
+ context.commit("update_company", {})
+ context.commit("update_selected_mous", [])
+ context.commit("update_mou", {})
+ context.commit("update_selected_doctors", [])
+ context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
+ context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
+ context.commit("update_default_mou", {})
+ context.commit("update_default_doctor", {})
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async getaddress(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.getaddress(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_addresses", data.records)
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async savesetup(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.savesetup(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_company", {})
+ context.commit("update_selected_mous", [])
+ context.commit("update_mou", {})
+ context.commit("update_selected_doctors", [])
+ context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
+ context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
+ context.commit("update_default_mou", {})
+ context.commit("update_default_doctor", {})
+ context.commit("update_dialog_success", true)
+ if(context.state.act === 'new')
+ var msg = "Pembuatan setup nomor " + resp.data.records.xnumber + " sudah berhasil dong ..."
+ else
+ var msg = "Perubahan setup nomor " + resp.data.records.xnumber + " sudah berhasil dong ..."
+
+ context.commit("update_msg_success", msg)
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async searchcity(context, prm) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let resp = await api.searchcity(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3)
+ } else {
+ context.commit("update_autocomplete_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_cities", resp.data.records)
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3)
+ }
+ },
+ async searchdoctor(context,prm) {
+ context.commit("update_autocomplete_status",1)
+ try {
+ var xpar = {}
+ xpar.search = prm
+ xpar.token = one_token()
+ let resp= await api.searchdoctor(xpar)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status",3)
+ } else {
+ context.commit("update_autocomplete_status",2)
+ let data = {
+ records : resp.data.records,
+ total: resp.data.total
+ }
+ var arr = resp.data.records
+ var xsel = context.state.selected_doctors
+ var filtered = arr.filter(o1 => xsel.filter(o2 => o2.id === o1.id).length === 0)
+ context.commit("update_doctors",filtered)
+ }
+ } catch(e) {
+ context.commit("update_autocomplete_status",3)
+ }
+ },
+ async searchcompany(context,prm) {
+ context.commit("update_autocomplete_status",1)
+ try {
+ prm.token = one_token()
+
+ let resp= await api.searchcompany(prm)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status",3)
+ } else {
+ context.commit("update_autocomplete_status",2)
+ let data = {
+ records : resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_companies",resp.data.records)
+ }
+ } catch(e) {
+ context.commit("update_autocomplete_status",3)
+ }
+ },
+ async getdistrict(context, prm) {
+ context.commit("update_get_data_status", 1)
+ try {
+ let resp = await api.getdistrict(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_get_data_status", 3)
+ } else {
+ context.commit("update_get_data_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_districts", resp.data.records)
+ }
+ } catch (e) {
+ context.commit("update_get_data_status", 3)
+ }
+ },
+ async getkelurahan(context, prm) {
+ context.commit("update_get_data_status", 1)
+ try {
+ let resp = await api.getkelurahan(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_get_data_status", 3)
+ } else {
+ context.commit("update_get_data_status", 2)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_kelurahans", resp.data.records)
+ }
+ } catch (e) {
+ context.commit("update_get_data_status", 3)
+ }
+ },
+ async savenewaddress(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.savenewaddress(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_dialog_form_address", false)
+ context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
+ context.commit("update_dialog_success", true)
+ var msg = "Penambahan data alamat pasien " + prm.M_PatientName + " sudah berhasil dong ..."
+ context.commit("update_msg_success", msg)
+
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async saveeditaddress(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.saveeditaddress(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_dialog_form_address", false)
+ context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
+ context.commit("update_dialog_success", true)
+ var msg = "Perubahan data alamat pasien " + prm.M_PatientName + " sudah berhasil dong ..."
+ context.commit("update_msg_success", msg)
+
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async deleteaddress(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.deleteaddress(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_dialog_confirmation_delete_addr", false)
+ context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
+ context.commit("update_dialog_success", true)
+ var msg = "Penghapusan data alamat " + prm.M_PatientAddressNote + " dari pasien " + prm.M_PatientName + " sudah berhasil dong ..."
+ context.commit("update_msg_success", msg)
+
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ }
+ },
+ async getmou(context,prm) {
+ context.commit("update_lookup_order",1)
+ try {
+ prm.token = one_token()
+ let resp= await api.getmou(prm)
+ if (resp.status != "OK") {
+ context.commit("update_lookup_order",3)
+ } else {
+ context.commit("update_lookup_order",2)
+ let data = {
+ records : resp.data.records,
+ total: resp.data.total
+ }
+ context.commit("update_mous",resp.data.records)
+ context.commit("update_mou",{})
+ context.commit("update_selected_mous",[])
+ }
+ } catch(e) {
+ context.commit("update_lookup_order",3)
+ }
+ },
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-beginning-balance/store.js b/test/vuex/acc-beginning-balance/store.js
new file mode 100644
index 0000000..67dd03e
--- /dev/null
+++ b/test/vuex/acc-beginning-balance/store.js
@@ -0,0 +1,29 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import patient from "./modules/patient.js";
+import system from "../../../apps/modules/system/system.js";
+import balance from "./modules/balance.js";
+export const store = new Vuex.Store({
+ modules: {
+ // patient: patient,
+ balance: balance,
+ system: system
+ },
+ state: {
+ tab_selected: 'pasien-dokter'
+ },
+ mutations: {
+ change_tab(state, ntab) {
+ state.tab_selected = ntab
+ }
+ },
+ actions: {
+ change_tab(context, ntab) {
+ context.commit('change_tab', ntab)
+ }
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-inventaris/api/po.js b/test/vuex/acc-one-approve-po-inventaris/api/po.js
new file mode 100644
index 0000000..7b86af1
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/api/po.js
@@ -0,0 +1,293 @@
+const URL = "/one-api/mockup/purchase/order/PurchaseOrderInventaris/";
+const URLRO = "/one-api/mockup/receive-item-po/receiveitempo/";
+
+export async function getSupplier(payload) {
+ try {
+ var response = await axios.post(URL + "getSupplier", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getItemCategory(payload) {
+ try {
+ var response = await axios.post(URL + "getItemCategory", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getWarehouse(payload) {
+ try {
+ var response = await axios.post(URL + "getWarehouse", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getItem(payload) {
+ try {
+ var response = await axios.post(URL + "getItem", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getItemUpdate(payload) {
+ try {
+ var response = await axios.post(URL + "getItemUpdate", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function saveOrder(payload) {
+ try {
+ var response = await axios.post(URL + "saveOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function search(payload) {
+ try {
+ var response = await axios.post(URL + "search", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function requestOrder(payload) {
+ try {
+ var response = await axios.post(URL + "requestOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function deleteOrder(payload) {
+ try {
+ var response = await axios.post(URL + "deleteOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function updateOrder(payload) {
+ try {
+ var response = await axios.post(URL + "updateOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function approvePOrder(payload) {
+ try {
+ var response = await axios.post(URL + "approvePOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function isValidMultipleWarehouse(payload) {
+ try {
+ var response = await axios.post(URL + "isValidMultipleWarehouse", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function generateItemPO(params) {
+ try {
+ var response = await axios.post(URLRO + "generateItemPo", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getApprovalLevel(params) {
+ try {
+ var response = await axios.post(URL + 'getApproveLevel', params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getDefaultSupplierPrice(payload) {
+ try {
+ var response = await axios.post(URL + "getDefaultSupplierPrice", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-inventaris/components/dialogView.vue b/test/vuex/acc-one-approve-po-inventaris/components/dialogView.vue
new file mode 100644
index 0000000..9c015e1
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/components/dialogView.vue
@@ -0,0 +1,595 @@
+
+
+
+
+
+
+ DETAIL PURCHASE ORDER {{ selectedPO.PurchaseOrderNumber ?? "" }}
+
+
+
+
+
+
+
+
+
+ Nomor PO
+
+
+
+
+ : {{ selectedPO.PurchaseOrderNumber }}
+
+
+
+
+
+ Tanggal
+
+
+
+
+ : {{ selectedPO.DisplayDate }}
+
+
+
+
+
+
+ Nomor Referensi
+
+
+
+
+ : {{ selectedPO.PurchaseOrderRefNumber }}
+
+
+
+
+
+
+ Pajak Pendapatan (PPN):
+
+
+
+
+ : {{ selectedPO.PurchaseOrderTaxPercentPpn }}%
+ : Rp {{ selectedPO.PurchaseOrderTaxAmountPpn }}
+ : -
+
+
+
+
+
+
+ Pajak Penghasilan (PPH)
+
+
+
+
+ : {{ selectedPO.PurchaseOrderTaxPercentPph }}%
+
+
+
+
+
+
+ Vendor
+
+
+
+
+ : {{ selectedPO.SupplierCode }}
+ {{ selectedPO.SupplierName }}
+
+
+
+
+
+
+
+ Diskon Vendor(Tipe Diskon)
+
+
+
+
+ : {{ selectedPO.PurchaseOrderDiscountPercent }}% (Percentage)
+ : Rp {{ selectedPO.PurchaseOrderDiscountAmount }} (Absolut)
+ : - (-)
+
+
+
+
+
+
+ Jangka Waktu Pembayaran
+
+
+
+
+ : {{ selectedPO.PurchaseOrderPaymentTerm }} hari
+
+
+
+
+
+
+ Tipe Gudang
+
+
+
+
+
+ : {{ selectedPO.PurchaseOrderWarehouseType }}
+
+
+
+
+
+
+ Gudang
+
+
+
+
+ : {{ selectedPO.WarehouseName }}
+
+
+
+
+
+
+ Biaya Ekspedisi
+
+
+
+
+ : {{ selectedPO && selectedPO.PurchaseOrderShippingCost != null
+ ? oneMoney(selectedPO.PurchaseOrderShippingCost) : '0' }}
+ Sudah dibayar
+
+ Belum dibayar
+
+
+
+
+
+
+
+
+ Keterangan
+
+
+
+
+ : {{ selectedPO.PurchaseOrderNote }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ props.expanded
+ ? "keyboard_arrow_down"
+ : "keyboard_arrow_right"
+ }}
+
+
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+
+
+ {{ props.item.TotalPoQty }} {{ props.item.PoItemUnitName }}
+
+
+ {{ oneMoney(props.item.RealPrice) }}
+
+
+
+ {{ oneMoney(props.item.discount) }}
+
+
+ {{ props.item.discount }}%
+ {{ oneMoney(props.item.summaryDiscountAmount) }}
+
+
+
+ {{ oneMoney(props.item.Price) }}
+
+
+ {{ oneMoney(props.item.Total) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ detailProps.item.M_ItemCode }}
+
+ {{ detailProps.item.M_ItemDesc }}
+
+
+ {{
+ detailProps.item.PurchaseRequestNumber
+ }}
+
+
+ {{
+ detailProps.item.M_BranchName ??
+ detailProps.item.S_RegionalName
+ }}
+
+
+ {{ detailProps.item.warehouse.WarehouseName }}
+
+
+ {{ detailProps.item.PoQty }}
+ {{ detailProps.item.PoItemUnitName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ TOTAL HARGA TANPA DISKON
+
+
+ {{
+ selectedPO && selectedPO.TotalRealPrice != null
+ ? oneMoney(selectedPO.TotalRealPrice) : '0'
+ }}
+
+
+
+
+ TOTAL DISKON PER ITEM
+
+
+ {{
+ selectedPO && selectedPO.TotalDiskonPerItem != null
+ ? oneMoney(selectedPO.TotalDiskonPerItem) : '0'
+ }}
+
+
+
+
+ DISKON VENDOR
+
+
+ {{
+ selectedPO && selectedPO.DiscountAmount != null
+ ? oneMoney(selectedPO.DiscountAmount) : '0'
+ }}
+
+
+
+
+ PAJAK PENDAPATAN(PPN)
+
+
+ {{
+ selectedPO && selectedPO.PurchaseOrderTaxAmountPpn != null
+ ? oneMoney(selectedPO.PurchaseOrderTaxAmountPpn) : '0'
+ }}
+
+
+
+
+ PAJAK PENGHASILAN(PPH)
+
+
+ {{
+ selectedPO && selectedPO.PurchaseOrderTaxAmountPph != null
+ ? oneMoney(selectedPO.PurchaseOrderTaxAmountPph) : '0'
+ }}
+
+
+
+
+ PAJAK
+
+
+ {{ selectedPO && selectedPO.TaxAmount != null
+ ? oneMoney(selectedPO.TaxAmount) : '0' }}
+
+
+
+
+ TOTAL
+
+
+ {{
+ selectedPO && selectedPO.PurchaseOrderGrandTotal != null
+ ? oneMoney(selectedPO.PurchaseOrderGrandTotal) : '0'
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-approve-po-inventaris/components/po.vue b/test/vuex/acc-one-approve-po-inventaris/components/po.vue
new file mode 100644
index 0000000..2951f22
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/components/po.vue
@@ -0,0 +1,713 @@
+
+
+
+
+
+ KONFIRMASI
+
+
+
+ Apakah anda yakin untuk menghapus
+ {{
+ selectedPO.PurchaseOrderNumber
+ }}
+ ??
+
+
+
+
+
+
+
+ Tidak
+
+
+ Ya
+
+
+
+
+
+
+
+
+ KONFIRMASI
+
+
+
+ Apakah anda yakin untuk mengunci
+ {{
+ selectedPO.PurchaseOrderNumber
+ }}
+ untuk melanjutkan ke proses approve?
+
+ *Setelah dikunci PO tidak dapat di edit
+
+
+
+
+
+
+
+
+ Tidak
+
+
+ Ya
+
+
+
+
+
+
+ {{ snackbar.message }}
+
+ Close
+
+
+
+
+ PURCHASE ORDER APPROVE INVENTARIS
+
+
+ arrow_back Back
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseOrderNumber }}
+ {{ props.item.PurchaseOrderDate }}
+ {{ props.item.SupplierName }}
+
+
+ {{ props.item.PurchaseOrderWarehouseType }}
+
+
+ {{ props.item.WarehouseName }}
+
+
+ {{ props.item.PurchaseOrderNote }}
+
+ Rp. {{ props.item.PurchaseOrderGrandTotal != null ? oneMoney(props.item.PurchaseOrderGrandTotal) : '0' }}
+
+
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{ props.item.PurchaseOrderStatus }}
+
+
+
+
+
+
+
+ {{ props.item.PurchaseOrderApprovedManagerUserID == '0' ? 'Approve (Manager)' : 'Approved (Manager)'}}
+ done_all
+
+
+
+ Approve (Kepala Reg)
+ done
+
+
+
+
+
+ visibility
+
+
+ View PO
+
+
+
+
+
+ edit
+
+
+ Edit PO
+
+
+
+
+
+
+
+ visibility
+
+
+ View PO
+
+
+
+
+
+ picture_as_pdf
+
+
+ PDF PO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-approve-po-inventaris/components/poForm.vue b/test/vuex/acc-one-approve-po-inventaris/components/poForm.vue
new file mode 100644
index 0000000..c8e34e0
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/components/poForm.vue
@@ -0,0 +1,1796 @@
+
+
+
+
+
+
+ TAMBAH ITEM
+
+
+
+
+
+
+
+
+
+
+
+ {{ header.text }}
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseRequestNumber }}
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+ {{ props.item.M_BranchName ?? props.item.S_RegionalName }}
+
+
+ {{ props.item.PoItemUnitName }}
+
+
+ {{ props.item.RequestQty }} {{ props.item.ReqItemUnitName }}
+
+
+ {{ props.item.RemainingQty }} {{ props.item.ReqItemUnitName }}
+
+
+
+
+
+
+
+ warning
+ {{ props.item.UnitReqPoConvertMsg }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ header.text }}
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseRequestNumber }}
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+ {{ props.item.M_BranchName ?? props.item.S_RegionalName }}
+
+
+ {{ props.item.PoItemUnitName }}
+
+
+ {{ props.item.RequestQty }} {{ props.item.ReqItemUnitName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Tambahkan
+
+
+
+
+
+
+
+
+
+ FORM PURCHASE ORDER INVENTARIS
+
+
+ {{ selectedPO.PurchaseOrderNumber ?? "" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ isValidMultipleWarehouse.message }}
+
+
+
+
+
+
+
+ TAMBAHKAN ITEM
+
+
+
+
+
+
+
+
+
+ {{
+ props.expanded
+ ? "keyboard_arrow_down"
+ : "keyboard_arrow_right"
+ }}
+
+
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+
+ {{ props.item.TotalPoQty }}
+ {{ props.item.PoItemUnitName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ Rp
+
+
+ %
+
+
+
+
+
+ Rupiah
+
+
+ Percent
+
+
+
+
+
+
+
+
+ {{ oneMoney(props.item.Price) }}
+
+
+ {{ oneMoney(props.item.Total) }}
+
+
+
+
+ delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ detailProps.item.M_ItemCode }}
+ {{ detailProps.item.M_ItemDesc }}
+
+
+ {{
+ detailProps.item.PurchaseRequestNumber
+ }}
+
+
+ {{
+ detailProps.item.RequesterBranchName
+ }}
+
+
+ {{
+ detailProps.item.M_BranchName ??
+ detailProps.item.S_RegionalName
+ }}
+
+
+
+ {{ detailProps.item.warehouse.WarehouseName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EDIT QTY
+
+
+ SPLIT PR
+
+
+
+
+
+ Edit QTY
+
+
+ Split PR
+
+
+
+
+
+
+
+
+ {{ detailProps.item.PoItemUnitName }}
+
+
+
+ delete
+
+
+
+
+
+
+
+
+
+
+
+
+ JUMLAH
+
+
+ {{ oneMoney(summaryTotal.total) }}
+
+
+
+
+ DISKON
+
+
+ {{ oneMoney(summaryTotal.discount) }}
+
+
+
+
+
+ PAJAK PENDAPATAN(PPN) {{ taxPpn }}%
+
+
+ PAJAK PENDAPATAN(PPN)
+
+
+
+ {{ oneMoney(summaryTotal.ppn) }}
+
+
+
+
+ PAJAK PENGHASILAN(PPH) {{ taxPph }}%
+
+
+ {{ oneMoney(summaryTotal.pph) }}
+
+
+
+
+ PAJAK
+
+
+ {{ oneMoney(summaryTotal.tax) }}
+
+
+
+
+ TOTAL
+
+
+ {{
+ oneMoney(summaryTotal.finalTotal)
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BATAL
+
+
+ SIMPAN
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-approve-po-inventaris/functions/functions.js b/test/vuex/acc-one-approve-po-inventaris/functions/functions.js
new file mode 100644
index 0000000..d0c94cc
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/functions/functions.js
@@ -0,0 +1,411 @@
+/**
+ * Utility functions for the ACC One Purchase Order application
+ */
+
+// /**
+// * Groups an array of objects by a specified key
+// * @param {Array} array - The array of objects to group
+// * @param {String} key - The key to group by
+// * @returns {Object} - An object with keys representing the grouped values and arrays as values
+// */
+// export const groupBy = (array, key) => {
+// return array.reduce((result, item) => {
+// const groupKey = item[key];
+// if (!result[groupKey]) {
+// result[groupKey] = [];
+// }
+// result[groupKey].push(item);
+// return result;
+// }, {});
+// };
+/**
+ * Groups an array of objects by one or multiple keys
+ * @param {Array} array - The array of objects to group
+ * @param {Function|String|Array} key - The key(s) to group by. Can be a string, array of strings, or a function.
+ * @returns {Object} - An object with keys representing the grouped values and arrays as values
+ */
+export const groupBy = (array, key) => {
+ return array.reduce((result, item) => {
+ let groupKey;
+
+ // Handle single key (string), multiple keys (array), or custom function
+ if (typeof key === 'function') {
+ groupKey = key(item);
+ } else if (Array.isArray(key)) {
+ groupKey = key.map(k => item[k]).join('_'); // Combine multiple keys with underscore
+ } else {
+ groupKey = item[key];
+ }
+
+ if (!result[groupKey]) {
+ result[groupKey] = [];
+ }
+ result[groupKey].push(item);
+ return result;
+ }, {});
+};
+
+/**
+ * Groups purchase request data by M_ItemID
+ * Terjadi jika ada beberapa item yang sama, maka akan digabungkan berdasarkan M_ItemID dan PoItemUnitID
+ * @param {Array} purchaseRequestData - Array of purchase request objects
+ * @returns {Array} - Array of objects with M_ItemID, M_ItemCode, M_ItemDesc, unit information, converted PoQty, and Details array
+ */
+export const groupPurchaseRequestsByItemId = (purchaseRequestData) => {
+ const grouped = groupBy(purchaseRequestData, ['M_ItemID', 'PoItemUnitID']);
+ // console.log("grouped");
+ // console.log(grouped);
+
+ return Object.keys(grouped).map(itemId => {
+ const items = grouped[itemId];
+ const firstItem = items[0];
+
+ /* Sebelum Kalkulasi Konversi Item di BE */
+ // // Calculate total PoQty from all items
+ // const totalPoQty = calculateTotalQuantity(items, 'PoQty');
+ // // Get the conversion factor from the first item
+ // const conversionFactor = Number(firstItem.DefaultPurchase.UnitConvertAmount) || 1;
+ // // Convert the total quantity and round up if it's a decimal
+ // const convertedPoQty = Math.ceil(convertUnits(totalPoQty, conversionFactor));
+
+ /* Sesudah Kalkulasi Konversi Item di BE getItem() */
+ const totalPoQty = calculateTotalQuantity(items, 'PoQty')
+ // console.log("Total PoQty for itemId", itemId, " : ", totalPoQty);
+
+ // get price real or default supplier price
+ const realPrice = Number(firstItem.RealPrice ?? firstItem.DefaultPurchase.SupplierPricePrice) || 0;
+
+ // let price = 0;
+
+ // calculagte price after discount
+ let priceAfterDiscount = realPrice;
+
+ if (parseFloat(firstItem.discount) > 0) {
+ if (firstItem.discountType === 'P') {
+ priceAfterDiscount = realPrice - (Number(firstItem.discount) * (realPrice / 100));
+ }
+ if (firstItem.discountType === 'R') {
+ priceAfterDiscount = realPrice - Number(firstItem.discount);
+ }
+
+ } else {
+ priceAfterDiscount = realPrice || 0;
+ }
+
+ // Get the price from the first item
+ // const realPrice = Number(firstItem.DefaultPurchase.SupplierPricePrice) || 0;
+
+ // Calculate the total (PoQty * priceAfterDiscount)
+ const total = totalPoQty * priceAfterDiscount;
+
+ const itemParts = itemId.split('_');
+ const M_ItemID = itemParts[0];
+
+ return {
+ keyID: itemId,
+ M_ItemID: M_ItemID,
+ PurchaseOrderID: firstItem.PurchaseOrderID ?? 0,
+ PurchaseOrderSummaryID: firstItem.PurchaseOrderSummaryID ?? 0,
+ M_ItemCode: firstItem.M_ItemCode,
+ M_ItemDesc: firstItem.M_ItemDesc,
+ discount: firstItem.discount,
+ discountType: firstItem.discountType,
+ PoItemUnitID: firstItem.DefaultPurchase.ItemUnitID,
+ ItemUnitCode: firstItem.DefaultPurchase.ItemUnitCode,
+ PoItemUnitName: firstItem.DefaultPurchase.ItemUnitName,
+ TotalPoQty: totalPoQty,
+ Price: priceAfterDiscount,
+ RealPrice: realPrice,
+ PriceAfterDiscount: priceAfterDiscount,
+ Total: total,
+ Details: items
+ };
+ });
+};
+
+/**
+ * Formats a number as currency (IDR)
+ * @param {Number} amount - The amount to format
+ * @returns {String} - Formatted currency string
+ */
+export const formatCurrency = (amount) => {
+ return new Intl.NumberFormat('id-ID', {
+ style: 'currency',
+ currency: 'IDR',
+ minimumFractionDigits: 0
+ }).format(amount);
+};
+
+/**
+ * Formats a date to a localized string
+ * @param {Date|String} date - The date to format
+ * @param {Object} options - Intl.DateTimeFormat options
+ * @returns {String} - Formatted date string
+ */
+export const formatDate = (date, options = {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+}) => {
+ if (!date) return '';
+ const dateObj = typeof date === 'string' ? new Date(date) : date;
+ return new Intl.DateTimeFormat('id-ID', options).format(dateObj);
+};
+
+/**
+ * Calculates the total value of purchase requests
+ * @param {Array} items - Array of purchase request items
+ * @returns {Number} - Total value
+ */
+export const calculateTotal = (items) => {
+ return items.reduce((sum, item) => sum + (Number(item.Total) || 0), 0);
+};
+
+/**
+ * Calculates the total quantity of items
+ * @param {Array} items - Array of purchase request items
+ * @param {String} qtyField - The field name containing quantity (e.g., 'PoQty')
+ * @returns {Number} - Total quantity
+ */
+export const calculateTotalQuantity = (items, qtyField = 'PoQty') => {
+ // console.log("Items in calculateTotalQuantity:", items);
+ return items.reduce((sum, item) => sum + (Number(item[qtyField]) || 0), 0);
+};
+
+/**
+ * Converts units based on the conversion factor
+ * @param {Number} quantity - The quantity to convert
+ * @param {Number} conversionFactor - The conversion factor
+ * @returns {Number} - Converted quantity
+ */
+export const convertUnits = (quantity, conversionFactor) => {
+ return quantity / conversionFactor;
+};
+
+/**
+ * Filters purchase requests by branch
+ * @param {Array} items - Array of purchase request items
+ * @param {String|Array} branchCodes - Branch code(s) to filter by
+ * @returns {Array} - Filtered items
+ */
+export const filterByBranch = (items, branchCodes) => {
+ if (!branchCodes) return items;
+
+ const codes = Array.isArray(branchCodes) ? branchCodes : [branchCodes];
+ return items.filter(item => codes.includes(item.BranchCode));
+};
+
+/**
+ * Filters purchase requests by regional
+ * @param {Array} items - Array of purchase request items
+ * @param {String|Array} regionalIds - Regional ID(s) to filter by
+ * @returns {Array} - Filtered items
+ */
+export const filterByRegional = (items, regionalIds) => {
+ if (!regionalIds) return items;
+
+ const ids = Array.isArray(regionalIds) ? regionalIds : [regionalIds];
+ return items.filter(item => ids.includes(item.S_RegionalID));
+};
+
+/**
+ * Validates if a purchase request item has all required fields
+ * @param {Object} item - Purchase request item
+ * @returns {Boolean} - True if valid, false otherwise
+ */
+export const validatePurchaseRequestItem = (item) => {
+ const requiredFields = [
+ 'M_ItemID',
+ 'M_ItemCode',
+ 'M_ItemDesc',
+ 'Price',
+ 'RequestQty'
+ ];
+
+ return requiredFields.every(field => item[field] !== undefined && item[field] !== null);
+};
+
+/**
+ * Sorts purchase request items by a specified field
+ * @param {Array} items - Array of purchase request items
+ * @param {String} field - Field to sort by
+ * @param {Boolean} ascending - Sort direction (true for ascending, false for descending)
+ * @returns {Array} - Sorted items
+ */
+export const sortPurchaseRequests = (items, field = 'M_ItemDesc', ascending = true) => {
+ return [...items].sort((a, b) => {
+ const valueA = a[field];
+ const valueB = b[field];
+
+ if (typeof valueA === 'string' && typeof valueB === 'string') {
+ return ascending
+ ? valueA.localeCompare(valueB)
+ : valueB.localeCompare(valueA);
+ }
+
+ return ascending
+ ? (valueA - valueB)
+ : (valueB - valueA);
+ });
+};
+
+/**
+ * Validates purchase order data before saving
+ * @param {Object} context - Vuex context object
+ * @returns {Boolean} - Returns true if validation passes, false otherwise
+ */
+export const validatePurchaseOrder = (context) => {
+ if (context.state.loading) {
+ let snackbar = {
+ state: true,
+ type: "warning",
+ message: 'Loading sedang berlangsung harap menunggu ...',
+ };
+ context.commit("update_snackbar", snackbar);
+ return false;
+ }
+
+ let warningMsg = [];
+ if (context.state.selectedItem.length == 0) {
+ warningMsg.push('Belum memilih item');
+ }
+ if (!context.state.refNumber || context.state.refNumber.trim() === '') {
+ warningMsg.push('Nomor Referensi belum diisi');
+ }
+ if (!context.state.selectedWarehouse || !context.state.selectedWarehouse.WarehouseID && context.state.warehouseType !== 'Multiple') {
+ warningMsg.push('Tipe Gudang Single Harus memilih Gudang');
+ }
+ if (!context.state.selectedSupplier || !context.state.selectedSupplier.SupplierID) {
+ warningMsg.push('Supplier belum dipilih');
+ }
+ if (context.state.discountType === 'Percentage') {
+ const discountValue = (context.state.itemTotal.total * context.state.discountAmount) / 100;
+ if (discountValue > context.state.itemTotal.total) {
+ warningMsg.push('Diskon tidak boleh melebihi total');
+ }
+ } else if (context.state.discountType === 'Absolute') {
+ if (context.state.discountAmount > context.state.itemTotal.total) {
+ warningMsg.push('Diskon tidak boleh melebihi total');
+ }
+ }
+
+ context.state.summary.forEach(element => {
+ if (Number(element.discount) < 0) {
+ warningMsg.push('Diskon ' + element.M_ItemDesc + ' tidak boleh kurang dari 0');
+ }
+ if (element.discountType === 'P') {
+ if (Number(element.discount) > 100) {
+ warningMsg.push('Diskon per item ' + element.M_ItemDesc + ' tidak boleh melebihi 100');
+ }
+ }
+ if (element.discountType === 'R') {
+ if (Number(element.discount) > Number(element.RealPrice)) {
+ warningMsg.push('Diskon per item ' + element.M_ItemDesc + ' tidak boleh melebihi dari harga');
+ }
+ }
+ });
+
+ if (warningMsg.length > 0) {
+ let snackbar = {
+ state: true,
+ type: "warning",
+ message: warningMsg.join(", "),
+ };
+ context.commit("update_snackbar", snackbar);
+ return false;
+ }
+
+ return true;
+};
+
+/**
+ * Menghitung total summary untuk purchase order
+ * @param {Array} summary - Array data summary
+ * @param {Number} taxPpn - Persentase pajak PPN
+ * @param {Number} taxPph - Persentase pajak PPH
+ * @param {String} discountType - Tipe diskon ('Percentage' atau 'Absolute')
+ * @param {Number} discountAmount - Jumlah diskon
+ * @returns {Object} - Object summaryTotal
+ */
+export const calculateSummaryTotal = (summary, typePpnSelected = 'Percentage', taxPpn = 0, taxPph = 0, discountType = 'Percentage', discountAmount = 0) => {
+ if (!summary || summary.length === 0) {
+ return {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ };
+ }
+
+ // Hitung total dari item summary
+ const total = summary.reduce((acc, item) => acc + (Number(item.Total) || 0), 0);
+
+ // Hitung diskon berdasarkan tipe
+ let discount = discountAmount;
+ if (discountType === 'Percentage') {
+ discount = (discountAmount / 100) * total;
+ }
+
+ // Hitung pajak
+ const newTotal = total - discount;
+ let ppn = taxPpn;
+ if (typePpnSelected === 'Percentage' && taxPpn > 0) {
+ ppn = (taxPpn / 100) * newTotal;
+ }
+ const pph = (taxPph / 100) * newTotal;
+ const tax = ppn + pph;
+ const finalTotal = newTotal + tax;
+
+ // Return object summaryTotal
+ return {
+ total: total,
+ tax: tax,
+ ppn: ppn,
+ pph: pph,
+ discount: discount,
+ finalTotal: finalTotal,
+ };
+};
+
+
+/**
+ * Menghapus item dari summary dan selectedItem berdasarkan itemId atau detailId
+ * @param {Array} summary - Array data summary
+ * @param {Array} selectedItem - Array data selectedItem
+ * @param {String} itemId - ID item yang akan dihapus (opsional)
+ * @param {String} detailId - ID detail yang akan dihapus (opsional)
+ * @returns {Object} - Object berisi summary dan selectedItem yang sudah diupdate
+ */
+export const deleteItemFromSummary = (summary, selectedItem, itemId = null, detailId = null) => {
+ // Jika itemId ada, hapus seluruh item dan detailsnya
+ if (itemId) {
+ const newSummary = summary.filter(item => item.M_ItemID !== itemId);
+ const newSelectedItem = selectedItem.filter(item => item.M_ItemID !== itemId);
+
+ return {
+ summary: newSummary,
+ selectedItem: newSelectedItem
+ };
+ }
+
+ // Jika detailId ada, hapus detail spesifik
+ if (detailId) {
+ // Hapus dari selectedItem
+ const newSelectedItem = selectedItem.filter(item => item.PurchaseRequestFlagID !== detailId);
+
+ // Regenerate summary dari selectedItem yang baru
+ const newSummary = groupPurchaseRequestsByItemId(newSelectedItem);
+
+ return {
+ summary: newSummary,
+ selectedItem: newSelectedItem
+ };
+ }
+
+ return {
+ summary,
+ selectedItem
+ };
+};
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-inventaris/index.php b/test/vuex/acc-one-approve-po-inventaris/index.php
new file mode 100644
index 0000000..d3024d3
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/index.php
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-inventaris/modules/po.js b/test/vuex/acc-one-approve-po-inventaris/modules/po.js
new file mode 100644
index 0000000..c73507b
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/modules/po.js
@@ -0,0 +1,1474 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/po.js";
+import { validatePurchaseOrder, groupPurchaseRequestsByItemId, calculateSummaryTotal } from "../functions/functions.js";
+
+export default {
+ namespaced: true,
+ state: {
+ statusOptions: [
+ { value: 'All', title: "All" },
+ { value: 'Draft', title: "Draft" },
+ { value: 'Pending', title: "Pending" },
+ { value: 'Approved', title: "Approved" },
+ { value: 'Rejected', title: "Rejected" },
+ { value: 'Completed', title: "Completed" },
+ ],
+ selectedStatus: { value: 'All', title: "All" },
+ selectedDate: moment(new Date()).format('YYYY-MM-DD'),
+ search: '',
+ totalPage: 0,
+ selectedPage: 1,
+ loading: false,
+ poList: [
+ {
+ "poNumber": "PO1234566",
+ "poDate": "01-01-2025",
+ "poVendor": "PT ABC 123",
+ "poTotal": "1000000",
+ "poStatus": "DRAFT",
+ }
+ ],
+ dialogForm: false,
+ detailData: [],
+ selectedPr: {},
+ loadingDetail: false,
+ snackbar: {
+ state: false,
+ type: 'success',
+ message: '',
+ },
+ //FORM
+ selectedDateForm: moment(new Date()).format('YYYY-MM-DD'),
+ selectedDateEnd: moment(new Date()).format('YYYY-MM-DD'),
+ selectedSupplier: {},
+ refNumber: '',
+ taxPpn: 0,
+ taxPph: 0,
+ paymentTerm: 0,
+ discountType: 'Percentage',
+ discountTypeList: ['Percentage', 'Absolute'],
+ discountAmount: 0,
+ note: '',
+ warehouseTypeList: ['Single', 'Multiple'],
+ warehouseType: 'Single',
+ warehouseList: [],
+ selectedWarehouse: {},
+ itemList: [],
+ selectedItemTemp: [],
+ selectedItem: [],
+ searchItem: '',
+ itemTotal: {
+ total: 0,
+ ppn: 0,
+ pph: 0,
+ tax: 0,
+ discount: 0,
+ finalTotal: 0,
+ },
+ defaultWarehouse: {},
+ shippingCost: 0,
+ shippingCostStatus: true,//Sudah di bayar atau belum
+ //END FORM
+ supplierList: [],
+ loadingAutocomplete: false,
+ searchSupplier: "",
+ dialogConfirmation: false,
+ dialogDelete: false,
+ selectedPO: {},
+ dialogItem: false,
+ currentPageItem: 1,
+ totalPageItem: 0,
+ dialogFormAct: 'ADD',
+ summary: [],
+ summaryTotal: {
+ total: 0,
+ ppn: 0,
+ pph: 0,
+ tax: 0,
+ discount: 0,
+ finalTotal: 0,
+ },
+ deletedItem: [],//kalau edit item sebelumnya yang dihapus masuk sini agar bisa dipilih lagi ,
+ dialogView: false,
+ itemCategoryList: [],
+ selectedItemCategory: {},
+ open_print: false,
+ // isValidMultipleWarehouse: false, // Flag untuk validasi multiple warehouse
+ isValidMultipleWarehouse: {
+ status: false,
+ message: '',
+ },
+ approve_level: 0,
+ status: '',
+ xstartdate: '',
+ itemDesc: '',
+ flag: '',
+ typePpn: ['Percentage', 'Absolute'],
+ typePpnSelected: 'Percentage',
+ },
+ mutations: {
+ update_shippingCost(state, val) {
+ state.shippingCost = val;
+ },
+ update_shippingCostStatus(state, val) {
+ state.shippingCostStatus = val;
+ },
+ update_selectedItemCategory(state, val) {
+ state.selectedItemCategory = val;
+ },
+ update_itemCategoryList(state, val) {
+ state.itemCategoryList = val;
+ },
+ update_dialogView(state, val) {
+ state.dialogView = val;
+ },
+ update_deletedItem(state, val) {
+ state.deletedItem = val;
+ },
+ update_summaryTotal(state, val) {
+ state.summaryTotal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialogFormAct(state, val) {
+ state.dialogFormAct = val;
+ },
+ update_totalPageItem(state, val) {
+ state.totalPageItem = val;
+ },
+ update_currentPageItem(state, val) {
+ state.currentPageItem = val;
+ },
+ update_dialogItem(state, val) {
+ state.dialogItem = val;
+ },
+ update_selectedPO(state, val) {
+ state.selectedPO = val;
+ },
+ update_dialogDelete(state, val) {
+ state.dialogDelete = val;
+ },
+ update_dialogConfirmation(state, val) {
+ state.dialogConfirmation = val;
+ },
+ update_defaultWarehouse(state, val) {
+ state.defaultWarehouse = val;
+ },
+ update_itemTotal(state, val) {
+ state.itemTotal = val;
+ },
+ update_searchItem(state, val) {
+ state.searchItem = val;
+ },
+ update_selectedItemTemp(state, val) {
+ state.selectedItemTemp = val;
+ },
+ update_selectedItem(state, val) {
+ state.selectedItem = val;
+ },
+ update_itemList(state, val) {
+ state.itemList = val;
+ },
+ update_warehouseList(state, val) {
+ state.warehouseList = val;
+ },
+ update_supplierList(state, val) {
+ state.supplierList = val;
+ },
+ update_searchSupplier(state, val) {
+ state.searchSupplier = val;
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val;
+ },
+ update_selectedWarehouse(state, val) {
+ state.selectedWarehouse = val;
+ },
+ update_warehouseTypeList(state, val) {
+ state.warehouseTypeList = val;
+ },
+ update_warehouseType(state, val) {
+ state.warehouseType = val;
+ // Disable and clear selectedWarehouse when type is Multiple
+ if (val === 'Multiple') {
+ state.selectedWarehouse = {};
+ }
+ },
+ update_note(state, val) {
+ state.note = val;
+ },
+ update_discountAmount(state, val) {
+ // debugger;
+ if (state.discountType === 'Percentage' && val > 100) {
+ state.snackbar = {
+ state: true,
+ type: 'warning',
+ message: 'Diskon tidak boleh lebih dari 100',
+ };
+ state.discountAmount = 100;
+ return;
+ }
+ if (state.discountType === 'Absolute' && val > state.itemTotal.total && state.itemTotal.total > 0) {
+ state.snackbar = {
+ state: true,
+ type: 'warning',
+ message: 'Diskon tidak boleh lebih dari total',
+ };
+ state.discountAmount = state.itemTotal.total;
+ return;
+ }
+ state.discountAmount = val;
+ },
+ update_discountType(state, val) {
+ state.discountType = val;
+ },
+ update_paymentTerm(state, val) {
+ state.paymentTerm = val;
+ },
+ update_taxPpn(state, val) {
+ if (state.typePpnSelected === 'Percentage' && val > 100) {
+ state.snackbar = {
+ state: true,
+ type: 'warning',
+ message: 'Persen tidak boleh lebih dari 100',
+ };
+ state.taxPpn = 100;
+ return;
+ }
+ if (state.typePpnSelected === 'Absolute' && val > state.itemTotal.total && state.itemTotal.total > 0) {
+ state.snackbar = {
+ state: true,
+ type: 'warning',
+ message: 'Ppn tidak boleh lebih dari total',
+ };
+ state.taxPpn = state.itemTotal.total;
+ return;
+ }
+ state.taxPpn = val;
+ // if (val > 0) {
+ // state.taxPpn = val;
+ // } else {
+ // state.taxPpn = 0;
+ // }
+ },
+ update_taxPph(state, val) {
+ if (val > 0) {
+ state.taxPph = val;
+ } else {
+ state.taxPph = 0;
+ }
+ },
+ update_refNumber(state, val) {
+ state.refNumber = val;
+ },
+ update_selectedSupplier(state, val) {
+ state.selectedSupplier = val;
+ },
+ update_selectedDateForm(state, val) {
+ state.selectedDateForm = val;
+ },
+ update_selectedDateEnd(state, val) {
+ state.selectedDateEnd = val;
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val;
+ },
+ update_loadingDetail(state, val) {
+ state.loadingDetail = val;
+ },
+ update_selectedPr(state, val) {
+ state.selectedPr = val;
+ },
+ update_detailData(state, val) {
+ state.detailData = val;
+ },
+ update_dialogForm(state, val) {
+ state.dialogForm = val;
+ },
+ update_selectedStatus(state, val) {
+ state.selectedStatus = val;
+ },
+ update_selectedDate(state, val) {
+ state.selectedDate = val;
+ },
+ update_search(state, val) {
+ state.search = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_totalPage(state, val) {
+ state.totalPage = val;
+ },
+ update_selectedPage(state, val) {
+ state.selectedPage = val;
+ },
+ update_poList(state, val) {
+ state.poList = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value
+ },
+ update_isValidMultipleWarehouse(state, value) {
+ state.isValidMultipleWarehouse = value;
+ },
+ update_approve_level(state, data) {
+ state.approve_level = data
+ },
+ update_status(state, val) {
+ state.status = val
+ },
+ update_xstartdate(state, val) {
+ state.xstartdate = val
+ },
+ update_itemDesc(state, val) {
+ state.itemDesc = val;
+ },
+ update_flag(state, val) {
+ state.flag = val
+ },
+ update_typePpn(state, val) {
+ state.typePpn = val;
+ },
+ update_typePpnSelected(state, val) {
+ state.typePpnSelected = val;
+ },
+ },
+ actions: {
+ async deleteItemFromSummary(context, { itemId = null, detailId = null }) {
+ // Jika itemId ada, hapus seluruh item dan detailsnya
+ if (itemId) {
+ const newSummary = context.state.summary.filter(item => item.keyID !== itemId);
+ const newSelectedItem = context.state.selectedItem.filter(item => item.keyID !== itemId);
+ if (context.state.dialogFormAct === 'EDIT') {
+ let deletedItemBefore = JSON.parse(JSON.stringify(context.state.deletedItem))
+ const deletedItem = context.state.selectedItem.filter(item => item.keyID === itemId
+ && item.PurchaseOrderDetailID !== undefined
+ && item.PurchaseOrderDetailID !== null
+ && item.PurchaseOrderDetailID !== 0);
+ let newDeletedItem = []
+ deletedItem.forEach(de => {
+ let cek = deletedItemBefore.find((element) =>
+ element.M_ItemID === de.M_ItemID
+ && element.PurchaseRequestFlagID === de.PurchaseRequestFlagID
+ && element.PurchaseOrderDetailID === de.PurchaseOrderDetailID)
+ if (!cek) {
+ newDeletedItem.push(de)
+ }
+ });
+ context.commit('update_deletedItem', [...deletedItemBefore, ...newDeletedItem]);
+ }
+ context.commit('update_summary', newSummary);
+ context.commit('update_selectedItem', newSelectedItem);
+ }
+
+ // Jika detailId ada, hapus detail spesifik
+ if (detailId) {
+ // Hapus dari selectedItem
+ const newSelectedItem = context.state.selectedItem.filter(
+ item => item.PurchaseRequestFlagID !== detailId
+ );
+ if (context.state.dialogFormAct === 'EDIT') {
+ let deletedItemBefore = JSON.parse(JSON.stringify(context.state.deletedItem))
+ const deletedItem = context.state.selectedItem.filter(
+ item => item.PurchaseRequestFlagID === detailId
+ && item.PurchaseOrderDetailID !== undefined
+ && item.PurchaseOrderDetailID !== null
+ && item.PurchaseOrderDetailID !== 0
+ );
+ let newDeletedItem = []
+ deletedItem.forEach(de => {
+ let cek = deletedItemBefore.find((element) =>
+ element.M_ItemID === de.M_ItemID
+ && element.PurchaseRequestFlagID === de.PurchaseRequestFlagID
+ && element.PurchaseOrderDetailID === de.PurchaseOrderDetailID)
+ if (!cek) {
+ newDeletedItem.push(de)
+ }
+ });
+ context.commit('update_deletedItem', [...deletedItemBefore, ...newDeletedItem]);
+ }
+
+ // Regenerate summary dari selectedItem yang baru
+ const newSummary = await groupPurchaseRequestsByItemId(newSelectedItem, context);
+
+ context.commit('update_summary', newSummary);
+ context.commit('update_selectedItem', newSelectedItem);
+ }
+
+ // Hitung ulang total
+ context.dispatch('countItemTotal');
+ context.dispatch('generateSummary');
+ },
+
+ generateSummaryTotal(context) {
+ const summaryTotal = calculateSummaryTotal(
+ context.state.summary,
+ context.state.typePpnSelected,
+ context.state.taxPpn,
+ context.state.taxPph,
+ context.state.discountType,
+ context.state.discountAmount
+ );
+ context.commit('update_summaryTotal', summaryTotal);
+ },
+
+ async generateSummary(context) {
+ let data = JSON.parse(JSON.stringify(context.state.selectedItem));
+ console.log("Data untuk param groupPurchaseRequestsByItemId:", JSON.parse(JSON.stringify(data)));
+
+ /**
+ * Tambah validasi:
+ * > Apakah bisa multiple warehouse?
+ */
+ context.dispatch('isValidMultipleWarehouse');
+
+ if (context.state.warehouseType === "Multiple") {
+ data.forEach((element) => {
+ element.warehouse = {
+ WarehouseID: element.WarehouseID,
+ WarehouseName: element.WarehouseName,
+ };
+ });
+ } else if (context.state.warehouseType === "Single") {
+ data.forEach((element) => {
+ element.warehouse = context.state.selectedWarehouse; // Semua item pakai warehouse yang sama
+ });
+ }
+
+ let summary = await groupPurchaseRequestsByItemId(data, context);
+ context.commit('update_summary', summary);
+ console.log("Summary setelah grouping:", JSON.parse(JSON.stringify(summary)));
+
+ // Hitung summary total menggunakan fungsi dari functions.js
+ const summaryTotal = calculateSummaryTotal(
+ summary,
+ context.state.typePpnSelected,
+ context.state.taxPpn,
+ context.state.taxPph,
+ context.state.discountType,
+ context.state.discountAmount
+ );
+
+ context.commit('update_summaryTotal', summaryTotal);
+ },
+
+ multipleWarehouseValidation(context, selectedItem) {
+ let data;
+
+ if (!selectedItem || selectedItem.length === 0) {
+ data = JSON.parse(JSON.stringify(context.state.selectedItem));
+ } else {
+ data = JSON.parse(JSON.stringify(selectedItem));
+ }
+
+ // Pakai 'Set' JS Object yang hanya menyimpan nilai unik.
+ const warehouseIds = new Set();
+
+ data.forEach(item => {
+ if (item.WarehouseID) {
+ // Kalau ada yang sama maka disimpan sekali.
+ warehouseIds.add(item.WarehouseID);
+ }
+ });
+
+ if (warehouseIds.size > 1) {
+ return true; // Ada lebih dari satu WarehouseID
+ } else {
+ return false; // Hanya ada satu WarehouseID
+ }
+ },
+
+ async isValidMultipleWarehouse(context) {
+ /**
+ * @param: array of PurchaseRequestDetailID dari selectedItem
+ * @api: api.isValidMultipleWarehouse
+ * @return: JSON -> {data.status (boolean), data.message (string)}
+ *
+ */
+ if (context.state.selectedItem.length === 0) {
+ return false; // Tidak ada item yang dipilih
+ }
+ try {
+ let payload = {
+ "PurchaseRequestDetailIDs": context.state.selectedItem.map(item => item.PurchaseRequestDetailID),
+ "token": one_token(),
+ };
+
+ let response = await api.isValidMultipleWarehouse(payload)
+
+ console.log("Payload untuk isValidMultipleWarehouse:", JSON.parse(JSON.stringify(payload.PurchaseRequestDetailIDs)));
+ console.log("Response dari isValidMultipleWarehouse:", JSON.parse(JSON.stringify(response)));
+
+ if (response.status !== "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_isValidMultipleWarehouse", {
+ status: false,
+ message: '',
+ });
+ context.commit("update_snackbar", snackbar);
+ } else {;
+ context.commit("update_isValidMultipleWarehouse", {
+ status: response.data.status,
+ message: response.data.message,
+ });
+ if(response.data.status == false) {
+ context.commit("update_warehouseType", 'Single');
+ context.commit("update_selectedWarehouse", context.state.selectedWarehouse);
+ }
+ };
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ }
+ },
+
+ assignEdit(context) {
+ let data = context.state.selectedPO
+ context.commit("update_selectedDateForm", data.PurchaseOrderDate);
+ context.commit("update_searchSupplier", data.SupplierName);
+ context.commit("update_selectedSupplier", {
+ "SupplierID": data.PurchaseOrderSupplierID,
+ "SupplierCode": data.SupplierCode,
+ "SupplierName": data.SupplierName
+ });
+ context.commit("update_selectedItemCategory", {
+ "itemCategoryID": data.itemCategoryID,
+ "itemCategoryName": data.itemCategoryName
+ });
+ context.commit("update_refNumber", data.PurchaseOrderRefNumber);
+ context.commit("update_shippingCost", data.PurchaseOrderShippingCost);
+ context.commit("update_shippingCostStatus", data.PurchaseOrderShippingCostStatus === 'Y' ? true : false);
+ context.commit("update_typePpnSelected", data.PurchaseOrderTaxPercentPpn > 0 ? 'Percentage' : 'Absolute');
+ if (data.PurchaseOrderTaxPercentPpn > 0) {
+ context.commit("update_taxPpn", parseFloat(data.PurchaseOrderTaxPercentPpn));
+ } else {
+ context.commit("update_taxPpn", parseFloat(data.PurchaseOrderTaxAmountPpn));
+ }
+ context.commit("update_taxPph", data.PurchaseOrderTaxPercentPph);
+ context.commit("update_paymentTerm", data.PurchaseOrderPaymentTerm);
+ context.commit("update_discountType", data.PurchaseOrderDiscountPercent > 0 ? 'Percentage' : 'Absolute');
+ if (data.PurchaseOrderDiscountPercent > 0) {
+ context.commit("update_discountAmount", parseFloat(data.PurchaseOrderDiscountPercent));
+ } else {
+ context.commit("update_discountAmount", parseFloat(data.PurchaseOrderDiscountAmount));
+ }
+ context.commit("update_note", data.PurchaseOrderNote);
+ context.commit("update_warehouseType", data.PurchaseOrderWarehouseType);
+ context.commit("update_selectedWarehouse", {
+ "WarehouseID": data.PurchaseOrderWarehouseID,
+ "WarehouseCode": data.WarehouseCode,
+ "WarehouseName": data.WarehouseName,
+ });
+ context.commit("update_dialogFormAct", 'EDIT');
+ context.dispatch("countItemTotal");
+ },
+
+ resetForm(context) {
+ context.commit("update_selectedDateForm", moment(new Date()).format('YYYY-MM-DD'));
+ context.commit("update_selectedSupplier", {});
+ context.commit("update_refNumber", '');
+ context.commit("update_taxPpn", 0);
+ context.commit("update_typePpnSelected", 'Percentage');
+ context.commit("update_taxPph", 0);
+ context.commit("update_paymentTerm", 0);
+ context.commit("update_discountType", 'Percentage');
+ context.commit("update_discountAmount", 0);
+ context.commit("update_note", '');
+ context.commit("update_warehouseType", 'Single');
+ context.commit("update_selectedWarehouse", context.state.defaultWarehouse);
+ context.commit("update_itemList", []);
+ context.commit("update_selectedItemTemp", []);
+ context.commit("update_selectedItem", []);
+ context.commit("update_deletedItem", []);
+ context.commit("update_selectedItemCategory", {});
+ context.commit("update_summary", []);
+ context.commit("update_searchItem", '');
+ context.commit("update_shippingCost", 0);
+ context.commit("update_shippingCostStatus", true);
+ context.commit("update_dialogFormAct", 'ADD');
+ context.commit("update_summaryTotal", {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ });
+ context.commit("update_itemTotal", {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ });
+ },
+
+ countItemTotal(context) {
+ let selectedItem = context.state.selectedItem;
+ if (selectedItem.length === 0) {
+ let hasil = {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ }
+ context.commit("update_itemTotal", hasil);
+ return;
+ }
+
+ // Fix: Ensure we're working with numeric values
+ let total = selectedItem.reduce((acc, item) => {
+ // Convert string to number if needed
+ const itemTotal = typeof item.Total === 'string' ?
+ parseFloat(item.Total.replace(/\./g, '').replace(',', '.')) :
+ item.Total;
+ return acc + (isNaN(itemTotal) ? 0 : itemTotal);
+ }, 0);
+
+ total = Math.round(total * 100) / 100;
+
+ let discount = parseFloat(context.state.discountAmount) || 0;
+ if (context.state.discountType === 'Percentage') {
+ discount = Math.round((discount / 100) * total * 100) / 100;
+ }
+
+ let newTotal = Math.round((total - discount) * 100) / 100;
+
+ let ppn = 0;
+ if (context.state.typePpnSelected === 'Absolute') {
+ ppn = context.state.taxPpn;
+ } else {
+ ppn = Math.round((parseFloat(context.state.taxPpn) / 100) * newTotal * 100) / 100;
+ }
+
+ let pph = Math.round((parseFloat(context.state.taxPph) / 100) * newTotal * 100) / 100;
+ let pajak = Math.round((ppn + pph) * 100) / 100;
+ let final = Math.round((newTotal + pajak) * 100) / 100;
+
+ let hasil = {
+ total: total,
+ tax: pajak,
+ ppn: ppn,
+ pph: pph,
+ discount: discount,
+ finalTotal: final,
+ }
+ context.commit("update_itemTotal", hasil);
+ },
+
+ updatePoQty(context, { itemId, newPoQty }) {
+ let updatedSelectedItem = context.state.selectedItem.map(item => {
+ if (item.PurchaseRequestFlagID === itemId) {
+ // Convert string to number and ensure minimum value of 1
+ const numericPoQty = Number(newPoQty);
+ item.PoQty = Math.max(1, Math.floor(isNaN(numericPoQty) ? 1 : numericPoQty));
+
+ // Recalculate item total
+ let price = item.DefaultPurchase?.SupplierPricePrice || 0;
+
+ // Apply discount if exists
+ if (item.discount > 0) {
+ if (item.discountType === 'P') {
+ price = price - (item.discount * price / 100);
+ } else if (item.discountType === 'R') {
+ price = price - item.discount;
+ }
+ }
+
+ item.Total = item.PoQty * price;
+ }
+ return item;
+ });
+
+ context.commit('update_selectedItem', updatedSelectedItem);
+
+ // Regenerate summary
+ context.dispatch('generateSummary');
+ context.dispatch('countItemTotal');
+ context.dispatch('generateSummaryTotal');
+ },
+
+ async getSupplier(context) {
+ if (context.state.searchSupplier.length < 2) return;
+ context.commit("update_loadingAutocomplete", true);
+
+ try {
+ var payload = {
+ token: one_token(),
+ search: context.state.searchSupplier,
+
+ };
+
+ let response = await api.getSupplier(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+
+ context.commit("update_supplierList", data.records);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ },
+
+ async getItemCategory(context) {
+
+ context.commit("update_loadingAutocomplete", true);
+
+ try {
+ var payload = {
+ token: one_token(),
+
+ };
+
+ let response = await api.getItemCategory(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+
+ context.commit("update_itemCategoryList", data.records);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ },
+
+ async getWarehouse(context) {
+
+ context.commit("update_loadingAutocomplete", true);
+
+ try {
+ var payload = {
+ regionalId: one_user().S_RegionalID,
+ token: one_token(),
+ };
+
+ let response = await api.getWarehouse(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ response.data.records.forEach(element => {
+ if (element.WarehouseIsDefault === 'Y') {
+ context.commit("update_defaultWarehouse", element);
+ }
+
+ });
+ context.commit("update_warehouseList", response.data.records);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ },
+
+ async getItem(context) {
+ context.commit("update_loading", true);
+ try {
+ var payload = {
+ "search": context.state.searchItem,
+ "currentPage": context.state.currentPageItem,
+ "supplierID": context.state.selectedSupplier.SupplierID,
+ "itemCategoryID": context.state.selectedItemCategory.itemCategoryID,
+ "regionalId": one_user().S_RegionalID,
+ "token": one_token(),
+ };
+
+ let response = await api.getItem(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.totalPage,
+ };
+
+ context.commit("update_itemList", data.records);
+ context.commit("update_totalPageItem", data.total);
+ context.commit("update_loading", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async getItemUpdate(context) {
+ context.commit("update_loading", true);
+ try {
+ var payload = {
+ "POID": context.state.selectedPO.PurchaseOrderID,
+ "token": one_token(),
+ };
+
+ let response = await api.getItemUpdate(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.totalPage,
+ };
+
+ context.commit("update_selectedItem", data.records);
+ /**
+ * Tambah validasi:
+ * > Apakah bisa multiple warehouse?
+ */
+ context.dispatch('isValidMultipleWarehouse');
+
+ context.commit("update_summary", response.data.summary)
+ context.dispatch("countItemTotal");
+ // Hitung summary total menggunakan fungsi dari functions.js
+ // TODO: Check ini akibat penyesuaian
+ const summaryTotal = calculateSummaryTotal(
+ response.data.summary,
+ context.state.typePpnSelected,
+ context.state.taxPpn,
+ context.state.taxPph,
+ context.state.discountType,
+ context.state.discountAmount
+ );
+
+ context.commit('update_summaryTotal', summaryTotal);
+
+ context.commit("update_loading", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async saveOrder(context) {
+ try {
+ if (!validatePurchaseOrder(context)) {
+ return;
+ }
+
+ const invalidQtyItems = context.state.selectedItem.filter(item => {
+ // Convert string to number first
+ const poQty = Number(item.PoQty);
+
+ // Check if conversion failed (NaN), is less than 1, or not an integer
+ return isNaN(poQty) || poQty < 1 || !Number.isInteger(poQty);
+ });
+
+ if (invalidQtyItems.length > 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: "Semua item harus memiliki quantity minimal 1",
+ }
+ context.commit("update_snackbar", snackbar);
+ return;
+ }
+
+ context.commit("update_loading", true);
+
+ // menambahkan pengecekan tax ppn 19-12-2025
+ // jika ppn persen maka masuk ke tax persentppn
+ // jika ppn absolute maka masuk ke tax amount ppn
+ let ppnPercent = 0;
+ if (context.state.typePpnSelected === 'Percentage') {
+ ppnPercent = context.state.taxPpn;
+ }
+
+ var payload = {
+ "token": one_token(),
+ "Date": context.state.selectedDateForm,
+ "RefNumber": context.state.refNumber,
+ "SupplierID": context.state.selectedSupplier.SupplierID,
+ "ItemCategoryID": context.state.selectedItemCategory.itemCategoryID,
+ "TaxPpnType": context.state.typePpnSelected === 'Percentage' ? 'P' : 'R',
+ "TaxPercent": ppnPercent,
+ "PaymentTerm": context.state.paymentTerm,
+ "DiscountPercent": context.state.discountType === 'Percentage' ? context.state.discountAmount : 0,
+ "DiscountAmount": context.state.discountType === 'Absolute' ? context.state.discountAmount : 0,
+ "WarehouseType": context.state.warehouseType,
+ "WarehouseID": context.state.selectedWarehouse.WarehouseID,
+ "Note": context.state.note,
+ "SubTotal": context.state.summaryTotal.total,
+ "TaxPercentPph": context.state.taxPph,
+ "TaxPercentPpn": ppnPercent,
+ "TaxAmount": context.state.summaryTotal.tax,
+ "TaxAmountPph": context.state.summaryTotal.pph,
+ "TaxAmountPpn": context.state.summaryTotal.ppn,
+ "GrandTotal": context.state.summaryTotal.finalTotal,
+ "ShippingCost": context.state.shippingCost,
+ "ShippingCostStatus": context.state.shippingCostStatus,
+ // "Details": detail,
+ "Summary": context.state.summary
+ };
+
+ // Validasi Total Tidak Boleh <0
+ const financialChecks = [
+ { value: payload.GrandTotal, name: "Total" },
+ { value: payload.SubTotal, name: "Sub Total" },
+ { value: payload.TaxAmount, name: "Pajak" },
+ { value: payload.TaxAmountPph, name: "Pajak PPH" },
+ { value: payload.TaxAmountPpn, name: "Pajak PPN" },
+ { value: payload.DiscountAmount, name: "Diskon" },
+ { value: payload.ShippingCost, name: "Biaya Ekspedisi" }
+ ];
+
+ for (const check of financialChecks) {
+ if (check.value < 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: `${check.name} tidak boleh kurang dari 0`,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ return;
+ }
+ }
+
+ let response = await api.saveOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil simpan data",
+ }
+ context.commit("update_snackbar", snackbar);
+
+
+ context.commit("update_loading", false);
+ context.commit("update_dialogForm", false);
+ context.dispatch("resetForm");
+ context.dispatch("searchData");
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async searchData(context) {
+ context.commit("update_loading", true);
+ try {
+
+ var url_string = window.location.href
+ var url = new URL(url_string);
+ var status = url.searchParams.get("status");
+ var xstartdate = url.searchParams.get("startdate");
+ var xsearch = url.searchParams.get("search");
+ var xflag = url.searchParams.get("flag");
+
+ // untuk notifikasi
+ if (xflag == 'N') {
+
+ if (xsearch != null && xsearch != '') {
+ context.commit("update_search", xsearch);
+ }
+ if (status != null && status != '') {
+ context.commit("update_selectedStatus", { value: status, title: status });
+ }
+ if (xstartdate != null && xstartdate != '') {
+ context.commit("update_selectedDate", xstartdate);
+ context.commit("update_selectedEndDate", xstartdate);
+ }
+
+ } else if (xflag == 'G') {
+ // untuk get data param approve all
+
+ if (status != null && status != '') {
+ context.commit("update_selectedStatus", { value: status, title: status });
+ }
+ if (xstartdate != null && xstartdate != '') {
+ context.commit("update_selectedDate", xstartdate);
+ context.commit("update_selectedDateEnd", moment(new Date()).format('YYYY-MM-DD'));
+ }
+ context.commit("update_flag", xflag);
+
+ }
+
+ var payload = {
+ "token": one_token(),
+ "currentPage": context.state.selectedPage,
+ "search": context.state.search,
+ "startDate": context.state.selectedDate,
+ "endDate": context.state.selectedDateEnd,
+ "status": context.state.selectedStatus.value,
+ "flag": context.state.flag
+ };
+
+ let response = await api.search(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ context.commit("update_totalPage", response.data.totalPage);
+ context.commit("update_poList", data.records);
+ context.commit("update_loading", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async requestOrder(context) {
+ context.commit("update_loading", true);
+
+ try {
+
+ var payload = {
+ "token": one_token(),
+ "ID": context.state.selectedPO.PurchaseOrderID,
+ };
+
+ let response = await api.requestOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil request order",
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ context.commit("update_dialogConfirmation", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async deleteOrder(context) {
+ context.commit("update_loading", true);
+
+ try {
+ var payload = {
+ "token": one_token(),
+ "PurchaseOrderId": context.state.selectedPO.PurchaseOrderID,
+ };
+
+ let response = await api.deleteOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil hapus order",
+ }
+ context.commit("update_snackbar", snackbar);
+
+ await context.dispatch("searchData");
+ context.commit("update_loading", false);
+ context.commit("update_dialogDelete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async updateOrder(context) {
+ try {
+ if (!validatePurchaseOrder(context)) {
+ return;
+ }
+
+ const invalidQtyItems = context.state.selectedItem.filter(item => {
+ // Convert string to number first
+ const poQty = Number(item.PoQty);
+
+ // Check if conversion failed (NaN), is less than 1, or not an integer
+ return isNaN(poQty) || poQty < 1 || !Number.isInteger(poQty);
+ });
+
+ console.log("InvalidQtyItem updateOrder", invalidQtyItems)
+
+ if (invalidQtyItems.length > 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: "Semua item harus memiliki quantity minimal 1",
+ }
+ context.commit("update_snackbar", snackbar);
+ return;
+ }
+
+ // menambahkan pengecekan tax ppn 19-12-2025
+ // jika ppn persen maka masuk ke tax persentppn
+ // jika ppn absolute maka masuk ke tax amount ppn
+ let ppnPercent = 0;
+ if (context.state.typePpnSelected === 'Percentage') {
+ ppnPercent = context.state.taxPpn;
+ }
+
+ var payload = {
+ "token": one_token(),
+ "Date": context.state.selectedDateForm,
+ "RefNumber": context.state.refNumber,
+ "SupplierID": context.state.selectedSupplier.SupplierID,
+ "TaxPpnType": context.state.typePpnSelected === 'Percentage' ? 'P' : 'R',
+ "TaxPercent": ppnPercent,
+ "PaymentTerm": context.state.paymentTerm,
+ "ItemCategoryID": context.state.selectedItemCategory.itemCategoryID,
+ "DiscountPercent": context.state.discountType === 'Percentage' ? context.state.discountAmount : 0,
+ "DiscountAmount": context.state.discountType === 'Absolute' ? context.state.discountAmount : 0,
+ "WarehouseType": context.state.warehouseType,
+ "WarehouseID": context.state.selectedWarehouse.WarehouseID,
+ "Note": context.state.note,
+ "SubTotal": context.state.summaryTotal.total,
+ "TaxPercentPph": context.state.taxPph,
+ "TaxPercentPpn": ppnPercent,
+ "TaxAmount": context.state.summaryTotal.tax,
+ "TaxAmountPph": context.state.summaryTotal.pph,
+ "TaxAmountPpn": context.state.summaryTotal.ppn,
+ "GrandTotal": context.state.summaryTotal.finalTotal,
+ "ShippingCost": context.state.shippingCost,
+ "ShippingCostStatus": context.state.shippingCostStatus,
+ "PO": context.state.selectedPO,
+ "Summary": context.state.summary,
+ "deletedItem": context.state.deletedItem,
+ "IsApprovalEdit": true,
+ };
+
+ // Validasi Total Tidak Boleh <0
+ const financialChecks = [
+ { value: payload.GrandTotal, name: "Total" },
+ { value: payload.SubTotal, name: "Sub Total" },
+ { value: payload.TaxAmount, name: "Pajak" },
+ { value: payload.TaxAmountPph, name: "Pajak PPH" },
+ { value: payload.TaxAmountPpn, name: "Pajak PPN" },
+ { value: payload.DiscountAmount, name: "Diskon" },
+ { value: payload.ShippingCost, name: "Biaya Ekspedisi" }
+ ];
+
+ for (const check of financialChecks) {
+ if (check.value < 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: `${check.name} tidak boleh kurang dari 0`,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ return;
+ }
+ }
+
+ context.commit("update_loading", true);
+ let response = await api.updateOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil simpan data",
+ }
+ context.commit("update_snackbar", snackbar);
+
+
+ context.commit("update_loading", false);
+ context.commit("update_dialogForm", false);
+ context.dispatch("resetForm");
+ context.dispatch("searchData");
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async approveOrder(context, payload) {
+ context.commit("update_loading", true);
+ try {
+ payload.token = one_token()
+ payload.approvelevel = context.state.approve_level
+
+ let response = await api.approvePOrder(payload);
+ if (response.status != 'OK') {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ if (context.state.approve_level == '2') {
+ let params = { token: one_token(), id: payload.poID }
+ let generateitempo = await api.generateItemPO(params)
+ if (generateitempo.status != 'OK') {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil approve order",
+ }
+ context.commit("update_snackbar", snackbar);
+
+ await context.dispatch("searchData");
+ context.commit("update_loading", false);
+ }
+ } else {
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil approve order manager",
+ }
+ context.commit("update_snackbar", snackbar);
+
+ await context.dispatch("searchData");
+ context.commit("update_loading", false);
+ }
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async getApprovalLevel(context) {
+ context.commit("update_loading", true);
+ try {
+ let response = await api.getApprovalLevel({token: one_token()});
+ if (response.status != 'OK') {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = response.data.M_UserM_ApproveLevelID
+
+ context.commit("update_approve_level", data)
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async getDefaultSupplierPrice(context, payload) {
+ context.commit("update_loading", true);
+ try {
+ payload.token = one_token()
+ payload.supplierID = context.state.selectedSupplier.SupplierID
+
+ let response = await api.getDefaultSupplierPrice(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("update_loading", false);
+
+ return data.records;
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+ },
+};
diff --git a/test/vuex/acc-one-approve-po-inventaris/store.js b/test/vuex/acc-one-approve-po-inventaris/store.js
new file mode 100644
index 0000000..e107174
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-inventaris/store.js
@@ -0,0 +1,14 @@
+// import manager from "./modules/manager.js";
+// import prkacab from "./modules/prkacab.js"
+import system from "../../../apps/modules/system/system.js";
+import po from "./modules/po.js";
+
+export const store = new Vuex.Store({
+ modules: {
+ po: po,
+ system: system
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-approve-po-jasa/api/api.js b/test/vuex/acc-one-approve-po-jasa/api/api.js
new file mode 100644
index 0000000..c0c0fc5
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/api/api.js
@@ -0,0 +1,162 @@
+const URL = "/one-api/mockup/purchase/order/PurchaseOrderService/";
+const URLRO = "/one-api/mockup/receive-item-po/ReceiveOrderService/";
+
+export async function getDaftarCabang(params) {
+ try {
+ var response = await axios.post(URL + "getDaftarCabang", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDaftarSupplier(params) {
+ try {
+ var response = await axios.post(URL + "getDaftarSupplier", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDaftarPOJasa(params) {
+ try {
+ var response = await axios.post(URL + "getDaftarPOJasa", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDataKontrakPOJasa(params) {
+ try {
+ var response = await axios.post(URL + "getDataKontrakPOJasa", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var response = await axios.post(URL + "getUserApproveLevel", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function updateApprovalPO(params) {
+ try {
+ var response = await axios.post(URL + "updateApprovalPO", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function generatePOItemReceive(params) {
+ try {
+ const response = await axios.post(URLRO + "generatePOItemReceive", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ const data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDaftarAttachment(params) {
+ try {
+ const response = await axios.post(URL + "getDaftarAttachment", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ const data = response.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-jasa/components/dialog-confirm.vue b/test/vuex/acc-one-approve-po-jasa/components/dialog-confirm.vue
new file mode 100644
index 0000000..23d6973
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/components/dialog-confirm.vue
@@ -0,0 +1,364 @@
+
+
+
+ KONFIRMASI PO JASA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.expanded
+ ? "keyboard_arrow_down"
+ : "keyboard_arrow_right"
+ }}
+
+ {{ props.item.M_ItemDesc }}
+ {{ props.item.RequestQty }}
+
+ Rp. {{ formatCurrency(props.item.SupplierPrice) }}
+
+
+ Rp. {{ formatCurrency(props.item.DiskonAmount) }}
+
+
+ Rp. {{ formatCurrency(props.item.EndPrice) }}
+
+
+ Rp. {{ formatCurrency(props.item.TempTotal) }}
+
+
+
+
+
+
+
+
+
+
+ {{ obj.item.M_ItemDesc }}
+ {{ obj.item.PurchaseRequestNumber }}
+ {{ obj.item.M_BranchName }}
+ {{ obj.item.RequestQty }}
+ {{ obj.item.ItemUnitName }}
+
+ {{ formatCurrency(obj.item.SupplierPrice) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ JUMLAH
+
+
+ Rp. {{ formatCurrency(selected_pojasa.summary.subtotal) }}
+
+
+
+
+
+ DISKON
+
+
+ Rp. {{ formatCurrency(selected_pojasa.summary.diskon) }}
+
+
+
+
+
+ PAJAK
+
+
+ Rp. {{ formatCurrency(selected_pojasa.summary.pajak) }}
+
+
+
+
+
+ TOTAL
+
+
+ Rp. {{ formatCurrency(selected_pojasa.summary.total) }}
+
+
+
+
+
+
+
+
+ Attachment
+
+ Batal
+
+ {{ selected_pojasa.verifiedby == '0' ? "Verifikasi" : "Approve" }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-jasa/components/dialog-view-attachment.vue b/test/vuex/acc-one-approve-po-jasa/components/dialog-view-attachment.vue
new file mode 100644
index 0000000..50bc58b
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/components/dialog-view-attachment.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+ VIEW ATTACHMENT
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+ {{ view_title }}
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-jasa/components/one-layout-service.vue b/test/vuex/acc-one-approve-po-jasa/components/one-layout-service.vue
new file mode 100644
index 0000000..68b2cae
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/components/one-layout-service.vue
@@ -0,0 +1,275 @@
+
+
+
+ APPROVE PURCHASE ORDER JASA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseOrderNumber }}
+ {{ props.item.PurchaseOrderDate }}
+ {{ props.item.SupplierName }}
+ {{ props.item.M_BranchName }}
+ {{ props.item.PurchaseOrderNote }}
+
+ Rp. {{ formatCurrency(props.item.PurchaseOrderGrandTotal) }}
+
+ {{ props.item.PurchaseOrderStatus }}
+
+
+
+
+ detail
+ list_alt
+
+
+ APPROVED
+
+
+
+
+ verifikasi
+ done
+
+
+ approve
+ done_all
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ snackbar.msg }}
+ Tutup
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-jasa/index.php b/test/vuex/acc-one-approve-po-jasa/index.php
new file mode 100644
index 0000000..c9f3033
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/index.php
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-jasa/modules/poservice.js b/test/vuex/acc-one-approve-po-jasa/modules/poservice.js
new file mode 100644
index 0000000..754f0c2
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/modules/poservice.js
@@ -0,0 +1,231 @@
+import * as api from '../api/api.js';
+
+export default {
+ namespaced: true,
+ state: {
+ /* utility */
+ snackbar: {
+ color: 'success',
+ msg: '',
+ state: false
+ },
+
+ filterjasa: {
+ startdate: moment(new Date()).format('YYYY-MM-DD'),
+ enddate: moment(new Date()).format('YYYY-MM-DD'),
+ status: "All",
+ search: ""
+ },
+ liststatus: ['All', 'Draft', 'Pending', 'Approved', 'Rejected', 'Completed'],
+ list_pojasa: {
+ records: [],
+ total: 0
+ },
+ currpage: 1,
+ loading_process: false,
+ list_supplier: [],
+ list_branch: [],
+ userinfo: {},
+
+ /* dialog konfirmasi */
+ dialog_confirm: false,
+ detail_view: false,
+ selected_pojasa: {
+ summary: {
+ subtotal: 0.00,
+ diskon: 0.00,
+ pajak: 0.00,
+ total: 0.00
+ }
+ },
+
+ /* dialog attachment */
+ dialog_attachment: false,
+ prview_attachment: []
+ },
+ mutations: {
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_filterjasa(state, val) {
+ state.filterjasa = val
+ },
+ update_liststatus(state, val) {
+ state.liststatus = val
+ },
+ update_list_pojasa(state, val) {
+ state.list_pojasa = val
+ },
+ update_currpage(state, val) {
+ state.currpage = val
+ },
+ update_loading_process(state, val) {
+ state.loading_process = val
+ },
+ update_list_supplier(state, val) {
+ state.list_supplier = val
+ },
+ update_list_branch(state, val) {
+ state.list_branch = val
+ },
+ update_userinfo(state, val) {
+ state.userinfo = val
+ },
+ update_dialog_confirm(state, val) {
+ state.dialog_confirm = val
+ },
+ update_detail_view(state, val) {
+ state.detail_view = val
+ },
+ update_selected_pojasa(state, val) {
+ state.selected_pojasa = val
+ },
+ update_dialog_attachment(state, val) {
+ state.dialog_attachment = val
+ },
+ update_prview_attachment(state, val) {
+ state.prview_attachment = val
+ }
+ },
+ actions: {
+ async lookupCabang(context) {
+ try {
+ const resp = await api.getDaftarCabang({token: one_token()})
+ if (resp.status != 'OK') {
+ let snac = {color: 'error', msg: resp.message, state: true}
+ context.commit('update_snackbar', snac)
+ } else {
+ context.commit("update_list_branch", resp.data)
+ }
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true}
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async lookupVendor(context) {
+ try {
+ const resp = await api.getDaftarSupplier({token: one_token()})
+ if (resp.status != 'OK') {
+ let snac = {color: 'error', msg: resp.message, state: true}
+ context.commit('update_snackbar', snac)
+ } else {
+ context.commit("update_list_supplier", resp.data)
+ }
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true}
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async lookupPOJasa(context) {
+ try {
+ let param = {
+ token: one_token(),
+ currpage: context.state.currpage,
+ ...context.state.filterjasa
+ }
+
+ const resp = await api.getDaftarPOJasa(param)
+ if (resp.status != 'OK') {
+ let snac = {color: 'error', msg: resp.message, state: true}
+ context.commit('update_snackbar', snac)
+ } else {
+ context.commit('update_list_pojasa', resp.data)
+ }
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true}
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async lookupDetailPO(context, poid) {
+ try {
+ let param = {
+ token: one_token(),
+ poID: poid
+ }
+
+ const resp = await api.getDataKontrakPOJasa(param)
+ if (resp.status != 'OK') {
+ let snac = {color: 'error', msg: resp.message, state: true}
+ context.commit('update_snackbar', snac)
+ } else {
+ context.commit("update_selected_pojasa", resp.data)
+ }
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true}
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async lookupUserApproveLevel(context) {
+ try {
+ const resp = await api.getUserApproveLevel({token: one_token()})
+ if (resp.status != 'OK') {
+ let snac = {color: 'error', msg: resp.message, state: true}
+ context.commit('update_snackbar', snac)
+ } else {
+ context.commit("update_userinfo", resp.data)
+ }
+
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true}
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async lookupAttachment(context, param) {
+ try {
+ param.token = one_token()
+ const resp = await api.getDaftarAttachment(param)
+ if (resp.status != 'OK') {
+ let snac = {color: 'error', msg: resp.message, state: true}
+ context.commit('update_snackbar', snac)
+ } else {
+ context.commit('update_prview_attachment', resp.data)
+ }
+
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true}
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async updateApprovePO(context) {
+ try {
+ context.state.loading_process = true;
+
+ const jasa = context.state.selected_pojasa;
+ const param = {
+ token: one_token(),
+ approvelevel: context.state.userinfo.M_UserM_ApproveLevelID,
+ poID: jasa.PurchaseOrderID,
+ kontrakid: jasa.T_KontrakJasaID
+ };
+
+ const resp = await api.updateApprovalPO(param);
+ if (resp.status !== 'OK') {
+ throw new Error(resp.message);
+ }
+
+ if (param.approvelevel === '2') {
+ const generate = await api.generatePOItemReceive(param);
+ if (generate.status !== 'OK') {
+ throw new Error(generate.message);
+ }
+ }
+
+ let snac = {color: 'success', msg: resp.data, state: true};
+ context.commit('update_snackbar', snac);
+ context.dispatch('lookupPOJasa');
+ context.state.dialog_confirm = false
+ } catch (error) {
+ let snac = {color: 'error', msg: error.message, state: true};
+ context.commit('update_snackbar', snac);
+ } finally {
+ context.state.loading_process = false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po-jasa/store.js b/test/vuex/acc-one-approve-po-jasa/store.js
new file mode 100644
index 0000000..ec6d4dd
--- /dev/null
+++ b/test/vuex/acc-one-approve-po-jasa/store.js
@@ -0,0 +1,11 @@
+import system from "../../../apps/modules/system/system.js";
+import poservice from "./modules/poservice.js";
+export const store = new Vuex.Store({
+ modules: {
+ system: system,
+ poservice: poservice
+ },
+ state: {},
+ mutations: {},
+ actions: {}
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po/api/po.js b/test/vuex/acc-one-approve-po/api/po.js
new file mode 100644
index 0000000..a6dbfaf
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/api/po.js
@@ -0,0 +1,293 @@
+const URL = "/one-api/mockup/purchase/order/PurchaseOrderV2/";
+const URLRO = "/one-api/mockup/receive-item-po/receiveitempo/";
+
+export async function getSupplier(payload) {
+ try {
+ var response = await axios.post(URL + "getSupplier", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getItemCategory(payload) {
+ try {
+ var response = await axios.post(URL + "getItemCategory", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getWarehouse(payload) {
+ try {
+ var response = await axios.post(URL + "getWarehouse", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getItem(payload) {
+ try {
+ var response = await axios.post(URL + "getItem", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function getItemUpdate(payload) {
+ try {
+ var response = await axios.post(URL + "getItemUpdate", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function saveOrder(payload) {
+ try {
+ var response = await axios.post(URL + "saveOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function search(payload) {
+ try {
+ var response = await axios.post(URL + "search", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function requestOrder(payload) {
+ try {
+ var response = await axios.post(URL + "requestOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function deleteOrder(payload) {
+ try {
+ var response = await axios.post(URL + "deleteOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function updateOrder(payload) {
+ try {
+ var response = await axios.post(URL + "updateOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function approvePOrder(payload) {
+ try {
+ var response = await axios.post(URL + "approvePOrder", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function isValidMultipleWarehouse(payload) {
+ try {
+ var response = await axios.post(URL + "isValidMultipleWarehouse", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function generateItemPO(params) {
+ try {
+ var response = await axios.post(URLRO + "generateItemPo", params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getApprovalLevel(params) {
+ try {
+ var response = await axios.post(URL + 'getApproveLevel', params);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getDefaultSupplierPrice(payload) {
+ try {
+ var response = await axios.post(URL + "getDefaultSupplierPrice", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po/components/dialogView.vue b/test/vuex/acc-one-approve-po/components/dialogView.vue
new file mode 100644
index 0000000..6ff7f41
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/components/dialogView.vue
@@ -0,0 +1,593 @@
+
+
+
+
+
+
+ DETAIL PURCHASE ORDER {{ selectedPO.PurchaseOrderNumber ?? "" }}
+
+
+
+
+
+
+
+
+
+ Nomor PO
+
+
+
+
+ : {{ selectedPO.PurchaseOrderNumber }}
+
+
+
+
+
+ Tanggal
+
+
+
+
+ : {{ selectedPO.DisplayDate }}
+
+
+
+
+
+
+ Nomor Referensi
+
+
+
+
+ : {{ selectedPO.PurchaseOrderRefNumber }}
+
+
+
+
+
+
+ Pajak Pendapatan (PPN):
+
+
+
+
+ : {{ selectedPO.PurchaseOrderTaxPercentPpn }}%
+
+
+
+
+
+
+ Pajak Penghasilan (PPH)
+
+
+
+
+ : {{ selectedPO.PurchaseOrderTaxPercentPph }}%
+
+
+
+
+
+
+ Vendor
+
+
+
+
+ : {{ selectedPO.SupplierCode }}
+ {{ selectedPO.SupplierName }}
+
+
+
+
+
+
+
+ Diskon Vendor(Tipe Diskon)
+
+
+
+
+ : {{ selectedPO.PurchaseOrderDiscountPercent }}% (Percentage)
+ : Rp {{ selectedPO.PurchaseOrderDiscountAmount }} (Absolut)
+ : - (-)
+
+
+
+
+
+
+ Jangka Waktu Pembayaran
+
+
+
+
+ : {{ selectedPO.PurchaseOrderPaymentTerm }} hari
+
+
+
+
+
+
+ Tipe Gudang
+
+
+
+
+
+ : {{ selectedPO.PurchaseOrderWarehouseType }}
+
+
+
+
+
+
+ Gudang
+
+
+
+
+ : {{ selectedPO.WarehouseName }}
+
+
+
+
+
+
+ Biaya Ekspedisi
+
+
+
+
+ : {{ selectedPO && selectedPO.PurchaseOrderShippingCost != null
+ ? oneMoney(selectedPO.PurchaseOrderShippingCost) : '0' }}
+ Sudah dibayar
+
+ Belum dibayar
+
+
+
+
+
+
+
+
+ Keterangan
+
+
+
+
+ : {{ selectedPO.PurchaseOrderNote }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ props.expanded
+ ? "keyboard_arrow_down"
+ : "keyboard_arrow_right"
+ }}
+
+
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+
+
+ {{ props.item.TotalPoQty }} {{ props.item.PoItemUnitName }}
+
+
+ {{ oneMoney(props.item.RealPrice) }}
+
+
+
+ {{ oneMoney(props.item.discount) }}
+
+
+ {{ props.item.discount }}%
+ {{ oneMoney(props.item.summaryDiscountAmount) }}
+
+
+
+ {{ oneMoney(props.item.Price) }}
+
+
+ {{ oneMoney(props.item.Total) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ detailProps.item.M_ItemCode }}
+
+ {{ detailProps.item.M_ItemDesc }}
+
+
+ {{
+ detailProps.item.PurchaseRequestNumber
+ }}
+
+
+ {{
+ detailProps.item.M_BranchName ??
+ detailProps.item.S_RegionalName
+ }}
+
+
+ {{ detailProps.item.warehouse.WarehouseName }}
+
+
+ {{ detailProps.item.PoQty }}
+ {{ detailProps.item.PoItemUnitName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ TOTAL HARGA TANPA DISKON
+
+
+ {{
+ selectedPO && selectedPO.TotalRealPrice != null
+ ? oneMoney(selectedPO.TotalRealPrice) : '0'
+ }}
+
+
+
+
+ TOTAL DISKON PER ITEM
+
+
+ {{
+ selectedPO && selectedPO.TotalDiskonPerItem != null
+ ? oneMoney(selectedPO.TotalDiskonPerItem) : '0'
+ }}
+
+
+
+
+ DISKON VENDOR
+
+
+ {{
+ selectedPO && selectedPO.DiscountAmount != null
+ ? oneMoney(selectedPO.DiscountAmount) : '0'
+ }}
+
+
+
+
+ PAJAK PENDAPATAN(PPN)
+
+
+ {{
+ selectedPO && selectedPO.PurchaseOrderTaxAmountPpn != null
+ ? oneMoney(selectedPO.PurchaseOrderTaxAmountPpn) : '0'
+ }}
+
+
+
+
+ PAJAK PENGHASILAN(PPH)
+
+
+ {{
+ selectedPO && selectedPO.PurchaseOrderTaxAmountPph != null
+ ? oneMoney(selectedPO.PurchaseOrderTaxAmountPph) : '0'
+ }}
+
+
+
+
+ PAJAK
+
+
+ {{ selectedPO && selectedPO.TaxAmount != null
+ ? oneMoney(selectedPO.TaxAmount) : '0' }}
+
+
+
+
+ TOTAL
+
+
+ {{
+ selectedPO && selectedPO.PurchaseOrderGrandTotal != null
+ ? oneMoney(selectedPO.PurchaseOrderGrandTotal) : '0'
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-approve-po/components/po.vue b/test/vuex/acc-one-approve-po/components/po.vue
new file mode 100644
index 0000000..32d57c3
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/components/po.vue
@@ -0,0 +1,713 @@
+
+
+
+
+
+ KONFIRMASI
+
+
+
+ Apakah anda yakin untuk menghapus
+ {{
+ selectedPO.PurchaseOrderNumber
+ }}
+ ??
+
+
+
+
+
+
+
+ Tidak
+
+
+ Ya
+
+
+
+
+
+
+
+
+ KONFIRMASI
+
+
+
+ Apakah anda yakin untuk mengunci
+ {{
+ selectedPO.PurchaseOrderNumber
+ }}
+ untuk melanjutkan ke proses approve?
+
+ *Setelah dikunci PO tidak dapat di edit
+
+
+
+
+
+
+
+
+ Tidak
+
+
+ Ya
+
+
+
+
+
+
+ {{ snackbar.message }}
+
+ Close
+
+
+
+
+ PURCHASE ORDER APPROVE
+
+
+ arrow_back Back
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseOrderNumber }}
+ {{ props.item.PurchaseOrderDate }}
+ {{ props.item.SupplierName }}
+
+
+ {{ props.item.PurchaseOrderWarehouseType }}
+
+
+ {{ props.item.WarehouseName }}
+
+
+ {{ props.item.PurchaseOrderNote }}
+
+ Rp. {{ props.item.PurchaseOrderGrandTotal != null ? oneMoney(props.item.PurchaseOrderGrandTotal) : '0' }}
+
+
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{
+ props.item.PurchaseOrderStatus }}
+
+ {{ props.item.PurchaseOrderStatus }}
+
+
+
+
+
+
+
+ {{ props.item.PurchaseOrderApprovedManagerUserID == '0' ? 'Approve (Manager)' : 'Approved (Manager)'}}
+ done_all
+
+
+
+ Approve (Kepala Reg)
+ done
+
+
+
+
+
+ visibility
+
+
+ View PO
+
+
+
+
+
+ edit
+
+
+ Edit PO
+
+
+
+
+
+
+
+ visibility
+
+
+ View PO
+
+
+
+
+
+ picture_as_pdf
+
+
+ PDF PO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-approve-po/components/poForm.vue b/test/vuex/acc-one-approve-po/components/poForm.vue
new file mode 100644
index 0000000..9e0674c
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/components/poForm.vue
@@ -0,0 +1,1509 @@
+
+
+
+
+
+
+ TAMBAH ITEM
+
+
+
+
+
+
+
+
+
+
+
+ {{ header.text }}
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseRequestNumber }}
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+ {{ props.item.M_BranchName ?? props.item.S_RegionalName }}
+
+
+ {{ props.item.PoItemUnitName }}
+
+
+ {{ props.item.RequestQty }} {{ props.item.ReqItemUnitName }}
+
+
+
+
+
+
+
+ warning
+ {{ props.item.UnitReqPoConvertMsg }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ header.text }}
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseRequestNumber }}
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+ {{ props.item.M_BranchName ?? props.item.S_RegionalName }}
+
+
+ {{ props.item.PoItemUnitName }}
+
+
+ {{ props.item.RequestQty }} {{ props.item.ReqItemUnitName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Tambahkan
+
+
+
+
+
+
+
+
+
+ FORM PURCHASE ORDER
+
+
+ {{ selectedPO.PurchaseOrderNumber ?? "" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ isValidMultipleWarehouse.message }}
+
+
+
+
+
+
+
+ TAMBAHKAN ITEM
+
+
+
+
+
+
+
+
+
+ {{
+ props.expanded
+ ? "keyboard_arrow_down"
+ : "keyboard_arrow_right"
+ }}
+
+
+ {{ props.item.M_ItemCode }}
+ {{ props.item.M_ItemDesc }}
+
+
+ {{ props.item.TotalPoQty }}
+ {{ props.item.PoItemUnitName }}
+
+
+ {{ oneMoney(props.item.RealPrice) }}
+
+
+
+
+
+
+
+
+
+ Rp
+
+
+ %
+
+
+
+
+
+ Rupiah
+
+
+ Percent
+
+
+
+
+
+
+
+
+ {{ oneMoney(props.item.Price) }}
+
+
+ {{ oneMoney(props.item.Total) }}
+
+
+
+
+ delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ detailProps.item.M_ItemCode }}
+ {{ detailProps.item.M_ItemDesc }}
+
+
+ {{
+ detailProps.item.PurchaseRequestNumber
+ }}
+
+
+ {{
+ detailProps.item.RequesterBranchName
+ }}
+
+
+ {{
+ detailProps.item.M_BranchName ??
+ detailProps.item.S_RegionalName
+ }}
+
+
+
+ {{ detailProps.item.warehouse.WarehouseName }}
+
+
+
+
+
+
+
+
+
+ {{ detailProps.item.PoItemUnitName }}
+
+
+
+ delete
+
+
+
+
+
+
+
+
+
+
+
+
+ JUMLAH
+
+
+ {{ oneMoney(summaryTotal.total) }}
+
+
+
+
+ DISKON
+
+
+ {{ oneMoney(summaryTotal.discount) }}
+
+
+
+
+ PAJAK PENDAPATAN(PPN) {{ taxPpn }}%
+
+
+ {{ oneMoney(summaryTotal.ppn) }}
+
+
+
+
+ PAJAK PENGHASILAN(PPH) {{ taxPph }}%
+
+
+ {{ oneMoney(summaryTotal.pph) }}
+
+
+
+
+ PAJAK
+
+
+ {{ oneMoney(summaryTotal.tax) }}
+
+
+
+
+ TOTAL
+
+
+ {{
+ oneMoney(summaryTotal.finalTotal)
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BATAL
+
+
+ SIMPAN
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-approve-po/functions/functions.js b/test/vuex/acc-one-approve-po/functions/functions.js
new file mode 100644
index 0000000..7e3d2ca
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/functions/functions.js
@@ -0,0 +1,475 @@
+/**
+ * Utility functions for the ACC One Purchase Order application
+ */
+
+// /**
+// * Groups an array of objects by a specified key
+// * @param {Array} array - The array of objects to group
+// * @param {String} key - The key to group by
+// * @returns {Object} - An object with keys representing the grouped values and arrays as values
+// */
+// export const groupBy = (array, key) => {
+// return array.reduce((result, item) => {
+// const groupKey = item[key];
+// if (!result[groupKey]) {
+// result[groupKey] = [];
+// }
+// result[groupKey].push(item);
+// return result;
+// }, {});
+// };
+/**
+ * Groups an array of objects by one or multiple keys
+ * @param {Array} array - The array of objects to group
+ * @param {Function|String|Array} key - The key(s) to group by. Can be a string, array of strings, or a function.
+ * @returns {Object} - An object with keys representing the grouped values and arrays as values
+ */
+export const groupBy = (array, key) => {
+ return array.reduce((result, item) => {
+ let groupKey;
+
+ // Handle single key (string), multiple keys (array), or custom function
+ if (typeof key === 'function') {
+ groupKey = key(item);
+ } else if (Array.isArray(key)) {
+ groupKey = key.map(k => item[k]).join('_'); // Combine multiple keys with underscore
+ } else {
+ groupKey = item[key];
+ }
+
+ if (!result[groupKey]) {
+ result[groupKey] = [];
+ }
+ result[groupKey].push(item);
+ return result;
+ }, {});
+};
+
+/**
+ * Groups purchase request data by M_ItemID
+ * Terjadi jika ada beberapa item yang sama, maka akan digabungkan berdasarkan M_ItemID dan PoItemUnitID
+ * @param {Array} purchaseRequestData - Array of purchase request objects
+ * @returns {Array} - Array of objects with M_ItemID, M_ItemCode, M_ItemDesc, unit information, converted PoQty, and Details array
+ */
+export const groupPurchaseRequestsByItemId_old = (purchaseRequestData) => {
+ const grouped = groupBy(purchaseRequestData, ['M_ItemID', 'PoItemUnitID']);
+ console.log("grouped");
+ console.log(grouped);
+
+ return Object.keys(grouped).map(itemId => {
+ const items = grouped[itemId];
+ const firstItem = items[0];
+
+ /* Sebelum Kalkulasi Konversi Item di BE */
+ // // Calculate total PoQty from all items
+ // const totalPoQty = calculateTotalQuantity(items, 'PoQty');
+ // // Get the conversion factor from the first item
+ // const conversionFactor = Number(firstItem.DefaultPurchase.UnitConvertAmount) || 1;
+ // // Convert the total quantity and round up if it's a decimal
+ // const convertedPoQty = Math.ceil(convertUnits(totalPoQty, conversionFactor));
+
+ /* Sesudah Kalkulasi Konversi Item di BE getItem() */
+ const convertedPoQty = calculateTotalQuantity(items, 'PoQty')
+ console.log("Total PoQty for itemId", itemId, " : ", convertedPoQty);
+
+ let price = 0;
+
+ if (parseFloat(firstItem.discount) > 0) {
+ if (firstItem.discountType === 'P') {
+ price = Number(firstItem.DefaultPurchase.SupplierPricePrice) - (Number(firstItem.discount) * (Number(firstItem.DefaultPurchase.SupplierPricePrice) / 100));
+ }
+ if (firstItem.discountType === 'R') {
+ price = Number(firstItem.DefaultPurchase.SupplierPricePrice) - Number(firstItem.discount);
+ }
+
+ } else {
+ price = Number(firstItem.DefaultPurchase.SupplierPricePrice) || 0;
+ }
+
+ // Get the price from the first item
+ const realPrice = Number(firstItem.DefaultPurchase.SupplierPricePrice) || 0;
+
+ // Calculate the total (PoQty * price)
+ const total = convertedPoQty * price;
+
+ const itemParts = itemId.split('_');
+ const M_ItemID = itemParts[0];
+
+ return {
+ keyID: itemId,
+ M_ItemID: M_ItemID,
+ PurchaseOrderID: firstItem.PurchaseOrderID ?? 0,
+ PurchaseOrderSummaryID: firstItem.PurchaseOrderSummaryID ?? 0,
+ M_ItemCode: firstItem.M_ItemCode,
+ M_ItemDesc: firstItem.M_ItemDesc,
+ discount: firstItem.discount,
+ discountType: firstItem.discountType,
+ PoItemUnitID: firstItem.DefaultPurchase.ItemUnitID,
+ ItemUnitCode: firstItem.DefaultPurchase.ItemUnitCode,
+ PoItemUnitName: firstItem.DefaultPurchase.ItemUnitName,
+ TotalPoQty: convertedPoQty,
+ Price: price,
+ RealPrice: realPrice,
+ PriceAfterDiscount: price,
+ Total: total,
+ Details: items
+ };
+ });
+};
+
+export const groupPurchaseRequestsByItemId = async (purchaseRequestData, context) => {
+ const grouped = groupBy(purchaseRequestData, ['M_ItemID', 'PoItemUnitID']);
+ console.log("grouped", grouped);
+
+ const results = await Promise.all(Object.keys(grouped).map(async (itemId) => {
+ const items = grouped[itemId];
+ const firstItem = items[0];
+
+ const convertedPoQty = calculateTotalQuantity(items, 'PoQty');
+ console.log("Total PoQty for itemId", itemId, ":", convertedPoQty);
+
+ // Fetch the default supplier price based on the first item's M_ItemID and the converted quantity
+ // penambahan multi harga di PO (untuk mendapatkan harga sesuai qty)
+ const supplierPrice = await context.dispatch('getDefaultSupplierPrice', {
+ itemID: firstItem.M_ItemID,
+ qty: convertedPoQty
+ });
+
+ if (supplierPrice == null) {
+ let snackbar = {
+ state: true,
+ type: "warning",
+ message: `Jumlah Quantity tidak tersedia di rentang harga supplier untuk item ${firstItem.M_ItemDesc}!`,
+ };
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_supplierPriceSave", supplierPrice);
+ context.commit("update_itemDesc", firstItem.M_ItemDesc);
+ } else {
+ context.commit("update_supplierPriceSave", supplierPrice);
+ context.commit("update_itemDesc", '');
+ }
+
+ let price = 0;
+
+ if (parseFloat(firstItem.discount) > 0) {
+ if (firstItem.discountType === 'P') {
+ price = Number(supplierPrice?.SupplierPricePrice || 0) - (Number(firstItem.discount) * (Number(supplierPrice?.SupplierPricePrice || 0) / 100));
+ } else if (firstItem.discountType === 'R') {
+ price = Number(supplierPrice?.SupplierPricePrice || 0) - Number(firstItem.discount);
+ }
+ } else {
+ price = Number(supplierPrice?.SupplierPricePrice || 0) || 0;
+ }
+
+ const total = convertedPoQty * price;
+
+ const itemParts = itemId.split('_');
+ const M_ItemID = itemParts[0];
+
+ return {
+ keyID: itemId,
+ M_ItemID: M_ItemID,
+ PurchaseOrderID: firstItem.PurchaseOrderID ?? 0,
+ PurchaseOrderSummaryID: firstItem.PurchaseOrderSummaryID ?? 0,
+ M_ItemCode: firstItem.M_ItemCode,
+ M_ItemDesc: firstItem.M_ItemDesc,
+ discount: firstItem.discount,
+ discountType: firstItem.discountType,
+ PoItemUnitID: firstItem.DefaultPurchase.ItemUnitID,
+ ItemUnitCode: firstItem.DefaultPurchase.ItemUnitCode,
+ PoItemUnitName: firstItem.DefaultPurchase.ItemUnitName,
+ TotalPoQty: convertedPoQty,
+ Price: price,
+ RealPrice: Number(supplierPrice?.SupplierPricePrice || 0),
+ PriceAfterDiscount: price,
+ Total: total,
+ Details: items
+ };
+ }));
+
+ return results; // hasil sudah dalam bentuk array berisi semua item lengkap
+};
+
+/**
+ * Formats a number as currency (IDR)
+ * @param {Number} amount - The amount to format
+ * @returns {String} - Formatted currency string
+ */
+export const formatCurrency = (amount) => {
+ return new Intl.NumberFormat('id-ID', {
+ style: 'currency',
+ currency: 'IDR',
+ minimumFractionDigits: 0
+ }).format(amount);
+};
+
+/**
+ * Formats a date to a localized string
+ * @param {Date|String} date - The date to format
+ * @param {Object} options - Intl.DateTimeFormat options
+ * @returns {String} - Formatted date string
+ */
+export const formatDate = (date, options = {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+}) => {
+ if (!date) return '';
+ const dateObj = typeof date === 'string' ? new Date(date) : date;
+ return new Intl.DateTimeFormat('id-ID', options).format(dateObj);
+};
+
+/**
+ * Calculates the total value of purchase requests
+ * @param {Array} items - Array of purchase request items
+ * @returns {Number} - Total value
+ */
+export const calculateTotal = (items) => {
+ return items.reduce((sum, item) => sum + (Number(item.Total) || 0), 0);
+};
+
+/**
+ * Calculates the total quantity of items
+ * @param {Array} items - Array of purchase request items
+ * @param {String} qtyField - The field name containing quantity (e.g., 'PoQty')
+ * @returns {Number} - Total quantity
+ */
+export const calculateTotalQuantity = (items, qtyField = 'PoQty') => {
+ console.log("Items in calculateTotalQuantity:", items);
+ return items.reduce((sum, item) => sum + (Number(item[qtyField]) || 0), 0);
+};
+
+/**
+ * Converts units based on the conversion factor
+ * @param {Number} quantity - The quantity to convert
+ * @param {Number} conversionFactor - The conversion factor
+ * @returns {Number} - Converted quantity
+ */
+export const convertUnits = (quantity, conversionFactor) => {
+ return quantity / conversionFactor;
+};
+
+/**
+ * Filters purchase requests by branch
+ * @param {Array} items - Array of purchase request items
+ * @param {String|Array} branchCodes - Branch code(s) to filter by
+ * @returns {Array} - Filtered items
+ */
+export const filterByBranch = (items, branchCodes) => {
+ if (!branchCodes) return items;
+
+ const codes = Array.isArray(branchCodes) ? branchCodes : [branchCodes];
+ return items.filter(item => codes.includes(item.BranchCode));
+};
+
+/**
+ * Filters purchase requests by regional
+ * @param {Array} items - Array of purchase request items
+ * @param {String|Array} regionalIds - Regional ID(s) to filter by
+ * @returns {Array} - Filtered items
+ */
+export const filterByRegional = (items, regionalIds) => {
+ if (!regionalIds) return items;
+
+ const ids = Array.isArray(regionalIds) ? regionalIds : [regionalIds];
+ return items.filter(item => ids.includes(item.S_RegionalID));
+};
+
+/**
+ * Validates if a purchase request item has all required fields
+ * @param {Object} item - Purchase request item
+ * @returns {Boolean} - True if valid, false otherwise
+ */
+export const validatePurchaseRequestItem = (item) => {
+ const requiredFields = [
+ 'M_ItemID',
+ 'M_ItemCode',
+ 'M_ItemDesc',
+ 'Price',
+ 'RequestQty'
+ ];
+
+ return requiredFields.every(field => item[field] !== undefined && item[field] !== null);
+};
+
+/**
+ * Sorts purchase request items by a specified field
+ * @param {Array} items - Array of purchase request items
+ * @param {String} field - Field to sort by
+ * @param {Boolean} ascending - Sort direction (true for ascending, false for descending)
+ * @returns {Array} - Sorted items
+ */
+export const sortPurchaseRequests = (items, field = 'M_ItemDesc', ascending = true) => {
+ return [...items].sort((a, b) => {
+ const valueA = a[field];
+ const valueB = b[field];
+
+ if (typeof valueA === 'string' && typeof valueB === 'string') {
+ return ascending
+ ? valueA.localeCompare(valueB)
+ : valueB.localeCompare(valueA);
+ }
+
+ return ascending
+ ? (valueA - valueB)
+ : (valueB - valueA);
+ });
+};
+
+/**
+ * Validates purchase order data before saving
+ * @param {Object} context - Vuex context object
+ * @returns {Boolean} - Returns true if validation passes, false otherwise
+ */
+export const validatePurchaseOrder = (context) => {
+ if (context.state.loading) {
+ let snackbar = {
+ state: true,
+ type: "warning",
+ message: 'Loading sedang berlangsung harap menunggu ...',
+ };
+ context.commit("update_snackbar", snackbar);
+ return false;
+ }
+
+ let warningMsg = [];
+ if (context.state.selectedItem.length == 0) {
+ warningMsg.push('Belum memilih item');
+ }
+ if (!context.state.refNumber || context.state.refNumber.trim() === '') {
+ warningMsg.push('Nomor Referensi belum diisi');
+ }
+ if (!context.state.selectedWarehouse || !context.state.selectedWarehouse.WarehouseID && context.state.warehouseType !== 'Multiple') {
+ warningMsg.push('Tipe Gudang Single Harus memilih Gudang');
+ }
+ if (!context.state.selectedSupplier || !context.state.selectedSupplier.SupplierID) {
+ warningMsg.push('Supplier belum dipilih');
+ }
+ if (context.state.discountType === 'Percentage') {
+ const discountValue = (context.state.itemTotal.total * context.state.discountAmount) / 100;
+ if (discountValue > context.state.itemTotal.total) {
+ warningMsg.push('Diskon tidak boleh melebihi total');
+ }
+ } else if (context.state.discountType === 'Absolute') {
+ if (context.state.discountAmount > context.state.itemTotal.total) {
+ warningMsg.push('Diskon tidak boleh melebihi total');
+ }
+ }
+
+ context.state.summary.forEach(element => {
+ if (Number(element.discount) < 0) {
+ warningMsg.push('Diskon ' + element.M_ItemDesc + ' tidak boleh kurang dari 0');
+ }
+ if (element.discountType === 'P') {
+ if (Number(element.discount) > 100) {
+ warningMsg.push('Diskon per item ' + element.M_ItemDesc + ' tidak boleh melebihi 100');
+ }
+ }
+ if (element.discountType === 'R') {
+ if (Number(element.discount) > Number(element.RealPrice)) {
+ warningMsg.push('Diskon per item ' + element.M_ItemDesc + ' tidak boleh melebihi dari harga');
+ }
+ }
+ });
+
+ if (warningMsg.length > 0) {
+ let snackbar = {
+ state: true,
+ type: "warning",
+ message: warningMsg.join(", "),
+ };
+ context.commit("update_snackbar", snackbar);
+ return false;
+ }
+
+ return true;
+};
+
+/**
+ * Menghitung total summary untuk purchase order
+ * @param {Array} summary - Array data summary
+ * @param {Number} taxPpn - Persentase pajak PPN
+ * @param {Number} taxPph - Persentase pajak PPH
+ * @param {String} discountType - Tipe diskon ('Percentage' atau 'Absolute')
+ * @param {Number} discountAmount - Jumlah diskon
+ * @returns {Object} - Object summaryTotal
+ */
+export const calculateSummaryTotal = (summary, taxPpn = 0, taxPph = 0, discountType = 'Percentage', discountAmount = 0) => {
+ if (!summary || summary.length === 0) {
+ return {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ };
+ }
+
+ // Hitung total dari item summary
+ const total = summary.reduce((acc, item) => acc + (Number(item.Total) || 0), 0);
+
+ // Hitung diskon berdasarkan tipe
+ let discount = discountAmount;
+ if (discountType === 'Percentage') {
+ discount = (discountAmount / 100) * total;
+ }
+
+ // Hitung pajak
+ const newTotal = total - discount;
+ const ppn = (taxPpn / 100) * newTotal;
+ const pph = (taxPph / 100) * newTotal;
+ const tax = ppn + pph;
+ const finalTotal = newTotal + tax;
+
+ // Return object summaryTotal
+ return {
+ total: total,
+ tax: tax,
+ ppn: ppn,
+ pph: pph,
+ discount: discount,
+ finalTotal: finalTotal,
+ };
+};
+
+
+/**
+ * Menghapus item dari summary dan selectedItem berdasarkan itemId atau detailId
+ * @param {Array} summary - Array data summary
+ * @param {Array} selectedItem - Array data selectedItem
+ * @param {String} itemId - ID item yang akan dihapus (opsional)
+ * @param {String} detailId - ID detail yang akan dihapus (opsional)
+ * @returns {Object} - Object berisi summary dan selectedItem yang sudah diupdate
+ */
+export const deleteItemFromSummary = (summary, selectedItem, itemId = null, detailId = null) => {
+ // Jika itemId ada, hapus seluruh item dan detailsnya
+ if (itemId) {
+ const newSummary = summary.filter(item => item.M_ItemID !== itemId);
+ const newSelectedItem = selectedItem.filter(item => item.M_ItemID !== itemId);
+
+ return {
+ summary: newSummary,
+ selectedItem: newSelectedItem
+ };
+ }
+
+ // Jika detailId ada, hapus detail spesifik
+ if (detailId) {
+ // Hapus dari selectedItem
+ const newSelectedItem = selectedItem.filter(item => item.PurchaseRequestFlagID !== detailId);
+
+ // Regenerate summary dari selectedItem yang baru
+ const newSummary = groupPurchaseRequestsByItemId(newSelectedItem);
+
+ return {
+ summary: newSummary,
+ selectedItem: newSelectedItem
+ };
+ }
+
+ return {
+ summary,
+ selectedItem
+ };
+};
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po/index.php b/test/vuex/acc-one-approve-po/index.php
new file mode 100644
index 0000000..d3024d3
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/index.php
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-approve-po/modules/po.js b/test/vuex/acc-one-approve-po/modules/po.js
new file mode 100644
index 0000000..9287dfb
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/modules/po.js
@@ -0,0 +1,1439 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/po.js";
+import { validatePurchaseOrder, groupPurchaseRequestsByItemId, calculateSummaryTotal } from "../functions/functions.js";
+
+export default {
+ namespaced: true,
+ state: {
+ statusOptions: [
+ { value: 'All', title: "All" },
+ { value: 'Draft', title: "Draft" },
+ { value: 'Pending', title: "Pending" },
+ { value: 'Approved', title: "Approved" },
+ { value: 'Rejected', title: "Rejected" },
+ { value: 'Completed', title: "Completed" },
+ ],
+ selectedStatus: { value: 'All', title: "All" },
+ selectedDate: moment(new Date()).format('YYYY-MM-DD'),
+ search: '',
+ totalPage: 0,
+ selectedPage: 1,
+ loading: false,
+ poList: [
+ {
+ "poNumber": "PO1234566",
+ "poDate": "01-01-2025",
+ "poVendor": "PT ABC 123",
+ "poTotal": "1000000",
+ "poStatus": "DRAFT",
+ }
+ ],
+ dialogForm: false,
+ detailData: [],
+ selectedPr: {},
+ loadingDetail: false,
+ snackbar: {
+ state: false,
+ type: 'success',
+ message: '',
+ },
+ //FORM
+ selectedDateForm: moment(new Date()).format('YYYY-MM-DD'),
+ selectedDateEnd: moment(new Date()).format('YYYY-MM-DD'),
+ selectedSupplier: {},
+ refNumber: '',
+ taxPpn: 0,
+ taxPph: 0,
+ paymentTerm: 0,
+ discountType: 'Percentage',
+ discountTypeList: ['Percentage', 'Absolute'],
+ discountAmount: 0,
+ note: '',
+ warehouseTypeList: ['Single', 'Multiple'],
+ warehouseType: 'Single',
+ warehouseList: [],
+ selectedWarehouse: {},
+ itemList: [],
+ selectedItemTemp: [],
+ selectedItem: [],
+ searchItem: '',
+ itemTotal: {
+ total: 0,
+ ppn: 0,
+ pph: 0,
+ tax: 0,
+ discount: 0,
+ finalTotal: 0,
+ },
+ defaultWarehouse: {},
+ shippingCost: 0,
+ shippingCostStatus: true,//Sudah di bayar atau belum
+ //END FORM
+ supplierList: [],
+ loadingAutocomplete: false,
+ searchSupplier: "",
+ dialogConfirmation: false,
+ dialogDelete: false,
+ selectedPO: {},
+ dialogItem: false,
+ currentPageItem: 1,
+ totalPageItem: 0,
+ dialogFormAct: 'ADD',
+ summary: [],
+ summaryTotal: {
+ total: 0,
+ ppn: 0,
+ pph: 0,
+ tax: 0,
+ discount: 0,
+ finalTotal: 0,
+ },
+ deletedItem: [],//kalau edit item sebelumnya yang dihapus masuk sini agar bisa dipilih lagi ,
+ dialogView: false,
+ itemCategoryList: [],
+ selectedItemCategory: {},
+ open_print: false,
+ // isValidMultipleWarehouse: false, // Flag untuk validasi multiple warehouse
+ isValidMultipleWarehouse: {
+ status: false,
+ message: '',
+ },
+ approve_level: 0,
+ status: '',
+ xstartdate: '',
+ supplierPriceSave: null,
+ itemDesc: '',
+ flag: ''
+ },
+ mutations: {
+ update_shippingCost(state, val) {
+ state.shippingCost = val;
+ },
+ update_shippingCostStatus(state, val) {
+ state.shippingCostStatus = val;
+ },
+ update_selectedItemCategory(state, val) {
+ state.selectedItemCategory = val;
+ },
+ update_itemCategoryList(state, val) {
+ state.itemCategoryList = val;
+ },
+ update_dialogView(state, val) {
+ state.dialogView = val;
+ },
+ update_deletedItem(state, val) {
+ state.deletedItem = val;
+ },
+ update_summaryTotal(state, val) {
+ state.summaryTotal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialogFormAct(state, val) {
+ state.dialogFormAct = val;
+ },
+ update_totalPageItem(state, val) {
+ state.totalPageItem = val;
+ },
+ update_currentPageItem(state, val) {
+ state.currentPageItem = val;
+ },
+ update_dialogItem(state, val) {
+ state.dialogItem = val;
+ },
+ update_selectedPO(state, val) {
+ state.selectedPO = val;
+ },
+ update_dialogDelete(state, val) {
+ state.dialogDelete = val;
+ },
+ update_dialogConfirmation(state, val) {
+ state.dialogConfirmation = val;
+ },
+ update_defaultWarehouse(state, val) {
+ state.defaultWarehouse = val;
+ },
+ update_itemTotal(state, val) {
+ state.itemTotal = val;
+ },
+ update_searchItem(state, val) {
+ state.searchItem = val;
+ },
+ update_selectedItemTemp(state, val) {
+ state.selectedItemTemp = val;
+ },
+ update_selectedItem(state, val) {
+ state.selectedItem = val;
+ },
+ update_itemList(state, val) {
+ state.itemList = val;
+ },
+ update_warehouseList(state, val) {
+ state.warehouseList = val;
+ },
+ update_supplierList(state, val) {
+ state.supplierList = val;
+ },
+ update_searchSupplier(state, val) {
+ state.searchSupplier = val;
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val;
+ },
+ update_selectedWarehouse(state, val) {
+ state.selectedWarehouse = val;
+ },
+ update_warehouseTypeList(state, val) {
+ state.warehouseTypeList = val;
+ },
+ update_warehouseType(state, val) {
+ state.warehouseType = val;
+ // Disable and clear selectedWarehouse when type is Multiple
+ if (val === 'Multiple') {
+ state.selectedWarehouse = {};
+ }
+ },
+ update_note(state, val) {
+ state.note = val;
+ },
+ update_discountAmount(state, val) {
+ // debugger;
+ if (state.discountType === 'Percentage' && val > 100) {
+ state.snackbar = {
+ state: true,
+ type: 'warning',
+ message: 'Diskon tidak boleh lebih dari 100',
+ };
+ state.discountAmount = 100;
+ return;
+ }
+ if (state.discountType === 'Absolute' && val > state.itemTotal.total && state.itemTotal.total > 0) {
+ state.snackbar = {
+ state: true,
+ type: 'warning',
+ message: 'Diskon tidak boleh lebih dari total',
+ };
+ state.discountAmount = state.itemTotal.total;
+ return;
+ }
+ state.discountAmount = val;
+ },
+ update_discountType(state, val) {
+ state.discountType = val;
+ },
+ update_paymentTerm(state, val) {
+ state.paymentTerm = val;
+ },
+ update_taxPpn(state, val) {
+ if (val > 0) {
+ state.taxPpn = val;
+ } else {
+ state.taxPpn = 0;
+ }
+ },
+ update_taxPph(state, val) {
+ if (val > 0) {
+ state.taxPph = val;
+ } else {
+ state.taxPph = 0;
+ }
+ },
+ update_refNumber(state, val) {
+ state.refNumber = val;
+ },
+ update_selectedSupplier(state, val) {
+ state.selectedSupplier = val;
+ },
+ update_selectedDateForm(state, val) {
+ state.selectedDateForm = val;
+ },
+ update_selectedDateEnd(state, val) {
+ state.selectedDateEnd = val;
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val;
+ },
+ update_loadingDetail(state, val) {
+ state.loadingDetail = val;
+ },
+ update_selectedPr(state, val) {
+ state.selectedPr = val;
+ },
+ update_detailData(state, val) {
+ state.detailData = val;
+ },
+ update_dialogForm(state, val) {
+ state.dialogForm = val;
+ },
+ update_selectedStatus(state, val) {
+ state.selectedStatus = val;
+ },
+ update_selectedDate(state, val) {
+ state.selectedDate = val;
+ },
+ update_search(state, val) {
+ state.search = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_totalPage(state, val) {
+ state.totalPage = val;
+ },
+ update_selectedPage(state, val) {
+ state.selectedPage = val;
+ },
+ update_poList(state, val) {
+ state.poList = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value
+ },
+ update_isValidMultipleWarehouse(state, value) {
+ state.isValidMultipleWarehouse = value;
+ },
+ update_approve_level(state, data) {
+ state.approve_level = data
+ },
+ update_status(state, val) {
+ state.status = val
+ },
+ update_xstartdate(state, val) {
+ state.xstartdate = val
+ },
+ update_supplierPriceSave(state, val) {
+ state.supplierPriceSave = val;
+ },
+ update_itemDesc(state, val) {
+ state.itemDesc = val;
+ },
+ update_flag(state, val) {
+ state.flag = val
+ }
+ },
+ actions: {
+ async deleteItemFromSummary(context, { itemId = null, detailId = null }) {
+ // Jika itemId ada, hapus seluruh item dan detailsnya
+ if (itemId) {
+ const newSummary = context.state.summary.filter(item => item.keyID !== itemId);
+ const newSelectedItem = context.state.selectedItem.filter(item => item.keyID !== itemId);
+ if (context.state.dialogFormAct === 'EDIT') {
+ let deletedItemBefore = JSON.parse(JSON.stringify(context.state.deletedItem))
+ const deletedItem = context.state.selectedItem.filter(item => item.keyID === itemId
+ && item.PurchaseOrderDetailID !== undefined
+ && item.PurchaseOrderDetailID !== null
+ && item.PurchaseOrderDetailID !== 0);
+ let newDeletedItem = []
+ deletedItem.forEach(de => {
+ let cek = deletedItemBefore.find((element) =>
+ element.M_ItemID === de.M_ItemID
+ && element.PurchaseRequestFlagID === de.PurchaseRequestFlagID
+ && element.PurchaseOrderDetailID === de.PurchaseOrderDetailID)
+ if (!cek) {
+ newDeletedItem.push(de)
+ }
+ });
+ context.commit('update_deletedItem', [...deletedItemBefore, ...newDeletedItem]);
+ }
+ context.commit('update_summary', newSummary);
+ context.commit('update_selectedItem', newSelectedItem);
+ }
+
+ // Jika detailId ada, hapus detail spesifik
+ if (detailId) {
+ // Hapus dari selectedItem
+ const newSelectedItem = context.state.selectedItem.filter(
+ item => item.PurchaseRequestFlagID !== detailId
+ );
+ if (context.state.dialogFormAct === 'EDIT') {
+ let deletedItemBefore = JSON.parse(JSON.stringify(context.state.deletedItem))
+ const deletedItem = context.state.selectedItem.filter(
+ item => item.PurchaseRequestFlagID === detailId
+ && item.PurchaseOrderDetailID !== undefined
+ && item.PurchaseOrderDetailID !== null
+ && item.PurchaseOrderDetailID !== 0
+ );
+ let newDeletedItem = []
+ deletedItem.forEach(de => {
+ let cek = deletedItemBefore.find((element) =>
+ element.M_ItemID === de.M_ItemID
+ && element.PurchaseRequestFlagID === de.PurchaseRequestFlagID
+ && element.PurchaseOrderDetailID === de.PurchaseOrderDetailID)
+ if (!cek) {
+ newDeletedItem.push(de)
+ }
+ });
+ context.commit('update_deletedItem', [...deletedItemBefore, ...newDeletedItem]);
+ }
+
+ // Regenerate summary dari selectedItem yang baru
+ const newSummary = await groupPurchaseRequestsByItemId(newSelectedItem, context);
+
+ context.commit('update_summary', newSummary);
+ context.commit('update_selectedItem', newSelectedItem);
+ }
+
+ // Hitung ulang total
+ context.dispatch('countItemTotal');
+ context.dispatch('generateSummary');
+ },
+
+ generateSummaryTotal(context) {
+ const summaryTotal = calculateSummaryTotal(
+ context.state.summary,
+ context.state.taxPpn,
+ context.state.taxPph,
+ context.state.discountType,
+ context.state.discountAmount
+ );
+ context.commit('update_summaryTotal', summaryTotal);
+ },
+
+ async generateSummary(context) {
+ let data = JSON.parse(JSON.stringify(context.state.selectedItem));
+ console.log("Data untuk param groupPurchaseRequestsByItemId:", JSON.parse(JSON.stringify(data)));
+
+ /**
+ * Tambah validasi:
+ * > Apakah bisa multiple warehouse?
+ */
+ context.dispatch('isValidMultipleWarehouse');
+
+ if (context.state.warehouseType === "Multiple") {
+ data.forEach((element) => {
+ element.warehouse = {
+ WarehouseID: element.WarehouseID,
+ WarehouseName: element.WarehouseName,
+ };
+ });
+ } else if (context.state.warehouseType === "Single") {
+ data.forEach((element) => {
+ element.warehouse = context.state.selectedWarehouse; // Semua item pakai warehouse yang sama
+ });
+ }
+
+ let summary = await groupPurchaseRequestsByItemId(data, context);
+ context.commit('update_summary', summary);
+ console.log("Summary setelah grouping:", JSON.parse(JSON.stringify(summary)));
+
+ // Hitung summary total menggunakan fungsi dari functions.js
+ const summaryTotal = calculateSummaryTotal(
+ summary,
+ context.state.taxPpn,
+ context.state.taxPph,
+ context.state.discountType,
+ context.state.discountAmount
+ );
+
+ context.commit('update_summaryTotal', summaryTotal);
+ },
+
+ multipleWarehouseValidation(context, selectedItem) {
+ let data;
+
+ if (!selectedItem || selectedItem.length === 0) {
+ data = JSON.parse(JSON.stringify(context.state.selectedItem));
+ } else {
+ data = JSON.parse(JSON.stringify(selectedItem));
+ }
+
+ // Pakai 'Set' JS Object yang hanya menyimpan nilai unik.
+ const warehouseIds = new Set();
+
+ data.forEach(item => {
+ if (item.WarehouseID) {
+ // Kalau ada yang sama maka disimpan sekali.
+ warehouseIds.add(item.WarehouseID);
+ }
+ });
+
+ if (warehouseIds.size > 1) {
+ return true; // Ada lebih dari satu WarehouseID
+ } else {
+ return false; // Hanya ada satu WarehouseID
+ }
+ },
+
+ async isValidMultipleWarehouse(context) {
+ /**
+ * @param: array of PurchaseRequestDetailID dari selectedItem
+ * @api: api.isValidMultipleWarehouse
+ * @return: JSON -> {data.status (boolean), data.message (string)}
+ *
+ */
+ if (context.state.selectedItem.length === 0) {
+ return false; // Tidak ada item yang dipilih
+ }
+ try {
+ let payload = {
+ "PurchaseRequestDetailIDs": context.state.selectedItem.map(item => item.PurchaseRequestDetailID),
+ "token": one_token(),
+ };
+
+ let response = await api.isValidMultipleWarehouse(payload)
+
+ console.log("Payload untuk isValidMultipleWarehouse:", JSON.parse(JSON.stringify(payload.PurchaseRequestDetailIDs)));
+ console.log("Response dari isValidMultipleWarehouse:", JSON.parse(JSON.stringify(response)));
+
+ if (response.status !== "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_isValidMultipleWarehouse", {
+ status: false,
+ message: '',
+ });
+ context.commit("update_snackbar", snackbar);
+ } else {;
+ context.commit("update_isValidMultipleWarehouse", {
+ status: response.data.status,
+ message: response.data.message,
+ });
+ if(response.data.status == false) {
+ context.commit("update_warehouseType", 'Single');
+ context.commit("update_selectedWarehouse", context.state.selectedWarehouse);
+ }
+ };
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ }
+ },
+
+ assignEdit(context) {
+ let data = context.state.selectedPO
+ context.commit("update_selectedDateForm", data.PurchaseOrderDate);
+ context.commit("update_searchSupplier", data.SupplierName);
+ context.commit("update_selectedSupplier", {
+ "SupplierID": data.PurchaseOrderSupplierID,
+ "SupplierCode": data.SupplierCode,
+ "SupplierName": data.SupplierName
+ });
+ context.commit("update_selectedItemCategory", {
+ "itemCategoryID": data.itemCategoryID,
+ "itemCategoryName": data.itemCategoryName
+ });
+ context.commit("update_refNumber", data.PurchaseOrderRefNumber);
+ context.commit("update_shippingCost", data.PurchaseOrderShippingCost);
+ context.commit("update_shippingCostStatus", data.PurchaseOrderShippingCostStatus === 'Y' ? true : false);
+ context.commit("update_taxPpn", data.PurchaseOrderTaxPercentPpn);
+ context.commit("update_taxPph", data.PurchaseOrderTaxPercentPph);
+ context.commit("update_paymentTerm", data.PurchaseOrderPaymentTerm);
+ context.commit("update_discountType", data.PurchaseOrderDiscountPercent > 0 ? 'Percentage' : 'Absolute');
+ if (data.PurchaseOrderDiscountPercent > 0) {
+ context.commit("update_discountAmount", parseFloat(data.PurchaseOrderDiscountPercent));
+ } else {
+ context.commit("update_discountAmount", parseFloat(data.PurchaseOrderDiscountAmount));
+ }
+ context.commit("update_note", data.PurchaseOrderNote);
+ context.commit("update_warehouseType", data.PurchaseOrderWarehouseType);
+ context.commit("update_selectedWarehouse", {
+ "WarehouseID": data.PurchaseOrderWarehouseID,
+ "WarehouseCode": data.WarehouseCode,
+ "WarehouseName": data.WarehouseName,
+ });
+ context.commit("update_dialogFormAct", 'EDIT');
+ context.dispatch("countItemTotal");
+ },
+
+ resetForm(context) {
+ context.commit("update_selectedDateForm", moment(new Date()).format('YYYY-MM-DD'));
+ context.commit("update_selectedSupplier", {});
+ context.commit("update_refNumber", '');
+ context.commit("update_taxPpn", 0);
+ context.commit("update_taxPph", 0);
+ context.commit("update_paymentTerm", 0);
+ context.commit("update_discountType", 'Percentage');
+ context.commit("update_discountAmount", 0);
+ context.commit("update_note", '');
+ context.commit("update_warehouseType", 'Single');
+ context.commit("update_selectedWarehouse", context.state.defaultWarehouse);
+ context.commit("update_itemList", []);
+ context.commit("update_selectedItemTemp", []);
+ context.commit("update_selectedItem", []);
+ context.commit("update_deletedItem", []);
+ context.commit("update_selectedItemCategory", {});
+ context.commit("update_summary", []);
+ context.commit("update_searchItem", '');
+ context.commit("update_shippingCost", 0);
+ context.commit("update_shippingCostStatus", true);
+ context.commit("update_dialogFormAct", 'ADD');
+ context.commit("update_summaryTotal", {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ });
+ context.commit("update_itemTotal", {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ });
+ },
+
+ countItemTotal(context) {
+ let selectedItem = context.state.selectedItem;
+ if (selectedItem.length === 0) {
+ let hasil = {
+ total: 0,
+ tax: 0,
+ ppn: 0,
+ pph: 0,
+ discount: 0,
+ finalTotal: 0,
+ }
+ context.commit("update_itemTotal", hasil);
+ return;
+ }
+
+ // Fix: Ensure we're working with numeric values
+ let total = selectedItem.reduce((acc, item) => {
+ // Convert string to number if needed
+ const itemTotal = typeof item.Total === 'string' ?
+ parseFloat(item.Total.replace(/\./g, '').replace(',', '.')) :
+ item.Total;
+ return acc + (isNaN(itemTotal) ? 0 : itemTotal);
+ }, 0);
+
+ total = Math.round(total * 100) / 100;
+
+ let discount = parseFloat(context.state.discountAmount) || 0;
+ if (context.state.discountType === 'Percentage') {
+ discount = Math.round((discount / 100) * total * 100) / 100;
+ }
+
+ let newTotal = Math.round((total - discount) * 100) / 100;
+ let ppn = Math.round((parseFloat(context.state.taxPpn) / 100) * newTotal * 100) / 100;
+ let pph = Math.round((parseFloat(context.state.taxPph) / 100) * newTotal * 100) / 100;
+ let pajak = Math.round((ppn + pph) * 100) / 100;
+ let final = Math.round((newTotal + pajak) * 100) / 100;
+
+ let hasil = {
+ total: total,
+ tax: pajak,
+ ppn: ppn,
+ pph: pph,
+ discount: discount,
+ finalTotal: final,
+ }
+ context.commit("update_itemTotal", hasil);
+ },
+
+ updatePoQty(context, { itemId, newPoQty }) {
+ let updatedSelectedItem = context.state.selectedItem.map(item => {
+ if (item.PurchaseRequestFlagID === itemId) {
+ // Convert string to number and ensure minimum value of 1
+ const numericPoQty = Number(newPoQty);
+ item.PoQty = Math.max(1, Math.floor(isNaN(numericPoQty) ? 1 : numericPoQty));
+
+ // Recalculate item total
+ let price = item.DefaultPurchase?.SupplierPricePrice || 0;
+
+ // Apply discount if exists
+ if (item.discount > 0) {
+ if (item.discountType === 'P') {
+ price = price - (item.discount * price / 100);
+ } else if (item.discountType === 'R') {
+ price = price - item.discount;
+ }
+ }
+
+ item.Total = item.PoQty * price;
+ }
+ return item;
+ });
+
+ context.commit('update_selectedItem', updatedSelectedItem);
+
+ // Regenerate summary
+ context.dispatch('generateSummary');
+ context.dispatch('countItemTotal');
+ context.dispatch('generateSummaryTotal');
+ },
+
+ async getSupplier(context) {
+ if (context.state.searchSupplier.length < 2) return;
+ context.commit("update_loadingAutocomplete", true);
+
+ try {
+ var payload = {
+ token: one_token(),
+ search: context.state.searchSupplier,
+
+ };
+
+ let response = await api.getSupplier(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+
+ context.commit("update_supplierList", data.records);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ },
+
+ async getItemCategory(context) {
+
+ context.commit("update_loadingAutocomplete", true);
+
+ try {
+ var payload = {
+ token: one_token(),
+
+ };
+
+ let response = await api.getItemCategory(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+
+ context.commit("update_itemCategoryList", data.records);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ },
+
+ async getWarehouse(context) {
+
+ context.commit("update_loadingAutocomplete", true);
+
+ try {
+ var payload = {
+ regionalId: one_user().S_RegionalID,
+ token: one_token(),
+ };
+
+ let response = await api.getWarehouse(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ response.data.records.forEach(element => {
+ if (element.WarehouseIsDefault === 'Y') {
+ context.commit("update_defaultWarehouse", element);
+ }
+
+ });
+ context.commit("update_warehouseList", response.data.records);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loadingAutocomplete", false);
+ }
+ },
+
+ async getItem(context) {
+ context.commit("update_loading", true);
+ try {
+ var payload = {
+ "search": context.state.searchItem,
+ "currentPage": context.state.currentPageItem,
+ "supplierID": context.state.selectedSupplier.SupplierID,
+ "itemCategoryID": context.state.selectedItemCategory.itemCategoryID,
+ "regionalId": one_user().S_RegionalID,
+ "token": one_token(),
+ };
+
+ let response = await api.getItem(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.totalPage,
+ };
+
+ context.commit("update_itemList", data.records);
+ context.commit("update_totalPageItem", data.total);
+ context.commit("update_loading", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async getItemUpdate(context) {
+ context.commit("update_loading", true);
+ try {
+ var payload = {
+ "POID": context.state.selectedPO.PurchaseOrderID,
+ "token": one_token(),
+ };
+
+ let response = await api.getItemUpdate(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.totalPage,
+ };
+
+ context.commit("update_selectedItem", data.records);
+ /**
+ * Tambah validasi:
+ * > Apakah bisa multiple warehouse?
+ */
+ context.dispatch('isValidMultipleWarehouse');
+
+ context.commit("update_summary", response.data.summary)
+ context.dispatch("countItemTotal");
+ // Hitung summary total menggunakan fungsi dari functions.js
+ // TODO: Check ini akibat penyesuaian
+ const summaryTotal = calculateSummaryTotal(
+ response.data.summary,
+ context.state.taxPpn,
+ context.state.taxPph,
+ context.state.discountType,
+ context.state.discountAmount
+ );
+
+ context.commit('update_summaryTotal', summaryTotal);
+
+ context.commit("update_loading", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async saveOrder(context) {
+ try {
+ if (!validatePurchaseOrder(context)) {
+ return;
+ }
+
+ const invalidQtyItems = context.state.selectedItem.filter(item => {
+ // Convert string to number first
+ const poQty = Number(item.PoQty);
+
+ // Check if conversion failed (NaN), is less than 1, or not an integer
+ return isNaN(poQty) || poQty < 1 || !Number.isInteger(poQty);
+ });
+
+ if (invalidQtyItems.length > 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: "Semua item harus memiliki quantity minimal 1",
+ }
+ context.commit("update_snackbar", snackbar);
+ return;
+ }
+
+ // Validasi: Cek apakah ada item dengan harga supplier null
+ if (context.state.supplierPriceSave === null) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: `Jumlah Quantity tidak tersedia di rentang harga supplier pada item ${context.state.itemDesc}!`,
+ }
+ context.commit("update_snackbar", snackbar);
+ return;
+ }
+
+ context.commit("update_loading", true);
+
+ var payload = {
+ "token": one_token(),
+ "Date": context.state.selectedDateForm,
+ "RefNumber": context.state.refNumber,
+ "SupplierID": context.state.selectedSupplier.SupplierID,
+ "ItemCategoryID": context.state.selectedItemCategory.itemCategoryID,
+ "TaxPercent": context.state.taxPpn,
+ "PaymentTerm": context.state.paymentTerm,
+ "DiscountPercent": context.state.discountType === 'Percentage' ? context.state.discountAmount : 0,
+ "DiscountAmount": context.state.discountType === 'Absolute' ? context.state.discountAmount : 0,
+ "WarehouseType": context.state.warehouseType,
+ "WarehouseID": context.state.selectedWarehouse.WarehouseID,
+ "Note": context.state.note,
+ "SubTotal": context.state.summaryTotal.total,
+ "TaxPercentPph": context.state.taxPph,
+ "TaxPercentPpn": context.state.taxPpn,
+ "TaxAmount": context.state.summaryTotal.tax,
+ "TaxAmountPph": context.state.summaryTotal.pph,
+ "TaxAmountPpn": context.state.summaryTotal.ppn,
+ "GrandTotal": context.state.summaryTotal.finalTotal,
+ "ShippingCost": context.state.shippingCost,
+ "ShippingCostStatus": context.state.shippingCostStatus,
+ // "Details": detail,
+ "Summary": context.state.summary
+ };
+
+ // Validasi Total Tidak Boleh <0
+ const financialChecks = [
+ { value: payload.GrandTotal, name: "Total" },
+ { value: payload.SubTotal, name: "Sub Total" },
+ { value: payload.TaxAmount, name: "Pajak" },
+ { value: payload.TaxAmountPph, name: "Pajak PPH" },
+ { value: payload.TaxAmountPpn, name: "Pajak PPN" },
+ { value: payload.DiscountAmount, name: "Diskon" },
+ { value: payload.ShippingCost, name: "Biaya Ekspedisi" }
+ ];
+
+ for (const check of financialChecks) {
+ if (check.value < 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: `${check.name} tidak boleh kurang dari 0`,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ return;
+ }
+ }
+
+ let response = await api.saveOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil simpan data",
+ }
+ context.commit("update_snackbar", snackbar);
+
+
+ context.commit("update_loading", false);
+ context.commit("update_dialogForm", false);
+ context.dispatch("resetForm");
+ context.dispatch("searchData");
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async searchData(context) {
+ context.commit("update_loading", true);
+ try {
+
+ var url_string = window.location.href
+ var url = new URL(url_string);
+ var status = url.searchParams.get("status");
+ var xstartdate = url.searchParams.get("startdate");
+ var xsearch = url.searchParams.get("search");
+ var xflag = url.searchParams.get("flag");
+
+ // untuk notifikasi
+ if (xflag == 'N') {
+
+ if (xsearch != null && xsearch != '') {
+ context.commit("update_search", xsearch);
+ }
+ if (status != null && status != '') {
+ context.commit("update_selectedStatus", { value: status, title: status });
+ }
+ if (xstartdate != null && xstartdate != '') {
+ context.commit("update_selectedDate", xstartdate);
+ context.commit("update_selectedEndDate", xstartdate);
+ }
+
+ } else if (xflag == 'G') {
+ // untuk get data param approve all
+
+ if (status != null && status != '') {
+ context.commit("update_selectedStatus", { value: status, title: status });
+ }
+ if (xstartdate != null && xstartdate != '') {
+ context.commit("update_selectedDate", xstartdate);
+ context.commit("update_selectedDateEnd", moment(new Date()).format('YYYY-MM-DD'));
+ }
+ context.commit("update_flag", xflag);
+
+ }
+
+ var payload = {
+ "token": one_token(),
+ "currentPage": context.state.selectedPage,
+ "search": context.state.search,
+ "startDate": context.state.selectedDate,
+ "endDate": context.state.selectedDateEnd,
+ "status": context.state.selectedStatus.value,
+ "flag": context.state.flag
+ };
+
+ let response = await api.search(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ context.commit("update_totalPage", response.data.totalPage);
+ context.commit("update_poList", data.records);
+ context.commit("update_loading", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async requestOrder(context) {
+ context.commit("update_loading", true);
+
+ try {
+
+ var payload = {
+ "token": one_token(),
+ "ID": context.state.selectedPO.PurchaseOrderID,
+ };
+
+ let response = await api.requestOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil request order",
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ context.commit("update_dialogConfirmation", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async deleteOrder(context) {
+ context.commit("update_loading", true);
+
+ try {
+ var payload = {
+ "token": one_token(),
+ "PurchaseOrderId": context.state.selectedPO.PurchaseOrderID,
+ };
+
+ let response = await api.deleteOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil hapus order",
+ }
+ context.commit("update_snackbar", snackbar);
+
+ await context.dispatch("searchData");
+ context.commit("update_loading", false);
+ context.commit("update_dialogDelete", false);
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async updateOrder(context) {
+ try {
+ if (!validatePurchaseOrder(context)) {
+ return;
+ }
+
+ const invalidQtyItems = context.state.selectedItem.filter(item => {
+ // Convert string to number first
+ const poQty = Number(item.PoQty);
+
+ // Check if conversion failed (NaN), is less than 1, or not an integer
+ return isNaN(poQty) || poQty < 1 || !Number.isInteger(poQty);
+ });
+
+ console.log("InvalidQtyItem updateOrder", invalidQtyItems)
+
+ if (invalidQtyItems.length > 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: "Semua item harus memiliki quantity minimal 1",
+ }
+ context.commit("update_snackbar", snackbar);
+ return;
+ }
+
+ // Validasi: Cek apakah ada item dengan harga supplier null
+ if (context.state.supplierPriceSave === null) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: `Jumlah Quantity tidak tersedia di rentang harga supplier pada item ${context.state.itemDesc}!`,
+ }
+ context.commit("update_snackbar", snackbar);
+ return;
+ }
+
+ var payload = {
+ "token": one_token(),
+ "Date": context.state.selectedDateForm,
+ "RefNumber": context.state.refNumber,
+ "SupplierID": context.state.selectedSupplier.SupplierID,
+ "TaxPercent": context.state.taxPpn,
+ "PaymentTerm": context.state.paymentTerm,
+ "ItemCategoryID": context.state.selectedItemCategory.itemCategoryID,
+ "DiscountPercent": context.state.discountType === 'Percentage' ? context.state.discountAmount : 0,
+ "DiscountAmount": context.state.discountType === 'Absolute' ? context.state.discountAmount : 0,
+ "WarehouseType": context.state.warehouseType,
+ "WarehouseID": context.state.selectedWarehouse.WarehouseID,
+ "Note": context.state.note,
+ "SubTotal": context.state.summaryTotal.total,
+ "TaxPercentPph": context.state.taxPph,
+ "TaxPercentPpn": context.state.taxPpn,
+ "TaxAmount": context.state.summaryTotal.tax,
+ "TaxAmountPph": context.state.summaryTotal.pph,
+ "TaxAmountPpn": context.state.summaryTotal.ppn,
+ "GrandTotal": context.state.summaryTotal.finalTotal,
+ "ShippingCost": context.state.shippingCost,
+ "ShippingCostStatus": context.state.shippingCostStatus,
+ "PO": context.state.selectedPO,
+ "Summary": context.state.summary,
+ "deletedItem": context.state.deletedItem,
+ "IsApprovalEdit": true,
+ };
+
+ // Validasi Total Tidak Boleh <0
+ const financialChecks = [
+ { value: payload.GrandTotal, name: "Total" },
+ { value: payload.SubTotal, name: "Sub Total" },
+ { value: payload.TaxAmount, name: "Pajak" },
+ { value: payload.TaxAmountPph, name: "Pajak PPH" },
+ { value: payload.TaxAmountPpn, name: "Pajak PPN" },
+ { value: payload.DiscountAmount, name: "Diskon" },
+ { value: payload.ShippingCost, name: "Biaya Ekspedisi" }
+ ];
+
+ for (const check of financialChecks) {
+ if (check.value < 0) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: `${check.name} tidak boleh kurang dari 0`,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ return;
+ }
+ }
+
+ context.commit("update_loading", true);
+ let response = await api.updateOrder(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil simpan data",
+ }
+ context.commit("update_snackbar", snackbar);
+
+
+ context.commit("update_loading", false);
+ context.commit("update_dialogForm", false);
+ context.dispatch("resetForm");
+ context.dispatch("searchData");
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async approveOrder(context, payload) {
+ context.commit("update_loading", true);
+ try {
+ payload.token = one_token()
+ payload.approvelevel = context.state.approve_level
+
+ let response = await api.approvePOrder(payload);
+ if (response.status != 'OK') {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ if (context.state.approve_level == '2') {
+ let params = { token: one_token(), id: payload.poID }
+ let generateitempo = await api.generateItemPO(params)
+ if (generateitempo.status != 'OK') {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil approve order",
+ }
+ context.commit("update_snackbar", snackbar);
+
+ await context.dispatch("searchData");
+ context.commit("update_loading", false);
+ }
+ } else {
+ let snackbar = {
+ state: true,
+ type: "success",
+ message: "Berhasil approve order manager",
+ }
+ context.commit("update_snackbar", snackbar);
+
+ await context.dispatch("searchData");
+ context.commit("update_loading", false);
+ }
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async getApprovalLevel(context) {
+ context.commit("update_loading", true);
+ try {
+ let response = await api.getApprovalLevel({token: one_token()});
+ if (response.status != 'OK') {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = response.data.M_UserM_ApproveLevelID
+
+ context.commit("update_approve_level", data)
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+
+ async getDefaultSupplierPrice(context, payload) {
+ context.commit("update_loading", true);
+ try {
+ payload.token = one_token()
+ payload.supplierID = context.state.selectedSupplier.SupplierID
+
+ let response = await api.getDefaultSupplierPrice(payload);
+ if (response.status != "OK") {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: response.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ } else {
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("update_loading", false);
+
+ return data.records;
+ }
+ } catch (e) {
+ let snackbar = {
+ state: true,
+ type: "error",
+ message: e.message,
+ }
+ context.commit("update_snackbar", snackbar);
+ context.commit("update_loading", false);
+ }
+ },
+ },
+};
diff --git a/test/vuex/acc-one-approve-po/store.js b/test/vuex/acc-one-approve-po/store.js
new file mode 100644
index 0000000..e107174
--- /dev/null
+++ b/test/vuex/acc-one-approve-po/store.js
@@ -0,0 +1,14 @@
+// import manager from "./modules/manager.js";
+// import prkacab from "./modules/prkacab.js"
+import system from "../../../apps/modules/system/system.js";
+import po from "./modules/po.js";
+
+export const store = new Vuex.Store({
+ modules: {
+ po: po,
+ system: system
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-cashier-v2/api/cashier.js b/test/vuex/acc-one-cashier-v2/api/cashier.js
new file mode 100644
index 0000000..9f6f47f
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/api/cashier.js
@@ -0,0 +1,401 @@
+const URL = "/one-api/mockup/purchase/cashier/";
+
+export async function search(prm) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/search", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function searchBranch(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirect/getbranch',{
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchAccDana(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirect/getcoa', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchAccBiaya(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirect/getcoa', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchAccTemp(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirect/getcoa', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getPurchase(token, prm) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirect/getPurchase", {
+ token: token,
+ branchcode: prm,
+ }
+ );
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function searchdetail(token, prm) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/searchdetail", {
+ token: token,
+ ID: prm,
+ }
+ );
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function saveDetail(token, prm) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirect/save", {
+ token: token,
+ BranchCode: prm.branch,
+ CoaSourceID: prm.accountDana,
+ CoaExpenseID: prm.accountBiaya,
+ CoaTemporaryID: prm.accountTemp,
+ total: prm.total,
+ details: prm.details
+ }
+ );
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getTotalDraft(token) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirectRealitation/getTotalDraft', {
+ token: token
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getTotalPaid(token) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirectRealitation/getTotalPaid', {
+ token: token
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function deleteVoucher(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'purchaseRequestDirect/delete', {
+ token: token,
+ ID: prm.PVID
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function editVoucher(prm) {
+ try {
+ // console.log(prm)
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/update",prm);
+ // console.log(resp)
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function updatepaid(prm) {
+ try {
+ // console.log(prm)
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/updatepaid", prm);
+ console.log('api resp',resp)
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getPurchaseUpdateNew(token, prm) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirect/getPurchaseUpdateNew", {
+ token: token,
+ branchcode: prm.branchcode,
+ ID: prm.voucherID
+ }
+ );
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getUserReceive(prm) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/getUserReceive", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getVoucherDetail(params) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/getVoucherDetail", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function saveVoucherDetail(params) {
+ try {
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/saveVoucherDetail", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+
+ let data = resp.data
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function editVoucherV2(prm) {
+ try {
+ // console.log(prm)
+ var resp = await axios.post(URL + "purchaseRequestDirectRealitation/updateV2",prm);
+ // console.log(resp)
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/cashierListing.vue b/test/vuex/acc-one-cashier-v2/components/cashierListing.vue
new file mode 100644
index 0000000..e8d331a
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/cashierListing.vue
@@ -0,0 +1,700 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+ KASIR
+
+
+ arrow_back Back
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+ Total belum di bayar :
+ {{ totalDraft }}
+
+
+ Total belum di realisasi :
+ {{ totalPaid }}
+
+
+
+
+
+
+
+
+ {{ props.item.PaymentVoucherNumber }}
+ {{ formatDateHeader(props.item.PaymentVoucherDate) }}
+
+
+ {{ props.item.M_BranchName }}
+ Total : Rp {{ convertMoney(props.item.PaymentVoucherTotal) }}
+
+ {{ formatDateHeader(props.item.PaymentVoucherRealitationDate) }}
+
+
+ {{ props.item.PaymentVoucherStatus }}
+
+
+
+
+ Bayar
+
+
+
+
+
+ picture_as_pdf
+ Realisasi
+
+
+
+
+ picture_as_pdf
+ picture_as_pdf
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/dialogForm.vue b/test/vuex/acc-one-cashier-v2/components/dialogForm.vue
new file mode 100644
index 0000000..f5c50d4
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/dialogForm.vue
@@ -0,0 +1,682 @@
+
+
+
+
+
+ FORM REALISASI
+
+
+
+
+
+ Catatan harus diisi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ edit
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BUKTI PEMBAYARAN :
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Simpan
+ Realisasi & Simpan
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/dialogFormPay.vue b/test/vuex/acc-one-cashier-v2/components/dialogFormPay.vue
new file mode 100644
index 0000000..ba0b34b
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/dialogFormPay.vue
@@ -0,0 +1,649 @@
+
+
+
+
+
+ FORM PEMBAYARAN
+
+
+
+
+ NOMOR REQUEST:
+
+
+
+
+
+ {{ item }}
+
+
+
+
+
+
+ Catatan harus diisi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Penerima uang belum di pilih
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BUKTI PEMBAYARAN :
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Simpan
+ Bayar & Simpan
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/dialogFormRealise.vue b/test/vuex/acc-one-cashier-v2/components/dialogFormRealise.vue
new file mode 100644
index 0000000..577ff02
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/dialogFormRealise.vue
@@ -0,0 +1,392 @@
+
+
+
+
+ FORM REALISASI
+
+
+
+
+
+
+ Catatan harus diisi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.PurchaseRequestDirectDescription }}
+
+
+
+
+
+ {{ item.PurchaseRequestDirectNumber }}
+
+
+ {{ item.PurchaseRequestDirectDescription }}
+
+ Kategori: {{ item.PurchaseDirectCategoryName }}
+
+
+
+ Harga Estimasi:
+ Rp. {{ oneMoney(item.estimate_price) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ close
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Simpan & Realisasi
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/dialogItemRealize.vue b/test/vuex/acc-one-cashier-v2/components/dialogItemRealize.vue
new file mode 100644
index 0000000..c5ed786
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/dialogItemRealize.vue
@@ -0,0 +1,136 @@
+
+
+
+ ITEM REALISE
+
+
+
+ {{ item.PurchaseRequestDirectNumber }}
+
+
+ {{ item.PurchaseRequestDirectDescription }}
+ Kategori: {{ item.PurchaseDirectCategoryName }}
+
+
+ Harga Estimasi:
+ Rp. {{ oneMoney(item.estimate_price) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ BATAL
+ SIMPAN
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/dialogViewImg.vue b/test/vuex/acc-one-cashier-v2/components/dialogViewImg.vue
new file mode 100644
index 0000000..b1b8b57
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/dialogViewImg.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ close
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/components/listingDetail.vue b/test/vuex/acc-one-cashier-v2/components/listingDetail.vue
new file mode 100644
index 0000000..9aada00
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/components/listingDetail.vue
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No :
+ {{
+ selected_cashier.PaymentVoucherNumber
+ }}
+
+
+
+
+ Sumber Dana :
+ {{
+ selected_cashier.CoaSource
+ }}
+
+
+
+
+
+
+
+ Tampungan Sementara :
+ {{
+ selected_cashier.CoaTemporary
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.index + 1 }}
+
+
+ {{ props.item.M_UserUsername }}
+
+
+ {{ props.item.PurchaseRequestDirectNumber }}
+
+
+ Rp
+ {{
+ convertMoney(props.item.PaymentVoucherDetailTotal)
+ }}
+
+
+
+ {{ value == 'notset'? '-' : value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/index.php b/test/vuex/acc-one-cashier-v2/index.php
new file mode 100644
index 0000000..598f200
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/index.php
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-cashier-v2/modules/cashier.js b/test/vuex/acc-one-cashier-v2/modules/cashier.js
new file mode 100644
index 0000000..4f6fc06
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/modules/cashier.js
@@ -0,0 +1,790 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/cashier.js";
+
+export default {
+ namespaced: true,
+ state: {
+ dialog_cashier: false,
+ status_options: [
+ { val: 0, text: 'All' }, { val: 1, text: 'Draft' },
+ { val: 2, text: 'Paid' }, { val: 3, text: 'Realitation' }
+ ],
+ selected_status: { val: 1, text: 'Draft' },
+ menuStartDate: false,
+ menuEndDate: false,
+
+ dStartDate: new Date().toISOString().substring(0, 10),
+ dEndDate: new Date().toISOString().substring(0, 10),
+ xStartDate: moment(new Date()).format('YYYY-MM-DD'),
+ xEndDate: moment(new Date()).format('YYYY-MM-DD'),
+
+ // listing
+ currentPage: 1,
+ search_status: 0,
+ search_error_message: "",
+ cashierList: [],
+ selected_cashier: {},
+ total_page_cashier: 0,
+ xsearch: "",
+ act: "new",
+ imagePreviews: [],
+ imagePrevPaid: [],
+
+ // form
+ load_status_branch: 0,
+ error_message: "",
+ alert_error: false,
+ branchList: [],
+ selected_branch: {},
+ search_branch: "",
+ accountDanaList: [],
+ selected_accountDana: {},
+ search_accountDana: "",
+ load_status_accDana: 0,
+ accountBiayaList: [],
+ selected_accountBiaya: {},
+ search_accountBiaya: "",
+ load_status_accBiaya: 0,
+ accountTempList: [],
+ selected_accountTemp: {},
+ search_accountTemp: "",
+ load_status_accTemp: 0,
+ load_status: 0,
+ purchaseList: [],
+ selected_purchase: [],
+ resume_total: {"totalRealitation": 0},
+ errors: [],
+ alert_error: false,
+ alert_success: false,
+ success_message: "",
+ totalDraft: 0,
+
+ // detail
+ search_status_detail: 0,
+ details: [],
+ show_progrees_upload: false,
+ note: "",
+ notepay: "",
+ dialog_cashier_pay: false,
+ totalPaid: 0,
+ restPrice: 0,
+ openprint: false,
+ numberRequest: [],
+ total_akhir: 0,
+ requestDescription: "",
+ status: '',
+ xdate: '',
+ imagePayPreviews: [],
+ imagePayFiles: [],
+ user: one_user(),
+ userReceive: [],
+ selected_userReceive:'',
+ imageRelationPreviews: [],
+ imageRelationFiles: [],
+
+ // voucher detail
+ dialog_view_img: false,
+ listing_item_realise: [],
+ selected_img_view: ''
+ },
+ mutations: {
+ update_dialog_cashier(state, val) {
+ state.dialog_cashier = val;
+ },
+ update_status_options(state, val) {
+ state.status_options = val;
+ },
+ update_selected_status(state, val) {
+ state.selected_status = val;
+ },
+ update_menuStartDate(state, val) {
+ state.menuStartDate = val;
+ },
+ update_menuEndDate(state, val) {
+ state.menuEndDate = val;
+ },
+ update_dStartDate(state, val) {
+ state.dStartDate = val;
+ },
+ update_dEndDate(state, val) {
+ state.dEndDate = val;
+ },
+ update_xStartDate(state, val) {
+ state.xStartDate = val;
+ },
+ update_xEndDate(state, val) {
+ state.xEndDate = val;
+ },
+ update_currentPage(state, val) {
+ state.currentPage = val;
+ },
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val;
+ },
+ update_cashierList(state, val) {
+ state.cashierList = val;
+ },
+ update_selected_cashier(state, val) {
+ state.selected_cashier = val;
+ },
+ update_total_page_cashier(state, val) {
+ state.total_page_cashier = val;
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val;
+ state.currentPage = 1;
+ },
+ update_act(state, val) {
+ state.act = val
+ },
+ update_load_status_branch(state, val) {
+ state.load_status_branch = val;
+ },
+ update_error_message(state, val) {
+ state.error_message = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_branchList(state, val) {
+ state.branchList = val;
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val;
+ },
+ update_search_branch(state, val) {
+ state.search_branch = val;
+ },
+ update_accountDanaList(state, val) {
+ state.accountDanaList = val;
+ },
+ update_selected_accountDana(state, val) {
+ state.selected_accountDana = val;
+ },
+ update_search_accountDana(state, val) {
+ state.search_accountDana = val;
+ },
+ update_load_status_accDana(state, val) {
+ state.load_status_accDana = val;
+ },
+ update_accountBiayaList(state, val) {
+ state.accountBiayaList = val;
+ },
+ update_selected_accountBiaya(state, val) {
+ state.selected_accountBiaya = val;
+ },
+ update_search_accountBiaya(state, val) {
+ state.search_accountBiaya = val;
+ },
+ update_load_status_accBiaya(state, val) {
+ state.load_status_accBiaya = val;
+ },
+ update_accountTempList(state, val) {
+ state.accountTempList = val;
+ },
+ update_selected_accountTemp(state, val) {
+ state.selected_accountTemp = val;
+ },
+ update_search_accountTemp(state, val) {
+ state.search_accountTemp = val;
+ },
+ update_load_status_accTemp(state, val) {
+ state.load_status_accTemp = val;
+ },
+ update_load_status(state, val) {
+ state.load_status = val;
+ },
+ update_purchaseList(state, val) {
+ state.purchaseList = val;
+ },
+ update_selected_purchase(state, val) {
+ state.selected_purchase = val;
+ },
+ update_resume_total(state, val) {
+ state.resume_total = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val;
+ },
+ update_success_message(state, val) {
+ state.success_message = val;
+ },
+ update_totalDraft(state, val) {
+ state.totalDraft = val
+ },
+ update_search_status_detail(state, val) {
+ state.search_status_detail = val;
+ },
+ update_details(state, val) {
+ state.details = val
+ },
+ update_show_progrees_upload(state, val) {
+ state.show_progrees_upload = val
+ },
+ update_note(state, val) {
+ state.note = val
+ },
+ update_notepay(state, val) {
+ state.notepay = val
+ },
+ update_dialog_cashier_pay(state, val) {
+ state.dialog_cashier_pay = val
+ },
+ update_totalPaid(state, val) {
+ state.totalPaid = val
+ },
+ update_restPrice(state, val) {
+ state.restPrice = val
+ },
+ update_openprint(state, val) {
+ state.openprint = val
+ },
+ update_imagePreviews(state, val) {
+ state.imagePreviews = val
+ },
+ update_imagePrevPaid(state, val) {
+ state.imagePrevPaid = val
+ },
+ update_numberRequest(state, val) {
+ state.numberRequest = val
+ },
+ update_total_akhir(state, val) {
+ state.total_akhir = val
+ },
+ update_requestDescription(state, val) {
+ state.requestDescription = val
+ },
+ update_status(state, val) {
+ state.status = val
+ },
+ update_xdate(state, val) {
+ state.xdate = val
+ },
+ update_imagePayPreviews(state, val) {
+ state.imagePayPreviews = val;
+ },
+ update_imagePayFiles(state, val) {
+ state.imagePayFiles = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_userReceive(state, val) {
+ state.userReceive = val;
+ },
+ update_selected_userReceive(state, val) {
+ state.selected_userReceive = val;
+ },
+ update_imageRelationPreviews(state, val) {
+ state.imageRelationPreviews = val;
+ },
+ update_imageRelationFiles(state, val) {
+ state.imageRelationFiles = val;
+ },
+ update_dialog_view_img(state, val) {
+ state.dialog_view_img = val
+ },
+ update_listing_item_realise(state, val) {
+ state.listing_item_realise = val
+ },
+ update_selected_img_view(state, val) {
+ state.selected_img_view = val
+ }
+ },
+ actions: {
+ async search(context) {
+ context.commit("update_search_status", 1);
+
+ try {
+ var url_string = window.location.href
+ var url = new URL(url_string);
+ var status = url.searchParams.get("status");
+ var xstartdate = url.searchParams.get("startdate");
+
+ context.commit("update_status", status);
+ context.commit("update_xdate", xstartdate);
+
+ const today = moment(new Date()).format('YYYY-MM-DD');
+
+ var startDate = xstartdate == null || xstartdate == '' ? context.state.xStartDate : xstartdate;
+ var endDate = xstartdate == null || xstartdate == '' ? context.state.xEndDate : today;
+
+ var prm = {
+ token: one_token(),
+ currentPage: context.state.currentPage,
+ status: status == null || status == '' ? context.state.selected_status.text : status,
+ search: context.state.xsearch,
+ startdate: startDate,
+ enddate: endDate,
+ lastId: -1,
+ };
+
+ let resp = await api.search(prm);
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2);
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total,
+ };
+
+ context.commit("update_cashierList", data.records);
+ context.commit("update_total_page_cashier", data.total);
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async searchBranch(context, prm) {
+ context.commit("update_load_status_branch", 1)
+ try {
+ let resp = await api.searchBranch(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status_branch", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status_branch", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_branchList", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status_branch", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async searchAccDana(context, prm) {
+ context.commit("update_load_status_accDana", 1)
+ try {
+ let resp = await api.searchAccDana(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status_accDana", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status_accDana", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_accountDanaList", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status_accDana", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async searchAccBiaya(context, prm) {
+ context.commit("update_load_status_accBiaya", 1)
+ try {
+ let resp = await api.searchAccBiaya(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status_accBiaya", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status_accBiaya", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_accountBiayaList", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status_accBiaya", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async searchAccTemp(context, prm) {
+ context.commit("update_load_status_accTemp", 1)
+ try {
+ let resp = await api.searchAccTemp(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status_accTemp", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status_accTemp", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_accountTempList", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status_accTemp", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getPurchase(context, prm) {
+ context.commit("update_load_status", 1)
+ try {
+ let resp = await api.getPurchase(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_purchaseList", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async searchdetail(context, prm) {
+ context.commit("update_search_status_detail", 1)
+ try {
+ let resp = await api.searchdetail(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status_detail", 2)
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ let total = 0;
+ data.records.forEach(element => {
+ total = total + Number(element.realised_price)
+ });
+
+ context.commit("update_details", data.records)
+ context.commit("update_restPrice", total)
+ }
+ } catch (e) {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async save(context, prm) {
+ context.commit("update_search_status_detail", 1)
+ try {
+
+ let resp = await api.saveDetail(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_search_status_detail", 2)
+ context.commit("update_error_message", resp.message);
+
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_cashier", false);
+ var msg = `Sukses menyimpan data baru dengan kode ${data.records[0].PaymentVoucherNumber}`;
+ context.commit("update_success_message", msg);
+ context.commit("update_selected_cashier", data.records[0]);
+ context.dispatch("search");
+ context.dispatch("searchdetail", data.records[0].PaymentVoucherID);
+ }
+ } catch (e) {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getTotalDraft(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+ let resp = await api.getTotalDraft(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ total: resp.data.total
+ }
+
+ context.commit("update_totalDraft", data.total)
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_error_message", e.message);
+ }
+ },
+
+ async getTotalPaid(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+ let resp = await api.getTotalPaid(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ total: resp.data.total
+ }
+
+ context.commit("update_totalPaid", data.total)
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_error_message", e.message);
+ }
+ },
+
+ async delete(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+
+ let resp = await api.deleteVoucher(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_error_message", resp.message);
+
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_cashier", false);
+ var msg = `Sukses menghapus data dengan kode ` + prm.PVNumber;
+ context.commit("update_success_message", msg);
+ // context.commit("update_selected_cashier", data.records[0]);
+ context.dispatch("search");
+ context.dispatch("searchdetail", "");
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async update(context, prm) {
+ context.commit("update_search_status_detail", 1)
+ try {
+
+ let resp = await api.editVoucherV2(prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_search_status_detail", 2)
+ context.commit("update_error_message", resp.message);
+
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_note", "");
+ context.commit("update_restPrice", 0);
+ context.commit("update_total_akhir", 0);
+ context.commit("update_imageRelationPreviews", []);
+ context.commit("update_imageRelationFiles", []);
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_cashier", false);
+ var msg = `Sukses Realisasi dengan kode ${data.records[0].PaymentVoucherNumber}`;
+ context.commit("update_success_message", msg);
+ // context.commit("update_selected_cashier", data.records[0]);
+ context.dispatch("search");
+ // context.dispatch("searchdetail", data.records[0].PaymentVoucherID);
+ }
+ } catch (e) {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async updatepaid(context, prm) {
+ context.commit("update_search_status_detail", 1)
+ try {
+
+ let resp = await api.updatepaid(prm)
+ console.log("updatepaid resp", resp)
+ if (resp.status != "OK") {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_search_status_detail", 2)
+ context.commit("update_error_message", resp.message);
+
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_notepay", "");
+ context.commit("update_imagePayPreviews", []);
+ context.commit("update_imagePayFiles", []);
+ context.commit("update_selected_userReceive", '');
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_cashier_pay", false);
+ var msg = `Sukses Pembayaran dengan kode ${data.records[0].PaymentVoucherNumber}`;
+ context.commit("update_success_message", msg);
+ // context.commit("update_selected_cashier", data.records[0]);
+ context.dispatch("search");
+ // context.dispatch("searchdetail", data.records[0].PaymentVoucherID);
+ }
+ } catch (e) {
+ context.commit("update_search_status_detail", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getPurchaseUpdateNew(context, prm) {
+ context.commit("update_load_status", 1)
+ try {
+ let resp = await api.getPurchaseUpdateNew(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_purchaseList", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getUserReceive(context) {
+ context.commit("update_load_status", 1)
+ try {
+ let prm = {
+ token: one_token(),
+ userId: context.state.user.M_UserID,
+ }
+ let resp = await api.getUserReceive(prm)
+ if (resp.status != "OK") {
+ context.commit("update_load_status", 3)
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_load_status", 2)
+ context.commit("update_error_message", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_userReceive", data.records)
+ }
+ } catch (e) {
+ context.commit("update_load_status", 3)
+ context.commit("update_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getVoucherDetail(context) {
+ try {
+ let param = {
+ token: one_token(),
+ ID: context.state.selected_cashier.PaymentVoucherID
+ }
+ let resp = await api.getVoucherDetail(param)
+ if (resp.status != 'OK') {
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ let data = resp.data
+
+ context.commit("update_listing_item_realise", data)
+
+ let realised = data.reduce((sum, item) => sum + Number(item.estimate_price), 0);
+ let detail = context.state.details;
+ let adjustment = detail.reduce((sum, item) => sum + Number(item.PurchaseRequestDirectAdjustment), 0)
+
+ let total = Number(context.state.selected_cashier.PaymentVoucherTotal)
+ let sisa = (total + adjustment) - realised
+ context.commit("update_total_akhir", sisa)
+ }
+ } catch (error) {
+ context.commit("update_error_message", error.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async saveVoucherDetail(context, param) {
+ try {
+ param.token = one_token()
+ let resp = await api.saveVoucherDetail(param)
+ if (resp.status != 'OK') {
+ context.commit("update_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_alert_success", true);
+ context.commit("update_success_message", "Success");
+
+ let ID = context.state.selected_cashier.PaymentVoucherID;
+ context.dispatch("searchdetail", ID)
+ context.commit("update_dialog_realise_item", false);
+ context.commit("update_listing_item_realise", [])
+ }
+
+ } catch (error) {
+ context.commit("update_error_message", error.message);
+ context.commit("update_alert_error", true);
+ }
+ }
+ },
+};
+
diff --git a/test/vuex/acc-one-cashier-v2/store.js b/test/vuex/acc-one-cashier-v2/store.js
new file mode 100644
index 0000000..f0479e4
--- /dev/null
+++ b/test/vuex/acc-one-cashier-v2/store.js
@@ -0,0 +1,11 @@
+import cashier from "./modules/cashier.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ cashier: cashier,
+ system: system,
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-fixed-asset/api/fixedasset.js b/test/vuex/acc-one-fixed-asset/api/fixedasset.js
new file mode 100644
index 0000000..1a2277e
--- /dev/null
+++ b/test/vuex/acc-one-fixed-asset/api/fixedasset.js
@@ -0,0 +1,192 @@
+const URL = "/one-api/fixedasset/item";
+
+export async function getAcAccumDepre(prm) {
+ try {
+ var resp = await axios.post(URL + '/getAcAccumDepre', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getAcCoa(prm) {
+ try {
+ var resp = await axios.post(URL + '/getAcCoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getItem(prm) {
+ try {
+ var resp = await axios.post(URL + '/getItem', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getDepartment(prm) {
+ try {
+ var resp = await axios.post(URL + '/getDepartment', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getPresentase(prm) {
+ try {
+ var resp = await axios.post(URL + '/getPresentase', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(prm) {
+ try {
+ var resp = await axios.post(URL + "/search", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function addData(prm) {
+ try {
+ var resp = await axios.post(URL + '/addData', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getByID(prm) {
+ try {
+ var resp = await axios.post(URL + '/get_by_id', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function editData(prm) {
+ try {
+ var resp = await axios.post(URL + '/editData', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function deleteData(prm) {
+ try {
+ var resp = await axios.post(URL + '/deleteData', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-fixed-asset/components/FixedAsset.vue b/test/vuex/acc-one-fixed-asset/components/FixedAsset.vue
new file mode 100644
index 0000000..b7d5235
--- /dev/null
+++ b/test/vuex/acc-one-fixed-asset/components/FixedAsset.vue
@@ -0,0 +1,1147 @@
+
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+
+ REGISTER FIXED ASSET
+
+
+ add_box
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.Fa_ItemNumber }}
+
+
+
+
{{props.item.Fa_ItemNote}}
+
+
{{props.item.M_ItemDesc}}
+
+
+
+
+
+ {{ props.item.Fa_ItemQty }}
+
+
+ {{ props.item.ClassCoaDescription }}
+
+
+ {{ props.item.AccumDepreCoaDescription }}
+
+
+ {{ props.item.AcquisitionCoaDescription }}
+
+
+
+
+ delete
+
+ Hapus
+
+
+
+ edit
+
+ Edit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FIX ASSET REGISTER {{xnumber}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Catatan harus diisi
+
+
+
+
+
+
+
+
+ Item harus dipilih
+
+
+ Harga perolehan harus diisi
+
+ Nilai Buku Saat Ini harus diisi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nilai saat ini : 0
+ Accum Depre : 0
+
+
+
+
+ TUTUP
+ SIMPAN
+ SIMPAN PERUBAHAN
+
+
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{ msgalertcoa }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+ EDIT FORM
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ SIMPAN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-fixed-asset/index.php b/test/vuex/acc-one-fixed-asset/index.php
new file mode 100644
index 0000000..c898d06
--- /dev/null
+++ b/test/vuex/acc-one-fixed-asset/index.php
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-fixed-asset/modules/fixedasset.js b/test/vuex/acc-one-fixed-asset/modules/fixedasset.js
new file mode 100644
index 0000000..e89ef89
--- /dev/null
+++ b/test/vuex/acc-one-fixed-asset/modules/fixedasset.js
@@ -0,0 +1,671 @@
+import * as api from "../api/fixedasset.js"
+
+export default {
+ namespaced: true,
+ state: {
+ Fa_ClassID: 0,
+ a_coas: [],
+ a_msg_info: '',
+ a_open_dialog_info: false,
+ a_save_status: 0,
+ // search table
+ a_x_search: '',
+ a_current_page: 1,
+ a_last_id: -1,
+ a_total_coa: 0,
+ // search table
+ a_selected_a_coa: {},
+ a_search_status: 0,
+ a_alert_success: false,
+ a_msg_success: '',
+ a_alert_error: false,
+ a_save_error_message: '',
+ dialog_add_coa: false,
+ dialog_edit_coa: false,
+ e_loading_nat_group: false,
+ // text classname
+ a_faname: '',
+ e_classname: '',
+ // ac coa
+ a_loading_coa: false,
+ a_coa_list: [],
+ a_coa: {},
+ a_coa_search: '',
+
+ // ac item
+ a_loading_item: false,
+ a_item_list: [],
+ a_item: {},
+ a_item_search: '',
+
+ // ac department
+ a_loading_department: false,
+ a_department_list: [],
+ a_department: {},
+ a_department_search: '',
+ // ac presentase
+ a_loading_presentase: false,
+ a_presentase_list: [],
+ a_presentase: {},
+ a_presentase_search: '',
+ a_inventaris : '',
+ a_note : '',
+ a_fa_account_id: 0,
+ a_fa_account_name: '',
+ a_accum_depre_account_id: 0,
+ a_accum_depre_account_name: '',
+ a_depre_account_id: 0,
+ a_depre_account_name: '',
+ a_qty: 1,
+ a_acquisition_price: 0,
+ a_book_value: 0,
+
+ // text note
+ a_note: '',
+ e_note: '',
+ a_errors_save: [],
+ Fa_ClassID: 0,
+ a_errors_save_coa: [],
+ xid: 0,
+ xnumber: '',
+ errors: [],
+ a_fa_age: 0,
+ a_fa_depresiasi_bulan: 0,
+ branchOptions: [],
+ regionalOptions: [],
+ xRegional: "",
+ xBranch: ""
+ },
+ mutations: {
+ updateBranchOptions(state, val) {
+ state.branchOptions = val;
+ },
+
+ updateRegionalOptions(state, val) {
+ state.regionalOptions = val;
+ },
+ updateXRegional(state, val) {
+ state.xRegional = val;
+ },
+ updateXBranch(state, val) {
+ state.xBranch = val;
+ },
+ update_a_fa_age(state, val) {
+ state.a_fa_age = val;
+ },
+ update_a_fa_depresiasi_bulan(state, val) {
+ state.a_fa_depresiasi_bulan = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_xid(state, val) {
+ state.xid = val
+ },
+ update_xnumber(state, val) {
+ state.xnumber = val
+ },
+ update_a_errors_save_coa(state, val) {
+ state.a_errors_save_coa = val
+ },
+ update_a_selected_a_coa(state, val) {
+ state.a_selected_a_coa = val
+ },
+ update_e_loading_nat_group(state, val) {
+ state.e_loading_nat_group = val
+ },
+ update_a_errors_save(state, val) {
+ state.a_errors_save = val
+ },
+ update_a_save_error_message(state, val) {
+ state.a_save_error_message = val
+ },
+ update_a_alert_error(state, val) {
+ state.a_alert_error = val
+ },
+ update_a_msg_success(state, val) {
+ state.a_msg_success = val
+ },
+ update_a_msg_info(state, val) {
+ state.a_msg_info = val
+ },
+ update_a_open_dialog_info(state, val) {
+ state.a_open_dialog_info = val
+ },
+ update_a_alert_success(state, val) {
+ state.a_alert_success = val
+ },
+ update_dialog_add_coa(state, val) {
+ state.dialog_add_coa = val
+ },
+ //table
+ update_a_search_error_message(state, val) {
+ state.a_search_error_message = val
+ },
+ update_a_search_status(state, val) {
+ state.a_search_status = val
+ },
+ update_a_x_search(state, val) {
+ state.a_x_search = val
+ },
+ update_a_current_page(state, val) {
+ state.a_current_page = val
+ },
+ update_a_last_id(state, val) {
+ state.a_last_id = val
+ },
+ update_a_total_coa(state, val) {
+ state.a_total_coa = val
+ },
+ update_a_a_coas(state, val) {
+ state.a_coas = val
+ },
+ // text classname
+ update_a_faname(state, val) {
+ state.a_faname = val
+ },
+ update_e_classname(state, val) {
+ state.e_classname = val
+ },
+ // ac coa
+ update_a_loading_coa(state, val) {
+ state.a_loading_coa = val
+ },
+ update_e_loading_coa(state, val) {
+ state.e_loading_coa = val
+ },
+ update_a_coa_list(state, val) {
+ state.a_coa_list = val
+ },
+ update_e_coa_list(state, val) {
+ state.e_coa_list = val
+ },
+ update_a_coa(state, val) {
+ state.a_coa = val
+ },
+ update_e_coa(state, val) {
+ state.e_coa = val
+ },
+ update_a_coa_search(state, val) {
+ state.a_coa_search = val
+ },
+ update_e_coa_search(state, val) {
+ state.e_coa_search = val
+ },
+ // ac item
+ update_a_loading_item(state, val) {
+ state.a_loading_item = val
+ },
+ update_a_item_list(state, val) {
+ state.a_item_list = val
+ },
+ update_a_item(state, val) {
+ state.a_item = val
+ },
+ update_a_item_search(state, val) {
+ state.a_item_search = val
+ },
+ // ac department
+ update_a_loading_department(state, val) {
+ state.a_loading_department = val
+ },
+ update_a_department_list(state, val) {
+ state.a_department_list = val
+ },
+ update_a_department(state, val) {
+ state.a_department = val
+ },
+ update_a_department_search(state, val) {
+ state.a_department_search = val
+ },
+ // ac presentase
+ update_a_loading_presentase(state, val) {
+ state.a_loading_presentase = val
+ },
+ update_a_presentase_list(state, val) {
+ state.a_presentase_list = val
+ },
+ update_a_presentase(state, val) {
+ state.a_presentase = val
+ },
+ update_a_presentase_search(state, val) {
+ state.a_presentase_search = val
+ },
+ update_a_inventaris(state, val) {
+ state.a_inventaris = val
+ },
+ update_a_note(state, val) {
+ state.a_note = val
+ },
+ update_a_fa_account_id(state, val) {
+ state.a_fa_account_id = val
+ },
+ update_a_fa_account_name(state, val) {
+ state.a_fa_account_name = val
+ },
+ update_a_accum_depre_account_id(state, val) {
+ state.a_accum_depre_account_id = val
+ },
+ update_a_accum_depre_account_name(state, val) {
+ state.a_accum_depre_account_name = val
+ },
+ update_a_depre_account_id(state, val) {
+ state.a_depre_account_id = val
+ },
+ update_a_depre_account_name(state, val) {
+ state.a_depre_account_name = val
+ },
+ update_a_qty(state, val) {
+ state.a_qty = val
+ },
+ update_a_acquisition_price(state, val) {
+ state.a_acquisition_price = val
+ },
+ update_a_book_value(state, val) {
+ state.a_book_value = val
+ },
+ // text note
+ update_a_note(state, val) {
+ state.a_note = val
+ },
+ update_e_note(state, val) {
+ state.e_note = val
+ },
+ update_dialog_add_coa(state, val) {
+ state.dialog_add_coa = val
+ },
+ update_dialog_edit_coa(state, val) {
+ state.dialog_edit_coa = val
+ },
+ update_Fa_ClassID(state, val) {
+ state.Fa_ClassID = val
+ },
+ update_a_save_status(state, val) {
+ state.a_save_status = val
+ },
+ },
+ actions: {
+ // search
+ async search(context, prm) {
+ context.commit("update_a_search_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_a_search_status", 3)
+ context.commit("update_a_search_error_message", resp.message)
+ context.commit("update_a_msg_info", resp.message)
+ context.commit("update_a_open_dialog_info", true)
+ } else {
+ context.commit("update_a_search_status", 2)
+ context.commit("update_a_search_error_message", "")
+ context.commit("update_a_msg_info", resp.message)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+
+ context.commit("update_a_a_coas", data.records)
+ context.commit("update_a_total_coa", data.total)
+ }
+ } catch (e) {
+ context.commit("update_a_search_status", 3)
+ context.commit("update_a_search_error_message", e.message)
+ context.commit("update_a_msg_info", e.message)
+ context.commit("update_a_open_dialog_info", true)
+ }
+ },
+
+ // get ac coa from api
+ async open_add_coa(context, payload) {
+ context.commit("update_a_loading_coa", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.search = payload.search
+ let resp = await api.getAcCoa(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_a_loading_coa", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_a_loading_coa", false)
+ context.commit("update_a_coa_list", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_a_loading_coa", false)
+ }
+ },
+
+
+ async open_add_item(context, payload) {
+ context.commit("update_a_loading_item", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.search = payload.search
+ let resp = await api.getItem(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_a_loading_item", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_a_loading_item", false)
+ context.commit("update_a_item_list", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_a_loading_item", false)
+ }
+ },
+ async open_add_department(context, payload) {
+ context.commit("update_a_loading_department", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.search = payload.search
+ let resp = await api.getDepartment(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_a_loading_department", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_a_loading_department", false)
+ context.commit("update_a_department_list", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_a_loading_department", false)
+ }
+ },
+ async open_add_presentase(context, payload) {
+ context.commit("update_a_loading_presentase", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.search = payload.search
+ let resp = await api.getPresentase(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_a_loading_presentase", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_a_loading_presentase", false)
+ context.commit("update_a_presentase_list", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_a_loading_presentase", false)
+ }
+ },
+ // add data
+ async add_data(context, prm) {
+ context.commit("update_a_save_status", 1)
+ try {
+ prm.token = one_token()
+
+ let resp = await api.addData(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_a_save_status", 3)
+ context.commit("update_a_save_error_message", resp.message)
+ context.commit("update_a_alert_error", true)
+ } else {
+ context.commit("update_a_save_status", 2)
+ context.commit("update_a_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ if (data.total !== -1) {
+ context.commit("update_a_alert_success", true)
+ var msg = " Add Data Sukses"
+ context.commit("update_a_msg_success", msg)
+ context.commit('update_dialog_add_coa', false)
+ context.dispatch("search", {
+ current_page: context.state.a_current_page,
+ search: context.state.a_x_search,
+ last_id: -1
+ })
+
+ context.commit("fixedasset/update_dialog_add_coa", false);
+ context.commit("fixedasset/update_a_faname", "");
+ context.commit("fixedasset/update_a_coa", {});
+ context.commit("fixedasset/update_a_deprecorp", "");
+ context.commit("fixedasset/update_a_coa_accum_depre", {});
+ context.commit("fixedasset/update_a_note", "");
+ } else {
+ context.commit("update_a_errors_save", [])
+ }
+
+ }
+ } catch (e) {
+ context.commit("update_a_save_status", 3)
+ context.commit("update_a_save_error_message", e.message)
+ context.commit("update_a_alert_error", true)
+ }
+ },
+
+ // get_by_id
+ async get_by_id(context, payload) {
+ context.commit("update_e_loading_nat_group", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ // fa_class
+ prm.Fa_ClassID = payload.Fa_ClassID
+ // coa
+ prm.Fa_ClassCoaID = payload.Fa_ClassCoaID
+ // accum depre
+ prm.Fa_ClassAccumDepreCoaID = payload.Fa_ClassAccumDepreCoaID
+
+ let resp = await api.getByID(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_e_loading_nat_group", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_e_loading_nat_group", true)
+
+ // MapNatGroup_ID
+ context.commit("update_Fa_ClassID", resp.data.record_fa_class[0].Fa_ClassID)
+
+ // coa
+ context.commit("update_e_coa_list", resp.data.records_coa)
+ context.commit("update_e_coa", {
+ coaID: resp.data.records_coa[0].coaID,
+ coaAccountNo: resp.data.records_coa[0].coaAccountNo,
+ coaDescription: resp.data.records_coa[0].coaDescription,
+ coaSubDescription: resp.data.records_coa[0].coaSubDescription,
+ coaAccountType: resp.data.records_coa[0].coaAccountType,
+ coaSpecialAccountType: resp.data.records_coa[0].coaSpecialAccountType,
+ coaIsInput: resp.data.records_coa[0].coaIsInput,
+ coaReportSchedule: resp.data.records_coa[0].coaReportSchedule,
+ coaCurrencyCode: resp.data.records_coa[0].coaCurrencyCode,
+ coaCashFlowCategory: resp.data.records_coa[0].coaCashFlowCategory,
+ coaCreated: resp.data.records_coa[0].coaCreated,
+ coaLastUpdated: resp.data.records_coa[0].coaLastUpdated,
+ coaIsActive: resp.data.records_coa[0].coaIsActive,
+ coaLevel: resp.data.records_coa[0].coaLevel
+ })
+
+ // accum depre
+ context.commit("update_e_coa_accum_depre_list", resp.data.records_accum_depre)
+ context.commit("update_e_coa_accum_depre", {
+ coaID: resp.data.records_accum_depre[0].coaID,
+ coaAccountNo: resp.data.records_accum_depre[0].coaAccountNo,
+ coaDescription: resp.data.records_accum_depre[0].coaDescription,
+ coaSubDescription: resp.data.records_accum_depre[0].coaSubDescription,
+ coaAccountType: resp.data.records_accum_depre[0].coaAccountType,
+ coaSpecialAccountType: resp.data.records_accum_depre[0].coaSpecialAccountType,
+ coaIsInput: resp.data.records_accum_depre[0].coaIsInput,
+ coaReportSchedule: resp.data.records_accum_depre[0].coaReportSchedule,
+ coaCurrencyCode: resp.data.records_accum_depre[0].coaCurrencyCode,
+ coaCashFlowCategory: resp.data.records_accum_depre[0].coaCashFlowCategory,
+ coaCreated: resp.data.records_accum_depre[0].coaCreated,
+ coaLastUpdated: resp.data.records_accum_depre[0].coaLastUpdated,
+ coaIsActive: resp.data.records_accum_depre[0].coaIsActive,
+ coaLevel: resp.data.records_accum_depre[0].coaLevel
+ })
+
+ // fa classname
+ context.commit("update_e_classname", resp.data.record_fa_class[0].Fa_ClassName)
+
+ // note
+ context.commit("update_e_note", resp.data.record_fa_class[0].Fa_ClassAccumNote)
+
+ // depre corp
+ context.commit("update_e_deprecorp", resp.data.record_fa_class[0].Fa_ClassDepreCorp)
+
+ context.commit("update_dialog_edit_coa", true)
+ }
+ } catch (e) {
+ context.commit("update_e_loading_nat_group", false)
+ }
+ },
+
+ // get ac coa from api
+ async open_edit_coa(context, payload) {
+ context.commit("update_e_loading_coa", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.search = payload.search
+ let resp = await api.getAcCoa(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_e_loading_coa", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_e_loading_coa", false)
+ context.commit("update_e_coa_list", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_e_loading_coa", false)
+ }
+ },
+
+ // get ac coa accum depre from api
+ async open_edit_coa_accum_depre(context, payload) {
+ context.commit("update_e_loading_coa_accum_depre", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.search = payload.search
+ let resp = await api.getAcAccumDepre(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_e_loading_coa_accum_depre", false)
+ } else {
+ // console.log('data nat_group ',resp.data)
+ context.commit("update_e_loading_coa_accum_depre", false)
+ context.commit("update_e_coa_accum_depre_list", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_e_loading_coa_accum_depre", false)
+ }
+ },
+ async regional(context) {
+ let response = await api.getRegional({ token: one_token() });
+ if (response.status === "OK") {
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("updateRegionalOptions", data.records);
+ }
+ },
+ async branch(context) {
+ let response = await api.getBranch({ token: one_token() });
+ if (response.status === "OK") {
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("updateBranchOptions", data.records);
+ }
+ },
+
+ // edit data
+ async edit_data(context, prm) {
+ context.commit("update_a_save_status", 1)
+ try {
+ prm.token = one_token()
+
+ let resp = await api.editData(prm)
+ // console.log('data nat_group ',resp)
+ if (resp.status != "OK") {
+ context.commit("update_a_save_status", 3)
+ context.commit("update_a_save_error_message", resp.message)
+ context.commit("update_a_alert_error", true)
+ } else {
+ context.commit("update_a_save_status", 2)
+ context.commit("update_a_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ if (data.total !== -1) {
+ context.commit("update_a_alert_success", true)
+ var msg = " Edit Data Sukses"
+ context.commit("update_a_msg_success", msg)
+ context.commit('update_dialog_add_coa', false)
+ context.dispatch("search", {
+ current_page: context.state.a_current_page,
+ search: context.state.a_x_search,
+ last_id: -1
+ })
+
+ context.commit("fixedasset/update_dialog_add_coa", false);
+ context.commit("fixedasset/update_a_faname", "");
+ context.commit("fixedasset/update_a_coa", {});
+ context.commit("fixedasset/update_a_deprecorp", "");
+ context.commit("fixedasset/update_a_coa_accum_depre", {});
+ context.commit("fixedasset/update_a_note", "");
+ } else {
+ context.commit("update_a_errors_save", [])
+ }
+
+ }
+ } catch (e) {
+ context.commit("update_a_save_status", 3)
+ context.commit("update_a_save_error_message", e.message)
+ context.commit("update_a_alert_error", true)
+ }
+ },
+ // delete data
+ async delete_data(context, prm) {
+ context.commit("update_a_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.deleteData(prm)
+ if (resp.status != "OK") {
+ context.commit("update_a_save_status", 3)
+ context.commit("update_a_save_error_message", resp.message)
+ context.commit("update_a_alert_error", true)
+ } else {
+ context.commit("update_a_save_status", 2)
+ context.commit("update_a_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ if (data.total !== -1) {
+ context.commit("update_a_alert_success", true)
+ var msg = " Coa " + prm.delete_data + " berhasil dihapus"
+ context.commit("update_a_msg_success", msg)
+ context.dispatch("search", {
+ current_page: context.state.a_current_page,
+ search: context.state.a_x_search,
+ last_id: -1
+ })
+ } else {
+ context.commit("update_a_errors_save_coa", [])
+ }
+
+ }
+ } catch (e) {
+ context.commit("update_a_save_status", 3)
+ context.commit("update_a_save_error_message", e.message)
+ context.commit("update_a_alert_error", true)
+ }
+ },
+ },
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-fixed-asset/store.js b/test/vuex/acc-one-fixed-asset/store.js
new file mode 100644
index 0000000..c35e534
--- /dev/null
+++ b/test/vuex/acc-one-fixed-asset/store.js
@@ -0,0 +1,12 @@
+import system from "../../../apps/modules/system/system.js";
+import fixedasset from "./modules/fixedasset.js";
+
+export const store = new Vuex.Store({
+ modules: {
+ system: system,
+ fixedasset:fixedasset,
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-item-out-v3/api/api-requester.js b/test/vuex/acc-one-item-out-v3/api/api-requester.js
new file mode 100644
index 0000000..04b9293
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/api/api-requester.js
@@ -0,0 +1,559 @@
+const URL = "/one-api/mockup/itemout/";
+
+export async function search(prm) {
+ try {
+ var response = await axios.post(URL + "itemoutv3/search", prm);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function searchDetail(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/searchDetail",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function saveRequest(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/saveRequest",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function updateRequest(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/updateRequest",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function deleteRequest(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/deleteRequest",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function saveDetail(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/saveDetail",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function updateDetail(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/updateDetail",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+export async function deleteDetail(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/deleteDetail",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getWarehouse(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/getWarehouse",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getDepartment(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/getDepartment",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function searchItem(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/searchItem', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getUnit(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/getUnit', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function orderConfirm(prm) {
+ try {
+ var response = await axios.post(
+ URL + "itemoutv3/orderConfirm",
+ prm
+ );
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function listrequestitem(prm) {
+ try {
+ var response = await axios.post(URL + "itemoutv3/listrequest", prm);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getDivisionUser(payload) {
+ try {
+ var response = await axios.post(URL + "RequestItemOut/getDivisionUser", payload);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function approveRequest(prm) {
+ try {
+ var response = await axios.post(URL + "itemoutv3/approveRequest", prm);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function rejectedRequest(prm) {
+ try {
+ var response = await axios.post(URL + "itemoutv3/rejectedRequest", prm);
+ if (response.status !== 200) {
+ return {
+ status: "ERR",
+ message: response.statusText,
+ };
+ }
+
+ let data = response.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getDivisionByUser(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/getDivisionByUser', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getItemRequest(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/getItemRequest', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getDetailItemOut(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/getDetailItemOut', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getItemOuts(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/getItemOuts', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function confirmIO(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/confirmIO', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function approveIO(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/approveIO', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function processIO(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/processIO', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function rejectRequest(prm) {
+ try {
+ var resp = await axios.post(URL + 'itemoutv3/rejectRequest', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getItemBatchListing(params) {
+ try {
+ var resp = await axios.post(URL + "itemoutv3/getItemBatchListing", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getlevel(prm) {
+ try {
+ var resp = await axios.post(URL + "itemoutv3/getlevel", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/addItemDetailDialog.vue b/test/vuex/acc-one-item-out-v3/components/addItemDetailDialog.vue
new file mode 100644
index 0000000..6cd51e7
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/addItemDetailDialog.vue
@@ -0,0 +1,324 @@
+
+
+
+
+
+ FORM DETAIL
+
+
+
+
+
+ Gudang : {{ this.selectedMainTable.WarehouseName }}
+
+
+
+
+
+
+
+
+
+
+ Item harus diisi
+
+
+
+
+
+
+
+ Qty harus diisi
+
+
+
+
+
+
+
+
+
+ Item Unit harus diisi
+
+
+
+
+
+ Tutup
+ Simpan
+ Simpan Perubahan
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-item-out-v3/components/addItemOutDialog.vue b/test/vuex/acc-one-item-out-v3/components/addItemOutDialog.vue
new file mode 100644
index 0000000..e61fc70
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/addItemOutDialog.vue
@@ -0,0 +1,917 @@
+
+
+
+
+
+
+ FORM PENGELUARAN BARANG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Pilih Item
+ Tutup Pilih Item
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+ {{ props.item.rioNumber }}
+
+
+
+
+ {{ props.item.itemCode }}
+
+ {{ props.item.itemDesc }}
+
+
+
+
+ {{ props.item.unitName }}
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.rioDQty }}
+
+
+ check
+
+
+
+
+
+
+
+
+
+
+
+ Tutup Pilih Item
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.rioNumber }}
+
+
+
+
+
+ {{ props.item.itemCode }}
+
+ {{ props.item.itemDesc }}
+
+
+
+
+
+ Batch: {{ obj.StockBatchNo }}, Jumlah: {{ obj.QtyReq }}, {{ obj.WarehouseName }}
+
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.rioDQty }}
+
+
+ {{ getRemaining(props.item) }} / {{ props.item.rioDReceiveQty }} {{ props.item.unitName }}
+ Jumlah melebihi request qty
+ Jumlah item harus diisi
+
+
+
+
+ edit
+
+ close
+
+
+
+
+
+
+
+
+
+
+ Konfirmasi
+
+
+ Tutup
+
+ Simpan
+ Simpan Perubahan
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-item-out-v3/components/dialogBatch.vue b/test/vuex/acc-one-item-out-v3/components/dialogBatch.vue
new file mode 100644
index 0000000..ba03c34
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/dialogBatch.vue
@@ -0,0 +1,307 @@
+
+
+
+
+
+ Pengeluaran Item
+
+
+
+
+
+
+
+
+ {{ data.item.StockBatchNo }}
+
+
+
+
+
+ Batch {{ data.item.StockBatchNo }}
+
+
+ Expired: {{ data.item.StockED }}
+
+
+
+
+
+
+
+
+ Nomor batch: {{ item.StockBatchNo }}
+ Expired: {{ item.StockED }}
+ {{ item.WarehouseName }}
+
+
+ Stock:
+ {{ item.StockQty }} {{ item.ItemUnitName }}
+
+
+ Isi Qty:
+
+
+
+
+
+
+
+
+
+
+ BATAL
+ SIMPAN
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/dialogItemApprove.vue b/test/vuex/acc-one-item-out-v3/components/dialogItemApprove.vue
new file mode 100644
index 0000000..6a3d28f
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/dialogItemApprove.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+ APPROVE
+
+
+
+
+
+ Nomor
+
+
+ : {{ selectedMainTable.T_ItemOutNumber }}
+
+
+
+
+
+ Tanggal Transaksi
+
+
+ : {{ deFormatedDate(selectedMainTable.T_ItemOutDate) }}
+
+
+
+
+
+ Gudang
+
+
+ : {{ selectedMainTable.WarehouseName }}
+
+
+
+
+
+ Divisi
+
+
+ : {{ selectedMainTable.DivisionName }}
+
+
+
+
+
+ Status
+
+
+ : {{ selectedMainTable.T_ItemOutStatus }}
+
+
+
+
+
+ Catatan
+
+
+ : {{ selectedMainTable.T_ItemOutNote }}
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.T_ItemOutNumber }}
+
+
+
+
+
+ {{ props.item.M_ItemDesc }}
+
+
+
+
+ {{ props.item.ItemUnitName }}
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.RequestItemOutDetailQty }}
+
+
+ {{ props.item.remainingRequestQty }}
+
+
+ {{ props.item.T_ItemOutDetailQty }}
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Approve
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/dialogItemConfirm.vue b/test/vuex/acc-one-item-out-v3/components/dialogItemConfirm.vue
new file mode 100644
index 0000000..b999cce
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/dialogItemConfirm.vue
@@ -0,0 +1,272 @@
+
+
+
+
+
+ KONFIRMASI
+
+
+
+
+
+ Nomor
+
+
+ : {{ selectedMainTable.T_ItemOutNumber }}
+
+
+
+
+
+ Tanggal Transaksi
+
+
+ : {{ deFormatedDate(selectedMainTable.T_ItemOutDate) }}
+
+
+
+
+
+ Gudang
+
+
+ : {{ selectedMainTable.WarehouseName }}
+
+
+
+
+
+ Divisi
+
+
+ : {{ selectedMainTable.DivisionName }}
+
+
+
+
+
+ Status
+
+
+ : {{ selectedMainTable.T_ItemOutStatus }}
+
+
+
+
+
+ Catatan
+
+
+ : {{ selectedMainTable.T_ItemOutNote }}
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.T_ItemOutNumber }}
+
+
+
+
+
+ {{ props.item.M_ItemDesc }}
+
+
+
+
+ {{ props.item.ItemUnitName }}
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.RequestItemOutDetailQty }}
+
+
+ {{ props.item.remainingRequestQty }}
+
+
+ {{ props.item.T_ItemOutDetailQty }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Konfirmasi
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/dialogItemPreview.vue b/test/vuex/acc-one-item-out-v3/components/dialogItemPreview.vue
new file mode 100644
index 0000000..465c74c
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/dialogItemPreview.vue
@@ -0,0 +1,237 @@
+
+
+
+
+
+ PREVIEW
+
+
+
+
+
+ Nomor
+
+
+ : {{ selectedMainTable.T_ItemOutNumber }}
+
+
+
+
+
+ Tanggal Transaksi
+
+
+ : {{ deFormatedDate(selectedMainTable.T_ItemOutDate) }}
+
+
+
+
+
+ Gudang
+
+
+ : {{ selectedMainTable.WarehouseName }}
+
+
+
+
+
+ Divisi
+
+
+ : {{ selectedMainTable.DivisionName }}
+
+
+
+
+
+ Status
+
+
+ : {{ selectedMainTable.T_ItemOutStatus }}
+
+
+
+
+
+ Catatan
+
+
+ : {{ selectedMainTable.T_ItemOutNote }}
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.T_ItemOutNumber }}
+
+
+
+
+
+ {{ props.item.M_ItemDesc }}
+
+
+
+
+ {{ props.item.ItemUnitName }}
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.RequestItemOutDetailQty }}
+
+
+ {{ props.item.T_ItemOutDetailQty }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/dialogItemProcess.vue b/test/vuex/acc-one-item-out-v3/components/dialogItemProcess.vue
new file mode 100644
index 0000000..0d6c580
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/dialogItemProcess.vue
@@ -0,0 +1,274 @@
+
+
+
+
+
+ PROSES TRANSAKSI
+
+
+
+
+
+ Nomor
+
+
+ : {{ selectedMainTable.T_ItemOutNumber }}
+
+
+
+
+
+ Tanggal Transaksi
+
+
+ : {{ deFormatedDate(selectedMainTable.T_ItemOutDate) }}
+
+
+
+
+
+ Gudang
+
+
+ : {{ selectedMainTable.WarehouseName }}
+
+
+
+
+
+ Divisi
+
+
+ : {{ selectedMainTable.DivisionName }}
+
+
+
+
+
+ Status
+
+
+ : {{ selectedMainTable.T_ItemOutStatus }}
+
+
+
+
+
+ Catatan
+
+
+ : {{ selectedMainTable.T_ItemOutNote }}
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.T_ItemOutNumber }}
+
+
+
+
+
+ {{ props.item.M_ItemDesc }}
+
+
+
+
+ {{ props.item.ItemUnitName }}
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.RequestItemOutDetailQty }}
+
+
+ {{ props.item.remainingRequestQty }}
+
+
+ {{ props.item.T_ItemOutDetailQty }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Process
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/requestItemOut.vue b/test/vuex/acc-one-item-out-v3/components/requestItemOut.vue
new file mode 100644
index 0000000..c836344
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/requestItemOut.vue
@@ -0,0 +1,888 @@
+
+
+
+ {{ snackbar.message }}
+
+ Close
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{ msgapprove }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{ msgreject }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+ LISTING REQUEST PENGELUARAN BARANG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+
+ {{ header.text }}
+
+
+
+
+
+
+
+
+
+
{{ props.item.rioNumber }}
+ {{ deFormatedDate(props.item.rioDate) }}
+
+
+
+ {{ props.item.M_ItemDesc }}
+
+
+ {{ props.item.StockQty }}
+
+
+ {{ props.item.rioDQty }}
+
+
+
+ {{ props.item.rioDStatus }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reject
+
+
+
+
+ Approve
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/components/requestListing.vue b/test/vuex/acc-one-item-out-v3/components/requestListing.vue
new file mode 100644
index 0000000..b9c54f0
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/components/requestListing.vue
@@ -0,0 +1,956 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgErrors }}
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+ TRANSAKSI PENGELUARAN BARANG
+
+
+ add_box
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+
+
{{ props.item.T_ItemOutNumber }}
+
+
+
+ {{ deFormatedDate(props.item.T_ItemOutDate) }}
+
+
+ {{ props.item.T_ItemOutNote }}
+
+
+ {{ props.item.DivisionName }}
+
+
+
+ {{ props.item.T_ItemOutStatus }}
+
+
+
+
+
+
+ Approve (Manager)
+
+
+
+ check_circle
+
+
+
+ check_circle_outline
+
+
+
+
+
+ receipt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{ msgAlertDeleteRequest }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Yakin lah
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{ msgAlertDeleteRequest }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Yakin lah
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-item-out-v3/index.php b/test/vuex/acc-one-item-out-v3/index.php
new file mode 100644
index 0000000..d8fba16
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/index.php
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-out-v3/modules/listrequest.js b/test/vuex/acc-one-item-out-v3/modules/listrequest.js
new file mode 100644
index 0000000..714e182
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/modules/listrequest.js
@@ -0,0 +1,266 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/api-requester.js";
+
+export default {
+ namespaced: true,
+ state: {
+ request: [],
+ selectedRequest: [],
+ totalPage: 0,
+ currentPage: 1,
+ dStartDate: new Date().toISOString().substring(0, 10),
+ dEndDate: new Date().toISOString().substring(0, 10),
+ fStartDate: moment(new Date()).format("YYYY-MM-DD"),
+ fEndDate: moment(new Date()).format("YYYY-MM-DD"),
+ menuStartDate: false,
+ menuEndDate: false,
+
+ statusOptions: [
+ { value: '', title: "All" },
+ { value: 'Draft', title: "Draft" },
+ { value: 'Send Request', title: "Send Request" },
+ { value: 'Process', title: "Process" },
+ { value: 'Rejected', title: "Rejected" },
+ { value: 'Partial', title: "Partial" },
+ { value: 'Completed', title: "Completed" },
+ ],
+ fStatus: {value: "", title: "All"},
+ fSearch: "",
+ lastId: -1,
+ loadingStatus: 0,
+ errorMessage: "",
+ selectedItems: [],
+ selectedItem: {},
+ opendialoginfo: false,
+ msginfo: "",
+ loadingSave: false,
+ errMessage: "",
+ alertError: false,
+ snackbar: {
+ state: false,
+ type: 'success',
+ message: '',
+ },
+ dialogapprove: false,
+ msgapprove: '',
+ dialogreject: false,
+ msgreject: '',
+ approveDivisionUserID: 0,
+ approveDivision: '',
+ },
+ mutations: {
+ update_request(state, val) {
+ state.request = val
+ },
+ update_selectedRequest(state, val) {
+ state.selectedRequest = val
+ },
+ update_totalPage(state, val) {
+ state.totalPage = val
+ },
+ update_currentPage(state, val) {
+ state.currentPage = val
+ },
+ update_dStartDate(state, val) {
+ state.dStartDate = val
+ },
+ update_dEndDate(state, val) {
+ state.dEndDate = val
+ },
+ update_fStartDate(state, val) {
+ state.fStartDate = val
+ },
+ update_fEndDate(state, val) {
+ state.fEndDate = val
+ },
+ update_menuStartDate(state, val) {
+ state.menuStartDate = val
+ },
+ update_menuEndDate(state, val) {
+ state.menuEndDate = val
+ },
+ update_statusOptions(state, val) {
+ state.statusOptions = val
+ },
+ update_fStatus(state, val) {
+ state.fStatus = val
+ },
+ update_fSearch(state, val) {
+ state.fSearch = val
+ },
+ update_lastId(state, val) {
+ state.lastId = val
+ },
+ update_loadingStatus(state, val) {
+ state.loadingStatus = val
+ },
+ update_errorMessage(state, val) {
+ state.errorMessage = val
+ },
+ update_selectedItems(state, val) {
+ state.selectedItems = val
+ },
+ update_selectedItem(state, val) {
+ state.selectedItem = val
+ },
+ update_opendialoginfo(state, val) {
+ state.opendialoginfo = val
+ },
+ update_msginfo(state, val) {
+ state.msginfo = val
+ },
+ update_loadingSave(state, val) {
+ state.loadingSave = val
+ },
+ update_errMessage(state, val) {
+ state.errMessage = val
+ },
+ update_alertError(state, val) {
+ state.alertError = val
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_dialogapprove(state, val) {
+ state.dialogapprove = val
+ },
+ update_msgapprove(state, val) {
+ state.msgapprove = val
+ },
+ update_dialogreject(state, val) {
+ state.dialogreject = val
+ },
+ update_msgreject(state, val) {
+ state.msgreject = val
+ },
+ updateApproveDivisionUserID(state, val) {
+ state.approveDivisionUserID = val;
+ },
+ updateApproveDivision(state, val) {
+ state.approveDivision = val;
+ }
+ },
+ actions: {
+ async listrequestitem(context) {
+ context.commit("update_loadingStatus", 1);
+
+ try {
+ var prm = {
+ token: one_token(),
+ current_page: context.state.currentPage,
+ startDate: context.state.fStartDate,
+ endDate: context.state.fEndDate,
+ status: context.state.fStatus.value,
+ search: context.state.fSearch
+ };
+
+ let response = await api.listrequestitem(prm);
+ if (response.status != "OK") {
+ context.commit("update_loadingStatus", 3);
+ context.commit("update_errorMessage", response.message);
+ } else {
+ context.commit("update_loadingStatus", 2);
+ context.commit("update_errorMessage", "");
+ let data = {
+ records: response.data.records,
+ total: response.data.totalPage,
+ };
+
+ context.commit("update_request", data.records);
+ context.commit("update_totalPage", data.total);
+
+ }
+ } catch (e) {
+ context.commit("update_loadingStatus", 3);
+ context.commit("update_errorMessage", e.message);
+ }
+ },
+ async getDivisionUser(context) {
+
+ try {
+ var payload = {
+ token: one_token()
+ };
+
+ let response = await api.getDivisionUser(payload);
+ if (response.status != "OK") {
+ context.commit("update_errorMessage", response.message);
+ } else {
+ context.commit("update_errorMessage", "");
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("updateApproveDivision", data.records[0].DivisionName);
+ context.commit("updateApproveDivisionUserID", data.records[0].M_UserDivisionDivisionID);
+ }
+ } catch (e) {
+ context.commit("update_errorMessage", e.message);
+ }
+ },
+ async approveRequest(context, prm) {
+ context.commit("update_loadingSave", true);
+ try {
+ prm.token = one_token();
+ let response = await api.approveRequest(prm);
+ if (response.status != "OK") {
+ context.commit("update_loadingSave", false);
+ context.commit("update_errMessage", response.message);
+ context.commit("update_alertError", true);
+ } else {
+ context.commit("update_loadingSave", false);
+
+ context.commit("update_snackbar", {
+ state: true,
+ type: 'success',
+ message: 'Request berhasil diapprove',
+ })
+
+ context.commit("update_dialogapprove", false);
+ context.commit("update_selectedItems", []);
+ context.commit("update_selectedItem", {});
+ context.dispatch("listrequestitem");
+ }
+
+ } catch (e) {
+ context.commit("update_loadingSave", false);
+ context.commit("update_errMessage", e.message);
+ context.commit("update_alertError", true);
+ }
+ },
+ async rejectedRequest(context, prm) {
+ context.commit("update_loadingSave", true);
+ try {
+ prm.token = one_token();
+ let response = await api.rejectedRequest(prm);
+ if (response.status != "OK") {
+ context.commit("update_loadingSave", false);
+ context.commit("update_errMessage", response.message);
+ context.commit("update_alertError", true);
+ } else {
+ context.commit("update_loadingSave", false);
+
+ context.commit("update_snackbar", {
+ state: true,
+ type: 'success',
+ message: 'Request berhasil ditolak',
+ })
+
+ context.commit("update_dialogreject", false);
+ context.commit("update_selectedItems", []);
+ context.commit("update_selectedItem", {});
+ context.dispatch("listrequestitem");
+ }
+
+ } catch (e) {
+ context.commit("update_loadingSave", false);
+ context.commit("update_errMessage", e.message);
+ context.commit("update_alertError", true);
+ }
+ },
+ },
+};
+
diff --git a/test/vuex/acc-one-item-out-v3/modules/requester.js b/test/vuex/acc-one-item-out-v3/modules/requester.js
new file mode 100644
index 0000000..59dc353
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/modules/requester.js
@@ -0,0 +1,1106 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/api-requester.js";
+
+export default {
+ namespaced: true,
+ state: {
+ user: one_user(),
+ mainTable: [],
+ detailTable: [],
+ countMainTable: 0,
+ countDetailTable: 0,
+ mainTableLoadingStatus: 0,
+ detailTableLoadingStatus: 0,
+ mainTableErrorMessage: "",
+ detailTableErrorMessage: "",
+ mainTableCurrentPage: 1,
+ mainTableLastId: -1,
+
+ selectedMainTable: {},
+ selectedDetailTable: {},
+
+ statusOptions: [
+ { value: 0, title: "All" },
+ { value: 1, title: "Draft" },
+ { value: 2, title: "Process" },
+ { value: 3, title: "Rejected" }
+ ],
+ regionalOptions: [],
+ branchOptions: [],
+
+ menuStartDate: false,
+ menuEndDate: false,
+ menuDateUse: false,
+
+ dStartDate: new Date().toISOString().substring(0, 10),
+ dEndDate: new Date().toISOString().substring(0, 10),
+ fStartDate: moment(new Date()).format("YYYY-MM-DD"),
+ fEndDate: moment(new Date()).format("YYYY-MM-DD"),
+ fStatus: {value: 0, title: "All"},
+ fSearch: "",
+
+ dDateUse: new Date().toISOString().substr(0, 10),
+ xDateUse: moment(new Date()).format("YYYY-MM-DD"),
+ warehouseOptions: [],
+ xWarehouse: "",
+ xNote: "",
+ departmentOptions: [],
+ xDepartment: "",
+ xDescription: "",
+ xTotalPrice: "",
+ xIOID: 0,
+ xNumber: "",
+ xIODID: 0,
+ xDescriptionDetail: "",
+ xAmountRequest: 0,
+ xEstimationPrice: 0,
+
+ dialogRequest: false,
+ dialogDetail: false,
+ act: "new",
+ errMessage: "",
+ successMessage: "",
+ alertError: false,
+ alertSuccess: false,
+ errors: [],
+ loadingAutocomplete: false,
+ dialogFormItem: false,
+ itemList: [],
+ selectedItem: {},
+ search_item: "",
+ xQty: "",
+ xPrice: "",
+ xIsCito: false,
+ itemsTemp: [],
+ erroritems: [],
+ dialogErrors: false,
+ item_units: [],
+ selected_item_unit: {},
+ search_item_unit: "",
+ total_price: 0,
+ errorsform: [],
+ divisionOptions: [],
+ selectedDivision: {},
+ dialogItem: false,
+ searchItem: "",
+ loadingItem: false,
+ itemCurrentPage: 1,
+ items: [],
+ selectedItems: [],
+ itemTotalPage: 0,
+ loadingSave: false,
+ emptycheck: [],
+ emptycheckvalue: [],
+
+ dialogApprove: false,
+ detailItemouts: [],
+ dialogPreview: false,
+ dialog_batchitem: false,
+ list_batchitemform: {},
+ form_batchitem: [],
+ buffer_detailitem: {},
+ approveLevelID: 0,
+ dialogProcess: false,
+ tempBatchNumber: {
+ records: [],
+ total: 0
+ },
+ dialogConfirm: false
+ },
+ mutations: {
+ updateErrorsform(state, val) {
+ state.errorsform = val
+ },
+ updateUser(state, val) {
+ state.user = val
+ },
+ updateMainTable(state, val) {
+ state.mainTable = val;
+ },
+ updateDetailTable(state, val) {
+ state.detailTable = val;
+ },
+ updateCountMainTable(state, val) {
+ state.countMainTable = val;
+ },
+ updateCountDetailTable(state, val) {
+ state.countDetailTable = val;
+ },
+ updateMainTableLoadingStatus(state, val) {
+ state.mainTableLoadingStatus = val;
+ },
+ updateDetailTableLoadingStatus(state, val) {
+ state.detailTableLoadingStatus = val;
+ },
+ updateMainTableErrorMessage(state, val) {
+ state.mainTableErrorMessage = val;
+ },
+ updateDetailTableErrorMessage(state, val) {
+ state.detailTableErrorMessage = val;
+ },
+ updateMainTableCurrentPage(state, val) {
+ state.mainTableCurrentPage = val;
+ },
+ updateMainTableLastId(state, val) {
+ state.mainTableLastId = val;
+ },
+
+ updateSelectedMainTable(state, val) {
+ state.selectedMainTable = val;
+ },
+ updateSelectedDetailTable(state, val) {
+ state.selectedDetailTable = val;
+ },
+
+ updateRegionalOptions(state, val) {
+ state.regionalOptions = val;
+ },
+
+ updateBranchOptions(state, val) {
+ state.branchOptions = val;
+ },
+
+ updateMenuStartDate(state, val) {
+ state.menuStartDate = val;
+ },
+ updateMenuEndDate(state, val) {
+ state.menuEndDate = val;
+ },
+ updateMenuDateUse(state, val) {
+ state.menuDateUse = val;
+ },
+
+ updateDStartDate(state, val) {
+ state.dStartDate = val;
+ },
+ updateDEndDate(state, val) {
+ state.dEndDate = val;
+ },
+ updateFStartDate(state, val) {
+ state.fStartDate = val;
+ },
+ updateFEndDate(state, val) {
+ state.fEndDate = val;
+ },
+ updateFStatus(state, val) {
+ state.fStatus = val;
+ },
+ updateFSearch(state, val) {
+ state.fSearch = val;
+ },
+
+ updateDDateUse(state, val) {
+ state.dDateUse = val;
+ },
+ updateXDateUse(state, val) {
+ state.xDateUse = val;
+ },
+ updateWarehouseOptions(state, val) {
+ state.warehouseOptions = val
+ },
+ updateXWarehouse(state, val) {
+ state.xWarehouse = val;
+ },
+ updateXNote(state, val) {
+ state.xNote = val
+ },
+ updateDepartmentOptions(state, val) {
+ state.departmentOptions = val
+ },
+ updateXDepartment(state, val) {
+ state.xDepartment = val
+ },
+ updateXDescription(state, val) {
+ state.xDescription = val;
+ },
+ updateXTotalPrice(state, val) {
+ state.xTotalPrice = val;
+ },
+ updateXIOID(state, val) {
+ state.xIOID = val;
+ },
+ updateXNumber(state, val) {
+ state.xNumber = val;
+ },
+ updateXIODID(state, val) {
+ state.xIODID = val;
+ },
+ updateXDescriptionDetail(state, val) {
+ state.xDescriptionDetail = val;
+ },
+ updateXAmountRequest(state, val) {
+ state.xAmountRequest = val;
+ },
+ updateXEstimationPrice(state, val) {
+ state.xEstimationPrice = val;
+ },
+
+ updateDialogRequest(state, val) {
+ state.dialogRequest = val;
+ },
+ updateDialogDetail(state, val) {
+ state.dialogDetail = val;
+ },
+ updateAct(state, val) {
+ state.act = val;
+ },
+ updateErrMessage(state, val) {
+ state.errMessage = val;
+ },
+ updateSuccessMessage(state, val) {
+ state.successMessage = val;
+ },
+ updateAlertError(state, val) {
+ state.alertError = val;
+ },
+ updateAlertSuccess(state, val) {
+ state.alertSuccess = val;
+ },
+ updateErrors(state, val) {
+ state.errors = val;
+ },
+ updateLoadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val
+ },
+ updateDialogFormItem(state, val) {
+ state.dialogFormItem = val
+ },
+ updateItemList(state, val) {
+ state.itemList = val
+ },
+ updateSelectedItem(state, val) {
+ state.selectedItem = val
+ },
+ update_search_item(state, val) {
+ state.search_item = val
+ },
+ updateXQty(state, val) {
+ state.xQty = val
+ },
+ updateXPrice(state, val) {
+ state.xPrice = val
+ },
+ updateXIsCito(state, val) {
+ state.xIsCito = val
+ },
+ updateItemsTemp(state, val) {
+ state.itemsTemp = val
+ },
+ updateErroritems(state, val) {
+ state.erroritems = val
+ },
+ updateDialogErrors(state, val) {
+ state.dialogErrors = val
+ },
+ updateItemUnits(state, val) {
+ state.item_units = val
+ },
+ updateSelectedItemUnit(state, val) {
+ state.selected_item_unit = val
+ },
+ updateSearchItemUnit(state, val) {
+ state.search_item_unit = val
+ },
+ updateTotalPrice(state, val) {
+ state.total_price = val
+ },
+ updateDivisionOptions(state, val) {
+ state.divisionOptions = val
+ },
+ updateSelectedDivision(state, val) {
+ state.selectedDivision = val
+ },
+ updateDialogItem(state, val) {
+ state.dialogItem = val
+ },
+ updateSearchItem(state, val) {
+ state.searchItem = val
+ },
+ updateLoadingItem(state, val) {
+ state.loadingItem = val
+ },
+ updateItemCurrentPage(state, val) {
+ state.itemCurrentPage = val
+ },
+ updateItems(state, val) {
+ state.items = val
+ },
+ updateSelectedItems(state, val) {
+ state.selectedItems = val
+ },
+ updateItemTotalPage(state, val) {
+ state.itemTotalPage = val
+ },
+ updateLoadingSave(state, val) {
+ state.loadingSave = val
+ },
+ updateEmptycheck(state, val) {
+ state.emptycheck = val
+ },
+ updateEmptycheckvalue(state, val) {
+ state.emptycheckvalue = val
+ },
+ updateDialogApprove(state, val) {
+ state.dialogApprove = val
+ },
+ updateDetailItemouts(state, val) {
+ state.detailItemouts = val
+ },
+ updateDialogPreview(state, val) {
+ state.dialogPreview = val
+ },
+ update_dialog_batchitem(state, val) {
+ state.dialog_batchitem = val
+ },
+ update_list_batchitemform(state, data) {
+ state.list_batchitemform = data
+ },
+ update_form_batchitem(state, data) {
+ state.form_batchitem = data
+ },
+ update_buffer_detailitem(state, data) {
+ state.buffer_detailitem = data
+ },
+ updateApproveLevelID(state, val) {
+ state.approveLevelID = val;
+ },
+ updateDialogProcess(state, val) {
+ state.dialogProcess = val
+ },
+ updateTempBatchNumber(state, val) {
+ state.tempBatchNumber = val
+ },
+ updateDialogConfirm(state, val) {
+ state.dialogConfirm = val
+ }
+ },
+ actions: {
+ async search(context) {
+ context.commit("updateMainTableLoadingStatus", 1);
+
+ try {
+ var prm = {
+ token: one_token(),
+ current_page: context.state.mainTableCurrentPage,
+ startDate: context.state.fStartDate,
+ endDate: context.state.fEndDate,
+ status: context.state.fStatus.title,
+ search: context.state.fSearch,
+ mainTableLastId: -1,
+ };
+
+ let response = await api.search(prm);
+ if (response.status != "OK") {
+ context.commit("updateMainTableLoadingStatus", 3);
+ context.commit("updateMainTableErrorMessage", response.message);
+ } else {
+ context.commit("updateMainTableLoadingStatus", 2);
+ context.commit("updateMainTableErrorMessage", "");
+ let data = {
+ records: response.data.records,
+ total: response.data.totalPage,
+ };
+
+ context.commit("updateMainTable", data.records);
+ context.commit("updateCountMainTable", data.total);
+
+ if (context.state.mainTableLastId == -1) {
+ if (response.data && response.data.records.length > 0) {
+ context.commit("updateSelectedMainTable", response.data.records[0])
+ }
+ } else {
+ let idx = _.findIndex(resp.data.records, function (o) {
+ return o.T_ItemOutID == context.state.updateSelectedMainTable.T_ItemOutID
+ });
+ if (idx >= 0) {
+ context.commit("updateSelectedMainTable", resp.data.records[idx]);
+ }
+ }
+ }
+ } catch (e) {
+ context.commit("updateMainTableLoadingStatus", 3);
+ context.commit("updateMainTableErrorMessage", e.message);
+ }
+ },
+ async searchDetail(context) {
+ context.commit("updateDetailTableLoadingStatus", 1);
+
+ try {
+ var prm = {
+ token: one_token(),
+ IOID: context.state.selectedMainTable.T_ItemOutID,
+ };
+
+ let response = await api.searchDetail(prm);
+ if (response.status != "OK") {
+ context.commit("updateDetailTableLoadingStatus", 3);
+ context.commit("updateDetailTableErrorMessage", response.message);
+ } else {
+ context.commit("updateDetailTableLoadingStatus", 2);
+ context.commit("updateDetailTableErrorMessage", "");
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ context.commit("updateDetailTable", data.records);
+ context.commit("updateCountDetailTable", data.total);
+ }
+ } catch (e) {
+ context.commit("updateDetailTableLoadingStatus", 3);
+ context.commit("updateDetailTableErrorMessage", e.message);
+ }
+ },
+
+ async saveRequest(context, prm) {
+ context.commit("updateLoadingSave", true);
+ try {
+ prm.token = one_token();
+
+ let response = await api.saveRequest(prm);
+ if (response.status !== "OK") {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateSelectedItems", []);
+ context.commit("updateSelectedItem", {});
+ context.commit("updateItems", []);
+ context.commit("updateItemTotalPage", 0);
+ context.commit("updateItemCurrentPage", 1);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogRequest", false);
+ var msg = "Berhasil simpan pengeluaran barang";
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async updateRequest(context, prm) {
+ try {
+ prm.token = one_token();
+
+ let response = await api.updateRequest(prm);
+ if (response.status !== "OK") {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogRequest", false);
+ var msg = "Berhasil update pengeluaran barang";
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async deleteRequest(context, prm) {
+ try {
+ prm.token = one_token();
+
+ let response = await api.deleteRequest(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogRequest", false);
+ var msg = `Pengeluaran barang dengan kode ${prm.Number} berhasil dihapus`;
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async saveDetail(context, prm) {
+ try {
+ prm.token = one_token();
+
+ let response = await api.saveDetail(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ } else {
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogDetail", false);
+ var msg = "Request baru " + prm.itemDescription + " sudah tersimpan";
+ context.commit("updateSuccessMessage", msg);
+ // context.dispatch("search");
+ context.dispatch("searchDetail");
+ } else {
+ context.commit("updateErrors", response.data.errors[0].msg);
+ context.commit("updateDialogErrors", true);
+ }
+ }
+ } catch (e) {
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async updateDetail(context, prm) {
+ try {
+ prm.token = one_token();
+
+ let response = await api.updateDetail(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogDetail", false);
+ var msg = "Perubahan Request item " + prm.itemDescription + " berhasil disimpan";
+ context.commit("updateSuccessMessage", msg);
+ // context.dispatch("search");
+ context.dispatch("searchDetail");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async deleteDetail(context, prm) {
+ try {
+ prm.token = one_token();
+
+ let response = await api.deleteDetail(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogDetail", false);
+ var msg = `Request [${prm.itemDescription}] sudah dihapus`;
+ context.commit("updateSuccessMessage", msg);
+ // context.dispatch("search");
+ context.dispatch("searchDetail");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getWarehouse(context) {
+ context.commit("updateLoadingAutocomplete", true)
+ try {
+ let prm = {}
+ prm.regionalID = context.state.user.S_RegionalID
+ prm.branchCode = context.state.user.M_BranchCode
+ prm.token = one_token()
+ let response = await api.getWarehouse(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ context.commit("updateLoadingAutocomplete", false)
+ } else {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("updateWarehouseOptions", data.records);
+ context.commit("updateXWarehouse", data.records[0]);
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", true)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getDepartment(context) {
+ context.commit("updateLoadingAutocomplete", true)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let response = await api.getDepartment(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ context.commit("updateLoadingAutocomplete", false)
+ } else {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ };
+
+ context.commit("updateDepartmentOptions", data.records);
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", true)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async searchItem(context, prm) {
+ context.commit("updateLoadingAutocomplete", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.searchItem(prm)
+ if (resp.status != "OK") {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", resp.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("updateItemList", data.records)
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", true)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getUnit(context, prm) {
+ context.commit("updateLoadingAutocomplete", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.getUnit(prm)
+ if (resp.status != "OK") {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", resp.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("updateItemUnits", data.records)
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", true)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async orderConfirm(context, prm) {
+ try {
+ prm.token = one_token();
+
+ let response = await api.orderConfirm(prm);
+ if (response.status !== "OK") {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogDetail", false);
+ context.dispatch("search");
+ context.dispatch("searchDetail");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getDivisionByUser(context, prm) {
+ context.commit("updateLoadingAutocomplete", true)
+ try {
+ prm.token = one_token()
+ prm.userId = context.state.user.M_UserID
+ let response = await api.getDivisionByUser(prm);
+ if (response.status != "OK") {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingAutocomplete", false)
+ let data = {
+ records: response.data.records,
+ selected: response.data.selected
+ };
+ context.commit("updateErrMessage", "");
+ context.commit("updateDivisionOptions", data.records);
+ context.commit("updateSelectedDivision", data.selected[0]);
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getItemRequest(context, prm) {
+ context.commit("updateLoadingItem", true)
+ try {
+ prm.token = one_token()
+ prm.currentPage = context.state.itemCurrentPage;
+ let response = await api.getItemRequest(prm);
+ if (response.status != "OK") {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", "");
+ context.commit("updateItems", response.data.records);
+ context.commit("updateItemTotalPage", response.data.total);
+ }
+ } catch (e) {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getDetailItemOut(context, prm) {
+ context.commit("updateLoadingItem", true)
+ try {
+ prm.token = one_token()
+ let response = await api.getDetailItemOut(prm);
+ if (response.status != "OK") {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", "");
+ context.commit("updateSelectedItems", response.data.records);
+ }
+ } catch (e) {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getItemOuts(context, prm) {
+ context.commit("updateLoadingItem", true)
+ try {
+ prm.token = one_token()
+ let response = await api.getItemOuts(prm);
+ if (response.status != "OK") {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", "");
+ context.commit("updateDetailItemouts", response.data.records);
+ }
+ } catch (e) {
+ context.commit("updateLoadingItem", false)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async confirmIO(context, prm) {
+ context.commit("updateLoadingSave", true);
+ try {
+ prm.token = one_token();
+
+ let response = await api.confirmIO(prm);
+ if (response.status !== "OK") {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogConfirm", false);
+ var msg = "Berhasil konfirmasi pengeluaran barang";
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async approveIO(context, prm) {
+ context.commit("updateLoadingSave", true);
+ try {
+ prm.token = one_token();
+
+ let response = await api.approveIO(prm);
+ if (response.status !== "OK") {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogApprove", false);
+ var msg = "Berhasil APPROVE pengeluaran barang";
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async processIO(context, prm) {
+ context.commit("updateLoadingSave", true);
+ try {
+ prm.token = one_token();
+
+ let response = await api.processIO(prm);
+ if (response.status !== "OK") {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogProcess", false);
+ var msg = "Berhasil Proses pengeluaran barang";
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async rejectRequest(context, prm) {
+ context.commit("updateLoadingSave", true);
+ try {
+ prm.token = one_token();
+
+ let response = await api.rejectRequest(prm);
+ if (response.status !== "OK") {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", "");
+ let data = {
+ total: response.data.total,
+ };
+
+ if (data.total !== -1) {
+ context.commit("updateErrors", []);
+ context.commit("updateAlertSuccess", true);
+ context.commit("updateDialogApprove", false);
+ var msg = "Berhasil REJECT pengeluaran barang";
+ context.commit("updateSuccessMessage", msg);
+ context.dispatch("search");
+ } else {
+ context.commit("updateErrors", response.data.errors);
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingSave", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getBatchItemDetail(context, params) {
+ try {
+ params.token = one_token()
+ params.regionalid = context.state.user.S_RegionalID
+ params.branchid = context.state.user.M_BranchID
+
+ let resp = await api.getItemBatchListing(params)
+ if (resp.status != 'OK') {
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateErrMessage", "");
+ context.commit("update_list_batchitemform", resp.data)
+
+ let newBatchNumber = resp.data.records;
+ let updateBatchNumber = context.state.tempBatchNumber.records
+ // console.log('before updateBatchNumber module', updateBatchNumber)
+ // console.log('before recordIndex module', newBatchNumber)
+ updateBatchNumber.forEach(bn => {
+ let recordIndex = newBatchNumber.findIndex(record =>
+ record.StockBatchNo === bn.StockBatchNo &&
+ record.StockItemID === bn.StockItemID &&
+ record.StockItemUnitID === bn.StockItemUnitID
+
+ );
+
+ // console.log('newBatchNumber module', newBatchNumber)
+ // console.log('recordIndex module', recordIndex)
+
+ if (recordIndex !== -1) {
+ let updatestock = updateBatchNumber[recordIndex].StockQty
+ newBatchNumber[recordIndex].StockQty = String(updatestock)
+
+ // Atau hapus record jika StockQty menjadi 0
+ // if (stok <= 0) {
+ // newBatchNumber.splice(recordIndex, 1);
+ // }
+
+ }
+ });
+
+ let newBatch = {
+ records: newBatchNumber,
+ total: newBatchNumber.length
+ };
+ context.commit("update_list_batchitemform", newBatch)
+ }
+ } catch (error) {
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+
+ async getlevel(context) {
+ context.commit("updateMainTableLoadingStatus", 1);
+
+ try {
+ var payload = {
+ token: one_token()
+ };
+
+ let resp = await api.getlevel(payload);
+ if (resp.status != "OK") {
+ context.commit("updateMainTableLoadingStatus", 3);
+ context.commit("updateMainTableErrorMessage", resp.message);
+ } else {
+ context.commit("updateMainTableLoadingStatus", 2);
+ context.commit("updateMainTableErrorMessage", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total,
+ };
+
+ // context.commit("updateLevelName", data.records[0].M_ApproveLevelName);
+ context.commit("updateApproveLevelID", data.records[0].M_ApproveLevelID);
+ }
+ } catch (e) {
+ context.commit("updateMainTableLoadingStatus", 3);
+ context.commit("updateMainTableErrorMessage", e.message);
+ }
+ }
+ },
+};
+
diff --git a/test/vuex/acc-one-item-out-v3/store.js b/test/vuex/acc-one-item-out-v3/store.js
new file mode 100644
index 0000000..feacfcb
--- /dev/null
+++ b/test/vuex/acc-one-item-out-v3/store.js
@@ -0,0 +1,13 @@
+import listrequest from "./modules/listrequest.js";
+import requester from "./modules/requester.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ listrequest: listrequest,
+ requester: requester,
+ system: system,
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-item-usage-v3/api/api.js b/test/vuex/acc-one-item-usage-v3/api/api.js
new file mode 100644
index 0000000..034aaeb
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/api/api.js
@@ -0,0 +1,166 @@
+const URL = "/one-api/mockup/itemout/";
+
+export async function getDivisionByUser(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/getDivisionByUser', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function search(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/search', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getUnit(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/getUnit', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function saveItemUsage(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/saveItemUsage', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+// item used
+export async function getItemUsed(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/getItemUsed', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function updateItemUsed(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/updateItemUsed', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function deleteItemUsed(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/deleteItemUsed', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function confirmItemUsed(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/confirmItemUsed', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getUnitByItemId(payload) {
+ try {
+ var resp = await axios.post(URL + 'itemusagev3/getUnitByItemId', payload);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-usage-v3/components/dialogDetailUsageItem.vue b/test/vuex/acc-one-item-usage-v3/components/dialogDetailUsageItem.vue
new file mode 100644
index 0000000..7b80fc6
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/components/dialogDetailUsageItem.vue
@@ -0,0 +1,310 @@
+
+
+
+
+
+ Ganti Satuan {{ selectedItemUsage.M_ItemDesc ? selectedItemUsage.M_ItemDesc : "" }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Ganti
+
+
+
+
+
+
+ Detail Pemakaian
+
+
+
+
+
+ Item: {{ selectedItemUsage.M_ItemDesc }}
+ Unit: {{ selectedItemUsage.ItemUnitName }}
+ Jumlah Stock: {{ selectedItemUsage.TotalStockQtyReq }}
+
+
+
+
+
+
+
+
+
+ {{ props.item.StockBatchNo }}
+
+
+ {{ props.item.ItemUnitName }}
+
+
+ {{ props.item.QtyReq }}
+
+
+
+
+ Jumlah melebihi stock request
+
+
+ {{ props.item.ItemUnitName }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Simpan
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-usage-v3/components/dialogUsageItem.vue b/test/vuex/acc-one-item-usage-v3/components/dialogUsageItem.vue
new file mode 100644
index 0000000..019f17e
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/components/dialogUsageItem.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+ Detail Pemakaian
+
+
+
+
+ Item: {{ selectedItem.M_ItemDesc }}
+ Unit Asal: {{ selectedItem.ItemUnitName }}
+ Qty: {{ selectedItem.ItemUsageQty }}
+
+
+
+
+
+
+
+ Jumlah digunakan masih kosong
+
+
+
+
+
+ Unit harus dipilih
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-usage-v3/components/itemUsageList.vue b/test/vuex/acc-one-item-usage-v3/components/itemUsageList.vue
new file mode 100644
index 0000000..96a645a
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/components/itemUsageList.vue
@@ -0,0 +1,331 @@
+
+
+
+ {{ snackbar.message }}
+
+ Close
+
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+
+ PEMAKAIAN ITEM PER DIVISI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.DivisionName }}
+
+
+ {{ props.item.M_ItemCode }} {{ props.item.M_ItemDesc }}
+
+
+
+ Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-item-usage-v3/components/itemUsedList.vue b/test/vuex/acc-one-item-usage-v3/components/itemUsedList.vue
new file mode 100644
index 0000000..d2f84ac
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/components/itemUsedList.vue
@@ -0,0 +1,690 @@
+
+
+
+ {{ snackbar.message }}
+
+ Close
+
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ DAFTAR ITEM DIGUNAKAN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatDate(props.item.ItemUsedDate)}}
+ {{ props.item.ItemUsedNumber }}
+
+
+ {{ props.item.M_ItemCode }} {{ props.item.M_ItemDesc }}
+
+
+ Qty : {{ props.item.ItemUsedQty }}
+ Unit : {{ props.item.ItemUnitName }}
+
+
+ {{ props.item.M_UserUsername }}
+
+
+
+
+ check_circle
+
+
+
+
+ Sudah Dikonfirmasi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Pemakaian
+
+
+
+
+ Item: {{ selectedItemUsed.M_ItemDesc }}
+ Unit: {{ selectedItemUsed.ItemUnitName }}
+ Qty: {{ selectedItemUsed.ItemUsedQty }}
+
+
+
+
+
+
+
+ Jumlah digunakan masih kosong
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
+
+
+
+
+ KONFIRMASI
+
+
+
+ Apakah anda yakin untuk konfirmasi ?
+
+
Item: {{ selectedItemUsed.M_ItemDesc }}
+
Batch No: {{ selectedItemUsed.ItemUsedBatchNo }}
+
Unit: {{ selectedItemUsed.ItemUnitName }}
+
Qty: {{ selectedItemUsed.ItemUsedQty }}
+
+
+
+
+
+
+
+
+ Tidak
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+ PERHATIAN
+
+
+
+ Apakah anda yakin untuk menghapus
+ {{
+ selectedItemUsed.M_ItemDesc
+ }}
+ ??
+
+
+
+
+
+
+
+ Tidak
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-item-usage-v3/index.php b/test/vuex/acc-one-item-usage-v3/index.php
new file mode 100644
index 0000000..a777a34
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/index.php
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+ Error
+
+
+
+ {{errMessage}}
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-usage-v3/modules/usage.js b/test/vuex/acc-one-item-usage-v3/modules/usage.js
new file mode 100644
index 0000000..db0534a
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/modules/usage.js
@@ -0,0 +1,290 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/api.js";
+
+export default {
+ namespaced: true,
+ state: {
+ errMessage: "",
+ alertError: false,
+ snackbar: {
+ state: false,
+ type: 'success',
+ message: '',
+ },
+ loadingAutocomplete: false,
+ divisionOptions: [],
+ selectedDivision: {},
+ user: one_user(),
+ currentPage: 1,
+ loadingStatus: 1, // 1 => LOADING, 2 => DONE, 3 => ERROR
+ itemUsageList: [],
+ selectedItemUsage: {},
+ totalPage: 0,
+ dialogUsage: false,
+ unitList: [],
+ selectedItemUnit: {},
+ usedQty: 0,
+ errors: [],
+ last_id: -1,
+ xsearch: "",
+ dialogform: false,
+ itemRequestList: [],
+ emptycheck: [],
+ dialogUnit: false,
+ selectedUnit: {},
+ unitOptions: [],
+ loadingUnit: false,
+ },
+ mutations: {
+ updateErrMessage(state, val) {
+ state.errMessage = val;
+ },
+ updateAlertError(state, val) {
+ state.alertError = val;
+ },
+ updateSnackbar(state, val) {
+ state.snackbar = val;
+ },
+ updateLoadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val;
+ },
+ updateDivisionOptions(state, val) {
+ state.divisionOptions = val;
+ },
+ updateSelectedDivision(state, val) {
+ state.selectedDivision = val;
+ },
+ updateUser(state, val) {
+ state.user = val;
+ },
+ updateCurrentPage(state, val) {
+ state.currentPage = val;
+ },
+ updateLoadingStatus(state, val) {
+ state.loadingStatus = val;
+ },
+ updateItemUsageList(state, val) {
+ state.itemUsageList = val;
+ },
+ updateSelectedItemUsage(state, val) {
+ state.selectedItemUsage = val;
+ },
+ updateTotalPage(state, val) {
+ state.totalPage = val;
+ },
+ updateDialogUsage(state, val) {
+ state.dialogUsage = val;
+ },
+ updateUnitList(state, val) {
+ state.unitList = val;
+ },
+ updateSelectedItemUnit(state, val) {
+ state.selectedItemUnit = val;
+ },
+ updateUsedQty(state, val) {
+ state.usedQty = val;
+ },
+ updateErrors(state, val) {
+ state.errors = val;
+ },
+ update_last_id(state, val) {
+ state.last_id = val
+ },
+ updateXsearch(state, val) {
+ state.xsearch = val
+ },
+ updateDialogform(state, val) {
+ state.dialogform = val
+ },
+ updateItemRequestList(state, val) {
+ state.itemRequestList = val
+ },
+ updateEmptycheck(state, val) {
+ state.emptycheck = val
+ },
+ updateLoadingUnit(state, val) {
+ state.loadingUnit = val;
+ },
+ updateDialogUnit(state, val) {
+ state.dialogUnit = val;
+ },
+ updateSelectedUnit(state, val) {
+ state.selectedUnit = val;
+ },
+ updateUnitOptions(state, val) {
+ state.unitOptions = val;
+ }
+ },
+ actions: {
+ async getDivisionByUser(context) {
+ context.commit("updateLoadingAutocomplete", true)
+ try {
+ let payload = {}
+ payload.token = one_token()
+ payload.userId = context.state.user.M_UserID
+ let response = await api.getDivisionByUser(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingAutocomplete", false)
+ let data = {
+ records: response.data.records,
+ selected: response.data.selected
+ };
+ context.commit("updateDivisionOptions", data.records);
+ context.commit("updateSelectedDivision", data.selected[0]);
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", false)
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async search(context, payload) {
+ context.commit("updateLoadingStatus", 1);
+ try {
+ // var payload = {
+ // token: one_token(),
+ // currentPage: context.state.currentPage,
+ // divisionID: context.state.selectedDivision == undefined ? 0 : context.state.selectedDivision.DivisionID,
+ // search: context.state.xsearch,
+ // };
+ payload.token = one_token();
+
+ let response = await api.search(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingStatus", 2);
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ total_page: response.data.total_page,
+ };
+
+ context.commit("updateItemUsageList", data.records);
+ context.commit("updateTotalPage", data.total_page);
+
+ if (context.state.last_id == -1) {
+ if (response.data && response.data.records.length > 0) {
+ context.commit("updateSelectedItemUsage", response.data.records[0])
+ }
+ } else {
+ let idx = _.findIndex(response.data.records, function (o) {
+ return o.ItemUsageID == context.state.selectedItemUsage.ItemUsageID
+ });
+ if (idx >= 0) {
+ context.commit("updateSelectedItemUsage", response.data.records[idx]);
+ }
+ }
+ }
+ } catch (e) {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async getUnit(context, payload) {
+ context.commit("updateLoadingAutocomplete", 1);
+ try {
+ payload.token = one_token()
+
+ let response = await api.getUnit(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingAutocomplete", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingAutocomplete", 2);
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records
+ };
+
+ context.commit("updateUnitList", data.records);
+ }
+ } catch (e) {
+ context.commit("updateLoadingAutocomplete", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async saveItemUsage(context, payload) {
+ context.commit("updateLoadingStatus", 1);
+ try {
+ payload.token = one_token();
+
+ let response = await api.saveItemUsage(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingStatus", 2);
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ };
+
+
+ context.commit("updateDialogform", false);
+ context.commit("updateItemRequestList", []);
+ context.commit("update_last_id", payload.ItemUsageID)
+
+ context.commit("updateSnackbar", {
+ state: true,
+ type: 'success',
+ message: 'Item usage saved successfully.'
+ });
+ context.dispatch("search", {
+ currentPage: payload.currentPageUsage,
+ divisionID: payload.divisionID,
+ search: payload.searchUsage
+ });
+ context.dispatch("used/getItemUsed", {
+ itemUsageID: payload.ItemUsageID,
+ currentPage: payload.currentPage,
+ search: payload.search,
+ statusConfirm: payload.statusConfirm,
+ }, { root: true });
+ }
+ } catch (e) {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async getUnitByItemId(context, payload) {
+ context.commit("updateLoadingUnit", true)
+ context.commit("updateDialogUnit", true);
+ try {
+ payload.token = one_token();
+ let response = await api.getUnitByItemId(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingUnit", false)
+ context.commit("updateDialogUnit", false);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingUnit", false)
+ context.commit("updateErrMessage", "");
+ context.commit("updateUnitOptions", response.data.records);
+ context.commit("updateSelectedUnit", payload.selectedUnit);
+
+ }
+ } catch (e) {
+ context.commit("updateLoadingUnit", false)
+ context.commit("updateDialogUnit", false);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ }
+ }
+};
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-usage-v3/modules/used.js b/test/vuex/acc-one-item-usage-v3/modules/used.js
new file mode 100644
index 0000000..0db9034
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/modules/used.js
@@ -0,0 +1,280 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/api.js";
+
+export default {
+ namespaced: true,
+ state: {
+ errMessage: "",
+ alertError: false,
+ snackbar: {
+ state: false,
+ type: 'success',
+ message: '',
+ },
+ user: one_user(),
+ currentPage: 1,
+ loadingStatus: 1, // 1 => LOADING, 2 => DONE, 3 => ERROR
+ itemUsedList: [],
+ selectedItemUsed: {},
+ totalPageUsed: 0,
+ selectedUsedQty: 0,
+ dialogUsed: false,
+ errors: [],
+ dialogDelete: false,
+ dialogConfirmation: false,
+ search: "",
+ statusConfirmOptions: [
+ { value: "X", text: "Semua" },
+ { value: "N", text: "Belum Dikonfirmasi" },
+ { value: "Y", text: "Sudah Dikonfirmasi" },
+
+ ],
+ statusConfirm: "X",
+ menuStartDate: false,
+ menuEndDate: false,
+ fStartDate: moment(new Date()).format("YYYY-MM-DD"),
+ fEndDate: moment(new Date()).format("YYYY-MM-DD"),
+ dStartDate: new Date().toISOString().substring(0, 10),
+ dEndDate: new Date().toISOString().substring(0, 10)
+ },
+ mutations: {
+ updateErrMessage(state, val) {
+ state.errMessage = val;
+ },
+ updateAlertError(state, val) {
+ state.alertError = val;
+ },
+ updateSnackbar(state, val) {
+ state.snackbar = val;
+ },
+ updateLoadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val;
+ },
+ updateDivisionOptions(state, val) {
+ state.divisionOptions = val;
+ },
+ updateSelectedDivision(state, val) {
+ state.selectedDivision = val;
+ },
+ updateUser(state, val) {
+ state.user = val;
+ },
+ updateCurrentPage(state, val) {
+ state.currentPage = val;
+ },
+ updateLoadingStatus(state, val) {
+ state.loadingStatus = val;
+ },
+ updateItemUsedList(state, val) {
+ state.itemUsedList = val;
+ },
+ updateSelectedItemUsed(state, val) {
+ state.selectedItemUsed = val;
+ },
+ updateTotalPageUsed(state, val) {
+ state.totalPageUsed = val;
+ },
+ updateSelectedUsedQty(state, val) {
+ state.selectedUsedQty = val;
+ },
+ updateDialogUsed(state, val) {
+ state.dialogUsed = val;
+ },
+ updateErrors(state, val) {
+ state.errors = val;
+ },
+ updateDialogDelete(state, val) {
+ state.dialogDelete = val;
+ },
+ updateDialogConfirmation(state, val) {
+ state.dialogConfirmation = val;
+ },
+ updateSearch(state, val) {
+ state.search = val;
+ state.currentPage = 1; // Reset to first page on new search
+ },
+ updateStatusConfirm(state, val) {
+ state.statusConfirm = val;
+ },
+ updateStatusConfirmOptions(state, val) {
+ state.statusConfirmOptions = val;
+ },
+ updateMenuStartDate(state, val) {
+ state.menuStartDate = val;
+ },
+ updateMenuEndDate(state, val) {
+ state.menuEndDate = val;
+ },
+ updateFStartDate(state, val) {
+ state.fStartDate = val;
+ },
+ updateFEndDate(state, val) {
+ state.fEndDate = val;
+ },
+ updateDStartDate(state, val) {
+ state.dStartDate = val;
+ },
+ updateDEndDate(state, val) {
+ state.dEndDate = val;
+ }
+ },
+ actions: {
+ async getItemUsed(context, payload) {
+ context.commit("updateLoadingStatus", 1);
+ try {
+ payload.token = one_token();
+ // var payload = {
+ // itemUsageID: context.state.usage.selectedItemUsage.ItemUsageID,
+ // currentPage: context.state.currentPage,
+ // search: context.state.search,
+ // statusConfirm: context.state.statusConfirm,
+ // token: one_token()
+ // };
+
+ let response = await api.getItemUsed(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingStatus", 2);
+ context.commit("updateErrMessage", "");
+ let data = {
+ records: response.data.records,
+ total_page: response.data.total_page,
+ };
+
+ context.commit("updateItemUsedList", data.records);
+ context.commit("updateTotalPageUsed", data.total_page);
+ }
+ } catch (e) {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async updateItemUsed(context, payload) {
+ context.commit("updateLoadingStatus", 1);
+ try {
+ payload.token = one_token();
+
+ let response = await api.updateItemUsed(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingStatus", 2);
+ context.commit("updateErrMessage", "");
+
+
+ context.commit("updateDialogUsed", false);
+ context.commit("updateSelectedItemUsed", {});
+ context.commit("updateSelectedUsedQty", 0);
+ context.commit("usage/update_last_id", payload.itemUsageID, { root: true });
+
+ context.commit("updateSnackbar", {
+ state: true,
+ type: 'success',
+ message: 'Item used berhasil diupdate.'
+ });
+ context.dispatch("usage/search",{}, { root: true });
+ context.dispatch("getItemUsed", {
+ itemUsageID: payload.itemUsageID,
+ currentPage: payload.currentPage,
+ search: payload.search,
+ statusConfirm: payload.statusConfirm,
+ startdate: payload.startdate,
+ enddate: payload.enddate
+ });
+ }
+ } catch (e) {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async deleteItemUsed(context, payload) {
+ context.commit("updateLoadingStatus", 1);
+ try {
+ payload.token = one_token();
+
+ let response = await api.deleteItemUsed(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingStatus", 2);
+ context.commit("updateErrMessage", "");
+
+
+ context.commit("updateDialogDelete", false);
+ context.commit("updateSelectedItemUsed", {});
+ context.commit("usage/update_last_id", payload.itemUsageID, { root: true });
+
+ context.commit("updateSnackbar", {
+ state: true,
+ type: 'success',
+ message: 'Item used berhasil dihapus.'
+ });
+ context.dispatch("usage/search",{}, { root: true });
+ context.dispatch("getItemUsed", {
+ itemUsageID: payload.itemUsageID,
+ currentPage: payload.currentPage,
+ search: payload.search,
+ statusConfirm: payload.statusConfirm,
+ startdate: payload.startdate,
+ enddate: payload.enddate
+ });
+ }
+ } catch (e) {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ },
+ async confirmItemUsed(context, payload) {
+ context.commit("updateLoadingStatus", 1);
+ try {
+ payload.token = one_token();
+
+ let response = await api.confirmItemUsed(payload);
+ if (response.status != "OK") {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", response.message);
+ context.commit("updateAlertError", true);
+ } else {
+ context.commit("updateLoadingStatus", 2);
+ context.commit("updateErrMessage", "");
+
+
+ context.commit("updateSelectedItemUsed", {});
+ context.commit("updateDialogConfirmation", false);
+ context.commit("usage/update_last_id", payload.itemUsageID, { root: true });
+
+ context.commit("updateSnackbar", {
+ state: true,
+ type: 'success',
+ message: 'Item used berhasil dikonfirmasi.'
+ });
+ context.dispatch("getItemUsed", {
+ itemUsageID: payload.itemUsageID,
+ currentPage: payload.currentPage,
+ search: payload.search,
+ statusConfirm: payload.statusConfirm,
+ startdate: payload.startdate,
+ enddate: payload.enddate
+ });
+ }
+ } catch (e) {
+ context.commit("updateLoadingStatus", 3);
+ context.commit("updateErrMessage", e.message);
+ context.commit("updateAlertError", true);
+ }
+ }
+ }
+};
\ No newline at end of file
diff --git a/test/vuex/acc-one-item-usage-v3/store.js b/test/vuex/acc-one-item-usage-v3/store.js
new file mode 100644
index 0000000..75868d5
--- /dev/null
+++ b/test/vuex/acc-one-item-usage-v3/store.js
@@ -0,0 +1,13 @@
+import usage from "./modules/usage.js";
+import used from "./modules/used.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ usage: usage,
+ used: used,
+ system: system,
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-jurnal-fix-asset/api/journal.js b/test/vuex/acc-one-jurnal-fix-asset/api/journal.js
new file mode 100644
index 0000000..159a561
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/api/journal.js
@@ -0,0 +1,282 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/getPeriode", prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(
+ token,
+ xdate,
+ periodeid,
+ current_page,
+ search,
+ branchCode,
+ regionalId
+) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/search", {
+ token: token,
+ xdate: xdate,
+ periodeid: periodeid,
+ current_page: current_page,
+ search: search,
+ branchCode: branchCode,
+ regionalId: regionalId
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(
+ URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/getUserApproveLevel", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getListingCOA(params) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/getListingCOA", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function requestEditJurnal(params) {
+ try {
+ const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ const data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function changeJurnalToPosted(params) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/changeJurnalToPosted", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getTotalJurnalNotPostedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journalfixasset/getTotalJurnalNotPostedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function closeJurnalPerPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "Journalfixasset/closeJurnalPerPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDataJurnalNotClosedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journalfixasset/getDataJurnalNotClosedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-fix-asset/components/dialogCloseJurnal.vue b/test/vuex/acc-one-jurnal-fix-asset/components/dialogCloseJurnal.vue
new file mode 100644
index 0000000..417ffbb
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/components/dialogCloseJurnal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang tidak dapat ditutup: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang dapat ditutup: {{ item.total_jurnal }}
+
+
+
+ Apakah anda yakin akan menutup semua jurnal yang dibuat di
+ {{ area_jurnal }} dalam rentang waktu
+ {{ selected_periode.periode }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-fix-asset/components/dialogEditJurnal.vue b/test/vuex/acc-one-jurnal-fix-asset/components/dialogEditJurnal.vue
new file mode 100644
index 0000000..0988f33
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/components/dialogEditJurnal.vue
@@ -0,0 +1,219 @@
+
+
+
+
+ EDIT JOURNAL FIX ASSET
+
+
+
+
+ Company Name
+
+ {{ selected_journal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.coaCurrencyCode }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fix-asset/components/dialogPostingJurnal.vue b/test/vuex/acc-one-jurnal-fix-asset/components/dialogPostingJurnal.vue
new file mode 100644
index 0000000..d611375
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/components/dialogPostingJurnal.vue
@@ -0,0 +1,68 @@
+
+
+
+
+ POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang dapat diposting: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang tidak dapat diposting: {{ item.total_jurnal }}
+ (belum diverifikasi setelah edit)
+
+
+
+ Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
+ {{ selected_periode.periode }} ?
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fix-asset/components/dialogRequestEditJurnal.vue b/test/vuex/acc-one-jurnal-fix-asset/components/dialogRequestEditJurnal.vue
new file mode 100644
index 0000000..92715a8
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/components/dialogRequestEditJurnal.vue
@@ -0,0 +1,58 @@
+
+
+
+
+ REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
+
+
+
+ Jurnal ini sudah pernah diedit sebelumnya oleh:
+ {{ selected_journal.JurnalRequestEditStaffName }}
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi?
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal:
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-fix-asset/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-fix-asset/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..3e578c7
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/components/oneMediaJournalList.vue
@@ -0,0 +1,1225 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ JOURNAL FIX ASSET
+
+
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+ book
+
+
+ Posting Jurnal
+
+
+
+
+
+
+ collections_bookmark
+
+
+ Tutup Jurnal
+
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+
+ error
+
+ error information
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ posted
+
+
+
+
+ not posted
+
+
+
+
+ closed
+
+
+
+
+
+
+
+ edit
+
+
+ Edit
+
+
+
+
+ visibility
+
+
+ Detail
+
+
+
+
+ picture_as_pdf
+
+
+ RPT PDF
+
+
+
+
+ receipt
+
+
+ RPT Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL FIX ASSET
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+ Error Type:
+ {{ error.JurnalErr_Msg.err_type }}
+
+
+ Message:
+ {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal
+ {{
+ msgalertgenerate
+ }}
+ ?
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-fix-asset/index.php b/test/vuex/acc-one-jurnal-fix-asset/index.php
new file mode 100644
index 0000000..a736dd6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/index.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fix-asset/modules/journal.js b/test/vuex/acc-one-jurnal-fix-asset/modules/journal.js
new file mode 100644
index 0000000..734c4af
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/modules/journal.js
@@ -0,0 +1,582 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js";
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: "new",
+ save_status: 0,
+ save_error_message: "",
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format("YYYY-MM-DD"),
+ end_date: moment(new Date()).format("YYYY-MM-DD"),
+ journals: [],
+ selected_journal: {},
+ summary: { debit: 0, credit: 0, balance: 0 },
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ regionals: [],
+ selected_regional: {},
+ branchs: [],
+ selected_branch: {},
+ xsearch: "",
+ open_dialog_info: false,
+ msg_info: "",
+
+ // --
+ dialog_edit_journal: false,
+ user_level: {},
+ list_coa: [],
+ journal_edit: [],
+ dialog_confirm_posting: false,
+ total_jurnal_not_posted: [],
+ dialog_request_edit: false,
+
+ // ---
+ dialog_close_jurnal: false,
+ jurnal_to_close: []
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_current_page(state, val) {
+ state.current_page = val;
+ },
+ update_x_search(state, val) {
+ state.x_search = val;
+ state.current_page = 1;
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val;
+ },
+ update_last_id(state, val) {
+ state.last_id = val;
+ },
+ update_coas(state, val) {
+ state.coas = val;
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val;
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val;
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val;
+ },
+ update_act(state, val) {
+ state.act = val;
+ },
+ update_save_status(state, val) {
+ state.save_status = val;
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val;
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value;
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val;
+ },
+ update_end_date(state, val) {
+ state.end_date = val;
+ },
+ update_journals(state, val) {
+ state.journals = val;
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val;
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val;
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val;
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val;
+ },
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val;
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val;
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val;
+ },
+ update_regionals(state, val) {
+ state.regionals = val;
+ },
+ update_selected_regional(state, val) {
+ state.selected_regional = val;
+ },
+ update_branchs(state, val) {
+ state.branchs = val;
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val;
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val;
+ state.current_page = 1;
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val;
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val;
+ },
+
+ // --
+ update_dialog_edit_journal(state, val) {
+ state.dialog_edit_journal = val;
+ },
+ update_user_level(state, val) {
+ state.user_level = val;
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val;
+ },
+ update_journal_edit(state, val) {
+ state.journal_edit = val;
+ },
+ update_dialog_confirm_posting(state, val) {
+ state.dialog_confirm_posting = val;
+ },
+ update_total_jurnal_not_posted(state, val) {
+ state.total_jurnal_not_posted = val;
+ },
+ update_dialog_request_edit(state, val) {
+ state.dialog_request_edit = val;
+ },
+
+ update_dialog_close_jurnal(state, val) {
+ state.dialog_close_jurnal = val;
+ },
+ update_jurnal_to_close(state, val) {
+ state.jurnal_to_close = val;
+ }
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let prm = {};
+ prm.token = one_token();
+ let resp = await api.getPeriode(prm);
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_autocomplete_status", 2);
+ let data = resp.data;
+ context.commit("update_periodeList", resp.data);
+
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(
+ (p) =>
+ p.periodeMonth == currentMonth.toString() &&
+ p.periodeYear == currentYear
+ );
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode);
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_status", 1);
+ try {
+ let resp = await api.search(
+ one_token(),
+ prm.xdate,
+ prm.periodeid,
+ prm.current_page,
+ prm.search,
+ prm.branchCode,
+ prm.regionalId
+ );
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2);
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ };
+
+ context.commit("update_journals", data.records);
+ context.commit("update_total_journal", data.total);
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1);
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno;
+ let resp = await api.insertSales(branchCode, date, jurnalno);
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_save_status", 2);
+ context.commit("update_save_error_message", resp.message);
+ let data = {
+ total: resp.data.total
+ };
+
+ context.commit("update_alert_success", true);
+ var msg = resp.data.msg;
+ context.commit("update_msg_success", msg);
+ context.dispatch("search", {
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getRegional(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getRegional({
+ token: one_token(),
+ regionalId: context.state.user.S_RegionalID
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_regionals", data.records);
+ context.commit("update_selected_regional", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async getBranch(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getBranch({
+ token: one_token(),
+ regionalId: context.state.selected_regional.S_RegionalID,
+ branchCode: context.state.user.M_BranchCode
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_branchs", data.records);
+ context.commit("update_selected_branch", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async postingJurnal(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.changeJurnalToPosted(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_total_jurnal_not_posted", []);
+ context.commit("update_dialog_confirm_posting", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getUserApprovalLevel(context) {
+ try {
+ let param = { token: one_token() };
+ const resp = await api.getUserApproveLevel(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_user_level", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getListingCOA(context) {
+ try {
+ let param = {
+ token: one_token(),
+ keyword: ""
+ };
+ const resp = await api.getListingCOA(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_list_coa", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async requestEditJurnal(context) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ staffID: context.state.user.M_UserID,
+ staffName: context.state.user.M_UserUsername
+ };
+ const resp = await api.requestEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_request_edit", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async saveEditJurnal(context, newdetail) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ jurnalRequestEditID: context.state.selected_journal.JurnalRequestEditID,
+ oldjurnaltx: context.state.selected_journal.detailtx,
+ newjurnaltx: newdetail
+ };
+ const resp = await api.saveEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_dialog_edit_journal", false);
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async totalJurnalNotPostedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getTotalJurnalNotPostedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_total_jurnal_not_posted", resp.data.total_jurnal ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getDataJurnalNotClosedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getDataJurnalNotClosedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_jurnal_to_close", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async closeJurnalPerPeriode(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.closeJurnalPerPeriode(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_jurnal_to_close", []);
+ context.commit("update_dialog_close_jurnal", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ }
+ }
+};
diff --git a/test/vuex/acc-one-jurnal-fix-asset/store.js b/test/vuex/acc-one-jurnal-fix-asset/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fix-asset/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fixed-asset-v2/api/journal.js b/test/vuex/acc-one-jurnal-fixed-asset-v2/api/journal.js
new file mode 100644
index 0000000..56922cb
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fixed-asset-v2/api/journal.js
@@ -0,0 +1,101 @@
+const URL = "/one-api/fixedasset/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + 'journalfixedassetv2/getPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(token, xdate, periodeid, branchid, regionalid) {
+ try {
+ var resp = await axios.post(URL + 'journalfixedassetv2/search', {
+ token:token,
+ xdate:xdate,
+ periodeid:periodeid,
+ branchid:branchid,
+ regionalid:regionalid
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getdetail(prm) {
+ try {
+ var resp = await axios.post(URL + 'journalfixedassetv2/getdetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function addConfirm(prm) {
+ try {
+ var resp = await axios.post(URL + 'journalfixedassetv2/addConfirm', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-fixed-asset-v2/components/oneBranchList.vue b/test/vuex/acc-one-jurnal-fixed-asset-v2/components/oneBranchList.vue
new file mode 100644
index 0000000..fe104a6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fixed-asset-v2/components/oneBranchList.vue
@@ -0,0 +1,864 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ DETAIL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.M_BranchName }}
+
+
+
+ error
+
+ error information
+
+
+
+
+
+ {{ props.item.coaDescription }}
+
+
+ {{ props.item.totaldepretext }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL PAYMENT VOUCHER
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ Rp {{ convertMoney(props.item.jurnalTxDebit) }}
+
+
+ Rp {{ convertMoney(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ Rp {{ convertMoney(xsummary.debit) }}
+
+
+ Rp {{ convertMoney(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ Rp {{ convertMoney(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ KONFIRMASI
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi fixed aset periode {{ this.$store.state.journal.selected_periode.periode }} ?
+
+
+
+
+
+ TUTUP
+ YAKIN
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+
Error Type: {{ error.JurnalErr_Msg.err_type }}
+
Message: {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal {{ msgalertgenerate }} ?
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fixed-asset-v2/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-fixed-asset-v2/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..76ae0b9
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fixed-asset-v2/components/oneMediaJournalList.vue
@@ -0,0 +1,956 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ CONFIRM
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.yearandmonth }}
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+ Period
+
+
+ Confirm
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.CodeFixedAsset }}
+
+
+
+ error
+
+ error information
+
+
+
+
+
+ {{ props.item.Fa_ItemNote }}
+ {{ props.item.NameFixedAsset }}
+
+
+ {{ props.item.AcquisitionPrice_text }}
+
+
+ {{ props.item.BookValue_text }}
+
+
+ {{ props.item.depresiasi_text }}
+
+
+ {{ props.item.akumulasi_text }}
+
+
+ {{ props.item.nilai_saat_ini_text }}
+
+
+
+
+ confirmed
+
+
+
+
+ not confirmed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL PAYMENT VOUCHER
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ Rp {{ convertMoney(props.item.jurnalTxDebit) }}
+
+
+ Rp {{ convertMoney(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ Rp {{ convertMoney(xsummary.debit) }}
+
+
+ Rp {{ convertMoney(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ Rp {{ convertMoney(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ KONFIRMASI
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi fixed aset periode {{ this.$store.state.journal.selected_periode.periode }} ?
+
+
+
+
+
+ TUTUP
+ YAKIN
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+
Error Type: {{ error.JurnalErr_Msg.err_type }}
+
Message: {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal {{ msgalertgenerate }} ?
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fixed-asset-v2/index.php b/test/vuex/acc-one-jurnal-fixed-asset-v2/index.php
new file mode 100644
index 0000000..a256f26
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fixed-asset-v2/index.php
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fixed-asset-v2/modules/journal.js b/test/vuex/acc-one-jurnal-fixed-asset-v2/modules/journal.js
new file mode 100644
index 0000000..5eab049
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fixed-asset-v2/modules/journal.js
@@ -0,0 +1,361 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js"
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: 'new',
+ save_status: 0,
+ save_error_message: '',
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format('YYYY-MM-DD'),
+ end_date: moment(new Date()).format('YYYY-MM-DD'),
+ journals: [
+ // {
+ // "journalID": "1",
+ // "journalNo": "JM002/08",
+ // "date": "31-08-2024",
+ // "name": "budhi/budhi",
+ // "account": "508501001",
+ // "title": "MS BESIN, SOLAR, PARKIR, TOL, TRANSPORT",
+ // "description": "ACCRUED PARKIR AGST 24",
+ // "debit": "275000",
+ // "credit": "0",
+ // "posted": "Y"
+ // },
+ // {
+ // "journalID": "2",
+ // "journalNo": "JM002/08",
+ // "date": "31-08-2024",
+ // "name": "budhi/budhi",
+ // "account": "2004009",
+ // "title": "ACCRUED EXP OTHERS",
+ // "description": "ACCRUED PARKIR AGST 24",
+ // "debit": "0",
+ // "credit": "275000",
+ // "posted": "Y"
+ // }
+ ],
+ selected_journal: {},
+ summary: {"debit": 0, "credit": 0, "balance": 0},
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ dialog_form_confirm: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ search_error_message: "",
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ user: one_user(),
+ ishide: 'Y',
+ branchlists: []
+ },
+ mutations: {
+ update_ishide(state, val) {
+ state.ishide = val
+ },
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_current_page(state, val) {
+ state.current_page = val
+ },
+ update_x_search(state, val) {
+ state.x_search = val
+ state.current_page = 1
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val
+ },
+ update_last_id(state, val) {
+ state.last_id = val
+ },
+ update_coas(state, val) {
+ state.coas = val
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val
+ },
+ update_act(state, val) {
+ state.act = val
+ },
+ update_save_status(state, val) {
+ state.save_status = val
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val
+ },
+ update_errors(state, val) {
+ state.errors = val
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val
+ },
+ update_open_print(state, value) {
+ state.open_print = value
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val
+ },
+ update_end_date(state, val) {
+ state.end_date = val
+ },
+ update_journals(state, val) {
+ state.journals = val
+ },
+ update_branchlists(state, val) {
+ state.branchlists = val
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val
+ },
+ update_summary(state, val) {
+ state.summary = val
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val
+ },
+ update_dialog_form_confirm(state, val) {
+ state.dialog_form_confirm = val
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val
+ },
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val
+ },
+ update_user(state, val) {
+ state.user = val
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val
+ },
+ update_user(state, val) {
+ state.user = val
+ }
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let resp = await api.getPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3)
+ } else {
+ context.commit("update_autocomplete_status", 2)
+ let data = resp.data
+
+ context.commit("update_periodeList", data)
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(p => p.periodeMonth == currentMonth.toString() && p.periodeYear == currentYear);
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode)
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3)
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+ // var prm = {
+ // token: one_token(),
+ // periodeid: context.state.selected_periode.id
+ // }
+ // var prm = {}
+ // prm.one_token()
+ let resp = await api.search(one_token(), prm.xdate, prm.periodeid, prm.branchid, prm.regionalid)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", resp.message)
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_search_error_message", "")
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+
+ context.commit("update_journals", data.records)
+ context.commit("update_ishide", data.records[0].ishide)
+ context.commit("update_total_journal", data.total)
+
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", e.message)
+ }
+ },
+ async getdetail(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+ // var prm = {
+ // token: one_token(),
+ // periodeid: context.state.selected_periode.id
+ // }
+ // var prm = {}
+ prm.token = one_token()
+ let resp = await api.getdetail(prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", resp.message)
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_search_error_message", "")
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+
+ context.commit("update_branchlists", data.records)
+
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", e.message)
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno
+ let resp = await api.insertSales(branchCode, date, jurnalno)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", resp.message)
+ context.commit("update_alert_error", true)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ context.commit("update_alert_success", true)
+ var msg = resp.data.msg
+ context.commit("update_msg_success", msg)
+ context.dispatch("search", {
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ })
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", e.message)
+ context.commit("update_alert_error", true)
+ }
+ },
+ async addConfirm(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.addConfirm(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", resp.message)
+ context.commit("update_alert_error", true)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ context.commit("update_alert_success", true)
+ var msg = " Fixed aset periode " + context.state.selected_periode.periode + " berhasil dikonfirmasi"
+ context.commit("update_msg_success", msg)
+ context.dispatch("search", {
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ })
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", e.message)
+ context.commit("update_alert_error", true)
+ }
+ },
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-fixed-asset-v2/store.js b/test/vuex/acc-one-jurnal-fixed-asset-v2/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-fixed-asset-v2/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-item-usage/api/journal.js b/test/vuex/acc-one-jurnal-item-usage/api/journal.js
new file mode 100644
index 0000000..ecce4b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/api/journal.js
@@ -0,0 +1,282 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/getPeriode", prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(
+ token,
+ xdate,
+ periodeid,
+ current_page,
+ search,
+ branchCode,
+ regionalId
+) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/search", {
+ token: token,
+ xdate: xdate,
+ periodeid: periodeid,
+ current_page: current_page,
+ search: search,
+ branchCode: branchCode,
+ regionalId: regionalId
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(
+ URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/getUserApproveLevel", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getListingCOA(params) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/getListingCOA", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function requestEditJurnal(params) {
+ try {
+ const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ const data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function changeJurnalToPosted(params) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/changeJurnalToPosted", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getTotalJurnalNotPostedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "JournalItemUsage/getTotalJurnalNotPostedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function closeJurnalPerPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "JournalItemUsage/closeJurnalPerPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDataJurnalNotClosedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "JournalItemUsage/getDataJurnalNotClosedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-item-usage/components/dialogCloseJurnal.vue b/test/vuex/acc-one-jurnal-item-usage/components/dialogCloseJurnal.vue
new file mode 100644
index 0000000..417ffbb
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/components/dialogCloseJurnal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang tidak dapat ditutup: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang dapat ditutup: {{ item.total_jurnal }}
+
+
+
+ Apakah anda yakin akan menutup semua jurnal yang dibuat di
+ {{ area_jurnal }} dalam rentang waktu
+ {{ selected_periode.periode }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-item-usage/components/dialogEditJurnal.vue b/test/vuex/acc-one-jurnal-item-usage/components/dialogEditJurnal.vue
new file mode 100644
index 0000000..206c1d9
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/components/dialogEditJurnal.vue
@@ -0,0 +1,223 @@
+
+
+
+
+ EDIT JOURNAL ITEM USAGE
+
+
+
+
+ Company Name
+
+ {{ selected_journal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.coaCurrencyCode }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-item-usage/components/dialogPostingJurnal.vue b/test/vuex/acc-one-jurnal-item-usage/components/dialogPostingJurnal.vue
new file mode 100644
index 0000000..dad7a87
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/components/dialogPostingJurnal.vue
@@ -0,0 +1,68 @@
+
+
+
+
+ POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang dapat diposting: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang tidak dapat diposting: {{ item.total_jurnal }}
+ (belum diverifikasi setelah edit)
+
+
+
+ Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
+ {{ selected_periode.periode }} ?
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-item-usage/components/dialogRequestEditJurnal.vue b/test/vuex/acc-one-jurnal-item-usage/components/dialogRequestEditJurnal.vue
new file mode 100644
index 0000000..92715a8
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/components/dialogRequestEditJurnal.vue
@@ -0,0 +1,58 @@
+
+
+
+
+ REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
+
+
+
+ Jurnal ini sudah pernah diedit sebelumnya oleh:
+ {{ selected_journal.JurnalRequestEditStaffName }}
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi?
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal:
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-item-usage/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-item-usage/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..f3c564b
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/components/oneMediaJournalList.vue
@@ -0,0 +1,1222 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ JOURNAL PEMAKAIAN ITEM
+
+
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+ book
+
+
+
+
+
+
+
+
+ collections_bookmark
+
+
+ Tutup Jurnal
+
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+
+ error
+
+ error information
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ posted
+
+
+
+
+ not posted
+
+
+
+
+ closed
+
+
+
+
+
+
+
+ edit
+
+
+ Edit
+
+
+
+
+ visibility
+
+
+ Detail
+
+
+
+
+ picture_as_pdf
+
+
+ RPT PDF
+
+
+
+
+ receipt
+
+
+ RPT Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL PENGELUARAN BARANG
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+ Error Type:
+ {{ error.JurnalErr_Msg.err_type }}
+
+
+ Message:
+ {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal
+ {{
+ msgalertgenerate
+ }}
+ ?
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-item-usage/index.php b/test/vuex/acc-one-jurnal-item-usage/index.php
new file mode 100644
index 0000000..a736dd6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/index.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-item-usage/modules/journal.js b/test/vuex/acc-one-jurnal-item-usage/modules/journal.js
new file mode 100644
index 0000000..11274ff
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/modules/journal.js
@@ -0,0 +1,582 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js";
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: "new",
+ save_status: 0,
+ save_error_message: "",
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format("YYYY-MM-DD"),
+ end_date: moment(new Date()).format("YYYY-MM-DD"),
+ journals: [],
+ selected_journal: {},
+ summary: { debit: 0, credit: 0, balance: 0 },
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ regionals: [],
+ selected_regional: {},
+ branchs: [],
+ selected_branch: {},
+ xsearch: "",
+ open_dialog_info: false,
+ msg_info: "",
+
+ // --
+ dialog_edit_journal: false,
+ user_level: {},
+ list_coa: [],
+ journal_edit: [],
+ dialog_confirm_posting: false,
+ total_jurnal_not_posted: [],
+ dialog_request_edit: false,
+
+ // ---
+ dialog_close_jurnal: false,
+ jurnal_to_close: []
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_current_page(state, val) {
+ state.current_page = val;
+ },
+ update_x_search(state, val) {
+ state.x_search = val;
+ state.current_page = 1;
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val;
+ },
+ update_last_id(state, val) {
+ state.last_id = val;
+ },
+ update_coas(state, val) {
+ state.coas = val;
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val;
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val;
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val;
+ },
+ update_act(state, val) {
+ state.act = val;
+ },
+ update_save_status(state, val) {
+ state.save_status = val;
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val;
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value;
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val;
+ },
+ update_end_date(state, val) {
+ state.end_date = val;
+ },
+ update_journals(state, val) {
+ state.journals = val;
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val;
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val;
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val;
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val;
+ },
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val;
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val;
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val;
+ },
+ update_regionals(state, val) {
+ state.regionals = val;
+ },
+ update_selected_regional(state, val) {
+ state.selected_regional = val;
+ },
+ update_branchs(state, val) {
+ state.branchs = val;
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val;
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val;
+ state.current_page = 1;
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val;
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val;
+ },
+
+ // --
+ update_dialog_edit_journal(state, val) {
+ state.dialog_edit_journal = val;
+ },
+ update_user_level(state, val) {
+ state.user_level = val;
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val;
+ },
+ update_journal_edit(state, val) {
+ state.journal_edit = val;
+ },
+ update_dialog_confirm_posting(state, val) {
+ state.dialog_confirm_posting = val;
+ },
+ update_total_jurnal_not_posted(state, val) {
+ state.total_jurnal_not_posted = val;
+ },
+ update_dialog_request_edit(state, val) {
+ state.dialog_request_edit = val;
+ },
+
+ update_dialog_close_jurnal(state, val) {
+ state.dialog_close_jurnal = val;
+ },
+ update_jurnal_to_close(state, val) {
+ state.jurnal_to_close = val;
+ }
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let prm = {};
+ prm.token = one_token();
+ let resp = await api.getPeriode(prm);
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_autocomplete_status", 2);
+ let data = resp.data;
+ context.commit("update_periodeList", resp.data);
+
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(
+ (p) =>
+ p.periodeMonth == currentMonth.toString() &&
+ p.periodeYear == currentYear
+ );
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode);
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_status", 1);
+ try {
+ let resp = await api.search(
+ one_token(),
+ prm.xdate,
+ prm.periodeid,
+ prm.current_page,
+ prm.search,
+ prm.branchCode,
+ prm.regionalId
+ );
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2);
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ };
+
+ context.commit("update_journals", data.records);
+ context.commit("update_total_journal", data.total);
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1);
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno;
+ let resp = await api.insertSales(branchCode, date, jurnalno);
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_save_status", 2);
+ context.commit("update_save_error_message", resp.message);
+ let data = {
+ total: resp.data.total
+ };
+
+ context.commit("update_alert_success", true);
+ var msg = resp.data.msg;
+ context.commit("update_msg_success", msg);
+ context.dispatch("search", {
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getRegional(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getRegional({
+ token: one_token(),
+ regionalId: context.state.user.S_RegionalID
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_regionals", data.records);
+ context.commit("update_selected_regional", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async getBranch(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getBranch({
+ token: one_token(),
+ regionalId: context.state.selected_regional.S_RegionalID,
+ branchCode: context.state.user.M_BranchCode
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_branchs", data.records);
+ context.commit("update_selected_branch", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async postingJurnal(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.changeJurnalToPosted(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_total_jurnal_not_posted", []);
+ context.commit("update_dialog_confirm_posting", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getUserApprovalLevel(context) {
+ try {
+ let param = { token: one_token() };
+ const resp = await api.getUserApproveLevel(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_user_level", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getListingCOA(context) {
+ try {
+ let param = {
+ token: one_token(),
+ keyword: ""
+ };
+ const resp = await api.getListingCOA(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_list_coa", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async requestEditJurnal(context) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ staffID: context.state.user.M_UserID,
+ staffName: context.state.user.M_UserUsername
+ };
+ const resp = await api.requestEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_request_edit", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async saveEditJurnal(context, newdetail) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ jurnalRequestEditID: context.state.selected_journal.JurnalRequestEditID,
+ oldjurnaltx: context.state.selected_journal.detailtx,
+ newjurnaltx: newdetail
+ };
+ const resp = await api.saveEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_dialog_edit_journal", false);
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async totalJurnalNotPostedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getTotalJurnalNotPostedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_total_jurnal_not_posted", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getDataJurnalNotClosedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getDataJurnalNotClosedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_jurnal_to_close", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async closeJurnalPerPeriode(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.closeJurnalPerPeriode(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_jurnal_to_close", []);
+ context.commit("update_dialog_close_jurnal", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ }
+ }
+};
diff --git a/test/vuex/acc-one-jurnal-item-usage/store.js b/test/vuex/acc-one-jurnal-item-usage/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-item-usage/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/api/journal.js b/test/vuex/acc-one-jurnal-payment-invoice/api/journal.js
new file mode 100644
index 0000000..8d0f83c
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/api/journal.js
@@ -0,0 +1,282 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/getPeriode", prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(
+ token,
+ xdate,
+ periodeid,
+ current_page,
+ search,
+ branchCode,
+ regionalId
+) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/search", {
+ token: token,
+ xdate: xdate,
+ periodeid: periodeid,
+ current_page: current_page,
+ search: search,
+ branchCode: branchCode,
+ regionalId: regionalId
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(
+ URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/getUserApproveLevel", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getListingCOA(params) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/getListingCOA", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function requestEditJurnal(params) {
+ try {
+ const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ const data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function changeJurnalToPosted(params) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/changeJurnalToPosted", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getTotalJurnalNotPostedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journalpaymentinv/getTotalJurnalNotPostedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function closeJurnalPerPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "Journalpaymentinv/closeJurnalPerPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDataJurnalNotClosedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journalpaymentinv/getDataJurnalNotClosedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/components/dialogCloseJurnal.vue b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogCloseJurnal.vue
new file mode 100644
index 0000000..95a8f00
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogCloseJurnal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang tidak dapat ditutup: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang dapat ditutup: {{ item.total_jurnal }}
+
+
+
+ Apakah anda yakin akan menutup semua jurnal yang dibuat di
+ {{ area_jurnal }} dalam rentang waktu
+ {{ selected_periode.periode }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/components/dialogEditJurnal.vue b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogEditJurnal.vue
new file mode 100644
index 0000000..d022329
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogEditJurnal.vue
@@ -0,0 +1,214 @@
+
+
+
+
+ EDIT JOURNAL PAYMENT INVOICE
+
+
+
+
+ Company Name
+
+ {{ selected_journal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+ {{ props.item.coaCurrencyCode }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/components/dialogPostingJurnal.vue b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogPostingJurnal.vue
new file mode 100644
index 0000000..dad7a87
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogPostingJurnal.vue
@@ -0,0 +1,68 @@
+
+
+
+
+ POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang dapat diposting: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang tidak dapat diposting: {{ item.total_jurnal }}
+ (belum diverifikasi setelah edit)
+
+
+
+ Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
+ {{ selected_periode.periode }} ?
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/components/dialogRequestEditJurnal.vue b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogRequestEditJurnal.vue
new file mode 100644
index 0000000..80a1939
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/components/dialogRequestEditJurnal.vue
@@ -0,0 +1,58 @@
+
+
+
+
+ REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
+
+
+
+ Jurnal ini sudah pernah diedit sebelumnya oleh:
+ {{ selected_journal.JurnalRequestEditStaffName }}
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi?
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal:
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-payment-invoice/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..6d8f83f
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/components/oneMediaJournalList.vue
@@ -0,0 +1,1224 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ JOURNAL PAYMENT INVOICE
+
+
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+ book
+
+
+ Posting Jurnal
+
+
+
+
+
+
+ collections_bookmark
+
+
+ Tutup Jurnal
+
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+
+
+ error
+
+
+ error information
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ posted
+
+
+
+
+ not posted
+
+
+
+
+ closed
+
+
+
+
+
+
+
+ edit
+
+
+ Edit
+
+
+
+
+ visibility
+
+
+ Detail
+
+
+
+
+ picture_as_pdf
+
+
+ RPT PDF
+
+
+
+
+ receipt
+
+
+ RPT Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL PAYMENT INVOICE
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+
+ TOTAL
+
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+ Error Type:
+ {{ error.JurnalErr_Msg.err_type }}
+
+
+ Message:
+ {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal
+ {{
+ msgalertgenerate
+ }}
+ ?
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/index.php b/test/vuex/acc-one-jurnal-payment-invoice/index.php
new file mode 100644
index 0000000..a736dd6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/index.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/modules/journal.js b/test/vuex/acc-one-jurnal-payment-invoice/modules/journal.js
new file mode 100644
index 0000000..88b7a8f
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/modules/journal.js
@@ -0,0 +1,583 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js";
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: "new",
+ save_status: 0,
+ save_error_message: "",
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format("YYYY-MM-DD"),
+ end_date: moment(new Date()).format("YYYY-MM-DD"),
+ journals: [],
+ selected_journal: {},
+ summary: { debit: 0, credit: 0, balance: 0 },
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ regionals: [],
+ selected_regional: {},
+ branchs: [],
+ selected_branch: {},
+ xsearch: "",
+ open_dialog_info: false,
+ msg_info: "",
+
+ // --
+ dialog_edit_journal: false,
+ user_level: {},
+ list_coa: [],
+ journal_edit: [],
+ dialog_confirm_posting: false,
+ total_jurnal_not_posted: [],
+ dialog_request_edit: false,
+
+ // ---
+ dialog_close_jurnal: false,
+ jurnal_to_close: []
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_current_page(state, val) {
+ state.current_page = val;
+ },
+ update_x_search(state, val) {
+ state.x_search = val;
+ state.current_page = 1;
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val;
+ },
+ update_last_id(state, val) {
+ state.last_id = val;
+ },
+ update_coas(state, val) {
+ state.coas = val;
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val;
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val;
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val;
+ },
+ update_act(state, val) {
+ state.act = val;
+ },
+ update_save_status(state, val) {
+ state.save_status = val;
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val;
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value;
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val;
+ },
+ update_end_date(state, val) {
+ state.end_date = val;
+ },
+ update_journals(state, val) {
+ state.journals = val;
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val;
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val;
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val;
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val;
+ },
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val;
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val;
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val;
+ },
+ update_regionals(state, val) {
+ state.regionals = val;
+ },
+ update_selected_regional(state, val) {
+ state.selected_regional = val;
+ },
+ update_branchs(state, val) {
+ state.branchs = val;
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val;
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val;
+ state.current_page = 1;
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val;
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val;
+ },
+
+ // --
+ update_dialog_edit_journal(state, val) {
+ state.dialog_edit_journal = val;
+ },
+ update_user_level(state, val) {
+ state.user_level = val;
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val;
+ },
+ update_journal_edit(state, val) {
+ state.journal_edit = val;
+ },
+ update_dialog_confirm_posting(state, val) {
+ state.dialog_confirm_posting = val;
+ },
+ update_total_jurnal_not_posted(state, val) {
+ state.total_jurnal_not_posted = val;
+ },
+ update_dialog_request_edit(state, val) {
+ state.dialog_request_edit = val;
+ },
+
+ update_dialog_close_jurnal(state, val) {
+ state.dialog_close_jurnal = val;
+ },
+ update_jurnal_to_close(state, val) {
+ state.jurnal_to_close = val;
+ }
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let prm = {};
+ prm.token = one_token();
+ let resp = await api.getPeriode(prm);
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_autocomplete_status", 2);
+ let data = resp.data;
+ context.commit("update_periodeList", resp.data);
+
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(
+ (p) =>
+ p.periodeMonth == currentMonth.toString() &&
+ p.periodeYear == currentYear
+ );
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode);
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_status", 1);
+ try {
+ let resp = await api.search(
+ one_token(),
+ prm.xdate,
+ prm.periodeid,
+ prm.current_page,
+ prm.search,
+ prm.branchCode,
+ prm.regionalId
+ );
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2);
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ };
+
+ context.commit("update_journals", data.records);
+ context.commit("update_total_journal", data.total);
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1);
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno;
+ let resp = await api.insertSales(branchCode, date, jurnalno);
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_save_status", 2);
+ context.commit("update_save_error_message", resp.message);
+ let data = {
+ total: resp.data.total
+ };
+
+ context.commit("update_alert_success", true);
+ var msg = resp.data.msg;
+ context.commit("update_msg_success", msg);
+ context.dispatch("search", {
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getRegional(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getRegional({
+ token: one_token(),
+ regionalId: context.state.user.S_RegionalID
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_regionals", data.records);
+ context.commit("update_selected_regional", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async getBranch(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getBranch({
+ token: one_token(),
+ regionalId: context.state.selected_regional.S_RegionalID,
+ branchCode: context.state.user.M_BranchCode
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_branchs", data.records);
+ context.commit("update_selected_branch", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async postingJurnal(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.changeJurnalToPosted(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_total_jurnal_not_posted", []);
+ context.commit("update_dialog_confirm_posting", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getUserApprovalLevel(context) {
+ try {
+ let param = { token: one_token() };
+ const resp = await api.getUserApproveLevel(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_user_level", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getListingCOA(context) {
+ try {
+ let param = {
+ token: one_token(),
+ keyword: ""
+ };
+ const resp = await api.getListingCOA(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_list_coa", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async requestEditJurnal(context) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ staffID: context.state.user.M_UserID,
+ staffName: context.state.user.M_UserUsername
+ };
+ const resp = await api.requestEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_request_edit", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async saveEditJurnal(context, newdetail) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ jurnalRequestEditID: context.state.selected_journal.JurnalRequestEditID,
+ oldjurnaltx: context.state.selected_journal.detailtx,
+ newjurnaltx: newdetail
+ };
+
+ const resp = await api.saveEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_dialog_edit_journal", false);
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async totalJurnalNotPostedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getTotalJurnalNotPostedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_total_jurnal_not_posted", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getDataJurnalNotClosedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getDataJurnalNotClosedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_jurnal_to_close", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async closeJurnalPerPeriode(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.closeJurnalPerPeriode(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_jurnal_to_close", []);
+ context.commit("update_dialog_close_jurnal", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ }
+ }
+};
diff --git a/test/vuex/acc-one-jurnal-payment-invoice/store.js b/test/vuex/acc-one-jurnal-payment-invoice/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-invoice/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/api/journal.js b/test/vuex/acc-one-jurnal-payment-voucher/api/journal.js
new file mode 100644
index 0000000..a4db263
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/api/journal.js
@@ -0,0 +1,267 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + 'journalpv/getPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(token, xdate, periodeid, current_page, search, branchCode, regionalId) {
+ try {
+ var resp = await axios.post(URL + 'journalpv/search', {
+ token:token,
+ xdate:xdate,
+ periodeid:periodeid,
+ current_page:current_page,
+ search:search,
+ branchCode:branchCode,
+ regionalId:regionalId
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "journalpv/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "journalpv/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+// edit jurnal section
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + "journalpv/getUserApproveLevel", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getListingCOA(params) {
+ try {
+ var resp = await axios.post(URL + "journalpv/getListingCOA", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function requestEditJurnal(params) {
+ try {
+ const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ const data = resp.data;
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function changeJurnalToPosted(params) {
+ try {
+ var resp = await axios.post(URL + "journalpv/changeJurnalToPosted", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getTotalJurnalNotPostedPerPeriod(params) {
+ try {
+ var resp = await axios.post(URL + "journalpv/getTotalJurnalNotPostedPerPeriod", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function closeJurnalPerPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "journalpv/closeJurnalPerPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getDataJurnalNotClosedPerPeriod(params) {
+ try {
+ var resp = await axios.post(URL + "journalpv/getDataJurnalNotClosedPerPeriod", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/components/dialogCloseJurnal.vue b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogCloseJurnal.vue
new file mode 100644
index 0000000..95a8f00
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogCloseJurnal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang tidak dapat ditutup: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang dapat ditutup: {{ item.total_jurnal }}
+
+
+
+ Apakah anda yakin akan menutup semua jurnal yang dibuat di
+ {{ area_jurnal }} dalam rentang waktu
+ {{ selected_periode.periode }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/components/dialogEditJurnal.vue b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogEditJurnal.vue
new file mode 100644
index 0000000..5671519
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogEditJurnal.vue
@@ -0,0 +1,214 @@
+
+
+
+
+ EDIT JOURNAL PAYMENT VOUCHER
+
+
+
+
+ Company Name
+
+ {{ selected_journal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+ {{ props.item.coaCurrencyCode }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/components/dialogPostingJurnal.vue b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogPostingJurnal.vue
new file mode 100644
index 0000000..0ae425c
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogPostingJurnal.vue
@@ -0,0 +1,68 @@
+
+
+
+
+ POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang dapat diposting: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang tidak dapat diposting: {{ item.total_jurnal }}
+ (belum diverifikasi setelah edit)
+
+
+
+ Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
+ {{ selected_periode.periode }} ?
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/components/dialogRequestEditJurnal.vue b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogRequestEditJurnal.vue
new file mode 100644
index 0000000..5352fe5
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/components/dialogRequestEditJurnal.vue
@@ -0,0 +1,58 @@
+
+
+
+
+ REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
+
+
+
+ Jurnal ini sudah pernah diedit sebelumnya oleh:
+ {{ selected_journal.JurnalRequestEditStaffName }}
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi?
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal:
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-payment-voucher/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..b92afa8
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/components/oneMediaJournalList.vue
@@ -0,0 +1,1226 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ JOURNAL PAYMENT VOUCHER
+
+
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+ book
+
+
+ Posting Jurnal
+
+
+
+
+
+
+ collections_bookmark
+
+
+ Tutup Jurnal
+
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+
+ error
+
+ error information
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ posted
+
+
+
+
+ not posted
+
+
+
+
+ closed
+
+
+
+
+
+
+
+ edit
+
+
+ Edit
+
+
+
+
+ visibility
+
+
+ Detail
+
+
+
+
+ picture_as_pdf
+
+
+ RPT PDF
+
+
+
+
+ receipt
+
+
+ RPT Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL PAYMENT VOUCHER
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+ Error Type:
+ {{ error.JurnalErr_Msg.err_type }}
+
+
+ Message:
+ {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal
+ {{
+ msgalertgenerate
+ }}
+ ?
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/index.php b/test/vuex/acc-one-jurnal-payment-voucher/index.php
new file mode 100644
index 0000000..a736dd6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/index.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/modules/journal.js b/test/vuex/acc-one-jurnal-payment-voucher/modules/journal.js
new file mode 100644
index 0000000..7bacf97
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/modules/journal.js
@@ -0,0 +1,606 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js"
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: 'new',
+ save_status: 0,
+ save_error_message: '',
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format('YYYY-MM-DD'),
+ end_date: moment(new Date()).format('YYYY-MM-DD'),
+ journals: [
+ // {
+ // "journalID": "1",
+ // "journalNo": "JM002/08",
+ // "date": "31-08-2024",
+ // "name": "budhi/budhi",
+ // "account": "508501001",
+ // "title": "MS BESIN, SOLAR, PARKIR, TOL, TRANSPORT",
+ // "description": "ACCRUED PARKIR AGST 24",
+ // "debit": "275000",
+ // "credit": "0",
+ // "posted": "Y"
+ // },
+ // {
+ // "journalID": "2",
+ // "journalNo": "JM002/08",
+ // "date": "31-08-2024",
+ // "name": "budhi/budhi",
+ // "account": "2004009",
+ // "title": "ACCRUED EXP OTHERS",
+ // "description": "ACCRUED PARKIR AGST 24",
+ // "debit": "0",
+ // "credit": "275000",
+ // "posted": "Y"
+ // }
+ ],
+ selected_journal: {},
+ summary: {"debit": 0, "credit": 0, "balance": 0},
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ regionals: [],
+ selected_regional: {},
+ branchs: [],
+ selected_branch: {},
+ xsearch: "",
+ open_dialog_info: false,
+ msg_info: "",
+
+ // --
+ dialog_edit_journal: false,
+ user_level: {},
+ list_coa: [],
+ journal_edit: [],
+ dialog_confirm_posting: false,
+ total_jurnal_not_posted: [],
+ dialog_request_edit: false,
+
+ // ---
+ dialog_close_jurnal: false,
+ jurnal_to_close: []
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_current_page(state, val) {
+ state.current_page = val
+ },
+ update_x_search(state, val) {
+ state.x_search = val
+ state.current_page = 1
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val
+ },
+ update_last_id(state, val) {
+ state.last_id = val
+ },
+ update_coas(state, val) {
+ state.coas = val
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val
+ },
+ update_act(state, val) {
+ state.act = val
+ },
+ update_save_status(state, val) {
+ state.save_status = val
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val
+ },
+ update_errors(state, val) {
+ state.errors = val
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val
+ },
+ update_open_print(state, value) {
+ state.open_print = value
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val
+ },
+ update_end_date(state, val) {
+ state.end_date = val
+ },
+ update_journals(state, val) {
+ state.journals = val
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val
+ },
+ update_summary(state, val) {
+ state.summary = val
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val
+ },
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val
+ },
+ update_user(state, val) {
+ state.user = val
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val
+ },
+ update_regionals(state, val) {
+ state.regionals = val
+ },
+ update_selected_regional(state, val) {
+ state.selected_regional = val
+ },
+ update_branchs(state, val) {
+ state.branchs = val
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val
+ state.current_page = 1
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val
+ },
+
+ update_dialog_edit_journal(state, val) {
+ state.dialog_edit_journal = val
+ },
+ update_user_level(state, val) {
+ state.user_level = val
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val
+ },
+ update_journal_edit(state, val) {
+ state.journal_edit = val
+ },
+ update_dialog_confirm_posting(state, val) {
+ state.dialog_confirm_posting = val
+ },
+ update_total_jurnal_not_posted(state, val) {
+ state.total_jurnal_not_posted = val
+ },
+ update_dialog_request_edit(state, val) {
+ state.dialog_request_edit = val
+ },
+
+ update_dialog_close_jurnal(state, val) {
+ state.dialog_close_jurnal = val
+ },
+ update_jurnal_to_close(state, val) {
+ state.jurnal_to_close = val
+ },
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let prm = {}
+ prm.token = one_token()
+ let resp = await api.getPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3)
+ } else {
+ context.commit("update_autocomplete_status", 2)
+ let data = resp.data
+
+ context.commit("update_periodeList", data)
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(p => p.periodeMonth == currentMonth.toString() && p.periodeYear == currentYear);
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode)
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3)
+ }
+ },
+
+ async search(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+ let resp = await api.search(
+ one_token(),
+ prm.xdate,
+ prm.periodeid,
+ prm.current_page,
+ prm.search,
+ prm.branchCode,
+ prm.regionalId
+ )
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", resp.message)
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_search_error_message", "")
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+
+ context.commit("update_journals", data.records)
+ context.commit("update_total_journal", data.total)
+
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", e.message)
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno
+ let resp = await api.insertSales(branchCode, date, jurnalno)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", resp.message)
+ context.commit("update_alert_error", true)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ context.commit("update_alert_success", true)
+ var msg = resp.data.msg
+ context.commit("update_msg_success", msg)
+ context.dispatch("search", {
+ branchCode: prm.branchCode,
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ })
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", e.message)
+ context.commit("update_alert_error", true)
+ }
+ },
+
+ async getRegional(context) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let resp = await api.getRegional({ token: one_token(), regionalId: context.state.user.S_RegionalID });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message)
+ context.commit("update_autocomplete_status", 3)
+ } else {
+ context.commit("update_search_error_message", "")
+ context.commit("update_autocomplete_status", 2)
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_regionals", data.records);
+ context.commit("update_selected_regional", data.selected)
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message)
+ context.commit("update_autocomplete_status", 3)
+ }
+ },
+
+ async getBranch(context) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let resp = await api.getBranch({
+ token: one_token(),
+ regionalId: context.state.selected_regional.S_RegionalID,
+ branchCode: context.state.user.M_BranchCode
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message)
+ context.commit("update_autocomplete_status", 3)
+ } else {
+ context.commit("update_search_error_message", "")
+ context.commit("update_autocomplete_status", 2)
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_branchs", data.records);
+ context.commit("update_selected_branch", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message)
+ context.commit("update_autocomplete_status", 3)
+ }
+ },
+
+ // edit jurnal section
+ async postingJurnal(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ }
+ const resp = await api.changeJurnalToPosted(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_msg_success", resp.data)
+ context.commit("update_alert_success", true)
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ })
+
+ context.commit("update_total_jurnal_not_posted", []);
+ context.commit("update_dialog_confirm_posting", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async getUserApprovalLevel(context) {
+ try {
+ let param = { token: one_token() }
+ const resp = await api.getUserApproveLevel(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_user_level", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async getListingCOA(context) {
+ try {
+ let param = {
+ token: one_token(),
+ keyword: ""
+ }
+ const resp = await api.getListingCOA(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_list_coa", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async requestEditJurnal(context) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ staffID: context.state.user.M_UserID,
+ staffName: context.state.user.M_UserUsername
+ }
+ const resp = await api.requestEditJurnal(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_msg_success", resp.data)
+ context.commit("update_alert_success", true)
+ context.commit("update_dialog_request_edit", false)
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async saveEditJurnal(context, newdetail) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ jurnalRequestEditID: context.state.selected_journal.JurnalRequestEditID,
+ oldjurnaltx: context.state.selected_journal.detailtx,
+ newjurnaltx: newdetail
+ }
+
+ const resp = await api.saveEditJurnal(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ })
+
+ context.commit("update_dialog_edit_journal", false);
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async totalJurnalNotPostedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ }
+ const resp = await api.getTotalJurnalNotPostedPerPeriod(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_total_jurnal_not_posted", resp.data ?? [])
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async getDataJurnalNotClosedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ }
+ const resp = await api.getDataJurnalNotClosedPerPeriod(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_jurnal_to_close", resp.data ?? [])
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ },
+
+ async closeJurnalPerPeriode(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ }
+ const resp = await api.closeJurnalPerPeriode(param)
+ if (resp.status != 'OK') {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message)
+ } else {
+ context.commit("update_msg_success", resp.data)
+ context.commit("update_alert_success", true)
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ })
+
+ context.commit("update_jurnal_to_close", []);
+ context.commit("update_dialog_close_jurnal", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-payment-voucher/store.js b/test/vuex/acc-one-jurnal-payment-voucher/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-payment-voucher/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/api/api.js b/test/vuex/acc-one-jurnal-penyesuaian/api/api.js
new file mode 100644
index 0000000..0496f9c
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/api/api.js
@@ -0,0 +1,196 @@
+const URL = "/one-api/mockup/masterdata/accounting/JournalPenyesuaian/";
+
+export async function getDaftarPeriode(params) {
+ try {
+ var resp = await axios.post(URL + 'getDaftarPeriode', params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDaftarTipeJurnal(params) {
+ try {
+ var resp = await axios.post(URL + 'getDaftarTipeJurnal', params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDaftarJournalClosed(params) {
+ try {
+ var resp = await axios.post(URL + 'getDaftarJournalClosed', params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDetailJournalClosed(params) {
+ try {
+ var resp = await axios.post(URL + 'getDetailJournalClosed', params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDaftarAccount(params) {
+ try {
+ var resp = await axios.post(URL + 'getDaftarAccount', params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveKoreksiJurnal(params) {
+ try {
+ var resp = await axios.post(URL + 'saveKoreksiJurnal', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ var data = resp.data
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getDaftarJournalBalik(params) {
+ try {
+ var resp = await axios.post(URL + 'getDaftarJournalBalik', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ var data = resp.data
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getDetailJournalBalik(params) {
+ try {
+ var resp = await axios.post(URL + 'getDetailJournalBalik', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ var data = resp.data
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function updateStatusKoreksiJurnal(params) {
+ try {
+ var resp = await axios.post(URL + 'updateStatusKoreksiJurnal', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ var data = resp.data
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + 'getUserApproveLevel', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ }
+ }
+
+ var data = resp.data
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/components/dialogAddRowJurnal.vue b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogAddRowJurnal.vue
new file mode 100644
index 0000000..14a3fb8
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogAddRowJurnal.vue
@@ -0,0 +1,167 @@
+
+
+
+
+ TAMBAH TRANSAKSI JURNAL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/components/dialogBalikJurnal.vue b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogBalikJurnal.vue
new file mode 100644
index 0000000..d7ae200
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogBalikJurnal.vue
@@ -0,0 +1,365 @@
+
+
+
+
+ KOREKSI JURNAL
+
+
+
+
+ Company Name
+
+ {{ selected_journal_closed.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal_closed.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal_closed.S_RegionalName }}
+
+
+
+ Branch
+
+ {{ selected_journal_closed.M_BranchName ?? "-" }}
+
+
+
+ Journal Date
+
+ {{ selected_journal_closed.jurnalDate }}
+
+
+
+ Journal Type
+
+ {{ selected_journal_closed.JurnalTypeName }}
+
+
+
+
+
+
+ Jurnal Awal
+
+
+
+ {{ props.item.coaAccountNo }}
+ {{ props.item.coaDescription }}
+ {{ props.item.jurnalAddOnValue }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(selected_journal_closed.totals.total_debit ?? 0) }}
+
+
+ {{ formatCurrency(selected_journal_closed.totals.total_kredit ?? 0) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(selected_journal_closed.totals.balance ?? 0) }}
+
+
+
+
+
+
+ Jurnal Balik
+
+
+
+ {{ props.item.coaAccountNo }}
+ {{ props.item.coaDescription }}
+ {{ props.item.jurnalAddOnValue }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(journal_detail_balik.summary.total_kredit ?? 0) }}
+
+
+ {{ formatCurrency(journal_detail_balik.summary.total_debit ?? 0) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(journal_detail_balik.summary.balance ?? 0) }}
+
+
+
+
+
+
+
+
+
+ Jurnal Penyesuaian
+
+
+
+ add
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+ {{ props.item.coaDescription }}
+ {{ props.item.jurnalAddOnValue }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+ delete
+
+
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(summary_balik_new.total_debit) }}
+
+
+ {{ formatCurrency(summary_balik_new.total_kredit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(summary_balik_new.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/components/dialogSelectJurnal.vue b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogSelectJurnal.vue
new file mode 100644
index 0000000..2eb8213
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogSelectJurnal.vue
@@ -0,0 +1,242 @@
+
+
+
+
+ PILIH JURNAL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.periodeName }}
+
+ {{ item.periodeStartDate }} - {{ item.periodeEndDate }}
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+ {{ props.item.jurnalNo }}
+ {{ props.item.jurnalTitle }}
+ {{ props.item.jurnalDescription }}
+ {{ props.item.JurnalTypeName }}
+
+
+ KOREKSI
+ assignment_return
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/components/dialogSelectPeriode.vue b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogSelectPeriode.vue
new file mode 100644
index 0000000..134be0d
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogSelectPeriode.vue
@@ -0,0 +1,91 @@
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+ {{ item.periodeStartDate }} - {{ item.periodeEndDate }}
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/components/dialogViewJurnal.vue b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogViewJurnal.vue
new file mode 100644
index 0000000..446e8d8
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/components/dialogViewJurnal.vue
@@ -0,0 +1,193 @@
+
+
+
+
+ DETAIL JURNAL PENYESUAIAN
+
+
+
+
+ Company Name
+
+ {{ selected_journal_balik.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal_balik.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal_balik.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal_balik.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal_balik.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal_balik.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+ {{ props.item.jurnalTxDescription }}
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.coaCurrencyCode }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(journal_detail_balik.summary.total_debit) }}
+
+
+ {{ formatCurrency(journal_detail_balik.summary.total_kredit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(journal_detail_balik.summary.balance) }}
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Verifikasi
+ Approve
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/components/one-layout.vue b/test/vuex/acc-one-jurnal-penyesuaian/components/one-layout.vue
new file mode 100644
index 0000000..04b4208
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/components/one-layout.vue
@@ -0,0 +1,287 @@
+
+
+
+ JURNAL PENYESUAIAN
+
+
+
+
+
+
+
+
+ {{ selected_periode.periodeStartDate }} - {{ selected_periode.periodeEndDate }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+ add
+
+
+
+
+ Periode Accounting
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+ {{ props.item.jurnalNo }}
+ {{ props.item.jurnalTitle }}
+ {{ props.item.jurnalDescription }}
+ {{ props.item.JurnalTypeName }}
+
+
+ {{ props.item.jurnalPenyesuaianStatus }}
+
+
+
+
+
+
+ visibility
+
+
+ Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ snackbar.message }}
+ Tutup
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/index.php b/test/vuex/acc-one-jurnal-penyesuaian/index.php
new file mode 100644
index 0000000..581d6f9
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/index.php
@@ -0,0 +1,66 @@
+
+
+
+
+
+ ONE | Jurnal Penyesuaian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/modules/journal.js b/test/vuex/acc-one-jurnal-penyesuaian/modules/journal.js
new file mode 100644
index 0000000..ba6881f
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/modules/journal.js
@@ -0,0 +1,477 @@
+import * as api from '../api/api.js';
+
+export default {
+ namespaced: true,
+ state: {
+ // dialog
+ dialog_journal: false,
+ dialog_journal_balik: false,
+ dialog_add_jurnaltrx: false,
+ dialog_view_jurnal: false,
+ dialog_pick_periode: false,
+
+ // jurnal balik
+ filter_balik: {
+ startdate: moment(new Date()).format('YYYY-MM-DD'),
+ enddate: moment(new Date()).format('YYYY-MM-DD'),
+ periodeID: 0,
+ typeJournalID: 0,
+ search: ""
+ },
+ list_journal_balik: {
+ records: [],
+ total: 0
+ },
+ currpage_balik: 1,
+ selected_journal_balik: {},
+ journal_detail_balik: {
+ transaction: [],
+ summary: {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0,
+ }
+ },
+ journal_balik_new: [],
+ summary_balik_new: {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0,
+ },
+
+ // list data general
+ list_periode: [],
+ selected_periode: {},
+ list_typejurnal: [],
+ list_account: [],
+
+ // jurnal closed
+ filter_closed: {
+ startdate: moment(new Date()).format('YYYY-MM-DD'),
+ enddate: moment(new Date()).format('YYYY-MM-DD'),
+ periodeID: 0,
+ typeJournalID: 0,
+ search: ""
+ },
+ list_journal_closed: {
+ records: [],
+ total: 0
+ },
+ currpage_closed: 1,
+ selected_journal_closed: {
+ totals: {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0,
+ }
+ },
+
+ // utilities
+ snackbar: {
+ color: "primary",
+ active: false,
+ message: ""
+ },
+ user_level: {}
+ },
+ mutations: {
+ // dialog
+ update_dialog_journal(state, val) {
+ state.dialog_journal = val
+ },
+ update_dialog_journal_balik(state, val) {
+ state.dialog_journal_balik = val
+ },
+ update_dialog_add_jurnaltrx(state, val) {
+ state.dialog_add_jurnaltrx = val
+ },
+ update_dialog_view_jurnal(state, val) {
+ state.dialog_view_jurnal = val
+ },
+ update_dialog_pick_periode(state, val) {
+ state.dialog_pick_periode = val
+ },
+
+ // jurnal balik
+ update_filter_balik(state, val) {
+ state.filter_balik = val
+ },
+ update_list_journal_balik(state, val) {
+ state.list_journal_balik = val
+ },
+ update_currpage_balik(state, val) {
+ state.currpage_balik = val
+ },
+ update_selected_journal_balik(state, val) {
+ state.selected_journal_balik = val
+ },
+ update_journal_detail_balik(state, val) {
+ state.journal_detail_balik = val
+ },
+ update_journal_balik_new(state, val) {
+ state.journal_balik_new = val
+ },
+ update_summary_balik_new(state, val) {
+ state.summary_balik_new = val
+ },
+
+ // list data general
+ update_list_periode(state, val) {
+ state.list_periode = val
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val
+ },
+ update_list_typejurnal(state, val) {
+ state.list_typejurnal = val
+ },
+ update_list_account(state, val) {
+ state.list_account = val
+ },
+
+ // journal closed
+ update_list_journal_closed(state, val) {
+ state.list_journal_closed = val
+ },
+ update_filter_closed(state, val) {
+ state.filter_closed = val
+ },
+ update_currpage_closed(state, val) {
+ state.currpage_closed = val
+ },
+ update_selected_journal_closed(state, val) {
+ state.selected_journal_closed = val
+ },
+
+ // utilities
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_user_level(state, val) {
+ state.user_level = val
+ }
+ },
+ actions: {
+ async getDaftarPeriode(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ var resp = await api.getDaftarPeriode({ token: one_token() })
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ context.commit('update_list_periode', resp.data);
+
+ let fbalik = context.state.filter_balik;
+ let fclosed = context.state.filter_closed;
+ fbalik.periodeID = resp.data[0].periodeID;
+ fclosed.periodeID = resp.data[0].periodeID;
+
+ context.commit('update_filter_balik', fbalik);
+ context.commit('update_filter_closed', fclosed);
+ context.commit('update_selected_periode', resp.data[0]);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true }
+ context.commit('update_snackbar', snac)
+ }
+ },
+
+ async getDaftarTipeJurnal(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ var resp = await api.getDaftarTipeJurnal({ token: one_token() });
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ context.commit("update_list_typejurnal", resp.data);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async getDaftarJournalClosed(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let params = {
+ token: one_token(),
+ currpage: context.state.currpage_closed,
+ ...context.state.filter_closed
+ }
+
+ var resp = await api.getDaftarJournalClosed(params)
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ context.commit("update_list_journal_closed", resp.data)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async getDetailJournalClosed(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let params = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal_closed.jurnalID
+ }
+
+ var resp = await api.getDetailJournalClosed(params)
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ let datatx = resp.data
+ // calculate total debit, kredit, balance
+ const totals = datatx.reduce((acc, item) => {
+ const debit = Number(item.jurnalTxDebit) || 0
+ const kredit = Number(item.jurnalTxCredit) || 0
+
+ acc.total_debit += debit
+ acc.total_kredit += kredit
+ return acc;
+ }, {total_debit: 0, total_kredit: 0})
+ totals.balance = totals.total_debit - totals.total_kredit
+
+ let selected = context.state.selected_journal_closed
+ let jrlbalik = context.state.journal_detail_balik
+
+ selected.detail = resp.data
+ selected.totals = totals
+
+ jrlbalik.transaction = datatx
+ jrlbalik.summary = totals
+
+ context.commit("update_selected_journal_closed", selected)
+ context.commit("update_journal_detail_balik", jrlbalik)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async getDaftarAccount(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let param = {
+ token: one_token(),
+ keyword: ""
+ }
+ var resp = await api.getDaftarAccount(param);
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ context.commit("update_list_account", resp.data)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async getDaftarJournalBalik(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let param = {
+ token: one_token(),
+ currpage: context.state.currpage_balik,
+ ...context.state.filter_balik
+ }
+ var resp = await api.getDaftarJournalBalik(param)
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ context.commit("update_list_journal_balik", resp.data)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async getDetailJournalBalik(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal_balik.jurnalID
+ }
+ var resp = await api.getDetailJournalBalik(param)
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ let datatx = resp.data
+
+ const summary = datatx.reduce((acc, item) => {
+ const debit = Number(item.jurnalTxDebit)
+ const kredit = Number(item.jurnalTxCredit)
+
+ acc.total_debit += debit
+ acc.total_kredit += kredit
+ return acc
+ }, { total_debit: 0, total_kredit: 0 })
+ summary.balance = summary.total_debit - summary.total_kredit
+
+ let detail_balik = {
+ transaction: datatx,
+ summary: summary
+ }
+ context.commit("update_journal_detail_balik", detail_balik)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async getUserApproveLevel(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ var resp = await api.getUserApproveLevel({token: one_token()});
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ context.commit("update_user_level", resp.data)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async saveKoreksiJurnal(context) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let detailtrx = [];
+ let jurnalbalik = context.state.journal_detail_balik.transaction
+ jurnalbalik.forEach(item => {
+ detailtrx.push({
+ coaID: item.jurnalTxCoaID,
+ coaDescription: item.coaDescription,
+ debit: item.jurnalTxDebit,
+ kredit: item.jurnalTxCredit,
+ info: item.jurnalAddOnValue,
+ infocode: item.jurnalAddOnCode
+ })
+ });
+
+ let jurnalnew = context.state.journal_balik_new
+ jurnalnew.forEach(item => {
+ detailtrx.push({
+ coaID: item.jurnalTxCoaID,
+ coaDescription: item.coaDescription,
+ debit: item.jurnalTxDebit,
+ kredit: item.jurnalTxCredit,
+ info: item.jurnalAddOnValue,
+ infocode: 'PENYESUAIAN'
+ })
+ });
+
+ let param = {
+ token: one_token(),
+ oldJurnalID: context.state.selected_journal_closed.jurnalID,
+ jurnalTypeCode: context.state.selected_journal_closed.JurnalTypeCode,
+ jurnalNo: context.state.selected_journal_closed.jurnalNo,
+ jurnalDate: context.state.selected_journal_closed.jurnalDate,
+ detailtrx: detailtrx
+ }
+ var resp = await api.saveKoreksiJurnal(param);
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ let snac = { color: 'success', message: resp.data, active: true };
+ context.commit('update_snackbar', snac);
+
+ context.state.selected_journal_closed = {
+ totals: {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0,
+ }
+ };
+
+ context.state.journal_detail_balik = {
+ transaction: [],
+ summary: {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0,
+ }
+ };
+
+ context.state.summary_balik_new = {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0,
+ }
+
+ context.dispatch("getDaftarJournalBalik");
+ context.state.dialog_journal_balik = false;
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snac);
+ }
+ },
+
+ async updateStatusJurnalKoreksi(context, status) {
+ try {
+ let snac = { color: 'primary', message: '', active: false };
+ context.commit('update_snackbar', snac);
+
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal_balik.jurnalID,
+ status: status
+ }
+
+ var resp = await api.updateStatusKoreksiJurnal(param)
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit('update_snackbar', snac);
+ } else {
+ let snac = { color: 'success', message: resp.data, active: true };
+ context.commit('update_snackbar', snac);
+
+ context.commit("update_selected_journal_balik", {});
+ context.dispatch("getDaftarJournalBalik");
+ context.commit('update_dialog_view_jurnal', false);
+ }
+ } catch (error) {
+ let snacc = { color: 'error', message: error.message, active: true };
+ context.commit('update_snackbar', snacc);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-penyesuaian/store.js b/test/vuex/acc-one-jurnal-penyesuaian/store.js
new file mode 100644
index 0000000..6b8b62f
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-penyesuaian/store.js
@@ -0,0 +1,12 @@
+import system from "../../../apps/modules/system/system.js";
+import journal from "./modules/journal.js";
+
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system: system
+ },
+ state: {},
+ mutations: {},
+ actions: {}
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/api/journal.js b/test/vuex/acc-one-jurnal-surat-jalan/api/journal.js
new file mode 100644
index 0000000..c7aa693
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/api/journal.js
@@ -0,0 +1,282 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/getPeriode", prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(
+ token,
+ xdate,
+ periodeid,
+ current_page,
+ search,
+ branchCode,
+ regionalId
+) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/search", {
+ token: token,
+ xdate: xdate,
+ periodeid: periodeid,
+ current_page: current_page,
+ search: search,
+ branchCode: branchCode,
+ regionalId: regionalId
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(
+ URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/getUserApproveLevel", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getListingCOA(params) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/getListingCOA", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function requestEditJurnal(params) {
+ try {
+ const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ const data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function changeJurnalToPosted(params) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/changeJurnalToPosted", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getTotalJurnalNotPostedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journalsuratjalan/getTotalJurnalNotPostedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function closeJurnalPerPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "Journalsuratjalan/closeJurnalPerPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDataJurnalNotClosedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journalsuratjalan/getDataJurnalNotClosedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/components/dialogCloseJurnal.vue b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogCloseJurnal.vue
new file mode 100644
index 0000000..417ffbb
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogCloseJurnal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang tidak dapat ditutup: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang dapat ditutup: {{ item.total_jurnal }}
+
+
+
+ Apakah anda yakin akan menutup semua jurnal yang dibuat di
+ {{ area_jurnal }} dalam rentang waktu
+ {{ selected_periode.periode }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/components/dialogEditJurnal.vue b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogEditJurnal.vue
new file mode 100644
index 0000000..f7d45aa
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogEditJurnal.vue
@@ -0,0 +1,223 @@
+
+
+
+
+ EDIT JOURNAL TRANSFER BARANG
+
+
+
+
+ Company Name
+
+ {{ selected_journal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.coaCurrencyCode }}
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/components/dialogPostingJurnal.vue b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogPostingJurnal.vue
new file mode 100644
index 0000000..0ae425c
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogPostingJurnal.vue
@@ -0,0 +1,68 @@
+
+
+
+
+ POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang dapat diposting: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang tidak dapat diposting: {{ item.total_jurnal }}
+ (belum diverifikasi setelah edit)
+
+
+
+ Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
+ {{ selected_periode.periode }} ?
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/components/dialogRequestEditJurnal.vue b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogRequestEditJurnal.vue
new file mode 100644
index 0000000..92715a8
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/components/dialogRequestEditJurnal.vue
@@ -0,0 +1,58 @@
+
+
+
+
+ REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
+
+
+
+ Jurnal ini sudah pernah diedit sebelumnya oleh:
+ {{ selected_journal.JurnalRequestEditStaffName }}
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi?
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal:
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-surat-jalan/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..5244a25
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/components/oneMediaJournalList.vue
@@ -0,0 +1,1224 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ JOURNAL SURAT JALAN
+
+
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+ book
+
+
+ Posting Jurnal
+
+
+
+
+
+
+ collections_bookmark
+
+
+ Tutup Jurnal
+
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+
+ error
+
+ error information
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ posted
+
+
+
+
+ not posted
+
+
+
+
+ closed
+
+
+
+
+
+
+ edit
+
+ Edit
+
+
+
+
+ edit
+
+
+ Edit
+
+
+
+
+ picture_as_pdf
+
+
+ RPT PDF
+
+
+
+
+ receipt
+
+
+ RPT Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL SURAT JALAN
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+ Error Type:
+ {{ error.JurnalErr_Msg.err_type }}
+
+
+ Message:
+ {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal
+ {{
+ msgalertgenerate
+ }}
+ ?
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/index.php b/test/vuex/acc-one-jurnal-surat-jalan/index.php
new file mode 100644
index 0000000..a736dd6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/index.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/modules/journal.js b/test/vuex/acc-one-jurnal-surat-jalan/modules/journal.js
new file mode 100644
index 0000000..b6b04f6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/modules/journal.js
@@ -0,0 +1,588 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js";
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: "new",
+ save_status: 0,
+ save_error_message: "",
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format("YYYY-MM-DD"),
+ end_date: moment(new Date()).format("YYYY-MM-DD"),
+ journals: [],
+ selected_journal: {},
+ summary: { debit: 0, credit: 0, balance: 0 },
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ regionals: [],
+ selected_regional: {},
+ branchs: [],
+ selected_branch: {},
+ xsearch: "",
+ open_dialog_info: false,
+ msg_info: "",
+
+ // --
+ dialog_edit_journal: false,
+ user_level: {},
+ list_coa: [],
+ journal_edit: [],
+ dialog_confirm_posting: false,
+ total_jurnal_not_posted: [],
+ dialog_request_edit: false,
+
+ // ---
+ dialog_close_jurnal: false,
+ jurnal_to_close: []
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_current_page(state, val) {
+ state.current_page = val;
+ },
+ update_x_search(state, val) {
+ state.x_search = val;
+ state.current_page = 1;
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val;
+ },
+ update_last_id(state, val) {
+ state.last_id = val;
+ },
+ update_coas(state, val) {
+ state.coas = val;
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val;
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val;
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val;
+ },
+ update_act(state, val) {
+ state.act = val;
+ },
+ update_save_status(state, val) {
+ state.save_status = val;
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val;
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value;
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val;
+ },
+ update_end_date(state, val) {
+ state.end_date = val;
+ },
+ update_journals(state, val) {
+ state.journals = val;
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val;
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val;
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val;
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val;
+ },
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val;
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val;
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_regionals(state, val) {
+ state.regionals = val;
+ },
+ update_selected_regional(state, val) {
+ state.selected_regional = val;
+ },
+ update_branchs(state, val) {
+ state.branchs = val;
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val;
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val;
+ state.current_page = 1;
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val;
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val;
+ },
+
+ // --
+ update_dialog_edit_journal(state, val) {
+ state.dialog_edit_journal = val;
+ },
+ update_user_level(state, val) {
+ state.user_level = val;
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val;
+ },
+ update_journal_edit(state, val) {
+ state.journal_edit = val;
+ },
+ update_dialog_confirm_posting(state, val) {
+ state.dialog_confirm_posting = val;
+ },
+ update_total_jurnal_not_posted(state, val) {
+ state.total_jurnal_not_posted = val;
+ },
+ update_dialog_request_edit(state, val) {
+ state.dialog_request_edit = val;
+ },
+
+ update_dialog_close_jurnal(state, val) {
+ state.dialog_close_jurnal = val;
+ },
+ update_jurnal_to_close(state, val) {
+ state.jurnal_to_close = val;
+ }
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let prm = {};
+ prm.token = one_token();
+ let resp = await api.getPeriode(prm);
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_autocomplete_status", 2);
+ let data = resp.data;
+ context.commit("update_periodeList", resp.data);
+
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(
+ (p) =>
+ p.periodeMonth == currentMonth.toString() &&
+ p.periodeYear == currentYear
+ );
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode);
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_status", 1);
+ try {
+ let resp = await api.search(
+ one_token(),
+ prm.xdate,
+ prm.periodeid,
+ prm.current_page,
+ prm.search,
+ prm.branchCode,
+ prm.regionalId
+ );
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2);
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ };
+
+ context.commit("update_journals", data.records);
+ context.commit("update_total_journal", data.total);
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1);
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno;
+ let resp = await api.insertSales(branchCode, date, jurnalno);
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_save_status", 2);
+ context.commit("update_save_error_message", resp.message);
+ let data = {
+ total: resp.data.total
+ };
+
+ context.commit("update_alert_success", true);
+ var msg = resp.data.msg;
+ context.commit("update_msg_success", msg);
+ context.dispatch("search", {
+ branchCode: prm.branchCode,
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getRegional(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getRegional({
+ token: one_token(),
+ regionalId: context.state.user.S_RegionalID
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_regionals", data.records);
+ context.commit("update_selected_regional", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async getBranch(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getBranch({
+ token: one_token(),
+ regionalId: context.state.selected_regional.S_RegionalID,
+ branchCode: context.state.user.M_BranchCode
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_branchs", data.records);
+ context.commit("update_selected_branch", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async postingJurnal(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.changeJurnalToPosted(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_total_jurnal_not_posted", []);
+ context.commit("update_dialog_confirm_posting", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getUserApprovalLevel(context) {
+ try {
+ let param = { token: one_token() };
+ const resp = await api.getUserApproveLevel(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_user_level", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getListingCOA(context) {
+ try {
+ let param = {
+ token: one_token(),
+ keyword: ""
+ };
+ const resp = await api.getListingCOA(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_list_coa", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async requestEditJurnal(context) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ staffID: context.state.user.M_UserID,
+ staffName: context.state.user.M_UserUsername
+ };
+ const resp = await api.requestEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_request_edit", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async saveEditJurnal(context, newdetail) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ jurnalRequestEditID: context.state.selected_journal.JurnalRequestEditID,
+ oldjurnaltx: context.state.selected_journal.detailtx,
+ newjurnaltx: newdetail
+ };
+ const resp = await api.saveEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_dialog_edit_journal", false);
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async totalJurnalNotPostedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getTotalJurnalNotPostedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_total_jurnal_not_posted", resp.data.total_jurnal ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getDataJurnalNotClosedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getDataJurnalNotClosedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_jurnal_to_close", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async closeJurnalPerPeriode(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.closeJurnalPerPeriode(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_jurnal_to_close", []);
+ context.commit("update_dialog_close_jurnal", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ }
+ }
+};
diff --git a/test/vuex/acc-one-jurnal-surat-jalan/store.js b/test/vuex/acc-one-jurnal-surat-jalan/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-surat-jalan/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/api/journal.js b/test/vuex/acc-one-jurnal-tukar-faktur/api/journal.js
new file mode 100644
index 0000000..48be3f2
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/api/journal.js
@@ -0,0 +1,282 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/getPeriode", prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function search(
+ token,
+ xdate,
+ periodeid,
+ current_page,
+ search,
+ branchCode,
+ regionalId
+) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/search", {
+ token: token,
+ xdate: xdate,
+ periodeid: periodeid,
+ current_page: current_page,
+ search: search,
+ branchCode: branchCode,
+ regionalId: regionalId
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function insertSales(branchCode, date, jurnalno) {
+ try {
+ var resp = await axios.get(
+ URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getUserApproveLevel(params) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/getUserApproveLevel", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getListingCOA(params) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/getListingCOA", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function requestEditJurnal(params) {
+ try {
+ const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ const data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function saveEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function changeJurnalToPosted(params) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/changeJurnalToPosted", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getTotalJurnalNotPostedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journaltukarfaktur/getTotalJurnalNotPostedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function closeJurnalPerPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "Journaltukarfaktur/closeJurnalPerPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
+
+export async function getDataJurnalNotClosedPerPeriod(params) {
+ try {
+ var resp = await axios.post(
+ URL + "Journaltukarfaktur/getDataJurnalNotClosedPerPeriod",
+ params
+ );
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ };
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogCloseJurnal.vue b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogCloseJurnal.vue
new file mode 100644
index 0000000..417ffbb
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogCloseJurnal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang tidak dapat ditutup: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang dapat ditutup: {{ item.total_jurnal }}
+
+
+
+ Apakah anda yakin akan menutup semua jurnal yang dibuat di
+ {{ area_jurnal }} dalam rentang waktu
+ {{ selected_periode.periode }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogEditJurnal.vue b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogEditJurnal.vue
new file mode 100644
index 0000000..ef6cc9a
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogEditJurnal.vue
@@ -0,0 +1,252 @@
+
+
+
+
+ EDIT JOURNAL TUKAR FAKTUR
+
+
+
+
+ Company Name
+
+ {{ selected_journal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_journal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_journal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_journal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_journal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+ Batal
+ Simpan
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogPostingJurnal.vue b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogPostingJurnal.vue
new file mode 100644
index 0000000..0ae425c
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogPostingJurnal.vue
@@ -0,0 +1,68 @@
+
+
+
+
+ POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
+
+
+
+
+ Jumlah jurnal yang dapat diposting: {{ item.total_jurnal }}
+
+
+ Jumlah jurnal yang tidak dapat diposting: {{ item.total_jurnal }}
+ (belum diverifikasi setelah edit)
+
+
+
+ Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
+ {{ selected_periode.periode }} ?
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogRequestEditJurnal.vue b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogRequestEditJurnal.vue
new file mode 100644
index 0000000..4df0f1e
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/components/dialogRequestEditJurnal.vue
@@ -0,0 +1,60 @@
+
+
+
+
+ REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
+
+
+
+ Jurnal ini sudah pernah diedit sebelumnya oleh:
+ {{ selected_journal.JurnalRequestEditStaffName }}
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi?
+
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+ Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal:
+
+ Nomor: {{ selected_journal.jurnalNo }}
+ Judul: {{ selected_journal.jurnalTitle }}
+ Deskripsi: {{ selected_journal.jurnalDescription }}
+
+
+
+
+ Batal
+ Ya
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/components/oneMediaJournalList.vue b/test/vuex/acc-one-jurnal-tukar-faktur/components/oneMediaJournalList.vue
new file mode 100644
index 0000000..7ebf9b7
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/components/oneMediaJournalList.vue
@@ -0,0 +1,1226 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ JOURNAL TUKAR FAKTUR
+
+
+
+
+
+
+
+
+
+ {{ this.$store.state.journal.selected_periode.periode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+ book
+
+
+ Posting Jurnal
+
+
+
+
+
+
+ collections_bookmark
+
+
+ Tutup Jurnal
+
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+
+ error
+
+ error information
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ posted
+
+
+
+
+ not posted
+
+
+
+
+ closed
+
+
+
+
+
+
+
+ edit
+
+
+ Edit
+
+
+
+
+ visibility
+
+
+ Detail
+
+
+
+
+ picture_as_pdf
+
+
+ RPT PDF
+
+
+
+
+ receipt
+
+
+ RPT Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DETAIL JOURNAL TUKAR FAKTUR
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchCompanyName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalTitle }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.S_RegionalName }}
+
+
+
+
+
+
+
{{ selected_journal.jurnalDate }}
+
+
+
+
+
+
+
+
+
+
+
{{ selected_journal.M_BranchName }}
+
+
+
+
+
+
+
{{ selected_journal.JurnalTypeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.jurnalTxDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+ {{ props.item.jurnalAddOnItem ?? "-" }}
+
+
+ {{ props.item.coaCurrencyCode }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+
+ {{ formatCurrency(xsummary.debit) }}
+
+
+ {{ formatCurrency(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+
+ {{ formatCurrency(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+ ERROR INFORMATION
+
+
+
+
+
+
+
+
+ Error Type:
+ {{ error.JurnalErr_Msg.err_type }}
+
+
+ Message:
+ {{ error.JurnalErr_Msg.err_msg }}
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau konfirmasi regenerate jurnal
+ {{
+ msgalertgenerate
+ }}
+ ?
+
+
+
+
+
+
+
+
+
+
+ Tutup
+ Ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/index.php b/test/vuex/acc-one-jurnal-tukar-faktur/index.php
new file mode 100644
index 0000000..a736dd6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/index.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/modules/journal.js b/test/vuex/acc-one-jurnal-tukar-faktur/modules/journal.js
new file mode 100644
index 0000000..aba5e33
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/modules/journal.js
@@ -0,0 +1,607 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/journal.js";
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ coas: [],
+ total_coas: 0,
+ selected_coa: {},
+ dialog_form_coa: false,
+ act: "new",
+ save_status: 0,
+ save_error_message: "",
+ errors: [],
+ alert_success: false,
+ msg_success: "",
+ alert_error: false,
+ dialog_error: false,
+ open_print: false,
+
+ // ----
+ xdate: moment(new Date()).format("YYYY-MM-DD"),
+ end_date: moment(new Date()).format("YYYY-MM-DD"),
+ journals: [
+ // {
+ // "journalID": "1",
+ // "journalNo": "JM002/08",
+ // "date": "31-08-2024",
+ // "name": "budhi/budhi",
+ // "account": "508501001",
+ // "title": "MS BESIN, SOLAR, PARKIR, TOL, TRANSPORT",
+ // "description": "ACCRUED PARKIR AGST 24",
+ // "debit": "275000",
+ // "credit": "0",
+ // "posted": "Y"
+ // },
+ // {
+ // "journalID": "2",
+ // "journalNo": "JM002/08",
+ // "date": "31-08-2024",
+ // "name": "budhi/budhi",
+ // "account": "2004009",
+ // "title": "ACCRUED EXP OTHERS",
+ // "description": "ACCRUED PARKIR AGST 24",
+ // "debit": "0",
+ // "credit": "275000",
+ // "posted": "Y"
+ // }
+ ],
+ selected_journal: {},
+ summary: { debit: 0, credit: 0, balance: 0 },
+ dialog_form_detail: false,
+ periodeList: [],
+ selected_periode: {},
+ loading: false,
+ dialog_form_periode: false,
+ autocomplete_status: 0,
+ search_status: 0,
+ total_journal: 0,
+ user: one_user(),
+ jurnaldetails: [],
+ dialog_error_jurnal: false,
+ msgerrjurnallist: [],
+ regionals: [],
+ selected_regional: {},
+ branchs: [],
+ selected_branch: {},
+ xsearch: "",
+ open_dialog_info: false,
+ msg_info: "",
+
+ // --
+ dialog_edit_journal: false,
+ user_level: {},
+ list_coa: [],
+ journal_edit: [],
+ dialog_confirm_posting: false,
+ total_jurnal_not_posted: [],
+ dialog_request_edit: false,
+
+ // ---
+ dialog_close_jurnal: false,
+ jurnal_to_close: []
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_current_page(state, val) {
+ state.current_page = val;
+ },
+ update_x_search(state, val) {
+ state.x_search = val;
+ state.current_page = 1;
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val;
+ },
+ update_last_id(state, val) {
+ state.last_id = val;
+ },
+ update_coas(state, val) {
+ state.coas = val;
+ },
+ update_total_coas(state, val) {
+ state.total_coas = val;
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val;
+ },
+ update_dialog_form_coa(state, val) {
+ state.dialog_form_coa = val;
+ },
+ update_act(state, val) {
+ state.act = val;
+ },
+ update_save_status(state, val) {
+ state.save_status = val;
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val;
+ },
+ update_errors(state, val) {
+ state.errors = val;
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val;
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val;
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val;
+ },
+ update_dialog_error(state, val) {
+ state.dialog_error = val;
+ },
+ update_open_print(state, value) {
+ state.open_print = value;
+ },
+
+ // ---
+ update_xdate(state, val) {
+ state.xdate = val;
+ },
+ update_end_date(state, val) {
+ state.end_date = val;
+ },
+ update_journals(state, val) {
+ state.journals = val;
+ },
+ update_selected_journal(state, val) {
+ state.selected_journal = val;
+ },
+ update_summary(state, val) {
+ state.summary = val;
+ },
+ update_dialog_form_detail(state, val) {
+ state.dialog_form_detail = val;
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val;
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val;
+ },
+ update_loading(state, val) {
+ state.loading = val;
+ },
+ update_dialog_form_periode(state, val) {
+ state.dialog_form_periode = val;
+ },
+ update_autocomplete_status(state, val) {
+ state.autocomplete_status = val;
+ },
+ update_search_status(state, val) {
+ state.search_status = val;
+ },
+ update_total_journal(state, val) {
+ state.total_journal = val;
+ },
+ update_user(state, val) {
+ state.user = val;
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val;
+ },
+ update_dialog_error_jurnal(state, val) {
+ state.dialog_error_jurnal = val;
+ },
+ update_msgerrjurnallist(state, val) {
+ state.msgerrjurnallist = val;
+ },
+ update_regionals(state, val) {
+ state.regionals = val;
+ },
+ update_selected_regional(state, val) {
+ state.selected_regional = val;
+ },
+ update_branchs(state, val) {
+ state.branchs = val;
+ },
+ update_selected_branch(state, val) {
+ state.selected_branch = val;
+ },
+ update_xsearch(state, val) {
+ state.xsearch = val;
+ state.current_page = 1;
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val;
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val;
+ },
+
+ // --
+ update_dialog_edit_journal(state, val) {
+ state.dialog_edit_journal = val;
+ },
+ update_user_level(state, val) {
+ state.user_level = val;
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val;
+ },
+ update_journal_edit(state, val) {
+ state.journal_edit = val;
+ },
+ update_dialog_confirm_posting(state, val) {
+ state.dialog_confirm_posting = val;
+ },
+ update_total_jurnal_not_posted(state, val) {
+ state.total_jurnal_not_posted = val;
+ },
+ update_dialog_request_edit(state, val) {
+ state.dialog_request_edit = val;
+ },
+
+ update_dialog_close_jurnal(state, val) {
+ state.dialog_close_jurnal = val;
+ },
+ update_jurnal_to_close(state, val) {
+ state.jurnal_to_close = val;
+ }
+ },
+ actions: {
+ async getPeriode(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let prm = {};
+ prm.token = one_token();
+ let resp = await api.getPeriode(prm);
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_autocomplete_status", 2);
+ let data = resp.data;
+ context.commit("update_periodeList", resp.data);
+
+ // Ambil bulan dan tahun sekarang
+ let now = new Date();
+ let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
+ let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
+
+ // Cari data dengan periodeMonth dan periodeYear yang cocok
+ let selectedPeriode = data.find(
+ (p) =>
+ p.periodeMonth == currentMonth.toString() &&
+ p.periodeYear == currentYear
+ );
+
+ // Jika tidak ditemukan, gunakan data pertama sebagai default
+ if (!selectedPeriode) {
+ selectedPeriode = data[0];
+ }
+
+ context.commit("update_selected_periode", selectedPeriode);
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+ async search(context, prm) {
+ context.commit("update_search_status", 1);
+ try {
+ let resp = await api.search(
+ one_token(),
+ prm.xdate,
+ prm.periodeid,
+ prm.current_page,
+ prm.search,
+ prm.branchCode,
+ prm.regionalId
+ );
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", resp.message);
+ } else {
+ context.commit("update_search_status", 2);
+ context.commit("update_search_error_message", "");
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ };
+
+ context.commit("update_journals", data.records);
+ context.commit("update_total_journal", data.total);
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3);
+ context.commit("update_search_error_message", e.message);
+ }
+ },
+
+ async insertSales(context, prm) {
+ context.commit("update_save_status", 1);
+ try {
+ let branchCode = prm.branchCode;
+ let date = prm.date;
+ let jurnalno = prm.jurnalno;
+ let resp = await api.insertSales(branchCode, date, jurnalno);
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", resp.message);
+ context.commit("update_alert_error", true);
+ } else {
+ context.commit("update_save_status", 2);
+ context.commit("update_save_error_message", resp.message);
+ let data = {
+ total: resp.data.total
+ };
+
+ context.commit("update_alert_success", true);
+ var msg = resp.data.msg;
+ context.commit("update_msg_success", msg);
+ context.dispatch("search", {
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3);
+ context.commit("update_save_error_message", e.message);
+ context.commit("update_alert_error", true);
+ }
+ },
+
+ async getRegional(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getRegional({
+ token: one_token(),
+ regionalId: context.state.user.S_RegionalID
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_regionals", data.records);
+ context.commit("update_selected_regional", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async getBranch(context) {
+ context.commit("update_autocomplete_status", 1);
+ try {
+ let resp = await api.getBranch({
+ token: one_token(),
+ regionalId: context.state.selected_regional.S_RegionalID,
+ branchCode: context.state.user.M_BranchCode
+ });
+ if (resp.status != "OK") {
+ context.commit("update_search_error_message", resp.message);
+ context.commit("update_autocomplete_status", 3);
+ } else {
+ context.commit("update_search_error_message", "");
+ context.commit("update_autocomplete_status", 2);
+ let data = {
+ records: resp.data.records,
+ selected: resp.data.selected
+ };
+
+ context.commit("update_branchs", data.records);
+ context.commit("update_selected_branch", data.selected);
+ }
+ } catch (e) {
+ context.commit("update_search_error_message", e.message);
+ context.commit("update_autocomplete_status", 3);
+ }
+ },
+
+ async postingJurnal(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.changeJurnalToPosted(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_total_jurnal_not_posted", []);
+ context.commit("update_dialog_confirm_posting", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getUserApprovalLevel(context) {
+ try {
+ let param = { token: one_token() };
+ const resp = await api.getUserApproveLevel(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_user_level", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getListingCOA(context) {
+ try {
+ let param = {
+ token: one_token(),
+ keyword: ""
+ };
+ const resp = await api.getListingCOA(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_list_coa", resp.data);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async requestEditJurnal(context) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: context.state.selected_journal.jurnalID,
+ staffID: context.state.user.M_UserID,
+ staffName: context.state.user.M_UserUsername
+ };
+ const resp = await api.requestEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ context.commit("update_dialog_request_edit", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async saveEditJurnal(context, newdetail) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalID: detail[0].jurnalID,
+ jurnalRequestEditID: context.state.selected_journal.JurnalRequestEditID,
+ oldjurnaltx: context.state.selected_journal.detailtx,
+ newjurnaltx: newdetail
+ };
+ const resp = await api.saveEditJurnal(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_dialog_edit_journal", false);
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async totalJurnalNotPostedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getTotalJurnalNotPostedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_total_jurnal_not_posted", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async getDataJurnalNotClosedPerPeriod(context) {
+ try {
+ let param = {
+ token: one_token(),
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.getDataJurnalNotClosedPerPeriod(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_jurnal_to_close", resp.data ?? []);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ },
+
+ async closeJurnalPerPeriode(context, typeid) {
+ try {
+ let param = {
+ token: one_token(),
+ jurnalTypeID: typeid,
+ periodeID: context.state.selected_periode.id
+ };
+ const resp = await api.closeJurnalPerPeriode(param);
+ if (resp.status != "OK") {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", resp.message);
+ } else {
+ context.commit("update_msg_success", resp.data);
+ context.commit("update_alert_success", true);
+
+ context.dispatch("search", {
+ branchCode: context.state.selected_branch.M_BranchCode ?? "",
+ regionalId: context.state.selected_regional.S_RegionalID,
+ search: context.state.x_search,
+ current_page: context.state.current_page,
+ xdate: context.state.xdate,
+ periodeid: context.state.selected_periode.id
+ });
+
+ context.commit("update_jurnal_to_close", []);
+ context.commit("update_dialog_close_jurnal", false);
+ }
+ } catch (error) {
+ context.commit("update_alert_error", true);
+ context.commit("update_save_error_message", error.message);
+ }
+ }
+ }
+};
diff --git a/test/vuex/acc-one-jurnal-tukar-faktur/store.js b/test/vuex/acc-one-jurnal-tukar-faktur/store.js
new file mode 100644
index 0000000..292d3b1
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-tukar-faktur/store.js
@@ -0,0 +1,23 @@
+// State
+// data ...
+// Mutations
+//
+//
+// Actions
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system:system
+ },
+ state: {
+
+ },
+ mutations: {
+
+ },
+ actions: {
+
+ }
+});
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/api/api.js b/test/vuex/acc-one-jurnal-verifikasi-edit/api/api.js
new file mode 100644
index 0000000..1ef35de
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/api/api.js
@@ -0,0 +1,115 @@
+const URL = "/one-api/mockup/masterdata/accounting/JournalVerifEdit/";
+
+export async function getListJournalEdit(params) {
+ try {
+ var resp = await axios.post(URL + "getListJournalEdit", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getDetailJournalEdit(params) {
+ try {
+ var resp = await axios.post(URL + "getDetailJournalEdit", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function verifEditJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "verifEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getListPeriode(params) {
+ try {
+ var resp = await axios.post(URL + "getListPeriode", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getListTypeJurnal(params) {
+ try {
+ var resp = await axios.post(URL + "getListTypeJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function updateRequestEditStatus(params) {
+ try {
+ var resp = await axios.post(URL + "updateRequestEditJurnal", params);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ var data = resp.data;
+ return data;
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/components/daftarVerifikasiJournal.vue b/test/vuex/acc-one-jurnal-verifikasi-edit/components/daftarVerifikasiJournal.vue
new file mode 100644
index 0000000..efe7db4
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/components/daftarVerifikasiJournal.vue
@@ -0,0 +1,283 @@
+
+
+
+ DAFTAR VERIFIKASI EDIT JURNAL
+
+
+
+
+
+
+
+
+ {{ selected_periode.periodeStartDate }} - {{ selected_periode.periodeEndDate }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+ Accounting Period
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+ {{ props.item.jurnalNo }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.jurnalDescription }}
+
+
+ {{ props.item.JurnalRequestEditStaffName }}
+
+
+
+
+ {{ props.item.JurnalRequestEditStatusRequest }}
+
+
Approved by: {{ props.item.RequestApprovedBy }}
+
+
+
+
+
+ {{ props.item.JurnalRequestEditStatusEdit }}
+
+
Approved by: {{ props.item.EditApprovedBy }}
+
+
+
+ DETAIL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ snacbar.message }}
+
+ Tutup
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogRequestEdit.vue b/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogRequestEdit.vue
new file mode 100644
index 0000000..cb8aecb
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogRequestEdit.vue
@@ -0,0 +1,59 @@
+
+
+
+
+ APPROVE / REJECT REQUEST EDIT JURNAL {{ selected_jurnal.jurnalNo }}
+
+
+
+ Request edit jurnal oleh: {{ selected_jurnal.JurnalRequestEditStaffName }}
+
+
+ Apakah anda yakin menyetujui request perubahan jurnal berikut:
+ Nomor: {{ selected_jurnal.jurnalNo }}
+ Judul: {{ selected_jurnal.jurnalTitle }}
+ Deskripsi: {{ selected_jurnal.jurnalDescription }}
+
+
+
+ Reject
+
+ Batal
+ Approve
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogSelectPeriode.vue b/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogSelectPeriode.vue
new file mode 100644
index 0000000..bfcd75e
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogSelectPeriode.vue
@@ -0,0 +1,91 @@
+
+
+
+
+ PILIH PERIODE
+
+
+
+
+
+
+
+ {{ item.periodeStartDate }} - {{ item.periodeEndDate }}
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogVerfikasiEdit.vue b/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogVerfikasiEdit.vue
new file mode 100644
index 0000000..ce1d6b5
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/components/dialogVerfikasiEdit.vue
@@ -0,0 +1,244 @@
+
+
+
+
+ VERIFIKASI PERUBAHAN ACCOUNT JURNAL
+
+
+
+
+ Company Name
+
+ {{ selected_jurnal.M_BranchCompanyName }}
+
+
+
+ Journal
+
+ {{ selected_jurnal.jurnalTitle }}
+
+
+
+ Regional
+
+ {{ selected_jurnal.S_RegionalName }}
+
+
+
+ Journal Date
+
+ {{ selected_jurnal.jurnalDate }}
+
+
+
+ Branch
+
+ {{ selected_jurnal.M_BranchName }}
+
+
+
+ Journal Type
+
+ {{ selected_jurnal.JurnalTypeName }}
+
+
+
+
+
+
+ Detail Account Sebelum Diubah
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.coaDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(summary_jurnal_detail.total_debit) }}
+
+
+ {{ formatCurrency(summary_jurnal_detail.total_kredit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(summary_jurnal_detail.balance) }}
+
+
+
+
+
+
+ Detail Account Setelah Diubah
+
+
+
+
+ {{ props.item.coaAccountNo }}
+
+
+ {{ props.item.coaDescription }}
+
+
+ {{ props.item.jurnalAddOnValue }}
+
+
+ {{ formatCurrency(props.item.jurnalTxDebit) }}
+
+
+ {{ formatCurrency(props.item.jurnalTxCredit) }}
+
+
+
+
+
+ TOTAL
+
+ {{ formatCurrency(summary_jurnal_detail.total_debit) }}
+
+
+ {{ formatCurrency(summary_jurnal_detail.total_kredit) }}
+
+
+
+ BALANCE
+
+ {{ formatCurrency(summary_jurnal_detail.balance) }}
+
+
+
+
+
+
+
+
+
+ BATAL
+ VERIFIKASI
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/index.php b/test/vuex/acc-one-jurnal-verifikasi-edit/index.php
new file mode 100644
index 0000000..cc63f4b
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/index.php
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/modules/journal.js b/test/vuex/acc-one-jurnal-verifikasi-edit/modules/journal.js
new file mode 100644
index 0000000..3fa118d
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/modules/journal.js
@@ -0,0 +1,244 @@
+import * as api from '../api/api.js'
+
+export default {
+ namespaced: true,
+ state: {
+ snacbar: {
+ message: '',
+ color: 'success',
+ active: false
+ },
+ filter: {
+ startdate: moment(new Date()).format('YYYY-MM-DD'),
+ enddate: moment(new Date()).format('YYYY-MM-DD'),
+ typejournal_id: 0,
+ search: '',
+ periode_id: 0,
+ },
+ list_jurnaltype: [],
+ list_periode: [],
+ selected_periode: {},
+ listjournal: {
+ records: [],
+ total: 0
+ },
+ currpage: 1,
+ selected_jurnal: {},
+ selected_jurnal_detail: {},
+ summary_jurnal_detail: {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0
+ },
+ dialog_verifikasi: false,
+ dialog_pick_periode: false,
+ dialog_edit_request: false
+ },
+ mutations: {
+ update_filter(state, val) {
+ state.filter = val
+ },
+ update_list_jurnaltype(state, val) {
+ state.list_jurnaltype = val
+ },
+ update_list_periode(state, val) {
+ state.list_periode = val
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val
+ },
+ update_listjournal(state, val) {
+ state.listjournal = val
+ },
+ update_currpage(state, val) {
+ state.currpage = val
+ },
+ update_selected_jurnal(state, val) {
+ state.selected_jurnal = val
+ },
+ update_selected_jurnal_detail(state, val) {
+ state.selected_jurnal_detail = val
+ },
+ update_summary_jurnal_detail(state, val) {
+ state.summary_jurnal_detail = val
+ },
+ update_dialog_verifikasi(state, val) {
+ state.dialog_verifikasi = val
+ },
+ update_snacbar(state, val) {
+ state.snacbar = val
+ },
+ update_dialog_pick_periode(state, val) {
+ state.dialog_pick_periode = val
+ },
+ update_dialog_edit_request(state, val) {
+ state.dialog_edit_request = val
+ }
+ },
+ actions: {
+ async getListPeriode(context) {
+ try {
+ let snac = { color: 'error', message: '', active: false };
+ context.commit("update_snacbar", snac);
+
+ var resp = await api.getListPeriode({token: one_token()});
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit("update_snacbar", snac);
+ } else {
+ context.commit("update_list_periode", resp.data);
+
+ // update to latest periode id in masterdata
+ let filter = context.state.filter
+ filter.periode_id = resp.data[0].periodeID
+ context.commit("update_filter", filter);
+ context.commit("update_selected_periode", resp.data[0]);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit("update_snacbar", snac);
+ }
+ },
+ async getListTypeJurnal(context) {
+ try {
+ let snac = { color: 'error', message: '', active: false };
+ context.commit("update_snacbar", snac);
+
+ var resp = await api.getListTypeJurnal({token: one_token()});
+ if (resp.status != 'OK') {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit("update_snacbar", snac);
+ } else {
+ context.commit("update_list_jurnaltype", resp.data);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit("update_snacbar", snac);
+ }
+ },
+ async getListJournalEdit(context) {
+ try {
+ let snac = { color: 'error', message: '', active: false };
+ context.commit("update_snacbar", snac);
+
+ let param = {
+ periodeID: context.state.filter.periode_id,
+ typeJournalID: context.state.filter.typejournal_id,
+ search: context.state.filter.search,
+ startdate: context.state.filter.startdate,
+ enddate: context.state.filter.enddate,
+ page: context.state.currpage,
+ token: one_token()
+ }
+ var resp = await api.getListJournalEdit(param);
+ if (resp.status != "OK") {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit("update_snacbar", snac);
+ } else {
+ context.commit("update_listjournal", resp.data);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit("update_snacbar", snac);
+ }
+ },
+ async getDetailJournalEdit(context, jurnalid) {
+ try {
+ let snac = { color: 'error', message: '', active: false };
+ context.commit("update_snacbar", snac);
+
+ let param = {
+ jurnalID: jurnalid,
+ token: one_token()
+ }
+ var resp = await api.getDetailJournalEdit(param);
+ if (resp.status != "OK") {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit("update_snacbar", snac);
+ } else {
+ const data = resp.data;
+ context.commit("update_selected_jurnal_detail", data);
+
+ // summary total kredit & debit jurnal
+ // changeAfter & changeBefore harusnya sama
+ const summary = data.changeAfter.reduce((acc, item) => {
+ const debit = Number(item.jurnalTxDebit) || 0;
+ const kredit = Number(item.jurnalTxCredit) || 0;
+
+ acc.total_debit += debit;
+ acc.total_kredit += kredit;
+ return acc;
+ }, {total_debit: 0, total_kredit: 0});
+ summary.balance = summary.total_debit - summary.total_kredit;
+
+ context.commit("update_summary_jurnal_detail", summary);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit("update_snacbar", snac);
+ }
+ },
+ async updateRequestEditStatus(context, status) {
+ try {
+ let snac = { color: 'error', message: '', active: false };
+ context.commit("update_snacbar", snac);
+
+ let param = {
+ JurnalRequestEditID: context.state.selected_jurnal.JurnalRequestEditID,
+ jurnalID: context.state.selected_jurnal.jurnalID,
+ status: status.status,
+ token: one_token()
+ }
+ var resp = await api.updateRequestEditStatus(param);
+ if (resp.status != "OK") {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit("update_snacbar", snac);
+ } else {
+ context.dispatch("getListJournalEdit");
+ let snac = { color: 'success', message: resp.data, active: true };
+ context.commit("update_snacbar", snac);
+
+ context.commit("update_dialog_edit_request", false)
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit("update_snacbar", snac);
+ }
+ },
+ async verifEditJurnal(context, status) {
+ try {
+ let snac = { color: 'error', message: '', active: false };
+ context.commit("update_snacbar", snac);
+
+ let param = {
+ jurnalID: context.state.selected_jurnal.jurnalID,
+ newtrx: context.state.selected_jurnal_detail.changeAfter,
+ JurnalRequestEditID: context.state.selected_jurnal.JurnalRequestEditID,
+ status: status,
+ token: one_token()
+ }
+ var resp = await api.verifEditJurnal(param);
+ if (resp.status != "OK") {
+ let snac = { color: 'error', message: resp.message, active: true };
+ context.commit("update_snacbar", snac);
+ } else {
+ context.dispatch("getListJournalEdit");
+ let snac = { color: 'success', message: resp.data, active: true };
+ context.commit("update_snacbar", snac);
+
+ context.commit("update_summary_jurnal_detail", {
+ total_debit: 0,
+ total_kredit: 0,
+ balance: 0
+ });
+ context.commit("update_selected_jurnal_detail", {});
+ context.commit("update_selected_jurnal", {})
+ context.commit("update_dialog_verifikasi", false);
+ }
+ } catch (error) {
+ let snac = { color: 'error', message: error.message, active: true };
+ context.commit("update_snacbar", snac);
+ }
+ }
+ }
+}
diff --git a/test/vuex/acc-one-jurnal-verifikasi-edit/store.js b/test/vuex/acc-one-jurnal-verifikasi-edit/store.js
new file mode 100644
index 0000000..cf36f4a
--- /dev/null
+++ b/test/vuex/acc-one-jurnal-verifikasi-edit/store.js
@@ -0,0 +1,11 @@
+import journal from "./modules/journal.js";
+import system from "../../../apps/modules/system/system.js";
+export const store = new Vuex.Store({
+ modules: {
+ journal: journal,
+ system: system
+ },
+ state: {},
+ mutations: {},
+ actions: {}
+});
diff --git a/test/vuex/acc-one-jurnal/api/jpbreg.js b/test/vuex/acc-one-jurnal/api/jpbreg.js
new file mode 100644
index 0000000..65f7b7f
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/api/jpbreg.js
@@ -0,0 +1,184 @@
+const URL = "/one-api/mockup/masterdata/accounting/Jurnalsendreg";
+
+export async function getJurnalType(prm) {
+ try {
+ var resp = await axios.post(URL + '/getJurnalType', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoa(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoaDetail(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoaDetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchBranchPercent(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchBranchPercent', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getDefaultBranch(prm) {
+ try {
+ var resp = await axios.post(URL + '/getBranch', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function saveJurnal(prm) {
+ try {
+ var resp = await axios.post(URL + '/saveJurnal', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function editJurnal(prm) {
+ try {
+ var resp = await axios.post(URL + '/editJurnal', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getDetail(prm) {
+ try {
+ var resp = await axios.post(URL + '/getDetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function deleteJurnal(prm) {
+ try {
+ var resp = await axios.post(URL + '/deleteJurnal', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/api/jurnalbiaya.js b/test/vuex/acc-one-jurnal/api/jurnalbiaya.js
new file mode 100644
index 0000000..470a11a
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/api/jurnalbiaya.js
@@ -0,0 +1,165 @@
+// https://accone.aplikasi.web.id/one-api/mockup/masterdata/accounting/Jurnalgaji/searchCoa
+const URL = "/one-api/mockup/masterdata/accounting/Jurnalbiaya";
+
+export async function getJurnalType(prm) {
+ try {
+ var resp = await axios.post(URL + '/getJurnalType', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoa(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoaDetail(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoaDetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchBranchPercent(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchBranchPercent', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getDefaultBranch(prm) {
+ try {
+ var resp = await axios.post(URL + '/getBranch', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function saveJurnalBiaya(prm) {
+ try {
+ var resp = await axios.post(URL + '/saveJurnalBiaya', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getDetail(prm) {
+ try {
+ var resp = await axios.post(URL + '/getDetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function deleteJurnalBiaya(prm) {
+ try {
+ var resp = await axios.post(URL + '/deleteJurnalBiaya', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/api/jurnalgaji.js b/test/vuex/acc-one-jurnal/api/jurnalgaji.js
new file mode 100644
index 0000000..97536a2
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/api/jurnalgaji.js
@@ -0,0 +1,165 @@
+// https://accone.aplikasi.web.id/one-api/mockup/masterdata/accounting/Jurnalgaji/searchCoa
+const URL = "/one-api/mockup/masterdata/accounting/Jurnalgaji";
+
+export async function getJurnalType(prm) {
+ try {
+ var resp = await axios.post(URL + '/getJurnalType', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoa(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchCoaDetail(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchCoaDetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchBranchPercent(prm) {
+ try {
+ var resp = await axios.post(URL + '/searchBranchPercent', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getDefaultBranch(prm) {
+ try {
+ var resp = await axios.post(URL + '/getBranch', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function saveJurnalGaji(prm) {
+ try {
+ var resp = await axios.post(URL + '/saveJurnalGaji', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function getDetail(prm) {
+ try {
+ var resp = await axios.post(URL + '/getDetail', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function deleteJurnalgaji(prm) {
+ try {
+ var resp = await axios.post(URL + '/deleteJurnalgaji', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/api/jurnalumum.js b/test/vuex/acc-one-jurnal/api/jurnalumum.js
new file mode 100644
index 0000000..43a440e
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/api/jurnalumum.js
@@ -0,0 +1,142 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function search(prm) {
+ try {
+ var resp = await axios.post(URL + "jurnalumum/search", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getjurnaltype(prm) {
+ try {
+ var resp = await axios.post(URL + 'jurnalumum/getjurnaltype', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function getperiode(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'jurnalumum/getperiode', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchcoa(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'jurnalumum/searchcoa', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function savejurnalumum(prm) {
+ try {
+ var resp = await axios.post(URL + 'jurnalumum/savejurnalumum', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function editjurnalumum(prm) {
+ try {
+ var resp = await axios.post(URL + 'jurnalumum/editjurnalumum', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+
+export async function deletejurnalumum(prm) {
+ try {
+ var resp = await axios.post(URL + 'jurnalumum/deletejurnalumum', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/api/pengeluaranbarang.js b/test/vuex/acc-one-jurnal/api/pengeluaranbarang.js
new file mode 100644
index 0000000..81cd9e5
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/api/pengeluaranbarang.js
@@ -0,0 +1,97 @@
+const URL = "/one-api/mockup/masterdata/accounting/jurnalpengeluaranbarang/"
+
+export async function get_periode(params) {
+ try {
+ var resp = await axios.post(URL + 'getperiode', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function get_coa(params) {
+ try {
+ var resp = await axios.post(URL + 'searchcoa', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function simpanjurnal(params) {
+ try {
+ var resp = await axios.post(URL + 'simpanjurnal', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function getdetailjurnal(params) {
+ try {
+ var resp = await axios.post(URL + 'getdetailjurnal', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function editdetailjurnal(params) {
+ try {
+ var resp = await axios.post(URL + 'editjurnal', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/api/terimaBarang.js b/test/vuex/acc-one-jurnal/api/terimaBarang.js
new file mode 100644
index 0000000..cff85ff
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/api/terimaBarang.js
@@ -0,0 +1,133 @@
+const URL = "/one-api/mockup/masterdata/accounting/Journalterimabarang";
+
+export async function getJurnalType(prm) {
+ try {
+ var resp = await axios.post(URL + '/getTipeJurnal', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+export async function searchPeriode(prm) {
+ try {
+ var resp = await axios.post(URL + '/getPeriode', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchSupplier(prm) {
+ try {
+ var resp = await axios.post(URL + '/getSupplier', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchCoa(prm) {
+ try {
+ var resp = await axios.post(URL + '/getCoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function saveJurnal(prm) {
+ try {
+ var resp = await axios.post(URL + '/createJurnal', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function loadEditDialog(prm) {
+ try {
+ var resp = await axios.post(URL + '/loadEditDialog', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function updateJurnal(prm) {
+ try {
+ var resp = await axios.post(URL + '/updateJurnal', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/components/JurnalPengirimanBarangRegional.vue b/test/vuex/acc-one-jurnal/components/JurnalPengirimanBarangRegional.vue
new file mode 100644
index 0000000..8e0bf22
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/JurnalPengirimanBarangRegional.vue
@@ -0,0 +1,1370 @@
+
+
+
+ {{ snackbar.msg }}
+
+ Close
+
+
+
+
+
+ FORM DETAIL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+ TAMBAHKAN
+
+
+ EDIT
+
+
+
+
+
+
+
+ FORM JURNAL PENGIRIMAN BARANG REGIONAL
+ {{ jurnalNumber }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TAMBAH
+
+
+
+
+
+
+ {{ props.item.coaNo }}
+ {{ props.item.description }}
+ {{ oneMoney(props.item.debet) }}
+ {{ oneMoney(props.item.kredit) }}
+
+
+
+ edit
+
+
+ delete
+
+
+
+
+
+
+ Total
+
+
+ {{ oneMoney(balance.debet) }}
+
+
+ {{ oneMoney(balance.kredit) }}
+
+
+
+
+
+ Balance
+
+
+
+
+ {{ oneMoney(balance.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+ SIMPAN
+
+
+ SIMPAN PERUBAHAN
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal/components/accountDialogJurnalUmum.vue b/test/vuex/acc-one-jurnal/components/accountDialogJurnalUmum.vue
new file mode 100644
index 0000000..1ab8410
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/accountDialogJurnalUmum.vue
@@ -0,0 +1,921 @@
+
+
+
+
+
+ FORM JURNAL UMUM
+
+
+
+
+
+
+
+
+
+
+
+ Jurnal type harus dipilih
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Periode harus dipilih
+
+
+
+
+
+
+
+
+
+
+
+
+ Judul harus diisi
+
+
+
+
+
+
+
+
+
+
+
+
+ TAMBAH
+
+
+
+
+
+
+
+
+
+ {{ props.item.account }}
+
+
+ {{ props.item.description }}
+
+
+ {{ oneMoney(props.item.debit) }}
+
+
+ {{ oneMoney(props.item.credit) }}
+
+
+ delete
+
+
+
+
+
+ TOTAL
+
+
+ {{ oneMoney(xsummary.debit) }}
+
+
+ {{ oneMoney(xsummary.credit) }}
+
+
+
+
+ BALANCE
+
+ {{ oneMoney(xsummary.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+ SIMPAN
+ SIMPAN PERUBAHAN
+
+
+
+
+
+
+
+
+ FORM DETAIL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Coa harus dipilih
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BATAL
+
+ TAMBAHKAN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/components/accountOneJurnalList.vue b/test/vuex/acc-one-jurnal/components/accountOneJurnalList.vue
new file mode 100644
index 0000000..27eebf5
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/accountOneJurnalList.vue
@@ -0,0 +1,1066 @@
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+ MANUAL JURNAL
+
+
+ add_box
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+
+
+
+
+
+
+
+ {{ props.item.jurnalDate }}
+
+
+
+ {{ props.item.jurnalNo }}
+
+
+ {{ props.item.jurnalTitle }}
+
+
+ {{ props.item.S_RegionalName }}
+
+
+ {{ props.item.JurnalTypeName }}
+
+
+
+
+ delete
+
+ Hapus
+
+
+
+ edit
+
+ Edit
+
+
+
+ picture_as_pdf
+
+ Voucher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{ msgalertjurnal }}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Ya
+
+
+
+
+
+
+
+
+
+
+ PILIH JURNAL TYPE
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ PILIH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal/components/jurnalbiaya.vue b/test/vuex/acc-one-jurnal/components/jurnalbiaya.vue
new file mode 100644
index 0000000..f2cee63
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/jurnalbiaya.vue
@@ -0,0 +1,1530 @@
+
+
+
+ {{ snackbar.msg }}
+
+ Close
+
+
+
+
+
+ FORM DETAIL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+ TAMBAHKAN
+
+
+ EDIT
+
+
+
+
+
+
+
+ FORM JURNAL BIAYA REGIONAL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JURNAL REGIONAL
+
+
+
+
+
+
+ {{ props.item.branchName }}
+ {{ props.item.coaNo }}
+ {{ props.item.description }}
+ {{ oneMoney(props.item.debet) }}
+ {{ oneMoney(props.item.kredit) }}
+
+
+
+
+
+
+ Total
+
+
+ {{ oneMoney(balanceRegional.debet) }}
+
+
+ {{ oneMoney(balanceRegional.kredit) }}
+
+
+
+
+
+ Balance
+
+
+
+
+ {{ oneMoney(balanceRegional.balance) }}
+
+
+
+
+
+
+
+ JURNAL CABANG
+
+
+
+
+
+
+
+ {{ props.item.branchName }}
+ {{ props.item.coaNo }}
+ {{ props.item.description }}
+ {{ oneMoney(props.item.debet) }}
+ {{ oneMoney(props.item.kredit) }}
+
+
+
+
+
+
+ Total
+
+
+ {{ oneMoney(balance.debet) }}
+
+
+ {{ oneMoney(balance.kredit) }}
+
+
+
+
+
+ Balance
+
+
+
+
+ {{ oneMoney(balance.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+ SIMPAN
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal/components/jurnalgaji.vue b/test/vuex/acc-one-jurnal/components/jurnalgaji.vue
new file mode 100644
index 0000000..17b5158
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/jurnalgaji.vue
@@ -0,0 +1,1525 @@
+
+
+
+ {{ snackbar.msg }}
+
+ Close
+
+
+
+
+
+ FORM DETAIL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+ TAMBAHKAN
+
+
+ EDIT
+
+
+
+
+
+
+
+ FORM JURNAL GAJI REGIONAL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JURNAL REGIONAL
+
+
+
+
+
+
+ {{ props.item.branchName }}
+ {{ props.item.coaNo }}
+ {{ props.item.description }}
+ {{ oneMoney(props.item.debet) }}
+ {{ oneMoney(props.item.kredit) }}
+
+
+
+
+
+
+ Total
+
+
+ {{ oneMoney(balanceRegional.debet) }}
+
+
+ {{ oneMoney(balanceRegional.kredit) }}
+
+
+
+
+
+ Balance
+
+
+
+
+ {{ oneMoney(balanceRegional.balance) }}
+
+
+
+
+
+
+
+ JURNAL CABANG
+
+
+
+
+
+
+
+ {{ props.item.branchName }}
+ {{ props.item.coaNo }}
+ {{ props.item.description }}
+ {{ oneMoney(props.item.debet) }}
+ {{ oneMoney(props.item.kredit) }}
+
+
+
+
+
+
+ Total
+
+
+ {{ oneMoney(balance.debet) }}
+
+
+ {{ oneMoney(balance.kredit) }}
+
+
+
+
+
+ Balance
+
+
+
+
+ {{ oneMoney(balance.balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+
+ SIMPAN
+
+
+
+
+
+
+
+
+
+
diff --git a/test/vuex/acc-one-jurnal/components/pengeluaranBarangDialog.vue b/test/vuex/acc-one-jurnal/components/pengeluaranBarangDialog.vue
new file mode 100644
index 0000000..536d1a6
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/pengeluaranBarangDialog.vue
@@ -0,0 +1,629 @@
+
+
+
+
+
+ {{ opp_type == "add" ? 'FORM JURNAL PENGELUARAN BARANG': 'EDIT FORM JURNAL PENGELUARAN BARANG' }}
+
+
+
+
+
+
+
+
+
+
+
+ Tipe jurnal kosong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Periode masih kosong
+
+
+
+
+
+
+
+
+
+
+
+
+ Title masih kosong
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TAMBAH
+
+
+
+
+
+
+
+ {{ props.item.coano }}
+ {{ props.item.coadesc }}
+ {{ oneMoney(props.item.debet) }}
+ {{ oneMoney(props.item.kredit) }}
+
+ delete
+
+
+
+
+ TOTAL
+ {{ oneMoney(summary_detail.total_debet) }}
+ {{ oneMoney(summary_detail.total_kredit) }}
+
+
+
+ BALANCE
+ {{ oneMoney(summary_detail.total_balance) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+ SIMPAN
+
+
+
+
+
+
+
+ FORM DETAIL
+
+
+
+
+
+ Coa masih kosong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BATAL
+
+ TAMBAH
+
+
+
+
+
+
+ {{ crud_jurnal.msg }}
+ Tutup
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/components/terimaBarangForm.vue b/test/vuex/acc-one-jurnal/components/terimaBarangForm.vue
new file mode 100644
index 0000000..8b34b5d
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/components/terimaBarangForm.vue
@@ -0,0 +1,1028 @@
+
+
+
+
+
+
+ FORM JURNAL PENERIMAAN BARANG
+
+
+
+
+
+
+
+
+
+ Pilih salah satu tipe jurnal
+
+
+
+
+
+
+
+
+
+
+
+ Pilih tanggal jurnal
+
+ Tanggal di luar rentang periode terpilih
+
+
+
+
+
+
+
+
+
+
+
+ Periode harus
+ dipilih
+
+
+
+
+
+
+ Judul harus
+ diisi
+
+
+
+
+ Supplier harus
+ dipilih
+
+
+
+
+
+
+
+ Isi salah satu GRNI atau Invoice
+
+
+
+
+ Deskripsi
+ harus diisi
+
+
+ TAMBAH DETAIL
+
+
+
+
+
+ {{ props.item.coaAccountNo }}
+ {{ props.item.coaDescription }}
+ {{ oneMoney(props.item.jurnalTxDebit)
+ }}
+
+ {{ oneMoney(props.item.jurnalTxCredit)
+ }}
+
+ delete
+
+
+
+ Total
+
+ {{ oneMoney(detailSum.debit) }}
+
+
+ {{ oneMoney(detailSum.credit) }}
+
+
+
+
+
+ Balance
+
+
+ {{ oneMoney(detailSum.balance) }}
+
+
+
+
+
+
+ Balance harus 0 sebelum disimpan. Silakan edit debit/kredit
+
+
+ Hanya boleh ada 1 kredit di Jurnal Penerimaan Barang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+ SIMPAN
+ SIMPAN PERUBAHAN
+
+
+
+
+
+
+
+
+ FORM DETAIL PENERIMAAN BARANG
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CoA harus dipilih
+
+
+
+
+
+
+
+
+
+
+
+
+ Isi salah satu Debit / Kredit
+
+
+
+
+
+
+
+
+
+
+ TUTUP
+
+ SIMPAN
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/index.php b/test/vuex/acc-one-jurnal/index.php
new file mode 100644
index 0000000..da4020d
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/index.php
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+ One
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/modules/jpbreg.js b/test/vuex/acc-one-jurnal/modules/jpbreg.js
new file mode 100644
index 0000000..43039d4
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/modules/jpbreg.js
@@ -0,0 +1,898 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/jpbreg.js"
+
+export default {
+ namespaced: true,
+ state: {
+ last_id: -1,
+ loading: false,
+ dialogForm: false,
+ dialogType: 'N',
+ startDate: moment(new Date()).format('YYYY-MM-DD'),
+ endDate: moment(new Date()).format('YYYY-MM-DD'),
+ selectedDate: moment(new Date()).format('YYYY-MM-DD'),
+ user: one_user(),
+ jurnalTypeList: [],
+ selectedJurnalType: {},
+ balance: {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ },
+ balanceRegional: {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ },
+ defaultJurnalType: {},
+ loading: false,
+ periodeList: [],
+ searchPeriode: '',
+ selectedPeriode: {},
+ loadingAutocomplete: false,
+ title: '',
+ coaList: [],
+ searchCoa: '',
+ selectedCoa: {},
+ sallary: 0,
+ description: '',
+ branchPercentList: [],
+ selectedBranchPercent: {},
+ defaultBranch: [],
+ detailJurnalGaji: [],
+ detailJurnalGajiRegional: [],
+ dialogAddDetail: false,
+ coaListDetail: [],
+ selectedCoaDetail: {},
+ searchCoaDetail: '',
+ coaListKas: [],
+ selectedCoaKas: {},
+ searchCoaKas: '',
+ selectedBranchDetail: {},
+ kreditDetail: 0,
+ debetDetail: 0,
+ snackbar: {
+ state: false,
+ color: 'success',
+ msg: ''
+ },
+ idEdit: 0,
+ isEdit: 'N',
+ jurnalNumber: "",
+ },
+ mutations: {
+ update_jurnalNumber(state, val) {
+ state.jurnalNumber = val
+ },
+ update_debetDetail(state, val) {
+ state.debetDetail = val
+ },
+ update_dialogType(state, val) {
+ state.dialogType = val
+ },
+ update_idEdit(state, val) {
+ state.idEdit = val
+ },
+ update_balance(state, val) {
+ state.balance = val
+ },
+ update_balanceRegional(state, val) {
+ state.balanceRegional = val
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_kreditDetail(state, val) {
+ state.kreditDetail = val
+ },
+ update_selectedBranchDetail(state, val) {
+ state.selectedBranchDetail = val
+ },
+ update_coaListKas(state, val) {
+ state.coaListKas = val
+ },
+ update_searchCoaKas(state, val) {
+ state.searchCoaKas = val
+ },
+ update_selectedCoaKas(state, val) {
+ state.selectedCoaKas = val
+ },
+ update_coaListDetail(state, val) {
+ state.coaListDetail = val
+ },
+ update_searchCoaDetail(state, val) {
+ state.searchCoaDetail = val
+ },
+ update_selectedCoaDetail(state, val) {
+ state.selectedCoaDetail = val
+ },
+ update_detailJurnalGaji(state, val) {
+ state.detailJurnalGaji = val
+ },
+ update_detailJurnalGajiRegional(state, val) {
+ state.detailJurnalGajiRegional = val
+ },
+ update_dialogAddDetail(state, val) {
+ state.dialogAddDetail = val
+ },
+ update_title(state, val) {
+ state.title = val
+ },
+ update_defaultBranch(state, val) {
+ state.defaultBranch = val
+ },
+ update_branchPercentList(state, val) {
+ state.branchPercentList = val
+ },
+ update_selectedBranchPercent(state, val) {
+ state.selectedBranchPercent = val
+ },
+ update_selectedDate(state, val) {
+ state.selectedDate = val
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val
+ },
+ update_coaList(state, val) {
+ state.coaList = val
+ },
+ update_searchCoa(state, val) {
+ state.searchCoa = val
+ },
+ update_selectedCoa(state, val) {
+ state.selectedCoa = val
+ },
+ update_selectedPeriode(state, val) {
+ state.selectedPeriode = val
+ },
+ update_searchPeriode(state, val) {
+ state.searchPeriode = val
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_defaultJurnalType(state, val) {
+ state.defaultJurnalType = val
+ },
+ update_selectedJurnalType(state, val) {
+ state.selectedJurnalType = val
+ },
+ update_jurnalTypeList(state, val) {
+ state.jurnalTypeList = val
+ },
+ update_dialogForm(state, val) {
+ state.dialogForm = val
+ },
+ update_startDate(state, val) {
+ state.startDate = val
+ },
+ update_endDate(state, val) {
+ state.endDate = val
+ },
+ update_sallary(state, val) {
+ state.sallary = val
+ },
+ update_description(state, val) {
+ state.description = val
+ },
+ update_isEdit(state, val) {
+ state.isEdit = val
+ },
+ },
+ actions: {
+ countSummary(context) {
+ let kredit = 0;
+ let debet = 0;
+ context.state.detailJurnalGaji.forEach((e) => {
+ if (e.type === "D") {
+ debet = parseFloat(e.debet) + debet;
+ }
+ if (e.type === "K") {
+ kredit = parseFloat(e.kredit) + kredit;
+ }
+ });
+ let total = debet - kredit;
+
+ let summary = {
+ debet: debet,
+ kredit: kredit,
+ balance: total,
+ };
+ context.commit("update_balance", summary)
+ // this.balance = summary;
+ },
+ countSummaryRegional(context) {
+ let kredit = 0;
+ let debet = 0;
+ context.state.detailJurnalGajiRegional.forEach((e) => {
+ if (e.type === "D") {
+ debet = parseFloat(e.debet) + debet;
+ }
+ if (e.type === "K") {
+ kredit = parseFloat(e.kredit) + kredit;
+ }
+ });
+ let total = debet - kredit;
+
+ let summary = {
+ debet: debet,
+ kredit: kredit,
+ balance: total,
+ };
+ context.commit("update_balanceRegional", summary)
+
+ },
+ async getDetail(context, prm) {
+ context.commit("update_loading", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.getDetail(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp.data);
+ // setTimeout(() => {
+ // // Tambahkan logika yang ingin dijalankan setelah 3 detik di sini
+ // console.log("Timer selesai, menjalankan sesuatu setelah 3 detik");
+ // context.commit("update_loading", false)
+ // }, 3000);
+ context.commit("update_selectedPeriode", resp.data.periode)
+ context.commit("update_searchPeriode", resp.data.periode.display)
+ context.commit("update_title", resp.data.title)
+ context.commit("update_selectedDate", resp.data.date)
+ // context.commit("update_selectedCoa", resp.data.coa)
+ // context.commit("update_searchCoa", resp.data.coa.display)
+ // context.commit("update_selectedCoaKas", resp.data.coaKas)
+ // context.commit("update_searchCoaKas", resp.data.coaKas.display ?? '')
+ // context.commit("update_sallary", resp.data.sallary)
+ context.commit("update_isEdit", resp.data.isEdit)
+ context.commit("update_jurnalNumber", resp.data.jurnal.jurnalNo)
+ context.commit("update_selectedBranchDetail", resp.data.destination)
+ context.commit("update_description", resp.data.description)
+ context.commit("update_detailJurnalGaji", resp.data.jurnalDetail)
+ // context.commit("update_detailJurnalGajiRegional", resp.data.jurnalDetailRegional)
+ // context.commit("update_dialogType", resp.data.type)
+ // context.commit("update_selectedBranchPercent", resp.data.branchPrecent)
+ context.dispatch("countSummary")
+ context.dispatch("countSummaryRegional")
+ context.commit("update_loading", false)
+
+ // let snackbar = {
+ // state: true,
+ // color: 'success',
+ // msg: 'Berhasil tambah jurnal gaji regional'
+ // }
+ // context.commit("update_snackbar", snackbar)
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async saveJurnal(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.saveJurnal(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah jurnal pengiriman barang ke cabang ' + prm.branchName
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_selectedCoaDetail", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchPercent", {})
+ context.commit("update_selectedBranchDetail", {})
+
+ context.commit("update_detailJurnalGaji", [])
+ context.commit("update_detailJurnalGajiRegional", [])
+ context.commit("jurnalumum/update_x_drop_tipe_jurnal", {}, {root: true});
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+ context.commit("update_balance", blc)
+ context.commit("update_balanceRegional", blc)
+ context.commit("update_sallary", 0)
+ context.commit("update_searchCoa", '')
+ context.commit("update_searchCoaKas", '')
+ context.commit("update_title", '')
+ context.commit("update_description", '')
+ context.commit("update_dialogForm", false)
+ const jurnalumumState = context.rootState.jurnalumum;
+
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+
+
+ // this.sallary = 0;
+ // this.searchCoa = "";
+ // this.searchCoaKas = "";
+ // this.title = "";
+ // this.description = "";
+ // console.log("close dialogs");
+ // this.$emit("update:show", false);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async editJurnal(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.editJurnal(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil ubah jurnal pengiriman barang ke cabang ' + prm.branchName
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_selectedCoaDetail", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchPercent", {})
+ context.commit("update_selectedBranchDetail", {})
+
+ context.commit("update_detailJurnalGaji", [])
+ context.commit("update_detailJurnalGajiRegional", [])
+ context.commit("jurnalumum/update_x_drop_tipe_jurnal", {}, {root: true});
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+ context.commit("update_balance", blc)
+ context.commit("update_balanceRegional", blc)
+ context.commit("update_sallary", 0)
+ context.commit("update_searchCoa", '')
+ context.commit("update_searchCoaKas", '')
+ context.commit("update_title", '')
+ context.commit("update_description", '')
+ const jurnalumumState = context.rootState.jurnalumum;
+
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+ context.commit("update_dialogForm", false)
+
+
+ // this.sallary = 0;
+ // this.searchCoa = "";
+ // this.searchCoaKas = "";
+ // this.title = "";
+ // this.description = "";
+ // console.log("close dialogs");
+ // this.$emit("update:show", false);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async getJurnalType(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ let resp = await api.getJurnalType(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_jurnalTypeList", resp.data.records)
+ context.commit("update_selectedJurnalType", resp.data.default)
+ context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getDefaultBranch(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+ let resp = await api.getDefaultBranch(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_defaultBranch", resp.data)
+ // context.commit("update_selectedJurnalType", resp.data.default)
+ // context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async deleteJurnal(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.deleteJurnal(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil delete jurnal gaji regional'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_selectedCoaDetail", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchPercent", {})
+ context.commit("update_selectedBranchDetail", {})
+
+ context.commit("update_detailJurnalGaji", [])
+ context.commit("update_detailJurnalGajiRegional", [])
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+ context.commit("update_balance", blc)
+ context.commit("update_balanceRegional", blc)
+ context.commit("update_sallary", 0)
+ context.commit("update_searchCoa", '')
+ context.commit("update_searchCoaKas", '')
+ context.commit("update_title", '')
+ context.commit("update_description", '')
+ context.commit("update_dialogForm", false)
+
+ const jurnalumumState = context.rootState.jurnalumum;
+
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+
+
+
+
+ // this.sallary = 0;
+ // this.searchCoa = "";
+ // this.searchCoaKas = "";
+ // this.title = "";
+ // this.description = "";
+ // console.log("close dialogs");
+ // this.$emit("update:show", false);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async getBranchpercent(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.regional = context.state.user.S_RegionalID
+ let resp = await api.searchBranchPercent(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_branchPercentList", resp.data)
+ // context.commit("update_selectedJurnalType", resp.data.default)
+ // context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getPeriode(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchPeriode;
+ prm.token = one_token()
+ let resp = await api.searchPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_periodeList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoa(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoa;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaKas(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaKas;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListKas", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaDetail(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaDetail;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+ prm.branch = context.state.selectedBranchDetail.branchID
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListDetail", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async searchKredit(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchKredit;
+ prm.token = one_token()
+ let resp = await api.searchkredit(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_kreditList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async search(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.search = context.state.searchTemplate
+ prm.page = context.state.page
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ } else {
+ context.commit("update_loading", false)
+ context.commit("update_templateList", resp.data.records)
+ context.commit("update_total", resp.data.total)
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async insertTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.insertTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogForm", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error add data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error add data')
+ }
+ },
+ async updateTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.updateTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogForm", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error edit data')
+ }
+ },
+ async deleteTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.deleteTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogAlert", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil delete data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error delete data')
+ }
+ },
+
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/modules/jurnalbiaya.js b/test/vuex/acc-one-jurnal/modules/jurnalbiaya.js
new file mode 100644
index 0000000..8f4fc38
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/modules/jurnalbiaya.js
@@ -0,0 +1,821 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/jurnalbiaya.js"
+
+export default {
+ namespaced: true,
+ state: {
+ last_id: -1,
+ loading: false,
+ dialogForm: false,
+ dialogType: 'N',
+ startDate: moment(new Date()).format('YYYY-MM-DD'),
+ endDate: moment(new Date()).format('YYYY-MM-DD'),
+ selectedDate: moment(new Date()).format('YYYY-MM-DD'),
+ user: one_user(),
+ jurnalTypeList: [],
+ selectedJurnalType: {},
+ balance: {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ },
+ balanceRegional: {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ },
+ defaultJurnalType: {},
+ loading: false,
+ periodeList: [],
+ searchPeriode: '',
+ selectedPeriode: {},
+ loadingAutocomplete: false,
+ title: '',
+ coaList: [],
+ searchCoa: '',
+ selectedCoa: {},
+ costs: 0,
+ description: '',
+ branchCostPercentList: [],
+ selectedBranchCostPercent: {},
+ defaultBranch: [],
+ detailJurnalBiaya: [],
+ detailJurnalBiayaRegional: [],
+ dialogAddDetail: false,
+ coaListDetail: [],
+ selectedCoaDetail: {},
+ searchCoaDetail: '',
+ coaListKas: [],
+ selectedCoaKas: {},
+ searchCoaKas: '',
+ coaListReg: [],
+ selectedCoaReg: {},
+ searchCoaReg: '',
+ selectedBranchDetail: {},
+ kreditDetail: 0,
+ snackbar: {
+ state: false,
+ color: 'success',
+ msg: ''
+ },
+ idEdit: 0,
+ },
+ mutations: {
+ update_dialogType(state, val) {
+ state.dialogType = val
+ },
+ update_idEdit(state, val) {
+ state.idEdit = val
+ },
+ update_balance(state, val) {
+ state.balance = val
+ },
+ update_balanceRegional(state, val) {
+ state.balanceRegional = val
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_kreditDetail(state, val) {
+ state.kreditDetail = val
+ },
+ update_selectedBranchDetail(state, val) {
+ state.selectedBranchDetail = val
+ },
+ update_coaListKas(state, val) {
+ state.coaListKas = val
+ },
+ update_searchCoaKas(state, val) {
+ state.searchCoaKas = val
+ },
+ update_selectedCoaKas(state, val) {
+ state.selectedCoaKas = val
+ },
+ update_coaListReg(state, val) {
+ state.coaListReg = val
+ },
+ update_searchCoaReg(state, val) {
+ state.searchCoaReg = val
+ },
+ update_selectedCoaReg(state, val) {
+ state.selectedCoaReg = val
+ },
+ update_coaListDetail(state, val) {
+ state.coaListDetail = val
+ },
+ update_searchCoaDetail(state, val) {
+ state.searchCoaDetail = val
+ },
+ update_selectedCoaDetail(state, val) {
+ state.selectedCoaDetail = val
+ },
+ update_detailJurnalBiaya(state, val) {
+ state.detailJurnalBiaya = val
+ },
+ update_detailJurnalBiayaRegional(state, val) {
+ state.detailJurnalBiayaRegional = val
+ },
+ update_dialogAddDetail(state, val) {
+ state.dialogAddDetail = val
+ },
+ update_title(state, val) {
+ state.title = val
+ },
+ update_defaultBranch(state, val) {
+ state.defaultBranch = val
+ },
+ update_branchCostPercentList(state, val) {
+ state.branchCostPercentList = val
+ },
+ update_selectedBranchCostPercent(state, val) {
+ state.selectedBranchCostPercent = val
+ },
+ update_selectedDate(state, val) {
+ state.selectedDate = val
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val
+ },
+ update_coaList(state, val) {
+ state.coaList = val
+ },
+ update_searchCoa(state, val) {
+ state.searchCoa = val
+ },
+ update_selectedCoa(state, val) {
+ state.selectedCoa = val
+ },
+ update_selectedPeriode(state, val) {
+ state.selectedPeriode = val
+ },
+ update_searchPeriode(state, val) {
+ state.searchPeriode = val
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_defaultJurnalType(state, val) {
+ state.defaultJurnalType = val
+ },
+ update_selectedJurnalType(state, val) {
+ state.selectedJurnalType = val
+ },
+ update_jurnalTypeList(state, val) {
+ state.jurnalTypeList = val
+ },
+ update_dialogForm(state, val) {
+ state.dialogForm = val
+ },
+ update_startDate(state, val) {
+ state.startDate = val
+ },
+ update_endDate(state, val) {
+ state.endDate = val
+ },
+ update_costs(state, val) {
+ state.costs = val
+ },
+ update_description(state, val) {
+ state.description = val
+ },
+ },
+ actions: {
+ countSummary(context) {
+ let kredit = 0;
+ let debet = 0;
+ context.state.detailJurnalBiaya.forEach((e) => {
+ if (e.type === "D") {
+ debet = parseFloat(e.debet) + debet;
+ }
+ if (e.type === "K") {
+ kredit = parseFloat(e.kredit) + kredit;
+ }
+ });
+ let total = debet - kredit;
+
+ let summary = {
+ debet: debet,
+ kredit: kredit,
+ balance: total,
+ };
+ context.commit("update_balance", summary)
+ // this.balance = summary;
+ },
+ countSummaryRegional(context) {
+ let kredit = 0;
+ let debet = 0;
+ context.state.detailJurnalBiayaRegional.forEach((e) => {
+ if (e.type === "D") {
+ debet = parseFloat(e.debet) + debet;
+ }
+ if (e.type === "K") {
+ kredit = parseFloat(e.kredit) + kredit;
+ }
+ });
+ let total = debet - kredit;
+
+ let summary = {
+ debet: debet,
+ kredit: kredit,
+ balance: total,
+ };
+ context.commit("update_balanceRegional", summary)
+
+ },
+ async getDetail(context, prm) {
+ context.commit("update_loading", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.getDetail(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp.data);
+ // setTimeout(() => {
+ // // Tambahkan logika yang ingin dijalankan setelah 3 detik di sini
+ // console.log("Timer selesai, menjalankan sesuatu setelah 3 detik");
+ // context.commit("update_loading", false)
+ // }, 3000);
+ context.commit("update_selectedPeriode", resp.data.periode)
+ context.commit("update_searchPeriode", resp.data.periode.display)
+ context.commit("update_title", resp.data.title)
+ context.commit("update_selectedDate", resp.data.date)
+ context.commit("update_selectedCoa", resp.data.coa)
+ context.commit("update_searchCoa", resp.data.coa.display)
+ context.commit("update_selectedCoaKas", resp.data.coaKas)
+ context.commit("update_searchCoaKas", resp.data.coaKas.display ?? '')
+ context.commit("update_selectedCoaReg", resp.data.coaReg)
+ context.commit("update_searchCoaReg", resp.data.coaReg.display ?? '')
+ context.commit("update_costs", resp.data.costs)
+ context.commit("update_description", resp.data.description)
+ context.commit("update_detailJurnalBiaya", resp.data.jurnalDetail)
+ context.commit("update_detailJurnalBiayaRegional", resp.data.jurnalDetailRegional)
+ context.commit("update_dialogType", resp.data.type)
+ context.commit("update_selectedBranchCostPercent", resp.data.branchPrecent)
+ context.dispatch("countSummary")
+ context.dispatch("countSummaryRegional")
+ context.commit("update_loading", false)
+
+ // let snackbar = {
+ // state: true,
+ // color: 'success',
+ // msg: 'Berhasil tambah jurnal gaji regional'
+ // }
+ // context.commit("update_snackbar", snackbar)
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async saveJurnalBiaya(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.saveJurnalBiaya(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah jurnal biaya regional'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchCostPercent", {})
+
+ context.commit("update_detailJurnalBiaya", [])
+ context.commit("update_detailJurnalBiayaRegional", [])
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+ context.commit("update_balance", blc)
+ context.commit("update_balanceRegional", blc)
+ context.commit("update_costs", 0)
+ context.commit("update_searchCoa", '')
+ context.commit("update_searchCoaKas", '')
+ context.commit("update_searchCoaReg", '')
+ context.commit("update_title", '')
+ context.commit("update_description", '')
+ context.commit("update_dialogForm", false)
+ context.commit("jurnalumum/update_x_drop_tipe_jurnal", {}, {root: true});
+ const jurnalumumState = context.rootState.jurnalumum;
+
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async deleteJurnalBiaya(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.deleteJurnalBiaya(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil delete jurnal biaya regional'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchCostPercent", {})
+
+ context.commit("update_detailJurnalBiaya", [])
+ context.commit("update_detailJurnalBiayaRegional", [])
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+
+ const jurnalumumState = context.rootState.jurnalumum;
+
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+
+
+
+
+ // this.costs = 0;
+ // this.searchCoa = "";
+ // this.searchCoaKas = "";
+ // this.title = "";
+ // this.description = "";
+ // console.log("close dialogs");
+ // this.$emit("update:show", false);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async getJurnalType(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ let resp = await api.getJurnalType(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_jurnalTypeList", resp.data.records)
+ context.commit("update_selectedJurnalType", resp.data.default)
+ context.commit("update_defaultJurnalType", resp.data.default)
+
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getDefaultBranch(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+ let resp = await api.getDefaultBranch(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_defaultBranch", resp.data)
+ // context.commit("update_selectedJurnalType", resp.data.default)
+ // context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getBranchpercent(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.regional = context.state.user.S_RegionalID
+ let resp = await api.searchBranchPercent(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_branchCostPercentList", resp.data)
+ // context.commit("update_selectedJurnalType", resp.data.default)
+ // context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getPeriode(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchPeriode;
+ prm.token = one_token()
+ let resp = await api.searchPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_periodeList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoa(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoa;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaKas(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaKas;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListKas", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaReg(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaReg;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListReg", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaDetail(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaDetail;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+ prm.branch = context.state.selectedBranchDetail.branchID
+ prm.token = one_token()
+ let resp = await api.searchCoaDetail(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListDetail", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async searchKredit(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchKredit;
+ prm.token = one_token()
+ let resp = await api.searchkredit(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_kreditList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async search(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.search = context.state.searchTemplate
+ prm.page = context.state.page
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ } else {
+ context.commit("update_loading", false)
+ context.commit("update_templateList", resp.data.records)
+ context.commit("update_total", resp.data.total)
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async insertTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.insertTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogForm", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error add data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error add data')
+ }
+ },
+ async updateTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.updateTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogForm", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error edit data')
+ }
+ },
+ async deleteTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.deleteTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogAlert", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil delete data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error delete data')
+ }
+ },
+
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/modules/jurnalgaji.js b/test/vuex/acc-one-jurnal/modules/jurnalgaji.js
new file mode 100644
index 0000000..dda61fe
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/modules/jurnalgaji.js
@@ -0,0 +1,841 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/jurnalgaji.js"
+
+export default {
+ namespaced: true,
+ state: {
+ last_id: -1,
+ loading: false,
+ dialogForm: false,
+ dialogType: 'N',
+ startDate: moment(new Date()).format('YYYY-MM-DD'),
+ endDate: moment(new Date()).format('YYYY-MM-DD'),
+ selectedDate: moment(new Date()).format('YYYY-MM-DD'),
+ user: one_user(),
+ jurnalTypeList: [],
+ selectedJurnalType: {},
+ balance: {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ },
+ balanceRegional: {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ },
+ defaultJurnalType: {},
+ loading: false,
+ periodeList: [],
+ searchPeriode: '',
+ selectedPeriode: {},
+ loadingAutocomplete: false,
+ title: '',
+ coaList: [],
+ searchCoa: '',
+ selectedCoa: {},
+ sallary: 0,
+ description: '',
+ branchPercentList: [],
+ selectedBranchPercent: {},
+ defaultBranch: [],
+ detailJurnalGaji: [],
+ detailJurnalGajiRegional: [],
+ dialogAddDetail: false,
+ coaListDetail: [],
+ selectedCoaDetail: {},
+ searchCoaDetail: '',
+ coaListKas: [],
+ selectedCoaKas: {},
+ searchCoaKas: '',
+ coaListReg: [],
+ selectedCoaReg: {},
+ searchCoaReg: '',
+ selectedBranchDetail: {},
+ kreditDetail: 0,
+ snackbar: {
+ state: false,
+ color: 'success',
+ msg: ''
+ },
+ idEdit: 0,
+ },
+ mutations: {
+ update_dialogType(state, val) {
+ state.dialogType = val
+ },
+ update_idEdit(state, val) {
+ state.idEdit = val
+ },
+ update_balance(state, val) {
+ state.balance = val
+ },
+ update_balanceRegional(state, val) {
+ state.balanceRegional = val
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_kreditDetail(state, val) {
+ state.kreditDetail = val
+ },
+ update_selectedBranchDetail(state, val) {
+ state.selectedBranchDetail = val
+ },
+ update_coaListKas(state, val) {
+ state.coaListKas = val
+ },
+ update_searchCoaKas(state, val) {
+ state.searchCoaKas = val
+ },
+ update_coaListReg(state, val) {
+ state.coaListReg = val
+ },
+ update_searchCoaReg(state, val) {
+ state.searchCoaReg = val
+ },
+ update_selectedCoaReg(state, val) {
+ state.selectedCoaReg = val
+ },
+ update_selectedCoaKas(state, val) {
+ state.selectedCoaKas = val
+ },
+ update_coaListDetail(state, val) {
+ state.coaListDetail = val
+ },
+ update_searchCoaDetail(state, val) {
+ state.searchCoaDetail = val
+ },
+ update_selectedCoaDetail(state, val) {
+ state.selectedCoaDetail = val
+ },
+ update_detailJurnalGaji(state, val) {
+ state.detailJurnalGaji = val
+ },
+ update_detailJurnalGajiRegional(state, val) {
+ state.detailJurnalGajiRegional = val
+ },
+ update_dialogAddDetail(state, val) {
+ state.dialogAddDetail = val
+ },
+ update_title(state, val) {
+ state.title = val
+ },
+ update_defaultBranch(state, val) {
+ state.defaultBranch = val
+ },
+ update_branchPercentList(state, val) {
+ state.branchPercentList = val
+ },
+ update_selectedBranchPercent(state, val) {
+ state.selectedBranchPercent = val
+ },
+ update_selectedDate(state, val) {
+ state.selectedDate = val
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val
+ },
+ update_coaList(state, val) {
+ state.coaList = val
+ },
+ update_searchCoa(state, val) {
+ state.searchCoa = val
+ },
+ update_selectedCoa(state, val) {
+ state.selectedCoa = val
+ },
+ update_selectedPeriode(state, val) {
+ state.selectedPeriode = val
+ },
+ update_searchPeriode(state, val) {
+ state.searchPeriode = val
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_defaultJurnalType(state, val) {
+ state.defaultJurnalType = val
+ },
+ update_selectedJurnalType(state, val) {
+ state.selectedJurnalType = val
+ },
+ update_jurnalTypeList(state, val) {
+ state.jurnalTypeList = val
+ },
+ update_dialogForm(state, val) {
+ state.dialogForm = val
+ },
+ update_startDate(state, val) {
+ state.startDate = val
+ },
+ update_endDate(state, val) {
+ state.endDate = val
+ },
+ update_sallary(state, val) {
+ state.sallary = val
+ },
+ update_description(state, val) {
+ state.description = val
+ },
+ },
+ actions: {
+ countSummary(context) {
+ let kredit = 0;
+ let debet = 0;
+ context.state.detailJurnalGaji.forEach((e) => {
+ if (e.type === "D") {
+ debet = parseFloat(e.debet) + debet;
+ }
+ if (e.type === "K") {
+ kredit = parseFloat(e.kredit) + kredit;
+ }
+ });
+ let total = debet - kredit;
+
+ let summary = {
+ debet: debet,
+ kredit: kredit,
+ balance: total,
+ };
+ context.commit("update_balance", summary)
+ // this.balance = summary;
+ },
+ countSummaryRegional(context) {
+ let kredit = 0;
+ let debet = 0;
+ context.state.detailJurnalGajiRegional.forEach((e) => {
+ if (e.type === "D") {
+ debet = parseFloat(e.debet) + debet;
+ }
+ if (e.type === "K") {
+ kredit = parseFloat(e.kredit) + kredit;
+ }
+ });
+ let total = debet - kredit;
+
+ let summary = {
+ debet: debet,
+ kredit: kredit,
+ balance: total,
+ };
+ context.commit("update_balanceRegional", summary)
+
+ },
+ async getDetail(context, prm) {
+ context.commit("update_loading", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.getDetail(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp.data);
+ // setTimeout(() => {
+ // // Tambahkan logika yang ingin dijalankan setelah 3 detik di sini
+ // console.log("Timer selesai, menjalankan sesuatu setelah 3 detik");
+ // context.commit("update_loading", false)
+ // }, 3000);
+ context.commit("update_selectedPeriode", resp.data.periode)
+ context.commit("update_searchPeriode", resp.data.periode.display)
+ context.commit("update_title", resp.data.title)
+ context.commit("update_selectedDate", resp.data.date)
+ context.commit("update_selectedCoa", resp.data.coa)
+ context.commit("update_searchCoa", resp.data.coa.display)
+ context.commit("update_selectedCoaKas", resp.data.coaKas)
+ context.commit("update_searchCoaKas", resp.data.coaKas.display ?? '')
+ context.commit("update_selectedCoaReg", resp.data.coaReg)
+ context.commit("update_searchCoaReg", resp.data.coaReg.display ?? '')
+ context.commit("update_sallary", resp.data.sallary)
+ context.commit("update_description", resp.data.description)
+ context.commit("update_detailJurnalGaji", resp.data.jurnalDetail)
+ context.commit("update_detailJurnalGajiRegional", resp.data.jurnalDetailRegional)
+ context.commit("update_dialogType", resp.data.type)
+ context.commit("update_selectedBranchPercent", resp.data.branchPrecent)
+ context.dispatch("countSummary")
+ context.dispatch("countSummaryRegional")
+ context.commit("update_loading", false)
+
+ // let snackbar = {
+ // state: true,
+ // color: 'success',
+ // msg: 'Berhasil tambah jurnal gaji regional'
+ // }
+ // context.commit("update_snackbar", snackbar)
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async saveJurnalGaji(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.saveJurnalGaji(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah jurnal gaji regional'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchPercent", {})
+
+ context.commit("update_detailJurnalGaji", [])
+ context.commit("update_detailJurnalGajiRegional", [])
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+ context.commit("update_balance", blc)
+ context.commit("update_balanceRegional", blc)
+ context.commit("update_sallary", 0)
+ context.commit("update_searchCoa", '')
+ context.commit("update_searchCoaKas", '')
+ context.commit("update_searchCoaReg", '')
+ context.commit("update_title", '')
+ context.commit("update_description", '')
+ context.commit("update_dialogForm", false)
+ context.commit("jurnalumum/update_x_drop_tipe_jurnal", {}, {root: true});
+ const jurnalumumState = context.rootState.jurnalumum;
+ // console.log("Data Jurnal Umum:", jurnalumumState);
+ // this.$store.dispatch("jurnalumum/search", {
+ // regionalid: this.$store.state.jurnalumum.user.S_RegionalID,
+ // branchid: this.$store.state.jurnalumum.user.M_BranchID,
+ // current_page: this.$store.state.jurnalumum.current_page,
+ // search: this.$store.state.jurnalumum.x_search,
+ // startdate: this.$store.state.jurnalumum.start_date,
+ // enddate: this.$store.state.jurnalumum.end_date,
+ // last_id: -1,
+ // });
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+
+
+
+
+ // this.sallary = 0;
+ // this.searchCoa = "";
+ // this.searchCoaKas = "";
+ // this.title = "";
+ // this.description = "";
+ // console.log("close dialogs");
+ // this.$emit("update:show", false);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async deleteJurnalgaji(context, prm) {
+ context.commit("update_loading", true)
+ try {
+
+ prm.token = one_token()
+ let resp = await api.deleteJurnalgaji(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil delete jurnal gaji regional'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_selectedPeriode", {})
+ context.commit("update_selectedCoa", {})
+ context.commit("update_coaList", [])
+ context.commit("update_coaListKas", [])
+ context.commit("update_selectedCoaKas", {})
+ context.commit("update_selectedBranchPercent", {})
+
+ context.commit("update_detailJurnalGaji", [])
+ context.commit("update_detailJurnalGajiRegional", [])
+
+ let blc = {
+ debet: 0,
+ kredit: 0,
+ balance: 0,
+ };
+
+ const jurnalumumState = context.rootState.jurnalumum;
+
+ context.dispatch("jurnalumum/search", {
+ regionalid: jurnalumumState.user.S_RegionalID,
+ branchid: jurnalumumState.user.M_BranchID,
+ current_page: jurnalumumState.current_page,
+ search: jurnalumumState.x_search,
+ startdate: jurnalumumState.start_date,
+ enddate: jurnalumumState.end_date,
+ last_id: -1,
+ }, { root: true });
+
+
+
+
+ // this.sallary = 0;
+ // this.searchCoa = "";
+ // this.searchCoaKas = "";
+ // this.title = "";
+ // this.description = "";
+ // console.log("close dialogs");
+ // this.$emit("update:show", false);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: e.message
+ }
+ context.commit("update_snackbar", snackbar)
+ }
+ },
+ async getJurnalType(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ let resp = await api.getJurnalType(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_jurnalTypeList", resp.data.records)
+ context.commit("update_selectedJurnalType", resp.data.default)
+ context.commit("update_defaultJurnalType", resp.data.default)
+
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getDefaultBranch(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+ let resp = await api.getDefaultBranch(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_defaultBranch", resp.data)
+ // context.commit("update_selectedJurnalType", resp.data.default)
+ // context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getBranchpercent(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ prm.regional = context.state.user.S_RegionalID
+ let resp = await api.searchBranchPercent(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loading", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_branchPercentList", resp.data)
+ // context.commit("update_selectedJurnalType", resp.data.default)
+ // context.commit("update_defaultJurnalType", resp.data.default)
+
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async getPeriode(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchPeriode;
+ prm.token = one_token()
+ let resp = await api.searchPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_periodeList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoa(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoa;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaKas(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaKas;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListKas", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaReg(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaReg;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListReg", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async getCoaDetail(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoaDetail;
+ prm.company = context.state.user.M_BranchCompanyID
+ prm.regional = context.state.user.S_RegionalID
+ prm.branch = context.state.selectedBranchDetail.branchID
+ prm.token = one_token()
+ let resp = await api.searchCoaDetail(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_coaListDetail", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async searchKredit(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchKredit;
+ prm.token = one_token()
+ let resp = await api.searchkredit(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(resp);
+ } else {
+ console.log(resp);
+ context.commit("update_loadingAutocomplete", false)
+ // let cek = 0;
+ // if (parseInt(resp.data) > 0) {
+ // cek = true
+ // }
+ context.commit("update_kreditList", resp.data)
+
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+ async search(context) {
+ context.commit("update_loading", true)
+ try {
+ let prm = {}
+ prm.search = context.state.searchTemplate
+ prm.page = context.state.page
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading", false)
+ } else {
+ context.commit("update_loading", false)
+ context.commit("update_templateList", resp.data.records)
+ context.commit("update_total", resp.data.total)
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loading", false)
+ console.log(e)
+ }
+ },
+ async insertTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.insertTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogForm", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil tambah data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error add data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error add data')
+ }
+ },
+ async updateTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.updateTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogForm", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error edit data')
+ }
+ },
+ async deleteTemplate(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.deleteTemplate(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.dispatch("search");
+ context.commit("update_dialogAlert", false)
+ let snackbar = {
+ state: true,
+ color: 'success',
+ msg: 'Berhasil delete data'
+ }
+ context.commit("update_snackbar", snackbar)
+
+ context.commit("update_loadingSave", false)
+
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: 'Error edit data'
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log('error delete data')
+ }
+ },
+
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/modules/jurnalumum.js b/test/vuex/acc-one-jurnal/modules/jurnalumum.js
new file mode 100644
index 0000000..0008958
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/modules/jurnalumum.js
@@ -0,0 +1,446 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+
+import * as api from "../api/jurnalumum.js";
+
+export default {
+ namespaced: true,
+ state: {
+ // state listing
+ search_status: 0,
+ current_page: 1,
+ x_search: "",
+ search_error_message: "",
+ last_id: -1,
+ jurnalumums: [],
+ total_jurnalumum: 0,
+ selected_jurnalumum: {},
+ start_date: moment(new Date().getFullYear() + '-01-01').format('YYYY-MM-DD'),
+ end_date: moment(new Date()).format('YYYY-MM-DD'),
+ open_dialog_info: false,
+ msg_info: "",
+ drop_tipe_jurnal: [],
+ x_drop_tipe_jurnal: {},
+ dialogjurnaltype: false,
+ open_print: false,
+
+ // state jurnal umum
+ user: one_user(),
+ dialog_is_active: false,
+ loading_jurnaltype: false,
+ jurnaltypes: [],
+ selected_jurnaltype: {},
+ selected_jurnaltype_u: {},
+ xdate: moment(new Date()).format('YYYY-MM-DD'),
+ periodes: [],
+ selected_periode: {},
+ autocomplete_status: 0,
+ dialogdetail: false,
+ coalist: [],
+ selected_coa: {},
+ errors: [],
+ errors_save_jurnal: [],
+ xsummary: { "debit": 0, "credit": 0, "balance": 0 },
+ open_dialog_detail_info: false,
+ msg_detail_info: "",
+ save_status: 0,
+ save_error_message: "",
+ alert_error: false,
+ alert_success: false,
+ msg_success: "",
+ act: "",
+ title: "",
+ deskripsi: "",
+ jurnaldetails: [],
+ selected_jurnaldetail: {},
+ periodeStartDate: moment(new Date()).format('YYYY-MM-DD'),
+ periodeEndDate: moment(new Date()).format('YYYY-MM-DD'),
+ is_posted: ""
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_current_page(state, val) {
+ state.current_page = val
+ },
+ update_x_search(state, val) {
+ state.x_search = val
+ state.current_page = 1
+ },
+ update_search_error_message(state, val) {
+ state.search_error_message = val
+ },
+ update_last_id(state, val) {
+ state.last_id = val
+ },
+ update_jurnalumums(state, val) {
+ state.jurnalumums = val
+ },
+ update_total_jurnalumum(state, val) {
+ state.total_jurnalumum = val
+ },
+ update_selected_jurnalumum(state, val) {
+ state.selected_jurnalumum = val
+ },
+ update_start_date(state, val) {
+ state.start_date = val
+ },
+ update_end_date(state, val) {
+ state.end_date = val
+ },
+ update_open_dialog_info(state, val) {
+ state.open_dialog_info = val
+ },
+ update_msg_info(state, val) {
+ state.msg_info = val
+ },
+ update_drop_tipe_jurnal(state, val) {
+ state.drop_tipe_jurnal = val
+ },
+ update_x_drop_tipe_jurnal(state, val) {
+ state.x_drop_tipe_jurnal = val
+ },
+ update_open_print(state, value) {
+ state.open_print = value
+ },
+
+ // state jurnal umum
+ update_user(state, val) {
+ state.user = val
+ },
+ update_dialog_is_active(state, val) {
+ state.dialog_is_active = val
+ },
+ update_loading_jurnaltype(state, val) {
+ state.loading_jurnaltype = val
+ },
+ update_jurnaltypes(state, val) {
+ state.jurnaltypes = val
+ },
+ update_selected_jurnaltype(state, val) {
+ state.selected_jurnaltype = val
+ },
+ update_selected_jurnaltype_u(state, val) {
+ state.selected_jurnaltype_u = val
+ },
+ update_xdate(state, val) {
+ state.xdate = val
+ },
+ update_periodes(state, val) {
+ state.periodes = val
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val
+ },
+ update_autocomplete_status(state, val) {
+ state.update_autocomplete_status = val
+ },
+ update_dialogdetail(state, val) {
+ state.dialogdetail = val
+ },
+ update_coalist(state, val) {
+ state.coalist = val
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val
+ },
+ update_errors(state, val) {
+ state.errors = val
+ },
+ update_errors_save_jurnal(state, val) {
+ state.errors_save_jurnal = val
+ },
+ update_xsummary(state, val) {
+ state.xsummary = val
+ },
+ update_open_dialog_detail_info(state, val) {
+ state.open_dialog_detail_info = val
+ },
+ update_msg_detail_info(state, val) {
+ state.msg_detail_info = val
+ },
+ update_msg_detail_info(state, val) {
+ state.msg_detail_info = val
+ },
+ update_save_status(state, val) {
+ state.save_status = val
+ },
+ update_save_error_message(state, val) {
+ state.save_error_message = val
+ },
+ update_alert_error(state, val) {
+ state.alert_error = val
+ },
+ update_alert_success(state, val) {
+ state.alert_success = val
+ },
+ update_msg_success(state, val) {
+ state.msg_success = val
+ },
+ update_act(state, val) {
+ state.act = val
+ },
+ update_title(state, val) {
+ state.title = val
+ },
+ update_deskripsi(state, val) {
+ state.deskripsi = val
+ },
+ update_jurnaldetails(state, val) {
+ state.jurnaldetails = val
+ },
+ update_selected_jurnaldetail(state, val) {
+ state.selected_jurnaldetail = val
+ },
+ update_periodeStartDate(state, val) {
+ state.periodeStartDate = val
+ },
+ update_periodeEndDate(state, val) {
+ state.periodeEndDate = val
+ },
+ update_is_posted(state, val) {
+ state.is_posted = val
+ },
+ update_dialogjurnaltype(state, val) {
+ state.dialogjurnaltype = val
+ }
+ },
+ actions: {
+ async search(context, prm) {
+ context.commit("update_search_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.search(prm)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", resp.message)
+ context.commit("update_msg_info", resp.message)
+ context.commit("update_open_dialog_info", true)
+ } else {
+ context.commit("update_search_status", 2)
+ context.commit("update_search_error_message", "")
+ context.commit("update_msg_info", resp.message)
+ let data = {
+ records: resp.data.records,
+ total: resp.data.total
+ }
+
+ context.commit("update_jurnalumums", data.records)
+ context.commit("update_total_jurnalumum", data.total)
+ }
+ } catch (e) {
+ context.commit("update_search_status", 3)
+ context.commit("update_search_error_message", e.message)
+ context.commit("update_msg_info", e.message)
+ context.commit("update_open_dialog_info", true)
+ }
+ },
+
+ async openjurnaltype(context) {
+ context.commit("update_loading_jurnaltype", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ let resp = await api.getjurnaltype(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading_jurnaltype", false)
+ } else {
+ context.commit("update_loading_jurnaltype", false)
+ context.commit("update_drop_tipe_jurnal", resp.data.records)
+ }
+ } catch (e) {
+ context.commit("update_loading_jurnaltype", false)
+ }
+ },
+
+ // jurnal umum
+ async getjurnaltype(context) {
+ context.commit("update_loading_jurnaltype", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ let resp = await api.getjurnaltype(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loading_jurnaltype", false)
+ } else {
+ context.commit("update_loading_jurnaltype", false)
+ context.commit("update_jurnaltypes", resp.data.records)
+ context.commit("update_selected_jurnaltype", resp.data.defaultju)
+ context.commit("update_selected_jurnaltype_u", resp.data.defaultju)
+ }
+ } catch (e) {
+ context.commit("update_loading_jurnaltype", false)
+ }
+ },
+
+ async getperiode(context, prm) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let resp = await api.getperiode(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3)
+ context.commit("update_search_error_message", resp.message)
+ } else {
+ context.commit("update_autocomplete_status", 2)
+ context.commit("update_search_error_message", "")
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_periodes", data.records)
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3)
+ context.commit("update_search_error_message", e.message)
+ }
+ },
+
+ async searchcoa(context, prm) {
+ context.commit("update_autocomplete_status", 1)
+ try {
+ let resp = await api.searchcoa(one_token(), prm)
+ if (resp.status != "OK") {
+ context.commit("update_autocomplete_status", 3)
+ context.commit("update_search_error_message", resp.message)
+ } else {
+ context.commit("update_autocomplete_status", 2)
+ context.commit("update_search_error_message", "")
+ let data = {
+ records: resp.data.records
+ }
+
+ context.commit("update_coalist", data.records)
+ }
+ } catch (e) {
+ context.commit("update_autocomplete_status", 3)
+ context.commit("update_search_error_message", e.message)
+ }
+ },
+
+ async savejurnalumum(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.savejurnalumum(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", resp.message)
+ context.commit("update_alert_error", true)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ if (data.total !== -1) {
+ context.commit("update_alert_success", true)
+ var msg = " Journal " + prm.title + " berhasil di ditambahkan"
+ context.commit("update_msg_success", msg)
+ context.dispatch("search", {
+ regionalid: context.state.user.S_RegionalID,
+ branchid: context.state.user.M_BranchID,
+ current_page: context.state.current_page,
+ search: context.state.x_search,
+ startdate: context.state.start_date,
+ enddate: context.state.end_date,
+ last_id: -1
+ })
+ } else {
+ context.commit("update_errors_save_jurnal", [])
+
+ }
+
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", e.message)
+ context.commit("update_alert_error", true)
+ }
+ },
+
+ async editjurnalumum(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.editjurnalumum(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", resp.message)
+ context.commit("update_alert_error", true)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ if (data.total !== -1) {
+ context.commit("update_alert_success", true)
+ var msg = " Journal " + prm.title + " berhasil di diupdate"
+ context.commit("update_msg_success", msg)
+ context.dispatch("search", {
+ regionalid: context.state.user.S_RegionalID,
+ branchid: context.state.user.M_BranchID,
+ current_page: context.state.current_page,
+ search: context.state.x_search,
+ startdate: context.state.start_date,
+ enddate: context.state.end_date,
+ last_id: -1
+ })
+ } else {
+ context.commit("update_errors_save_jurnal", [])
+ }
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", e.message)
+ context.commit("update_alert_error", true)
+ }
+ },
+
+ async deletejurnalumum(context, prm) {
+ context.commit("update_save_status", 1)
+ try {
+ prm.token = one_token()
+ let resp = await api.deletejurnalumum(prm)
+ if (resp.status != "OK") {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", resp.message)
+ context.commit("update_alert_error", true)
+ } else {
+ context.commit("update_save_status", 2)
+ context.commit("update_save_error_message", resp.message)
+ let data = {
+ total: resp.data.total
+ }
+
+ if (data.total !== -1) {
+ context.commit("update_alert_success", true)
+ var msg = " Journal " + prm.title + " berhasil dihapus"
+ context.commit("update_msg_success", msg)
+ context.dispatch("search", {
+ regionalid: context.state.user.S_RegionalID,
+ branchid: context.state.user.M_BranchID,
+ current_page: context.state.current_page,
+ search: context.state.x_search,
+ startdate: context.state.start_date,
+ enddate: context.state.end_date,
+ last_id: -1
+ })
+ } else {
+ context.commit("update_errors_save_jurnal", [])
+
+ }
+
+ }
+ } catch (e) {
+ context.commit("update_save_status", 3)
+ context.commit("update_save_error_message", e.message)
+ context.commit("update_alert_error", true)
+ }
+ },
+ },
+};
diff --git a/test/vuex/acc-one-jurnal/modules/pengeluaranbarang.js b/test/vuex/acc-one-jurnal/modules/pengeluaranbarang.js
new file mode 100644
index 0000000..1a7569e
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/modules/pengeluaranbarang.js
@@ -0,0 +1,404 @@
+import * as api from "../api/pengeluaranbarang.js";
+
+export default {
+ namespaced: true,
+ state: {
+ search_status: 0,
+ insert_status: 0,
+ insert_error: '',
+ current_page: 1,
+
+ user: one_user(),
+ keluar_barang_dialog: false,
+ selected_jurnal_type: {},
+ periode_start_date: moment(new Date()).format('YYYY-MM-DD'),
+ periode_end_date: moment(new Date()).format('YYYY-MM-DD'),
+
+ input_company: one_user().M_BranchCompanyName,
+ input_regional: one_user().S_RegionalName,
+ input_cabang: one_user().M_BranchName,
+ input_date: moment(new Date()).format('YYYY-MM-DD'),
+ input_title: "",
+ input_description: "",
+ list_periode: [],
+ selected_periode: {},
+
+
+ detail_dialog: false,
+ table_detail: [],
+ list_coa: [],
+ selected_coa: {},
+ input_detail_debet: 0,
+ input_detail_kredit: 0,
+ summary_detail: {
+ total_debet: 0,
+ total_kredit: 0,
+ total_balance: 0
+ },
+
+ opp_type: "add",
+ crud_jurnal_status: 0,
+ crud_jurnal: {
+ state: false,
+ msg: "",
+ color: "error"
+ },
+
+ current_jurnal: {}
+ },
+ mutations: {
+ update_search_status(state, val) {
+ state.search_status = val
+ },
+ update_insert_status(state, val) {
+ state.insert_status = val
+ },
+ update_insert_error(state, val) {
+ state.insert_error = val
+ },
+ update_current_page(state, val) {
+ state.current_page = val
+ },
+ update_user(state, val) {
+ state.user = val
+ },
+ update_pengeluaran_barang_dialog(state, val) {
+ state.keluar_barang_dialog = val
+ },
+ update_selected_jurnal_type(state, val) {
+ state.selected_jurnal_type = val
+ },
+ update_periode_start_date(state, val) {
+ state.periode_start_date = val
+ },
+ update_periode_end_date(state, val) {
+ state.periode_end_date = val
+ },
+ update_input_company(state, val) {
+ state.input_company = val
+ },
+ update_input_regional(state, val) {
+ state.input_regional = val
+ },
+ update_input_cabang(state, val) {
+ state.input_cabang = val
+ },
+ update_input_date(state, val) {
+ state.input_date = val
+ },
+ update_input_title(state, val) {
+ state.input_title = val
+ },
+ update_input_description(state, val) {
+ state.input_description = val
+ },
+ update_list_periode(state, val) {
+ state.list_periode = val
+ },
+ update_selected_periode(state, val) {
+ state.selected_periode = val
+ },
+ update_list_coa(state, val) {
+ state.list_coa = val
+ },
+ update_selected_coa(state, val) {
+ state.selected_coa = val
+ },
+ update_detail_dialog(state, val) {
+ state.detail_dialog = val
+ },
+ update_table_detail(state, val) {
+ state.table_detail = val
+ },
+ update_summary_detail(state, val) {
+ state.summary_detail = val
+ },
+ update_input_detail_debet(state, val) {
+ state.input_detail_debet = val
+ },
+ update_input_detail_kredit(state, val) {
+ state.input_detail_kredit = val
+ },
+ update_crud_jurnal_status(state, val) {
+ state.crud_jurnal_status = val
+ },
+ update_crud_jurnal(state, val) {
+ state.crud_jurnal = val
+ },
+ update_opp_type(state, val) {
+ state.opp_type = val
+ },
+ update_current_jurnal(state, val) {
+ state.current_jurnal = val
+ }
+ },
+ actions: {
+ async getperiode(context, params) {
+ context.commit("update_search_status", 1)
+ try {
+ params.token = one_token()
+ let resp = await api.get_periode(params)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ } else {
+ context.commit("update_list_periode", resp.data.records)
+ context.commit("update_search_status", 2)
+ }
+ } catch (error) {
+ context.commit("update_search_status", 3)
+ }
+ },
+ async getcoa(context, params) {
+ context.commit("update_search_status", 1)
+ try {
+ params.token = one_token()
+ let resp = await api.get_coa(params)
+ if (resp.status != "OK") {
+ context.commit("update_search_status", 3)
+ } else {
+ context.commit("update_list_coa", resp.data.records)
+ context.commit("update_search_status", 2)
+ }
+ } catch (error) {
+ context.commit("update_search_status", 3)
+ }
+ },
+ async add_detail_table(context, params) {
+ context.commit("update_insert_status", 1)
+ try {
+ let curr_detail = context.state.table_detail
+ curr_detail.push(params)
+
+ let k = 0
+ let d = 0
+ curr_detail.forEach(item => {
+ d += parseFloat(Number(item.debet).toFixed(2))
+ k += parseFloat(Number(item.kredit).toFixed(2))
+ });
+
+ let summary = {
+ total_kredit: k,
+ total_debet: d,
+ total_balance: (d - k)
+ }
+
+
+ context.commit("update_table_detail", curr_detail)
+ context.commit("update_summary_detail", summary)
+ context.commit("update_insert_status", 2)
+ } catch (error) {
+ context.commit("update_insert_error", "error insert detail jurnal")
+ context.commit("update_insert_status", 3)
+ }
+ },
+ async del_detail_table(context, params) {
+ context.commit("update_insert_status", 1)
+ try {
+ let curr_detail = context.state.table_detail
+ if (params > -1) {
+ curr_detail.splice(params, 1)
+ }
+
+ let k = 0
+ let d = 0
+ if (Object.keys(curr_detail).length > 0) {
+ curr_detail.forEach(item => {
+ d += parseFloat(Number(item.debet).toFixed(2))
+ k += parseFloat(Number(item.kredit).toFixed(2))
+ })
+ }
+
+ let summary = {
+ total_kredit: k,
+ total_debet: d,
+ total_balance: (d - k)
+ }
+
+ context.commit("update_table_detail", curr_detail)
+ context.commit("update_summary_detail", summary)
+ context.commit("update_insert_status", 2)
+ } catch (error) {
+ context.commit("update_insert_error", "error delete detail jurnal")
+ context.commit("update_insert_status", 3)
+ }
+ },
+ async simpan_jurnal(context, params) {
+ context.commit("update_crud_jurnal_status", 1)
+ try {
+ params.token = one_token()
+ let resp = await api.simpanjurnal(params)
+ if (resp.status != "OK") {
+ let a = {
+ state: true,
+ msg: resp.message,
+ color: "error"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 3)
+ } else {
+ let a = {
+ state: true,
+ msg: "Sukses",
+ color: "success"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 2)
+ context.commit("update_pengeluaran_barang_dialog", false)
+
+ context.dispatch('jurnalumum/search', {
+ current_page: context.rootState.jurnalumum.current_page,
+ search: context.rootState.jurnalumum.x_search,
+ startdate: context.rootState.jurnalumum.start_date,
+ enddate: context.rootState.jurnalumum.end_date,
+ regionalid: context.rootState.jurnalumum.user.S_RegionalID,
+ branchid: context.rootState.jurnalumum.user.M_BranchID,
+ last_id: -1
+ }, { root: true })
+ }
+ } catch (error) {
+ let a = {
+ state: true,
+ msg: error.message,
+ color: "error"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 3)
+ }
+ },
+ async load_jurnal(context, params) {
+ try {
+ params.token = one_token()
+ let resp = await api.getdetailjurnal(params)
+ if (resp.status != "OK") {
+
+ } else {
+ let sel_jurnal = {
+ JurnalTypeID: resp.data.jurnal.JurnalTypeID,
+ JurnalTypeCode: resp.data.jurnal.JurnalTypeCode,
+ JurnalTypeName: resp.data.jurnal.JurnalTypeName,
+ JurnalTypeAccesRight: resp.data.jurnal.JurnalTypeAccesRight,
+ JurnalTypeIsActive: resp.data.jurnal.JurnalTypeIsActive
+ }
+ context.commit("update_selected_jurnal_type", sel_jurnal)
+
+ let sel_periode = resp.data.periode
+ context.commit("update_selected_periode", sel_periode)
+
+ let in_title = resp.data.jurnal.jurnalTitle
+ context.commit("update_input_title", in_title)
+ let in_desc = resp.data.jurnal.jurnalDescription
+ context.commit("update_input_description", in_desc)
+ let in_date = resp.data.jurnal.jurnalDate
+ context.commit("update_input_date", in_date)
+
+ let j_detail = resp.data.jurnaldetail
+ context.commit("update_table_detail", j_detail)
+
+ let k = 0
+ let d = 0
+ j_detail.forEach(item => {
+ d += parseFloat(Number(item.debet).toFixed(2))
+ k += parseFloat(Number(item.kredit).toFixed(2))
+ })
+
+ let summary = {
+ total_kredit: k,
+ total_debet: d,
+ total_balance: (d - k)
+ }
+ context.commit("update_summary_detail", summary)
+ context.commit("update_current_jurnal", resp.data.jurnal)
+ }
+ } catch (error) {
+ let a = {
+ state: true,
+ msg: error.message,
+ color: "error"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 3)
+ }
+ },
+ async edit_jurnal(context, params) {
+ try {
+ context.commit("update_opp_type", "edit")
+ context.dispatch("load_jurnal", params)
+ context.commit("update_pengeluaran_barang_dialog", true)
+ } catch (error) {
+ console.log(error)
+ }
+ },
+ async simpan_edit_jurnal(context, params) {
+ context.commit("update_crud_jurnal_status", 1)
+ try {
+ params.token = one_token()
+ let resp = await api.editdetailjurnal(params)
+ if (resp.status != "OK") {
+ let a = {
+ state: true,
+ msg: resp.message,
+ color: "error"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 3)
+ } else {
+ let a = {
+ state: true,
+ msg: "Sukses",
+ color: "success"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 2)
+ context.commit("update_pengeluaran_barang_dialog", false)
+
+ context.dispatch('jurnalumum/search', {
+ current_page: context.rootState.jurnalumum.current_page,
+ search: context.rootState.jurnalumum.x_search,
+ startdate: context.rootState.jurnalumum.start_date,
+ enddate: context.rootState.jurnalumum.end_date,
+ regionalid: context.rootState.jurnalumum.user.S_RegionalID,
+ branchid: context.rootState.jurnalumum.user.M_BranchID,
+ last_id: -1
+ }, { root: true })
+ }
+ } catch (error) {
+ let a = {
+ state: true,
+ msg: error.message,
+ color: "error"
+ }
+ context.commit("update_crud_jurnal", a)
+ context.commit("update_crud_jurnal_status", 3)
+ }
+ },
+ async add_jurnal(context) {
+ try {
+ context.commit("update_opp_type", "add")
+
+ context.commit("update_input_company", context.state.user.M_BranchCompanyName)
+ context.commit("update_input_regional", context.state.user.S_RegionalName)
+ context.commit("update_input_cabang", context.state.user.M_BranchName)
+ context.commit("update_selected_jurnal_type", context.rootState.jurnalumum.x_drop_tipe_jurnal)
+
+ context.commit("update_selected_periode", {})
+ context.commit("update_input_date", moment(new Date()).format('YYYY-MM-DD'))
+ context.commit("update_input_title", "")
+ context.commit("update_input_description", "")
+
+ context.commit("update_table_detail", [])
+ context.commit("update_selected_coa", {})
+ context.commit("update_input_detail_debet", 0)
+ context.commit("update_input_detail_kredit", 0)
+ let summary = {
+ total_kredit: 0,
+ total_debet: 0,
+ total_balance: 0
+ }
+ context.commit("update_summary_detail", summary)
+ context.commit("update_pengeluaran_barang_dialog", true)
+ } catch (error) {
+ console.log(error)
+ }
+ }
+ }
+};
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/modules/terimaBarang.js b/test/vuex/acc-one-jurnal/modules/terimaBarang.js
new file mode 100644
index 0000000..8c51a01
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/modules/terimaBarang.js
@@ -0,0 +1,382 @@
+// 1 => LOADING
+// 2 => DONE
+// 3 => ERROR
+import * as api from "../api/terimaBarang.js"
+
+export default {
+ namespaced: true,
+ state: {
+ user: one_user(),
+ dialogJurnalTerimaBarang: false,
+ selectedJurnalType: {},
+ jurnalTypeList: [],
+ defaultJurnalType: {},
+ selectedDate: moment(new Date()).format('YYYY-MM-DD'),
+ searchPeriode: '',
+ selectedPeriode: {},
+ periodeList: [],
+ loadingAutocomplete: false,
+ searchSupplier: '',
+ supplierList: [],
+ selectedSupplier: {},
+ jurnalTitle: '',
+ grniValue: '',
+ invoiceValue: '',
+ jurnalDescription: '',
+ searchCoa: '',
+ selectedCoa: {},
+ coaList: [],
+ kreditValue: 0,
+ debitValue: 0,
+ errorsAddDetail: [],
+ errorsAddJurnal: [],
+ detailsJurnalTerimaBarang: [],
+ detailSum: { debit: 0, credit: 0, balance: 0 },
+ loadingSave: false,
+ dialogForm: false,
+ snackbar: {
+ state: false,
+ color: 'success',
+ msg: ''
+ },
+ act: "",
+ // Untuk Edit Dialog
+ companyInfo: {},
+ isPosted: false,
+ selectedJurnal: {},
+
+ last_id: -1,
+ loading: false,
+ startDate: moment(new Date()).format('YYYY-MM-DD'),
+ endDate: moment(new Date()).format('YYYY-MM-DD'),
+ loading: false,
+ sallary: 0,
+ description: '',
+ branchPercentList: [],
+ selectedBranchPercent: {},
+ },
+ mutations: {
+ update_dialogJurnalTerimaBarang(state, val) {
+ state.dialogJurnalTerimaBarang = val
+ },
+ update_selectedJurnalType(state, val) {
+ state.selectedJurnalType = val
+ },
+ update_jurnalTypeList(state, val) {
+ state.jurnalTypeList = val
+ },
+ update_defaultJurnalType(state, val) {
+ state.defaultJurnalType = val
+ },
+ update_selectedDate(state, val) {
+ state.selectedDate = val
+ },
+ update_searchPeriode(state, val) {
+ state.searchPeriode = val
+ },
+ update_selectedPeriode(state, val) {
+ state.selectedPeriode = val
+ },
+ update_periodeList(state, val) {
+ state.periodeList = val
+ },
+ update_loadingAutocomplete(state, val) {
+ state.loadingAutocomplete = val
+ },
+ update_searchSupplier(state, val) {
+ state.searchSupplier = val
+ },
+ update_selectedSupplier(state, val) {
+ state.selectedSupplier = val
+ },
+ update_supplierList(state, val) {
+ state.supplierList = val
+ },
+ update_jurnalTitle(state, val) {
+ state.jurnalTitle = val
+ },
+ update_grniValue(state, val) {
+ state.grniValue = val
+ },
+ update_invoiceValue(state, val) {
+ state.invoiceValue = val
+ },
+ update_debitValue(state, val) {
+ state.debitValue = val
+ },
+ update_jurnalDescription(state, val) {
+ state.jurnalDescription = val
+ },
+ update_kreditValue(state, val) {
+ state.kreditValue = val
+ },
+ update_coaList(state, val) {
+ state.coaList = val
+ },
+ update_searchCoa(state, val) {
+ state.searchCoa = val
+ },
+ update_selectedCoa(state, val) {
+ state.selectedCoa = val
+ },
+ update_errorsAddDetail(state, val) {
+ state.errorsAddDetail = val
+ },
+ update_errorsAddJurnal(state, val) {
+ state.errorsAddJurnal = val
+ },
+ update_detailsJurnalTerimaBarang(state, val) {
+ state.detailsJurnalTerimaBarang = val
+ },
+ update_detailSum(state, val) {
+ state.detailSum = val
+ },
+ update_loadingSave(state, val) {
+ state.loadingSave = val
+ },
+ update_snackbar(state, val) {
+ state.snackbar = val
+ },
+ update_actForm(state, val) {
+ state.act = val
+ },
+ update_companyInfo(state, val) {
+ state.companyInfo = val
+ },
+ update_isPosted(state, val) {
+ state.isPosted = val
+ },
+ update_selectedJurnal(state, val) {
+ state.selectedJurnal = val
+ },
+
+
+ /* NOT USED YET */
+ update_defaultBranch(state, val) {
+ state.defaultBranch = val
+ },
+ update_branchPercentList(state, val) {
+ state.branchPercentList = val
+ },
+ update_selectedBranchPercent(state, val) {
+ state.selectedBranchPercent = val
+ },
+ update_loading(state, val) {
+ state.loading = val
+ },
+ update_dialogForm(state, val) {
+ state.dialogForm = val
+ },
+ update_startDate(state, val) {
+ state.startDate = val
+ },
+ update_endDate(state, val) {
+ state.endDate = val
+ },
+ update_sallary(state, val) {
+ state.sallary = val
+ },
+
+ },
+ actions: {
+ async getJurnalType(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.token = one_token()
+ let resp = await api.getJurnalType(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ } else {
+ context.commit("update_loadingAutocomplete", false)
+ context.commit("update_jurnalTypeList", resp.data.records)
+ context.commit("update_selectedJurnalType", resp.data.default)
+ context.commit("update_defaultJurnalType", resp.data.default)
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+
+ async getPeriode(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchPeriode;
+ prm.token = one_token()
+ let resp = await api.searchPeriode(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ } else {
+ context.commit("update_loadingAutocomplete", false)
+ context.commit("update_periodeList", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+
+ async getSupplier(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchSupplier;
+ prm.token = one_token()
+ let resp = await api.searchSupplier(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ } else {
+ context.commit("update_loadingAutocomplete", false)
+ context.commit("update_supplierList", resp.data)
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+
+ async getCoa(context) {
+ context.commit("update_loadingAutocomplete", true)
+ try {
+ let prm = {};
+ prm.search = context.state.searchCoa;
+ prm.token = one_token()
+ let resp = await api.searchCoa(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingAutocomplete", false)
+ } else {
+ context.commit("update_loadingAutocomplete", false)
+ context.commit("update_coaList", resp.data.records)
+ }
+ } catch (e) {
+ context.commit("update_loadingAutocomplete", false)
+ console.log(e)
+ }
+ },
+
+ async saveJurnal(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.saveJurnal(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ context.commit("jurnalumum/update_save_error_message", resp.message, { root: true })
+ context.commit("jurnalumum/update_alert_error", true, { root: true })
+ console.log(resp);
+ } else {
+ context.commit("jurnalumum/update_alert_success", true, { root: true })
+ var msg = " Journal " + prm.jurnalTitle + " berhasil disimpan"
+ context.commit("jurnalumum/update_msg_success", msg, { root: true })
+
+ context.dispatch('jurnalumum/search', {
+ current_page: context.rootState.jurnalumum.current_page,
+ search: context.rootState.jurnalumum.x_search,
+ startdate: context.rootState.jurnalumum.start_date,
+ enddate: context.rootState.jurnalumum.end_date,
+ regionalid: context.rootState.jurnalumum.user.S_RegionalID,
+ branchid: context.rootState.jurnalumum.user.M_BranchID,
+ last_id: -1
+ }, { root: true })
+
+ context.commit("update_dialogForm", false)
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ console.log(e)
+ }
+ },
+
+ async loadEditDialog(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.loadEditDialog(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ let snackbar = {
+ state: true,
+ color: 'error',
+ msg: resp.message
+ }
+ context.commit("update_snackbar", snackbar)
+ console.log(resp)
+ } else {
+ context.commit("update_loadingSave", false)
+
+ context.commit("update_selectedJurnal", resp.data.jurnalHead)
+ context.commit("update_selectedJurnalType", {
+ JurnalTypeID: resp.data.jurnalHead.JurnalTypeID,
+ JurnalTypeName: resp.data.jurnalHead.JurnalTypeName
+ })
+ context.commit("update_selectedDate", resp.data.jurnalHead.jurnalDate)
+ context.commit("update_jurnalTitle", resp.data.jurnalHead.jurnalTitle)
+ context.commit("update_jurnalDescription", resp.data.jurnalHead.jurnalDescription)
+ context.commit("update_grniValue", resp.data.jurnalHead.GRNIGR ? resp.data.jurnalHead.GRNIGR : '')
+ context.commit("update_invoiceValue", resp.data.jurnalHead.INVGR ? resp.data.jurnalHead.INVGR : '')
+ context.commit("update_isPosted", resp.data.jurnalHead.jurnalIsPosted)
+
+ context.commit("update_selectedSupplier", resp.data.supplier)
+ context.commit("update_selectedPeriode", resp.data.periode)
+ context.commit("update_detailsJurnalTerimaBarang", resp.data.details)
+
+ // Hitung sum
+ let totalDebit = 0, totalCredit = 0
+ resp.data.details.forEach((item) => {
+ totalDebit += parseFloat(item.jurnalTxDebit)
+ totalCredit += parseFloat(item.jurnalTxCredit)
+ })
+ let totalBalance = totalDebit - totalCredit
+ context.commit("update_detailSum", {
+ debit: totalDebit,
+ credit: totalCredit,
+ balance: totalBalance
+ })
+
+ context.commit("update_dialogJurnalTerimaBarang", true)
+ context.commit("update_actForm", 'edit')
+ console.log(resp.data);
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ console.log(e)
+ }
+ },
+
+ async updateJurnal(context, prm) {
+ context.commit("update_loadingSave", true)
+ try {
+ prm.token = one_token()
+ let resp = await api.updateJurnal(prm)
+ if (resp.status != "OK") {
+ context.commit("update_loadingSave", false)
+ context.commit("jurnalumum/update_save_error_message", resp.message, { root: true })
+ context.commit("jurnalumum/update_alert_error", true, { root: true })
+ console.log(resp)
+ } else {
+ context.commit("update_loadingSave", false)
+ context.commit("jurnalumum/update_alert_success", true, { root: true })
+ var msg = " Journal " + prm.jurnalTitle + " berhasil diupdate"
+ context.commit("jurnalumum/update_msg_success", msg, { root: true })
+ context.dispatch('jurnalumum/search', {
+ current_page: context.rootState.jurnalumum.current_page,
+ search: context.rootState.jurnalumum.x_search,
+ startdate: context.rootState.jurnalumum.start_date,
+ enddate: context.rootState.jurnalumum.end_date,
+ regionalid: context.rootState.jurnalumum.user.S_RegionalID,
+ branchid: context.rootState.jurnalumum.user.M_BranchID,
+ last_id: -1
+ }, { root: true })
+ console.log(resp)
+ }
+ } catch (e) {
+ context.commit("update_loadingSave", false)
+ console.log(e)
+ }
+ },
+
+
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-jurnal/store.js b/test/vuex/acc-one-jurnal/store.js
new file mode 100644
index 0000000..3bf8c4e
--- /dev/null
+++ b/test/vuex/acc-one-jurnal/store.js
@@ -0,0 +1,22 @@
+import jurnalumum from "./modules/jurnalumum.js";
+import terimaBarang from "./modules/terimaBarang.js";
+import system from "../../../apps/modules/system/system.js";
+import jurnalgaji from "./modules/jurnalgaji.js";
+import pengeluaranbarang from "./modules/pengeluaranbarang.js";
+import jpbreg from "./modules/jpbreg.js";
+import jurnalbiaya from "./modules/jurnalbiaya.js";
+
+export const store = new Vuex.Store({
+ modules: {
+ jurnalumum: jurnalumum,
+ jurnalgaji: jurnalgaji,
+ terimaBarang: terimaBarang,
+ pengeluaranbarang: pengeluaranbarang,
+ jpbreg: jpbreg,
+ jurnalbiaya: jurnalbiaya,
+ system: system
+ },
+ state: {},
+ mutations: {},
+ actions: {},
+});
diff --git a/test/vuex/acc-one-listing-pr/api/api.js b/test/vuex/acc-one-listing-pr/api/api.js
new file mode 100644
index 0000000..47dfa1e
--- /dev/null
+++ b/test/vuex/acc-one-listing-pr/api/api.js
@@ -0,0 +1,115 @@
+const URL = "/one-api/mockup/purchase/listing/PurchaseRequestListing/";
+
+export async function listing_regional(params) {
+ try {
+ var resp = await axios.post(URL + 'listing_regional', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function listing_branch(params) {
+ try {
+ var resp = await axios.post(URL + 'listing_branch', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+// export async function listing_purchase_req(params) {
+// try {
+// var resp = await axios.post(URL + 'listing_pr', params)
+// if (resp.status != 200) {
+// return {
+// status: "ERR",
+// message: resp.message
+// }
+// }
+// let data = resp.data
+// return data
+// } catch (error) {
+// return {
+// status: "ERR",
+// message: error.message
+// }
+// }
+// }
+
+export async function listing_purchase_req(params) {
+ try {
+ var resp = await axios.post(URL + 'list_purchaserequest', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function add_flag_status(params) {
+ try {
+ var resp = await axios.post(URL + 'insertstatus', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
+
+export async function edit_flag_status(params) {
+ try {
+ var resp = await axios.post(URL + 'changestatus', params)
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.message
+ }
+ }
+ let data = resp.data
+ return data
+ } catch (error) {
+ return {
+ status: "ERR",
+ message: error.message
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-listing-pr/components/filter-pr.vue b/test/vuex/acc-one-listing-pr/components/filter-pr.vue
new file mode 100644
index 0000000..1aa3edc
--- /dev/null
+++ b/test/vuex/acc-one-listing-pr/components/filter-pr.vue
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CARI
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-listing-pr/components/listing-pr.vue b/test/vuex/acc-one-listing-pr/components/listing-pr.vue
new file mode 100644
index 0000000..758eb45
--- /dev/null
+++ b/test/vuex/acc-one-listing-pr/components/listing-pr.vue
@@ -0,0 +1,271 @@
+
+
+
+
+
+
+
+
+ {{ props.item.PurchaseRequestDate }}
+ {{ props.item.PurchaseRequestNumber }}
+ {{ props.item.S_RegionalName }}
+ {{ props.item.M_BranchName }}
+ {{ props.item.M_ItemDesc }}
+ {{ `${props.item.PurchaseRequestDetailQty} ${props.item.UnitRequest || ''}` }}
+
+
+
+
+ {{ `${stock.QtyTotal} ${stock.ItemUnitName || ''}` }}
+
+
+
+
+ 0 (No Data)
+
+
+ {{ props.item.PurchaseRequestDetailIsCito }}
+ {{ props.item.PurchaseRequestDetailStatus }}
+
+ TF
+ PO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-listing-pr/index.php b/test/vuex/acc-one-listing-pr/index.php
new file mode 100644
index 0000000..165e0dd
--- /dev/null
+++ b/test/vuex/acc-one-listing-pr/index.php
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+ List PR
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/vuex/acc-one-listing-pr/modules/listingpr.js b/test/vuex/acc-one-listing-pr/modules/listingpr.js
new file mode 100644
index 0000000..f4b2cdc
--- /dev/null
+++ b/test/vuex/acc-one-listing-pr/modules/listingpr.js
@@ -0,0 +1,197 @@
+import * as api from "../api/api.js"
+
+export default {
+ namespaced: true,
+ state: {
+ user: one_user(),
+ api_status: 1,
+ detaildialog: false,
+ err_msg: "",
+ err_val: 0,
+
+ regional: [],
+ selected_regional: {
+ S_RegionalID: one_user()['S_RegionalID'],
+ S_RegionalName: one_user()['S_RegionalName']
+ },
+ branch: [],
+ selected_branch: {},
+ selected_status: "SEMUA",
+
+ startdate: new Date().toISOString().substr(0, 10),
+ enddate: new Date().toISOString().substr(0, 10),
+ list_pr: {},
+ pagination: 1
+ },
+ mutations: {
+ update_err_msg(state, data) {
+ state.err_msg = data
+ },
+ update_err_val(state, data) {
+ state.err_val = data
+ },
+ update_startdate(state, data) {
+ state.startdate = data
+ },
+ update_enddate(state, data) {
+ state.enddate = data
+ },
+ update_regional(state, data) {
+ state.regional = data
+ },
+ update_selected_regional(state, data) {
+ state.selected_regional = data
+ },
+ update_branch(state, data) {
+ state.branch = data
+ },
+ update_selected_branch(state, data) {
+ state.selected_branch = data
+ },
+ update_selected_status(state, data) {
+ state.selected_status = data
+ },
+ update_list_pr(state, data) {
+ state.list_pr = data
+ },
+ update_pagination(state, data) {
+ state.pagination = data
+ },
+ update_api_status(state, data) {
+ state.api_status = data
+ },
+ update_detaildialog(state, data) {
+ state.detaildialog = data
+ }
+ },
+ actions: {
+ async getregional(context, params) {
+ context.commit("update_err_val", 0)
+ try {
+ params.token = one_token()
+ let response = await api.listing_regional(params)
+ if (response.status != "OK") {
+ context.commit("update_err_val", 1)
+ } else {
+ let data = response.data.records
+ context.commit("update_regional", data)
+ }
+ } catch (error) {
+ context.commit("update_err_val", 1)
+ }
+ },
+ async getbranch(context, params) {
+ context.commit("update_err_val", 0)
+ try {
+ params.token = one_token()
+ let response = await api.listing_branch(params)
+ if (response.status != "OK") {
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error get listing branch: ", response.message)
+ } else {
+ let data = [
+ {
+ M_BranchCode: "ALL",
+ M_BranchName: "SEMUA"
+ },
+ ...response.data.result
+ ]
+
+ context.commit("update_branch", data)
+ }
+ } catch (error) {
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error get listing branch: ", error.message)
+ }
+ },
+ async getlistingpurchase(context, params) {
+ context.commit("update_err_val", 0)
+ try {
+ params.token = one_token()
+ let resp = await api.listing_purchase_req(params)
+ if (resp.status != "OK") {
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error get listing branch: ", response.message)
+ } else {
+ let data = {
+ records: resp.data.records,
+ total: parseInt(resp.data.total)
+ }
+ context.commit("update_list_pr", data)
+ }
+ } catch (error) {
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error get listing request: ", error.message)
+ }
+ },
+ async addflagstatus(context, params) {
+ context.commit("update_err_val", 0)
+ context.commit("update_api_status", 1)
+ try {
+ params.token = one_token()
+ let resp = await api.add_flag_status(params)
+ if (resp.status != "OK") {
+ context.commit("update_api_status", 3)
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error add flag request: ", resp.message)
+ } else {
+ context.dispatch("refresh_list")
+ context.commit("update_api_status", 2)
+ }
+ } catch (error) {
+ context.commit("update_api_status", 3)
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error add flag request: ", error.message)
+ }
+ },
+ async editflagstatus(context, params) {
+ context.commit("update_api_status", 1)
+ context.commit("update_err_val", 0)
+ try {
+ params.token = one_token()
+ let resp = await api.edit_flag_status(params)
+ if (resp.status != "OK") {
+ context.commit("update_api_status", 3)
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error edit flag request: ", resp.message)
+ } else {
+ context.dispatch("refresh_list")
+ context.commit("update_api_status", 2)
+ }
+ } catch (error) {
+ context.commit("update_api_status", 3)
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error edit flag request: ", error.message)
+ }
+ },
+ async refresh_list(context) {
+ context.commit("update_err_val", 0)
+ try {
+ let params = {
+ token: one_token(),
+ currpage: context.state.pagination,
+ startdate: context.state.startdate,
+ enddate: context.state.enddate,
+ regional: context.state.selected_regional.S_RegionalID,
+ branch: !context.state.selected_branch ? "" : context.state.selected_branch.M_BranchCode,
+ status: context.state.selected_status
+ }
+ let resp = await api.listing_purchase_req(params)
+
+ if (resp.status != "OK") {
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error refresh request: ", resp.message)
+ } else {
+ let data = {
+ records: resp.data.records,
+ total: parseInt(resp.data.total)
+ }
+ context.commit("update_list_pr", data)
+ }
+ } catch (error) {
+ context.commit("update_err_val", 1)
+ context.commit("update_err_msg", "error refresh request: ", error.message)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-listing-pr/store.js b/test/vuex/acc-one-listing-pr/store.js
new file mode 100644
index 0000000..c61c550
--- /dev/null
+++ b/test/vuex/acc-one-listing-pr/store.js
@@ -0,0 +1,11 @@
+import system from "../../../apps/modules/system/system.js";
+import listingpr from "./modules/listingpr.js";
+export const store = new Vuex.Store({
+ modules: {
+ system: system,
+ listingpr: listingpr,
+ },
+ state: {},
+ mutations: {},
+ actions: {}
+})
\ No newline at end of file
diff --git a/test/vuex/acc-one-map-bank-coa/api/bank.js b/test/vuex/acc-one-map-bank-coa/api/bank.js
new file mode 100644
index 0000000..7e624e8
--- /dev/null
+++ b/test/vuex/acc-one-map-bank-coa/api/bank.js
@@ -0,0 +1,162 @@
+const URL = "/one-api/mockup/masterdata/accounting/";
+
+export async function getRegional(prm) {
+ try {
+ var resp = await axios.post(URL + "bankcoa/getRegional", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function getBranch(prm) {
+ try {
+ var resp = await axios.post(URL + "bankcoa/getBranch", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function search(prm) {
+ try {
+ var resp = await axios.post(URL + "bankcoa/search", prm);
+ if (resp.status !== 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText,
+ };
+ }
+
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message,
+ };
+ }
+}
+
+export async function searchCoaBank(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'bankcoa/searchCoaBank', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function searchCoaEDC(token, prm) {
+ try {
+ var resp = await axios.post(URL + 'bankcoa/searchCoaEDC', {
+ token: token,
+ search: prm
+ });
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function saveupdate(prm) {
+ try {
+ var resp = await axios.post(URL + 'bankcoa/saveupdate', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function deletebankcoa(prm) {
+ try {
+ var resp = await axios.post(URL + 'bankcoa/deletebankcoa', prm);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
+
+export async function importBank(branchCode) {
+ try {
+ var resp = await axios.get(URL + `Mediajurnalauto/injectMapBankCab/${branchCode}`);
+ if (resp.status != 200) {
+ return {
+ status: "ERR",
+ message: resp.statusText
+ };
+ }
+ let data = resp.data;
+ return data;
+ } catch (e) {
+ return {
+ status: "ERR",
+ message: e.message
+ };
+ }
+}
\ No newline at end of file
diff --git a/test/vuex/acc-one-map-bank-coa/components/bankCoaList.vue b/test/vuex/acc-one-map-bank-coa/components/bankCoaList.vue
new file mode 100644
index 0000000..5a9abdf
--- /dev/null
+++ b/test/vuex/acc-one-map-bank-coa/components/bankCoaList.vue
@@ -0,0 +1,730 @@
+
+
+
+
+
+ {{ msgSnackbar }}
+ Tutup
+
+
+
+
+
+
+ ERROR !
+
+
+
+ {{ msgError }}
+
+
+
+ Tutup
+
+
+
+
+
+
+
+
+ MAPPING BANK COA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ search
+
+
+
+ IMPORT BANK
+
+
+
+
+
+
+
+
+
+ {{ props.item.MapBank_BranchCode }}
+
+
+ {{ props.item.MapBank_NatBankName }}
+
+
+ {{ props.item.MapBank_NatBankCode }}
+
+
+ {{ props.item.MapBank_BankAccountNo }}
+
+
+
+ Ya
+
+
+ Tidak
+
+
+
+
+ {{ props.item.MapBank_CoaAccountNo }}
+
+
+ {{ props.item.MapBank_CoaDescription }}
+
+
+
+ {{ props.item.MapBank_EDC_CoaAccountNo }}
+
+
+ {{ props.item.MapBank_EDC_CoaDescription }}
+
+
+
+
+ delete
+
+ Hapus
+
+
+
+ edit
+
+ Edit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FORM EDIT MAP BANK COA
+
+
+
+
+
+
+
+
+
{{ selected_bankcoa.MapBank_NatBankName }}
+
+
+
+
+
+
{{ selected_bankcoa.MapBank_NatBankCode }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+ Simpan Perubahan
+
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ {{msgalert}}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Yakin lah
+
+
+
+
+
+
+
+
+
+
+ Peringatan !
+
+
+
+
+
+
+
+
+ Yakin, mau import bank dari cabang {{msgalert_bankname}}
+
+
+
+
+
+
+
+
+
+
+
+ Tutup
+
+
+ Yakin lah
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+