add modules folder based on s_menu

This commit is contained in:
2026-06-30 10:16:11 +07:00
parent 315b657ee3
commit a1aab09ac9
625 changed files with 192283 additions and 794 deletions

View File

@@ -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
}
}
}

View File

@@ -0,0 +1,167 @@
<template>
<v-dialog v-model="dialog_add_jurnaltrx" persistent width="60vw">
<v-card>
<v-card-title class="headline grey lighten-2">
TAMBAH TRANSAKSI JURNAL
</v-card-title>
<v-card-text>
<v-layout row wrap>
<v-flex xs2 pr-1>
<v-text-field
v-model="trx_acc.coaAccountNo" hide-details
label="Nomor Account" outline readonly
></v-text-field>
</v-flex>
<v-flex xs3 px-1>
<v-autocomplete
label="Deskripsi Account" hide-details outline
v-model="trx_acc" :items="list_account"
item-text="coaDescription" return-object
></v-autocomplete>
</v-flex>
<v-flex xs3 px-1>
<v-text-field
v-model="trx_info" hide-details
label="Informasi Transaksi" outline
></v-text-field>
</v-flex>
<v-flex xs2 px-1>
<v-text-field
v-model="trx_debit" hide-details @blur="handleBlur('trx_debit')"
label="Debit" outline prefix="Rp." @focus="handleFocus('trx_debit')"
></v-text-field>
</v-flex>
<v-flex xs2 pl-1>
<v-text-field
v-model="trx_kredit" hide-details @blur="handleBlur('trx_kredit')"
label="Kredit" outline prefix="Rp." @focus="handleFocus('trx_kredit')"
></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn @click="batalJurnalTrx()" color="red" class="white--text">Batal</v-btn>
<v-btn @click="simpanJurnalTrx()" color="primary" class="white--text">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
trx_acc: {},
trx_info: "",
trx_debit: 0.00,
trx_kredit: 0.00
}
},
computed: {
dialog_add_jurnaltrx: {
get() {
return this.$store.state.journal.dialog_add_jurnaltrx
},
set(val) {
this.$store.commit("journal/update_dialog_add_jurnaltrx", val)
}
},
list_account() {
return this.$store.state.journal.list_account
},
journal_balik_new() {
return this.$store.state.journal.journal_balik_new
},
summary_balik_new() {
return this.$store.state.journal.summary_balik_new
}
},
methods: {
formatCurrency(value) {
const num = parseFloat(value);
if (isNaN(num)) return 0;
return num.toFixed(2).replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ".");
},
parseCurrency(value) {
let cleanedValue = String(value).replace(/\./g, '');
cleanedValue = cleanedValue.replace(',', '.');
return parseFloat(cleanedValue) || 0;
},
handleFocus(modelname) {
const currentValue = this[modelname];
this[modelname] = String(currentValue).replace(/\./g, '');
},
handleBlur(modelname) {
const currentValue = this[modelname];
const parsedValue = this.parseCurrency(currentValue);
this[modelname] = parsedValue;
this[modelname] = this.formatCurrency(parsedValue);
},
batalJurnalTrx() {
this.dialog_add_jurnaltrx = false
},
simpanJurnalTrx() {
let temp_trx = JSON.parse(JSON.stringify(this.journal_balik_new))
var count = temp_trx.length
const debit = this.parseCurrency(this.trx_debit);
const kredit = this.parseCurrency(this.trx_kredit);
let new_trx = {
...this.trx_acc,
jurnalTxID: "temp_" + (count + 1),
jurnalTxCoaID: this.trx_acc.coaID,
jurnalTxDebit: debit,
jurnalTxCredit: kredit,
jurnalTxDescription: this.trx_acc.coaDescription,
jurnalAddOnValue: this.trx_info
}
temp_trx.push(new_trx)
const total = temp_trx.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 })
total.balance = total.total_debit - total.total_kredit
this.$store.commit("journal/update_journal_balik_new", temp_trx)
this.$store.commit("journal/update_summary_balik_new", total)
this.dialog_add_jurnaltrx = false
}
},
watch: {
dialog_add_jurnaltrx(val) {
if (val) {
this.$nextTick(() => {
this.trx_acc = {}
this.trx_info = ""
this.trx_debit = 0.00
this.trx_kredit = 0.00
})
}
},
trx_debit: {
immediate: true,
handler(newValue) {
if (typeof newValue === 'number') {
this.trx_debit = this.formatCurrency(newValue);
}
}
},
trx_kredit: {
immediate: true,
handler(newValue) {
if (typeof newValue === 'number') {
this.trx_kredit = this.formatCurrency(newValue);
}
}
}
}
}
</script>

