update proses add akun pusat media jurnal & move barcode to serah terima
This commit is contained in:
276
test/vuex/acc-one-pendapatan-cash-v2/api/journal.js
Normal file
276
test/vuex/acc-one-pendapatan-cash-v2/api/journal.js
Normal file
@@ -0,0 +1,276 @@
|
||||
const URL = "/one-api/mockup/masterdata/accounting/";
|
||||
|
||||
export async function getPeriode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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 + "journalcashv2/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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_close_jurnal" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
TUTUP SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<div v-for="item in jurnal_to_close" :key="item.jurnalIsPosted">
|
||||
<p v-if="item.jurnalIsPosted == 'N'">
|
||||
Jumlah jurnal yang tidak dapat ditutup: <strong>{{ item.total_jurnal }}</strong>
|
||||
</p>
|
||||
<p v-else>
|
||||
Jumlah jurnal yang dapat ditutup: <strong>{{ item.total_jurnal }}</strong>
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
Apakah anda yakin akan menutup semua jurnal yang dibuat di
|
||||
<strong> {{ area_jurnal }} </strong> dalam rentang waktu <br>
|
||||
<strong>{{ selected_periode.periode }}</strong> <br>
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" outline flat @click="dialog_close_jurnal = false">Batal</v-btn>
|
||||
<v-btn color="primary" dark @click="closeJurnal()">Ya</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected_periode() {
|
||||
return this.$store.state.journal.selected_periode
|
||||
},
|
||||
area_jurnal() {
|
||||
const user = this.$store.state.journal.user
|
||||
if (user.M_BranchID == '0') {
|
||||
return `Regional ${user.S_RegionalName}`
|
||||
} else {
|
||||
return `Cabang ${user.M_BranchName}, Regional ${user.S_RegionalName}`
|
||||
}
|
||||
},
|
||||
jurnal_to_close() {
|
||||
return this.$store.state.journal.jurnal_to_close
|
||||
},
|
||||
dialog_close_jurnal: {
|
||||
get() {
|
||||
return this.$store.state.journal.dialog_close_jurnal
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_dialog_close_jurnal", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeJurnal() {
|
||||
var jurnal = this.jurnal_to_close.find(item => item.jurnalIsPosted === 'Y')
|
||||
if (jurnal && Number(jurnal.total_jurnal) > 0) {
|
||||
this.$store.dispatch("journal/closeJurnalPerPeriode", { typeid: jurnal.JurnalTypeID })
|
||||
return;
|
||||
}
|
||||
this.$store.commit("journal/update_open_dialog_info", true);
|
||||
this.$store.commit("journal/update_msg_info",
|
||||
"Tidak ada jurnal yang dapat ditutup"
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_edit_jurnal" persistetnt width="70vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
EDIT JOURNAL PENDAPATAN CASH
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">Company Name</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
{{ selected_journal.M_BranchCompanyName }}
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">Journal</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
{{ selected_journal.jurnalTitle }}
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">Regional</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
{{ selected_journal.S_RegionalName }}
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">Journal Date</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
{{ selected_journal.jurnalDate }}
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">Branch</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
{{ selected_journal.M_BranchName }}
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">Journal Type</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
{{ selected_journal.JurnalTypeName }}
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap mt-3>
|
||||
<v-flex xs12>
|
||||
<v-data-table
|
||||
:headers="headerdetails" :items="journal_edit"
|
||||
hide-actions class="elevation-1"
|
||||
>
|
||||
<template slot="items" slot-scope="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2">{{ props.item.coaAccountNo }}</td>
|
||||
<td class="text-xs-left pa-2">
|
||||
<v-autocomplete
|
||||
label="Account" hide-details outline
|
||||
v-model="props.item.coaAccountNo"
|
||||
:items="list_coa" item-text="coaDescription"
|
||||
item-value="coaAccountNo"
|
||||
></v-autocomplete>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.jurnalAddOnValue }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.coaCurrencyCode }}</td>
|
||||
<td class="text-xs-right pa-2">{{ formatCurrency(props.item.jurnalTxDebit) }}</td>
|
||||
<td class="text-xs-right pa-2">{{ formatCurrency(props.item.jurnalTxCredit) }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<tr>
|
||||
<td colspan="4" class="font-weight-bold pa-2">TOTAL</td>
|
||||
<td class="text-xs-right pa-2 font-weight-bold">
|
||||
{{ formatCurrency(xsummary.debit) }}
|
||||
</td>
|
||||
<td class="text-xs-right pa-2 font-weight-bold">
|
||||
{{ formatCurrency(xsummary.credit) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" class="font-weight-bold pa-2">BALANCE</td>
|
||||
<td width="10%" class="text-xs-right pa-2 font-weight-bold">
|
||||
{{ formatCurrency(xsummary.balance) }}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" outline flat @click="closeEditDialog()">Batal</v-btn>
|
||||
<v-btn color="primary" dark @click="simpanEditDialog()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
headerdetails: [
|
||||
{
|
||||
text: "AKUN", align: "center", sortable: false,
|
||||
value: "action", width: "20%", class: "pa-2 pl-2 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "DESKRIPSI", align: "center", sortable: false,
|
||||
value: "mr", width: "25%", class: "pa-2 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "INFO", align: "center", sortable: false,
|
||||
value: "lab", width: "15%", class: "pa-2 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "CURRENCY", align: "center", sortable: false,
|
||||
value: "lab", width: "10%", class: "pa-2 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "DEBIT", align: "center", sortable: false,
|
||||
value: "lab", width: "15%", class: "pa-2 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "CREDIT", align: "center", sortable: false,
|
||||
value: "lab", width: "15%", class: "pa-2 blue lighten-3 white--text",
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_edit_jurnal: {
|
||||
get() {
|
||||
return this.$store.state.journal.dialog_edit_journal;
|
||||
},
|
||||
set(val) {1
|
||||
this.$store.commit("journal/update_dialog_edit_journal", val);
|
||||
}
|
||||
},
|
||||
selected_journal: {
|
||||
get() {
|
||||
return this.$store.state.journal.selected_journal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_selected_journal", val);
|
||||
},
|
||||
},
|
||||
journal_edit: {
|
||||
get() {
|
||||
return this.$store.state.journal.journal_edit
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_journal_edit", val);
|
||||
}
|
||||
},
|
||||
selected_periode() {
|
||||
return this.$store.state.journal.selected_periode
|
||||
},
|
||||
xsummary() {
|
||||
return this.$store.state.journal.summary
|
||||
},
|
||||
list_coa() {
|
||||
return this.$store.state.journal.list_coa
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatCurrency(val) {
|
||||
const price = parseFloat(val);
|
||||
const IDR = new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR"
|
||||
});
|
||||
return `${IDR.format(price)}`;
|
||||
},
|
||||
simpanEditDialog() {
|
||||
const originaldetail = this.selected_journal.detailtx;
|
||||
const editnewdetails = this.journal_edit;
|
||||
const listcoa = this.list_coa;
|
||||
|
||||
const originalMap = new Map();
|
||||
for (const item of originaldetail) {
|
||||
originalMap.set(item.jurnalTxID, item.coaAccountNo);
|
||||
}
|
||||
|
||||
const coaMap = new Map();
|
||||
for (const coaItem of listcoa) {
|
||||
coaMap.set(coaItem.coaAccountNo, coaItem);
|
||||
}
|
||||
|
||||
const editeddetail = editnewdetails.flatMap(detail => {
|
||||
const originalAcc = originalMap.get(detail.jurnalTxID);
|
||||
if (originalAcc !== detail.coaAccountNo) {
|
||||
const accMatch = coaMap.get(detail.coaAccountNo);
|
||||
if (accMatch) {
|
||||
return [{
|
||||
jurnalID: detail.jurnalTxJurnalID,
|
||||
jurnalTxID: detail.jurnalTxID,
|
||||
coaID: accMatch.coaID,
|
||||
coaDescription: accMatch.coaDescription,
|
||||
coaAccountNo: accMatch.coaAccountNo
|
||||
}]
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
|
||||
this.$store.dispatch("journal/saveEditJurnal", editeddetail);
|
||||
},
|
||||
closeEditDialog() {
|
||||
this.selected_journal = {};
|
||||
this.journal_edit = [];
|
||||
this.dialog_edit_jurnal = false;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_confirm_posting" persistetnt width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
POSTING SEMUA JURNAL PADA PERIODE {{ selected_periode.periodeName }}
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<div v-for="item in total_jurnal_not_posted" :key="item.jurnalEditStatus">
|
||||
<p v-if="item.jurnalEditStatus == 'N'">
|
||||
Jumlah jurnal yang dapat diposting: <strong>{{ item.total_jurnal }}</strong>
|
||||
</p>
|
||||
<p v-if="item.jurnalEditStatus == 'Y'">
|
||||
Jumlah jurnal yang tidak dapat diposting: <strong>{{ item.total_jurnal }}</strong>
|
||||
(belum diverifikasi setelah edit)
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
Apakah anda yakin akan melakukan posting semua jurnal yang dibuat dalam rentang waktu
|
||||
<strong>{{ selected_periode.periode }}</strong> ?
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" outline flat @click="dialog_confirm_posting = false">Batal</v-btn>
|
||||
<v-btn color="primary" dark @click="postingJurnal()">Ya</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected_periode() {
|
||||
return this.$store.state.journal.selected_periode
|
||||
},
|
||||
total_jurnal_not_posted() {
|
||||
return this.$store.state.journal.total_jurnal_not_posted
|
||||
},
|
||||
dialog_confirm_posting: {
|
||||
get() {
|
||||
return this.$store.state.journal.dialog_confirm_posting;
|
||||
},
|
||||
set(val) {1
|
||||
this.$store.commit("journal/update_dialog_confirm_posting", val);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
postingJurnal() {
|
||||
var jurnal = this.total_jurnal_not_posted.find(jrnl => jrnl.jurnalEditStatus === 'N')
|
||||
if (jurnal && Number(jurnal.total_jurnal) > 0) {
|
||||
this.$store.dispatch("journal/postingJurnal", { typeid: jurnal.JurnalTypeID });
|
||||
return;
|
||||
}
|
||||
this.$store.commit("journal/update_open_dialog_info", true);
|
||||
this.$store.commit("journal/update_msg_info",
|
||||
"semua jurnal para periode ini sudah terposting"
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_request_edit" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
REQUEST EDIT JURNAL {{ selected_journal.jurnalNo }}
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<p v-if="selected_journal.JurnalRequestEditStatusEdit == 'approved'">
|
||||
Jurnal ini sudah pernah diedit sebelumnya oleh:
|
||||
{{ selected_journal.JurnalRequestEditStaffName }} <br>
|
||||
Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan lagi? <br>
|
||||
Nomor: <strong>{{ selected_journal.jurnalNo }}</strong> <br>
|
||||
Judul: <strong>{{ selected_journal.jurnalTitle }}</strong> <br>
|
||||
Deskripsi: {{ selected_journal.jurnalDescription }} <br>
|
||||
</p>
|
||||
<p v-else>
|
||||
Apakah anda yakin akan mengajukan permintaan untuk melakukan perubahan jurnal: <br>
|
||||
Nomor: <strong>{{ selected_journal.jurnalNo }}</strong> <br>
|
||||
Judul: <strong>{{ selected_journal.jurnalTitle }}</strong> <br>
|
||||
Deskripsi: {{ selected_journal.jurnalDescription }} <br>
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" outline @click="dialog_request_edit = false">Batal</v-btn>
|
||||
<v-btn color="primary" dark @click="requestEdit()">Ya</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_request_edit: {
|
||||
get() {
|
||||
return this.$store.state.journal.dialog_request_edit
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_dialog_request_edit", val)
|
||||
}
|
||||
},
|
||||
selected_journal() {
|
||||
return this.$store.state.journal.selected_journal
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
requestEdit() {
|
||||
this.$store.dispatch("journal/requestEditJurnal");
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
73
test/vuex/acc-one-pendapatan-cash-v2/index.php
Normal file
73
test/vuex/acc-one-pendapatan-cash-v2/index.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp">
|
||||
<one-navbar></one-navbar>
|
||||
<v-content class="blue lighten-5">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 class="center" fill-height pa-1>
|
||||
<!-- komponen -->
|
||||
<one-media-journal></one-media-journal>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../libs/vendor/vue.js"></script>
|
||||
<script src="../../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../../libs/one_global.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import {
|
||||
store
|
||||
} from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
// window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-media-journal': httpVueLoader('./components/oneMediaJournalList.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
584
test/vuex/acc-one-pendapatan-cash-v2/modules/journal.js
Normal file
584
test/vuex/acc-one-pendapatan-cash-v2/modules/journal.js
Normal file
@@ -0,0 +1,584 @@
|
||||
// 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: {},
|
||||
open_dialog_info: false,
|
||||
msg_info: "",
|
||||
xsearch: "",
|
||||
|
||||
// --
|
||||
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_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val;
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val;
|
||||
},
|
||||
update_xsearch(state, val) {
|
||||
state.xsearch = val;
|
||||
state.current_page = 1;
|
||||
},
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
23
test/vuex/acc-one-pendapatan-cash-v2/store.js
Normal file
23
test/vuex/acc-one-pendapatan-cash-v2/store.js
Normal file
@@ -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: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user