View File

@@ -0,0 +1,365 @@
<template>
<v-dialog v-model="dialog_journal_balik" persistent width="90vw" scrollable>
<v-card>
<v-card-title class="headline grey lighten-2">
KOREKSI JURNAL
</v-card-title>
<v-card-text style="max-height: 80vh;">
<v-layout row wrap>
<v-flex xs6 pa-1>
<div class="font-weight-bold">Company Name</div>
<div class="pa-2 grey lighten-2">
{{ selected_journal_closed.M_BranchCompanyName }}
</div>
</v-flex>
<v-flex xs6 pa-1>
<div class="font-weight-bold">Journal</div>
<div class="pa-2 grey lighten-2">
{{ selected_journal_closed.jurnalTitle }}
</div>
</v-flex>
<v-flex xs3 pa-1>
<div class="font-weight-bold">Regional</div>
<div class="pa-2 grey lighten-2">
{{ selected_journal_closed.S_RegionalName }}
</div>
</v-flex>
<v-flex xs3 pa-1>
<div class="font-weight-bold">Branch</div>
<div class="pa-2 grey lighten-2">
{{ selected_journal_closed.M_BranchName ?? "-" }}
</div>
</v-flex>
<v-flex xs3 pa-1>
<div class="font-weight-bold">Journal Date</div>
<div class="pa-2 grey lighten-2">
{{ selected_journal_closed.jurnalDate }}
</div>
</v-flex>
<v-flex xs3 pa-1>
<div class="font-weight-bold">Journal Type</div>
<div class="pa-2 grey lighten-2">
{{ selected_journal_closed.JurnalTypeName }}
</div>
</v-flex>
</v-layout>
<v-layout row wrap class="mt-2">
<v-flex xs6 pr-1>
<h3>Jurnal Awal</h3>
<v-data-table
:headers="headers" class="elevation-1"
:items="selected_journal_closed.detail" hide-actions
>
<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">{{ props.item.coaDescription }}</td>
<td class="text-xs-left pa-2">{{ props.item.jurnalAddOnValue }}</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="3" class="font-weight-bold pa-2">TOTAL</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(selected_journal_closed.totals.total_debit ?? 0) }}
</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(selected_journal_closed.totals.total_kredit ?? 0) }}
</td>
</tr>
<tr>
<td colspan="4" class="font-weight-bold pa-2">BALANCE</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(selected_journal_closed.totals.balance ?? 0) }}
</td>
</tr>
</template>
</v-data-table>
</v-flex>
<v-flex xs6 pl-1>
<h3>Jurnal Balik</h3>
<v-data-table
:headers="headers_balik" class="elevation-1"
:items="journal_detail_balik.transaction" hide-actions
>
<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">{{ props.item.coaDescription }}</td>
<td class="text-xs-left pa-2">{{ props.item.jurnalAddOnValue }}</td>
<td class="text-xs-right pa-2">{{ formatCurrency(props.item.jurnalTxCredit) }}</td>
<td class="text-xs-right pa-2">{{ formatCurrency(props.item.jurnalTxDebit) }}</td>
</tr>
</template>
<template v-slot:footer>
<tr>
<td colspan="3" class="font-weight-bold pa-2">TOTAL</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(journal_detail_balik.summary.total_kredit ?? 0) }}
</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(journal_detail_balik.summary.total_debit ?? 0) }}
</td>
</tr>
<tr>
<td colspan="4" class="font-weight-bold pa-2">BALANCE</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(journal_detail_balik.summary.balance ?? 0) }}
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-layout row wrap class="mt-2">
<v-flex grow pr-1>
<h3>Jurnal Penyesuaian</h3>
</v-flex>
<v-flex shrink pl-1>
<v-btn
color="primary" dark @click="addTransactions()"
style="min-width: 50px; margin: 0;" small
>
<v-icon small>add</v-icon>
</v-btn>
</v-flex>
<v-flex xs12 mt-2>
<v-data-table
:headers="headers_trx" class="elevation-1"
:items="journal_balik_new" hide-actions
>
<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">{{ props.item.coaDescription }}</td>
<td class="text-xs-left pa-2">{{ props.item.jurnalAddOnValue }}</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>
<td class="text-xs-center pa-2">
<v-btn
color="red" dark @click="removeTransaction(props.item)"
style="min-width: 50px; margin: 0;" small
>
<v-icon small>delete</v-icon>
</v-btn>
</td>
</tr>
</template>
<template v-slot:footer>
<tr>
<td colspan="3" class="font-weight-bold pa-2">TOTAL</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(summary_balik_new.total_debit) }}
</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(summary_balik_new.total_kredit) }}
</td>
</tr>
<tr>
<td colspan="4" class="font-weight-bold pa-2">BALANCE</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(summary_balik_new.balance) }}
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn @click="batalBalikJurnal()" color="red" class="white--text">Batal</v-btn>
<v-btn @click="simpanBalikJurnal()" color="primary" class="white--text">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
headers: [
{
text: "AKUN", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 info white--text",
},
{
text: "DESKRIPSI", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 info white--text",
},
{
text: "INFO", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 info white--text",
},
{
text: "DEBIT", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 info white--text",
},
{
text: "KREDIT", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 info white--text",
},
],
headers_balik: [
{
text: "AKUN", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 orange white--text",
},
{
text: "DESKRIPSI", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 orange white--text",
},
{
text: "INFO", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 orange white--text",
},
{
text: "DEBIT", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 orange white--text",
},
{
text: "KREDIT", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 orange white--text",
},
],
headers_trx: [
{
text: "AKUN", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "DESKRIPSI", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "INFO", align: "center", sortable: false,
value: "action", width: "20%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "DEBIT", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "KREDIT", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "AKSI", align: "center", sortable: false,
value: "action", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
]
}
},
computed: {
dialog_journal_balik: {
get() {
return this.$store.state.journal.dialog_journal_balik
},
set(val) {
this.$store.commit("journal/update_dialog_journal_balik", val)
}
},
selected_journal_closed: {
get() {
return this.$store.state.journal.selected_journal_closed
},
set(val) {
this.$store.commit("journal/update_selected_journal_closed", val)
}
},
journal_detail_balik: {
get() {
return this.$store.state.journal.journal_detail_balik
},
set(val) {
this.$store.commit("journal/update_journal_detail_balik", val)
}
},
journal_balik_new: {
get() {
return this.$store.state.journal.journal_balik_new
},
set(val) {
this.$store.commit("journal/update_journal_balik_new", val)
}
},
summary_balik_new: {
get() {
return this.$store.state.journal.summary_balik_new
},
set(val) {
this.$store.commit("journal/update_summary_balik_new", val)
}
}
},
methods: {
formatCurrency(amount) {
const price = parseFloat(amount)
const IDR = new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR"
})
return `${IDR.format(price)}`
},
resetState() {
this.selected_journal_closed = {
totals: {
total_debit: 0,
total_kredit: 0,
balance: 0,
}
}
this.journal_detail_balik = {
transaction: [],
summary: {
total_debit: 0,
total_kredit: 0,
balance: 0,
}
}
this.summary_balik_new = {
total_debit: 0,
total_kredit: 0,
balance: 0,
}
},
batalBalikJurnal() {
this.resetState()
this.dialog_journal_balik = false
this.$store.commit("journal/update_dialog_journal", true)
},
addTransactions() {
this.$store.commit("journal/update_dialog_add_jurnaltrx", true)
},
removeTransaction(item) {
let current_trx = JSON.parse(JSON.stringify(this.journal_balik_new))
const new_trx = current_trx.filter(trx => trx.jurnalTxID != item.jurnalTxID)
const summary = new_trx.reduce((acc, item) => {
const debit = Number(item.jurnalTxDebit)
const credit = Number(item.jurnalTxCredit)
acc.total_debit += debit
acc.total_kredit += credit
return acc
}, {total_debit: 0, total_kredit: 0 })
summary.balance = summary.total_debit - summary.total_kredit
this.journal_balik_new = new_trx
this.summary_balik_new = summary
},
simpanBalikJurnal() {
this.$store.dispatch("journal/saveKoreksiJurnal")
}
},
watch: {
},
}
</script>

View File

@@ -0,0 +1,242 @@
<template>
<v-dialog v-model="dialog_journal" persistent width="80vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
PILIH JURNAL
</v-card-title>
<v-card-text>
<v-layout row align-center>
<v-flex xs2>
<v-menu
v-model="menuStartdateFilter" offset-y lazy min-width="290px"
transition="scale-transition" max-width="290px" full-width
:nudge-right="40" :close-on-content-click="false"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="formattedStartdate" label="Tanggal Awal"
hide-details readonly v-on="on" outline
></v-text-field>
</template>
<v-date-picker
v-model="filter_closed.startdate" no-title
@input="menuStartdateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs2 pl-2>
<v-menu
v-model="menuEnddateFilter" offset-y lazy min-width="290px"
transition="scale-transition" max-width="290px" full-width
:nudge-right="40" :close-on-content-click="false"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="formattedEnddate" label="Tanggal Akhir"
hide-details readonly v-on="on" outline
></v-text-field>
</template>
<v-date-picker
v-model="filter_closed.enddate" no-title
@input="menuEnddateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs2 pl-2>
<v-autocomplete
:items="list_typejurnal" outline hide-details item-text="JurnalTypeName"
v-model="filter_closed.typeJournalID" item-value="JurnalTypeID" label="Tipe Jurnal"
></v-autocomplete>
</v-flex>
<v-flex xs3 pl-2>
<v-autocomplete
:items="list_periode" outline hide-details item-text="periodeName"
v-model="filter_closed.periodeID" item-value="periodeID" label="Periode"
>
<template slot="item" slot-scope="{item}">
<v-list-tile-content>
<v-list-tile-title>{{ item.periodeName }}</v-list-tile-title>
<v-list-tile-sub-title>
{{ item.periodeStartDate }} - {{ item.periodeEndDate }}
</v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex grow pl-2>
<v-text-field
v-model="filter_closed.search" hide-details
label="Cari nomor jurnal" outline
></v-text-field>
</v-flex>
<v-flex shrink pl-2 text-xs-right>
<v-btn
color="info" dark @click="searchJurnal()"
style="min-width: 50px; height: 50px; margin: 0;"
>
<v-icon>search</v-icon>
</v-btn>
</v-flex>
</v-layout>
<v-layout row wrap class="mt-4">
<v-flex xs12>
<v-data-table
:headers="headers" class="elevation-1" hide-actions
:items="list_journal_closed.records"
>
<template slot="items" slot-scope="props">
<tr>
<td class="text-xs-center pa-2">{{ props.item.jurnalDate }}</td>
<td class="text-xs-center pa-2">{{ props.item.jurnalNo }}</td>
<td class="text-xs-center pa-2">{{ props.item.jurnalTitle }}</td>
<td class="text-xs-center pa-2">{{ props.item.jurnalDescription }}</td>
<td class="text-xs-center pa-2">{{ props.item.JurnalTypeName }}</td>
<td class="text-xs-center pa-2">
<v-btn
outline small color="primary"
@click="openDialogJurnalBalik(props.item)"
>
KOREKSI
<v-icon small right dark>assignment_return</v-icon>
</v-btn>
</td>
</tr>
</template>
</v-data-table>
<v-divider class="my-1"></v-divider>
<div class="pa-2 mt-2 text-xs-center">
<v-pagination
v-model="currpage_closed" :length="tablelength"
:total-visible="10"
></v-pagination>
</div>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn @click="closeDialogJournal()" color="red" class="white--text">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
menuStartdateFilter: false,
menuEnddateFilter: false,
headers: [
{
text: "JOURNAL DATE", align: "center", sortable: false,
value: "action", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL NO", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL DESCRIPTION", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL TYPE", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "ACTION", align: "center", sortable: false,
value: "action", width: "10%", class: "pa-1 blue lighten-3 white--text",
}
]
}
},
computed: {
dialog_journal: {
get() {
return this.$store.state.journal.dialog_journal
},
set(val) {
this.$store.commit("journal/update_dialog_journal", val)
}
},
filter_closed: {
get() {
return this.$store.state.journal.filter_closed
},
set(val) {
this.$store.commit("journal/update_filter_closed", val)
}
},
formattedStartdate() {
return this.formatDate(this.filter_closed.startdate)
},
formattedEnddate() {
return this.formatDate(this.filter_closed.enddate)
},
list_typejurnal() {
return this.$store.state.journal.list_typejurnal
},
list_periode() {
return this.$store.state.journal.list_periode
},
list_journal_closed() {
return this.$store.state.journal.list_journal_closed
},
currpage_closed: {
get() {
return this.$store.state.journal.currpage_closed
},
set(val) {
this.$store.commit("journal/update_currpage_closed", val)
this.$store.dispatch("journal/getDaftarJournalClosed")
}
},
tablelength() {
let total = this.list_journal_closed.total
if (total == undefined || total < 1) return 1
return Math.ceil(total/5)
},
},
methods: {
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split('-');
return `${day}-${month}-${year}`;
},
searchJurnal() {
this.$store.dispatch("journal/getDaftarJournalClosed")
},
closeDialogJournal() {
this.dialog_journal = false
},
openDialogJurnalBalik(jurnal) {
jurnal.detail = []
jurnal.totals = {
total_debit: 0,
total_kredit: 0,
balance: 0,
}
this.$store.commit("journal/update_selected_journal_closed", jurnal)
this.$store.dispatch("journal/getDetailJournalClosed")
this.$store.commit("journal/update_dialog_journal_balik", true)
this.dialog_journal = false
}
},
watch: {
dialog_journal(val) {
if (val) {
this.$nextTick(() => {
this.$store.dispatch("journal/getDaftarJournalClosed")
})
}
}
},
}
</script>

View File

@@ -0,0 +1,91 @@
<template>
<v-dialog v-model="dialog_pick_periode" persistent max-width="35vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
PILIH PERIODE
</v-card-title>
<v-card-text>
<v-autocomplete
v-model="temp_periode" :items="list_periode"
outline hide-details label="Periode Jurnal"
item-text="periodeName" return-object
>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.periodeName"></v-list-tile-title>
<v-list-tile-sub-title>
{{ item.periodeStartDate }} - {{ item.periodeEndDate }}
</v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" flat @click="closeDialogPeriode()">TUTUP</v-btn>
<v-btn color="primary" @click="choosePeriode()">PILIH</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
temp_periode: {}
}
},
computed: {
list_periode() {
return this.$store.state.journal.list_periode
},
dialog_pick_periode: {
get() {
return this.$store.state.journal.dialog_pick_periode
},
set(val) {
this.$store.commit("journal/update_dialog_pick_periode", val)
}
},
selected_periode: {
get() {
return this.$store.state.journal.selected_periode
},
set(val) {
this.$store.commit("journal/update_selected_periode", val)
}
}
},
methods: {
closeDialogPeriode() {
this.temp_periode = {}
this.dialog_pick_periode = false
},
choosePeriode() {
var periode = this.temp_periode
let filter = this.$store.state.journal.filter_balik
if (!periode || periode.periodeID == '') {
return
}
this.selected_periode = periode
filter.periodeID = periode.periodeID
this.$store.commit("journal/update_filter_balik", filter)
this.temp_periode = {}
this.dialog_pick_periode = false
}
},
watch: {
dialog_pick_periode(val) {
if (val) {
this.$nextTick(() => {
this.temp_periode = this.selected_periode
})
}
}
},
}
</script>

View File

@@ -0,0 +1,193 @@
<template>
<v-dialog v-model="dialog_view_jurnal" persistent width="70vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
DETAIL JURNAL PENYESUAIAN
</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_balik.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_balik.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_balik.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_balik.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_balik.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_balik.JurnalTypeName }}
</div>
</v-flex>
</v-layout>
<v-layout row wrap mt-3>
<v-flex xs12>
<v-data-table
:headers="headerdetails" class="elevation-1"
:items="journal_detail_balik.transaction" hide-actions
>
<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"> {{ props.item.jurnalTxDescription }}</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(journal_detail_balik.summary.total_debit) }}
</td>
<td class="text-xs-right pa-2 font-weight-bold">
{{ formatCurrency(journal_detail_balik.summary.total_kredit) }}
</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(journal_detail_balik.summary.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()">Tutup</v-btn>
<div v-if="(user_level.M_ApproveLevelID == '1' && user_level.DivisionKodeSurat == 'KEU')
|| Number(user_level.M_ApproveLevelID) >= 2"
>
<v-btn
v-if="selected_journal_balik.jurnalPenyesuaianStatus == 'draft'"
color="primary" dark @click="updateJurnalStatus('verified')"
>Verifikasi</v-btn>
<v-btn
v-if="selected_journal_balik.jurnalPenyesuaianStatus == 'verified'"
color="primary" dark @click="updateJurnalStatus('approved')"
>Approve</v-btn>
</div>
</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_view_jurnal: {
get() {
return this.$store.state.journal.dialog_view_jurnal
},
set(val) {
this.$store.commit("journal/update_dialog_view_jurnal", val)
}
},
selected_journal_balik: {
get() {
return this.$store.state.journal.selected_journal_balik;
},
set(val) {
this.$store.commit("journal/update_selected_journal_balik", val);
},
},
journal_detail_balik: {
get() {
return this.$store.state.journal.journal_detail_balik
},
set(val) {
this.$store.commit("journal/update_journal_detail_balik", val)
}
},
user_level() {
return this.$store.state.journal.user_level
}
},
methods: {
formatCurrency(val) {
const price = parseFloat(val)
const IDR = new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR"
})
return `${IDR.format(price)}`
},
closeEditDialog() {
let detailnull ={
transaction: [],
summary: {
total_debit: 0,
total_kredit: 0,
balance: 0,
}
}
this.journal_detail_balik = detailnull
this.selected_journal_balik = {}
this.dialog_view_jurnal = false
},
updateJurnalStatus(status) {
this.$store.dispatch("journal/updateStatusJurnalKoreksi", status)
}
},
}
</script>

View File

@@ -0,0 +1,287 @@
<template>
<div style="width: 100%;">
<v-toolbar dark class="blue lighten-3 white--text">
<v-toolbar-title class="white--text">JURNAL PENYESUAIAN</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card class="pa-2">
<v-layout row align-center>
<v-flex grow>
<span>
<v-chip outline color="red">
{{ selected_periode.periodeStartDate }} - {{ selected_periode.periodeEndDate }}
</v-chip>
</span>
</v-flex>
<v-flex xs2 pl-2>
<v-menu
v-model="menuStartdateFilter" offset-y lazy min-width="290px"
transition="scale-transition" max-width="290px" full-width
:nudge-right="40" :close-on-content-click="false"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="formattedStartdate" label="Tanggal Awal"
hide-details readonly v-on="on" outline
></v-text-field>
</template>
<v-date-picker
v-model="filter_balik.startdate" no-title
@input="menuStartdateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs2 pl-2>
<v-menu
v-model="menuEnddateFilter" offset-y lazy min-width="290px"
transition="scale-transition" max-width="290px" full-width
:nudge-right="40" :close-on-content-click="false"
>
<template v-slot:activator="{on}">
<v-text-field
v-model="formattedEnddate" label="Tanggal Akhir"
hide-details readonly v-on="on" outline
></v-text-field>
</template>
<v-date-picker
v-model="filter_balik.enddate" no-title
@input="menuEnddateFilter = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs2 pl-2>
<v-autocomplete
:items="list_typejurnal" outline hide-details item-text="JurnalTypeName"
v-model="filter_balik.typeJournalID" item-value="JurnalTypeID" label="Tipe Jurnal"
></v-autocomplete>
</v-flex>
<v-flex xs2 pl-2>
<v-text-field
v-model="filter_balik.search" hide-details
label="Cari nomor jurnal" outline
></v-text-field>
</v-flex>
<v-flex shrink pl-2>
<v-btn
color="info" dark @click="searchJurnal()"
style="min-width: 50px; height: 50px; margin: 0;"
>
<v-icon>search</v-icon>
</v-btn>
</v-flex>
<v-flex shrink pl-2>
<v-btn
color="primary" dark @click="addKoreksiJurnal()"
style="min-width: 50px; height: 50px; margin: 0;"
>
<v-icon>add</v-icon>
</v-btn>
</v-flex>
<v-flex text-xs-right>
<v-btn
color="orange" class="white--text"
@click="choosePeriode()"
>
Periode Accounting
</v-btn>
</v-flex>
</v-layout>
</v-card>
<v-card class="pa-2 mt-2">
<v-data-table
:headers="headers" :items="list_journal_balik.records"
class="elevation-1" hide-actions
>
<template slot="items" slot-scope="props">
<tr>
<td class="text-xs-center pa-2">{{ props.item.jurnalDate }}</td>
<td class="text-xs-center pa-2">{{ props.item.jurnalNo }}</td>
<td class="text-xs-center pa-2">{{ props.item.jurnalTitle }}</td>
<td class="text-xs-center pa-2">{{ props.item.jurnalDescription }}</td>
<td class="text-xs-center pa-2">{{ props.item.JurnalTypeName }}</td>
<td class="text-xs-center pa-2">
<v-chip color="info" outline small>
{{ props.item.jurnalPenyesuaianStatus }}
</v-chip>
</td>
<td class="text-xs-center pa-2">
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-btn
outline small color="info"
style="min-width: 50px; margin: 0"
>
<v-icon
v-bind="attrs" v-on="on" color="info"
@click="openDialogJurnalBalik(props.item)"
>visibility</v-icon>
</v-btn>
</template>
<span>Detail</span>
</v-tooltip>
<!-- <v-tooltip bottom v-if="props.item.jurnalPenyesuaianStatus == 'draft'">
<template v-slot:activator="{on, attrs}">
<v-btn
outline small color="primary"
style="min-width: 50px; margin: 0"
>
<v-icon
v-bind="attrs" v-on="on" color="primary"
@click="{}"
>check</v-icon>
</v-btn>
</template>
<span>Verifikasi</span>
</v-tooltip> -->
</td>
</tr>
</template>
</v-data-table>
<v-divider class="my-1"></v-divider>
<div class="pa-2 mt-1 text-xs-center">
<v-pagination v-model="currpage_balik" :length="pagilength" :total-visible="10"></v-pagination>
</div>
</v-card>
<v-snackbar v-model="snackbar.active" multi-line top :timeout="3000" :color="snackbar.color">
{{ snackbar.message }}
<v-btn class="ml-2" round flat @click="snackbar.active = false">Tutup</v-btn>
</v-snackbar>
<dialog-pilih-jurnal></dialog-pilih-jurnal>
<dialog-balik-jurnal></dialog-balik-jurnal>
<dialog-add-jurnaltrx></dialog-add-jurnaltrx>
<dialog-view-jurnal></dialog-view-jurnal>
<dialog-sel-periode></dialog-sel-periode>
</div>
</template>
<script>
module.exports = {
components: {
'dialog-pilih-jurnal': httpVueLoader('./dialogSelectJurnal.vue'),
'dialog-balik-jurnal': httpVueLoader('./dialogBalikJurnal.vue'),
'dialog-add-jurnaltrx': httpVueLoader('./dialogAddRowJurnal.vue'),
'dialog-view-jurnal': httpVueLoader('./dialogViewJurnal.vue'),
'dialog-sel-periode': httpVueLoader('./dialogSelectPeriode.vue')
},
mounted() {
this.$store.dispatch("journal/getUserApproveLevel")
this.$store.dispatch("journal/getDaftarTipeJurnal")
this.$store.dispatch("journal/getDaftarAccount")
this.$store.dispatch("journal/getDaftarPeriode")
.then(() => {
this.$store.dispatch("journal/getDaftarJournalBalik")
})
},
data() {
return {
menuStartdateFilter: false,
menuEnddateFilter: false,
headers: [
{
text: "JOURNAL DATE", align: "center", sortable: false,
value: "action", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL NO", align: "center", sortable: false,
value: "action", width: "15%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL DESCRIPTION", align: "center", sortable: false,
value: "action", width: "25%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL TYPE", align: "center", sortable: false,
value: "action", width: "10%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "JOURNAL TYPE", align: "center", sortable: false,
value: "action", width: "5%", class: "pa-1 blue lighten-3 white--text",
},
{
text: "ACTION", align: "center", sortable: false,
value: "action", width: "10%", class: "pa-1 blue lighten-3 white--text",
}
]
}
},
computed: {
filter_balik: {
get() {
return this.$store.state.journal.filter_balik
},
set(val) {
this.$store.commit("journal/update_filter_balik", val)
}
},
formattedStartdate() {
return this.formatDate(this.filter_balik.startdate)
},
formattedEnddate() {
return this.formatDate(this.filter_balik.enddate)
},
list_typejurnal() {
return this.$store.state.journal.list_typejurnal
},
list_periode() {
return this.$store.state.journal.list_periode
},
selected_periode() {
return this.$store.state.journal.selected_periode
},
list_journal_balik() {
return this.$store.state.journal.list_journal_balik
},
currpage_balik: {
get() {
return this.$store.state.journal.currpage_balik
},
set(val) {
this.$store.commit("journal/update_currpage_balik", val)
this.$store.dispatch("journal/getDaftarJournalBalik")
}
},
pagilength() {
let total = this.list_journal_balik.total
if (total == undefined || total < 1) return 1
return Math.ceil(total/10)
},
snackbar: {
get() {
return this.$store.state.journal.snackbar
},
set(val) {
this.$store.commit("journal/update_snackbar", val)
}
}
},
methods: {
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split('-');
return `${day}-${month}-${year}`;
},
addKoreksiJurnal() {
this.$store.commit("journal/update_dialog_journal", true)
},
searchJurnal() {
this.$store.dispatch("journal/getDaftarJournalBalik")
},
choosePeriode() {
this.$store.commit("journal/update_dialog_pick_periode", true)
},
openDialogJurnalBalik(item) {
this.$store.commit("journal/update_selected_journal_balik", item)
this.$store.dispatch("journal/getDetailJournalBalik")
this.$store.commit("journal/update_dialog_view_jurnal", true)
}
},
}
</script>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ONE | Jurnal Penyesuaian</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="px-1 py-2">
<v-layout row wrap pa-1 fill-height>
<one-layout></one-layout>
</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 ?>';
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-layout': httpVueLoader('./components/one-layout.vue'),
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {}
.right {}
</style>
</body>
</html>

View File

@@ -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);
}
}
}
}

View File

@@ -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: {}
});