add modules folder based on s_menu
This commit is contained in:
101
test/vuex/acc-one-jurnal-fixed-asset-v2/api/journal.js
Normal file
101
test/vuex/acc-one-jurnal-fixed-asset-v2/api/journal.js
Normal file
@@ -0,0 +1,101 @@
|
||||
const URL = "/one-api/fixedasset/";
|
||||
|
||||
export async function getPeriode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'journalfixedassetv2/getPeriode', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search(token, xdate, periodeid, branchid, regionalid) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'journalfixedassetv2/search', {
|
||||
token:token,
|
||||
xdate:xdate,
|
||||
periodeid:periodeid,
|
||||
branchid:branchid,
|
||||
regionalid:regionalid
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'journalfixedassetv2/getdetail', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function insertSales(branchCode, date, jurnalno) {
|
||||
try {
|
||||
var resp = await axios.get(URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function addConfirm(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'journalfixedassetv2/addConfirm', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,864 @@
|
||||
<template>
|
||||
<div style="width: 100%;" class="">
|
||||
<!-- SNACKBAR -->
|
||||
<v-snackbar
|
||||
v-model="snackbar"
|
||||
:timeout="5000"
|
||||
:multi-line="false"
|
||||
:vertical="false"
|
||||
:top="true"
|
||||
>
|
||||
{{ msgSnackbar }}
|
||||
<v-btn flat @click="updateAlertSuccess(false)"> Tutup </v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<!-- ERROR DIALOG -->
|
||||
<v-dialog v-model="dialog_error" max-width="500px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span>ERROR !</span>
|
||||
<v-spacer></v-spacer>
|
||||
</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<div class="ma-3 red--text">{{ msgError }}</div>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialog_error = false"
|
||||
>Tutup</v-btn
|
||||
>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- END ERROR DIALOG -->
|
||||
|
||||
<v-toolbar dark class="blue lighten-3 white--text">
|
||||
<v-toolbar-title class="white--text">DETAIL</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card class="pa-2">
|
||||
<v-layout row align-center>
|
||||
<span>
|
||||
</span>
|
||||
<span>
|
||||
</span>
|
||||
<v-flex text-xs-right>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="pa-2 mt-2">
|
||||
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xbranchlists"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.M_BranchName }}
|
||||
<span v-if="props.item.ErrStatus === 'Y'">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" class="ml-1" color="red" small @click="viewError(props.item)">error</v-icon>
|
||||
</template>
|
||||
<span>error information</span>
|
||||
</v-tooltip>
|
||||
</span>
|
||||
<!-- <span v-if="props.item.ErrStatus === 'Y'"><v-icon small color="red" @click="viewError(props.item)">error</v-icon></span> -->
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.coaDescription }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.totaldepretext }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-pagination
|
||||
style="margin-top: 10px; margin-bottom: 10px;"
|
||||
v-model="curr_page"
|
||||
:length="xtotal_page"
|
||||
></v-pagination>
|
||||
</v-card>
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="dialogformdetail" persistent width="70vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
DETAIL JOURNAL PAYMENT VOUCHER
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Company Name</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.M_BranchCompanyName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xcompanyname" label="Company Name"></v-text-field> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Journal</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.jurnalTitle }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xrefno" label="Ref No"></v-text-field> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Regional</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.S_RegionalName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xjournalno" label="Journal No"></v-text-field> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Journal Date</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.jurnalDate }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xjournaldate" label="Journal Date"></v-text-field> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Branch</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.M_BranchName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xaccount" label="Account"></v-text-field> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Journal Type</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.JurnalTypeName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xjournaltype" label="Journal Type"></v-text-field> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap pt-3>
|
||||
<v-flex>
|
||||
<v-data-table
|
||||
:headers="headerdetails"
|
||||
:items="xjurnaldetails"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template slot="items" slot-scope="props">
|
||||
<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"
|
||||
>
|
||||
Rp {{ convertMoney(props.item.jurnalTxDebit) }}
|
||||
</td>
|
||||
<td
|
||||
class="text-xs-right pa-2"
|
||||
>
|
||||
Rp {{ convertMoney(props.item.jurnalTxCredit) }}
|
||||
</td>
|
||||
</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">
|
||||
Rp {{ convertMoney(xsummary.debit) }}
|
||||
</td>
|
||||
<td class="text-xs-right pa-2 font-weight-bold">
|
||||
Rp {{ convertMoney(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">
|
||||
Rp {{ convertMoney(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" flat @click="closeDialogFormDetail()">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogperiode" persistent max-width="550px">
|
||||
<v-toolbar dark class="blue lighten-3 white--text">
|
||||
<v-toolbar-title class="white--text">PILIH PERIODE</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card>
|
||||
<v-card-text class="pt-4 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
v-model="selectedPeriode"
|
||||
:items="periodeList"
|
||||
outline
|
||||
hide-details
|
||||
color="blue"
|
||||
label="Periode"
|
||||
item-text="periodeName"
|
||||
return-object
|
||||
>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<template>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.periodeName"></v-list-tile-title>
|
||||
<v-list-tile-sub-title
|
||||
v-text="item.periode"
|
||||
></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions class="pr-3">
|
||||
<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>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogconfirm" persistent max-width="550px">
|
||||
<v-toolbar dark class="blue lighten-3 white--text">
|
||||
<v-toolbar-title class="white--text">KONFIRMASI</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card>
|
||||
<v-card-text class="pt-4 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
Yakin, mau konfirmasi fixed aset periode <span class="font-weight-bold">{{ this.$store.state.journal.selected_periode.periode }}</span> ?
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions class="pr-3">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" flat @click="closeDialogConfirm()">TUTUP</v-btn>
|
||||
<v-btn color="primary" @click="addConfirm()">YAKIN</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogerror" persistent max-width="650px">
|
||||
<v-toolbar dark class="red lighten-1 white--text">
|
||||
<v-toolbar-title class="white--text">ERROR INFORMATION</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card>
|
||||
<v-card-text class="pt-4 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<div v-for="(error, index) in msgerrjurnallist" :key="index">
|
||||
<p><strong>Error Type:</strong> {{ error.JurnalErr_Msg.err_type }}</p>
|
||||
<p><strong>Message:</strong> {{ error.JurnalErr_Msg.err_msg }}</p>
|
||||
<v-divider></v-divider>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions class="pr-3">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" flat @click="closeDialogError()">TUTUP</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="dialogregenerate" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Peringatan !
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout row>
|
||||
<v-flex xs12 d-flex>
|
||||
<v-layout row>
|
||||
<v-flex pb-1 xs12>
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pr-2 xs12>
|
||||
Yakin, mau konfirmasi regenerate jurnal <span class="font-weight-bold">{{ msgalertgenerate }}</span> ?
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" flat @click="dialogregenerate = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="doRegenerateJurnal()"
|
||||
>
|
||||
Ya
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<one-dialog-print :title="printtitle" :width="printwidth" :height="700" :status="openprint" :urlprint="urlprint"
|
||||
@close-dialog-print="openprint = false"></one-dialog-print>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-print': httpVueLoader('../../common/oneDialogPrintX.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("journal/getPeriode")
|
||||
.then(() => {
|
||||
// Setelah `selected_periode` diupdate dengan data pertama
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.$store.state.journal.xdate,
|
||||
periodeid: this.$store.state.journal.selected_periode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error fetching periode:", error);
|
||||
});
|
||||
|
||||
},
|
||||
data: () => ({
|
||||
menufilterdate: false,
|
||||
menufilterdateend: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
search_city: "",
|
||||
oldlabel: "",
|
||||
selectedData: {},
|
||||
debit: 0,
|
||||
credit: 0,
|
||||
btnUpload: false,
|
||||
xperiodeid: "",
|
||||
search_item_periode: "",
|
||||
xyearandmonth: "",
|
||||
xperiode: "",
|
||||
formatreport: "pdf",
|
||||
urlprint: "",
|
||||
printtitle: '',
|
||||
printwidth: '100%',
|
||||
dialogregenerate: false,
|
||||
msgalertgenerate: "",
|
||||
xbranchCode: "",
|
||||
xsearchDate: "",
|
||||
xFa_ItemID: "",
|
||||
xname: "",
|
||||
headers: [
|
||||
{
|
||||
text: "CABANG",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "5%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "COA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "TOTAL",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
}
|
||||
],
|
||||
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: {
|
||||
isLoading() {
|
||||
return this.$store.state.journal.search_status === 1;
|
||||
},
|
||||
periodeList() {
|
||||
return this.$store.state.journal.periodeList
|
||||
},
|
||||
dialogperiode() {
|
||||
return this.$store.state.journal.dialog_form_periode
|
||||
},
|
||||
dialogconfirm() {
|
||||
return this.$store.state.journal.dialog_form_confirm
|
||||
},
|
||||
selectedPeriode: {
|
||||
get() {
|
||||
return this.$store.state.journal.selected_periode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_selected_periode", val)
|
||||
},
|
||||
},
|
||||
dialogformdetail() {
|
||||
return this.$store.state.journal.dialog_form_detail
|
||||
},
|
||||
xjournals() {
|
||||
return this.$store.state.journal.journals
|
||||
},
|
||||
xsummary() {
|
||||
return this.$store.state.journal.summary
|
||||
},
|
||||
ishide: {
|
||||
get() {
|
||||
return this.$store.state.journal.ishide
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_ishide", val)
|
||||
}
|
||||
},
|
||||
xdate: {
|
||||
get() {
|
||||
return this.$store.state.journal.xdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_xdate", val)
|
||||
}
|
||||
},
|
||||
xdateend: {
|
||||
get() {
|
||||
return this.$store.state.journal.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_end_date", val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormatted() {
|
||||
return this.formatDate(this.xdate)
|
||||
},
|
||||
filterComputedDateFormattedEnd() {
|
||||
return this.formatDate(this.xdateend)
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.journal.current_page;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_current_page", val);
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.$store.state.journal.xdate,
|
||||
periodeid: this.$store.state.journal.selected_periode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
});
|
||||
},
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.journal.total_journal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_total_journal", val);
|
||||
},
|
||||
},
|
||||
selected_journal: {
|
||||
get() {
|
||||
return this.$store.state.journal.selected_journal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_selected_journal", val);
|
||||
},
|
||||
},
|
||||
user() {
|
||||
return this.$store.state.journal.user
|
||||
},
|
||||
xjurnaldetails() {
|
||||
return this.$store.state.journal.jurnaldetails
|
||||
},
|
||||
xbranchlists() {
|
||||
return this.$store.state.journal.branchlists
|
||||
},
|
||||
openprint: {
|
||||
get() {
|
||||
return this.$store.state.journal.open_print;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_open_print", val);
|
||||
},
|
||||
},
|
||||
dialogerror: {
|
||||
get() {
|
||||
return this.$store.state.journal.dialog_error_jurnal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_dialog_error_jurnal", val);
|
||||
},
|
||||
},
|
||||
msgerrjurnallist() {
|
||||
return this.$store.state.journal.msgerrjurnallist;
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.journal.alert_success;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_alert_success", val);
|
||||
},
|
||||
},
|
||||
msgSnackbar() {
|
||||
return this.$store.state.journal.msg_success;
|
||||
},
|
||||
dialog_error: {
|
||||
get() {
|
||||
return this.$store.state.journal.alert_error;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_alert_error", val);
|
||||
},
|
||||
},
|
||||
msgError() {
|
||||
return this.$store.state.journal.save_error_message;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
convertMoney(money){
|
||||
return one_money(money)
|
||||
},
|
||||
doPrint(val) {
|
||||
// console.log(val)
|
||||
this.printwidth = 1028
|
||||
this.printtitle = ""
|
||||
let user = one_user()
|
||||
tm = Date.now()
|
||||
var rptname = 'rpt_jurnal_pendapatan_001'
|
||||
var formatrpt = this.formatreport
|
||||
|
||||
this.urlprint = "/birt/run?__report=report/one/accounting/" + rptname + ".rptdesign&__format=" + formatrpt + "&PID=" + val.Fa_ItemID + "&username=" + user.M_StaffName + "&tm=" + tm
|
||||
// console.log(this.urlprint)
|
||||
|
||||
this.$store.commit("journal/update_open_print", true)
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.Fa_ItemID == this.$store.state.journal.selected_journal.Fa_ItemID;
|
||||
},
|
||||
selectMe(sc) {
|
||||
this.$store.commit("journal/update_selected_journal", sc);
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.xdate,
|
||||
periodeid: this.selectedPeriode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
})
|
||||
}, 1000),
|
||||
closeDialogPeriode() {
|
||||
this.$store.commit("journal/update_dialog_form_periode", false)
|
||||
},
|
||||
openDialogPeriode() {
|
||||
this.$store.commit("journal/update_dialog_form_periode", true)
|
||||
},
|
||||
openDialogConfirm() {
|
||||
this.$store.commit("journal/update_dialog_form_confirm", true)
|
||||
},
|
||||
closeDialogConfirm() {
|
||||
this.$store.commit("journal/update_dialog_form_confirm", false)
|
||||
},
|
||||
addConfirm() {
|
||||
this.xperiodeid = this.$store.state.journal.selected_periode.id
|
||||
this.xyearandmonth = this.$store.state.journal.selected_periode.yearandmonth
|
||||
this.xperiode = this.$store.state.journal.selected_periode.periode
|
||||
this.$store.commit("journal/update_dialog_form_confirm", false)
|
||||
|
||||
this.$store.dispatch("journal/addConfirm", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.xdate,
|
||||
periodeid: this.selectedPeriode.id,
|
||||
details : this.$store.state.journal.journals
|
||||
})
|
||||
},
|
||||
choosePeriode() {
|
||||
this.xperiodeid = this.$store.state.journal.selected_periode.id
|
||||
this.xyearandmonth = this.$store.state.journal.selected_periode.yearandmonth
|
||||
this.xperiode = this.$store.state.journal.selected_periode.periode
|
||||
// console.log(this.xperiodeid)
|
||||
this.$store.commit("journal/update_dialog_form_periode", false)
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.xdate,
|
||||
periodeid: this.selectedPeriode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
})
|
||||
},
|
||||
closeDialogFormDetail() {
|
||||
this.$store.commit("journal/update_dialog_form_detail", false)
|
||||
},
|
||||
vieDetail(val) {
|
||||
this.$store.commit("journal/update_dialog_form_detail", true)
|
||||
this.$store.commit("journal/update_jurnaldetails", val.detailtx)
|
||||
|
||||
let totalDebit = 0;
|
||||
let totalKredit = 0;
|
||||
for (let item = 0; item < val.detailtx.length; item++) {
|
||||
const element = val.detailtx[item];
|
||||
totalDebit += parseFloat(element.jurnalTxDebit || '0');
|
||||
totalKredit += parseFloat(element.jurnalTxCredit || '0');
|
||||
}
|
||||
|
||||
let totalBalance = totalDebit - totalKredit;
|
||||
let summary = {
|
||||
debit: totalDebit,
|
||||
credit: totalKredit,
|
||||
balance: totalBalance,
|
||||
};
|
||||
this.$store.commit("journal/update_summary", summary);
|
||||
},
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
isObjectEmpty(val) {
|
||||
let obj = val;
|
||||
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||
},
|
||||
isPeriodeEmpty() {
|
||||
return Object.keys(this.selectedPeriode).length === 0;
|
||||
},
|
||||
openDialogEdit(val) {
|
||||
this.selectedData = val;
|
||||
if (val.type == "DB") {
|
||||
this.debit = val.value;
|
||||
this.credit = 0;
|
||||
}
|
||||
if (val.type == "CR") {
|
||||
this.credit = val.value;
|
||||
this.debit = 0;
|
||||
}
|
||||
this.dialogEdit = true;
|
||||
},
|
||||
formatCurrency(val) {
|
||||
// Format the price above to USD using the locale, style, and currency.
|
||||
let price = parseFloat(val);
|
||||
let USDollar = new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
});
|
||||
|
||||
// console.log(
|
||||
// `The formated version of ${price} is ${USDollar.format(price)}`
|
||||
// );
|
||||
return `${USDollar.format(price)}`;
|
||||
},
|
||||
resetInputFile() {
|
||||
document.getElementById("csv_file").value = null;
|
||||
this.dialogImport = false;
|
||||
},
|
||||
viewError(val) {
|
||||
this.$store.commit("journal/update_dialog_error_jurnal", true)
|
||||
this.$store.commit("journal/update_msgerrjurnallist", val.ErrMsg)
|
||||
},
|
||||
closeDialogError() {
|
||||
this.$store.commit("journal/update_dialog_error_jurnal", false)
|
||||
},
|
||||
openGenerate(val) {
|
||||
// console.log(val)
|
||||
this.xbranchCode = val.jurnalM_BranchCode
|
||||
this.xsearchDate = this.deFormatedDate(val.jurnalDate)
|
||||
this.xFa_ItemID = val.Fa_ItemID
|
||||
this.xname = val.jurnalTitle
|
||||
this.msgalertgenerate = val.jurnalTitle
|
||||
this.dialogregenerate = true
|
||||
},
|
||||
doRegenerateJurnal() {
|
||||
this.dialogregenerate = false
|
||||
|
||||
// console.log(prm)
|
||||
let user = one_user();
|
||||
console.log(user.M_BranchID)
|
||||
if (user.M_BranchID === 0 || user.M_BranchID === '0') {
|
||||
// generate regional
|
||||
this.$store.dispatch("journal/insertSales", {branchCode: 'ZZ', date: this.xsearchDate, jurnalno: this.selected_journal.jurnalNo})
|
||||
} else {
|
||||
// generate cabang
|
||||
this.$store.dispatch("journal/insertSales", {branchCode: this.xbranchCode, date: this.xsearchDate, jurnalno: this.selected_journal.jurnalNo})
|
||||
}
|
||||
},
|
||||
updateAlertSuccess(val) {
|
||||
this.$store.commit("journal/update_alert_success", val);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
xdate(val, old) {
|
||||
this.xdate = val
|
||||
this.thr_search()
|
||||
},
|
||||
xdateend(val, old) {
|
||||
this.xdateend = val
|
||||
this.thr_search()
|
||||
},
|
||||
// search_item_periode(val, old) {
|
||||
// if (val == old) return
|
||||
// if (!val) return
|
||||
|
||||
// if (val.length < 1) {
|
||||
// this.$store.dispatch("journal/getPeriode", this.search_item_periode)
|
||||
// return this.thr_search_periode()
|
||||
// }
|
||||
|
||||
// if (val.length > 1) {
|
||||
// this.$store.dispatch("journal/getPeriode", this.search_item_periode)
|
||||
// return this.thr_search_periode()
|
||||
// }
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,956 @@
|
||||
<template>
|
||||
<div style="width: 100%;" class="">
|
||||
<!-- SNACKBAR -->
|
||||
<v-snackbar
|
||||
v-model="snackbar"
|
||||
:timeout="5000"
|
||||
:multi-line="false"
|
||||
:vertical="false"
|
||||
:top="true"
|
||||
>
|
||||
{{ msgSnackbar }}
|
||||
<v-btn flat @click="updateAlertSuccess(false)"> Tutup </v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<!-- ERROR DIALOG -->
|
||||
<v-dialog v-model="dialog_error" max-width="500px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span>ERROR !</span>
|
||||
<v-spacer></v-spacer>
|
||||
</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<div class="ma-3 red--text">{{ msgError }}</div>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialog_error = false"
|
||||
>Tutup</v-btn
|
||||
>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- END ERROR DIALOG -->
|
||||
|
||||
<v-toolbar dark class="blue lighten-3 white--text">
|
||||
<v-toolbar-title class="white--text">CONFIRM</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card class="pa-2">
|
||||
<v-layout row align-center>
|
||||
<span>
|
||||
<v-chip outline color="teal">
|
||||
{{ this.$store.state.journal.selected_periode.yearandmonth }}
|
||||
</v-chip>
|
||||
</span>
|
||||
<span>
|
||||
<v-chip outline color="red">
|
||||
{{ this.$store.state.journal.selected_periode.periode }}
|
||||
</v-chip>
|
||||
<v-btn color="orange" class="white--text" @click="openDialogPeriode()">Period</v-btn>
|
||||
</span>
|
||||
<v-flex text-xs-right>
|
||||
<v-btn v-if="this.ishide === 'N'" color="green" class="white--text" @click="openDialogConfirm()">Confirm</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="pa-2 mt-2">
|
||||
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xjournals"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.CodeFixedAsset }}
|
||||
<span v-if="props.item.ErrStatus === 'Y'">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" class="ml-1" color="red" small @click="viewError(props.item)">error</v-icon>
|
||||
</template>
|
||||
<span>error information</span>
|
||||
</v-tooltip>
|
||||
</span>
|
||||
<!-- <span v-if="props.item.ErrStatus === 'Y'"><v-icon small color="red" @click="viewError(props.item)">error</v-icon></span> -->
|
||||
</td>
|
||||
<td class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.Fa_ItemNote }}
|
||||
<p>{{ props.item.NameFixedAsset }}</p>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.AcquisitionPrice_text }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.BookValue_text }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.depresiasi_text }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.akumulasi_text }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
{{ props.item.nilai_saat_ini_text }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)">
|
||||
<span v-if="props.item.Fa_ItemIsConfirm == 'Y'">
|
||||
<v-chip
|
||||
color="indigo"
|
||||
class="ml-0"
|
||||
outline
|
||||
small
|
||||
>
|
||||
confirmed
|
||||
</v-chip>
|
||||
</span>
|
||||
<span v-else="props.item.Fa_ItemIsConfirm == 'N'">
|
||||
<v-chip
|
||||
color="red"
|
||||
class="ml-0"
|
||||
outline
|
||||
small
|
||||
>
|
||||
not confirmed
|
||||
</v-chip>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-pagination
|
||||
style="margin-top: 10px; margin-bottom: 10px;"
|
||||
v-model="curr_page"
|
||||
:length="xtotal_page"
|
||||
></v-pagination>
|
||||
</v-card>
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="dialogformdetail" persistent width="70vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
DETAIL JOURNAL PAYMENT VOUCHER
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Company Name</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.M_BranchCompanyName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xcompanyname" label="Company Name"></v-text-field> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Journal</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.jurnalTitle }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xrefno" label="Ref No"></v-text-field> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Regional</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.S_RegionalName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xjournalno" label="Journal No"></v-text-field> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Journal Date</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.jurnalDate }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xjournaldate" label="Journal Date"></v-text-field> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1 pr-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Branch</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.M_BranchName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xaccount" label="Account"></v-text-field> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1 pl-3>
|
||||
<div class="font-weight-bold">
|
||||
<div>Journal Type</div>
|
||||
</div>
|
||||
<div class="pa-2 grey lighten-2">
|
||||
<div>{{ selected_journal.JurnalTypeName }}</div>
|
||||
</div>
|
||||
<!-- <v-text-field :value="xjournaltype" label="Journal Type"></v-text-field> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap pt-3>
|
||||
<v-flex>
|
||||
<v-data-table
|
||||
:headers="headerdetails"
|
||||
:items="xjurnaldetails"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template slot="items" slot-scope="props">
|
||||
<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"
|
||||
>
|
||||
Rp {{ convertMoney(props.item.jurnalTxDebit) }}
|
||||
</td>
|
||||
<td
|
||||
class="text-xs-right pa-2"
|
||||
>
|
||||
Rp {{ convertMoney(props.item.jurnalTxCredit) }}
|
||||
</td>
|
||||
</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">
|
||||
Rp {{ convertMoney(xsummary.debit) }}
|
||||
</td>
|
||||
<td class="text-xs-right pa-2 font-weight-bold">
|
||||
Rp {{ convertMoney(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">
|
||||
Rp {{ convertMoney(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" flat @click="closeDialogFormDetail()">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogperiode" persistent max-width="550px">
|
||||
<v-toolbar dark class="blue lighten-3 white--text">
|
||||
<v-toolbar-title class="white--text">PILIH PERIODE</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card>
|
||||
<v-card-text class="pt-4 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
v-model="selectedPeriode"
|
||||
:items="periodeList"
|
||||
outline
|
||||
hide-details
|
||||
color="blue"
|
||||
label="Periode"
|
||||
item-text="periodeName"
|
||||
return-object
|
||||
>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<template>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.periodeName"></v-list-tile-title>
|
||||
<v-list-tile-sub-title
|
||||
v-text="item.periode"
|
||||
></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions class="pr-3">
|
||||
<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>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogconfirm" persistent max-width="550px">
|
||||
<v-toolbar dark class="blue lighten-3 white--text">
|
||||
<v-toolbar-title class="white--text">KONFIRMASI</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card>
|
||||
<v-card-text class="pt-4 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
Yakin, mau konfirmasi fixed aset periode <span class="font-weight-bold">{{ this.$store.state.journal.selected_periode.periode }}</span> ?
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions class="pr-3">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" flat @click="closeDialogConfirm()">TUTUP</v-btn>
|
||||
<v-btn color="primary" @click="addConfirm()">YAKIN</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogerror" persistent max-width="650px">
|
||||
<v-toolbar dark class="red lighten-1 white--text">
|
||||
<v-toolbar-title class="white--text">ERROR INFORMATION</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card>
|
||||
<v-card-text class="pt-4 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<div v-for="(error, index) in msgerrjurnallist" :key="index">
|
||||
<p><strong>Error Type:</strong> {{ error.JurnalErr_Msg.err_type }}</p>
|
||||
<p><strong>Message:</strong> {{ error.JurnalErr_Msg.err_msg }}</p>
|
||||
<v-divider></v-divider>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions class="pr-3">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" flat @click="closeDialogError()">TUTUP</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="dialogregenerate" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Peringatan !
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout row>
|
||||
<v-flex xs12 d-flex>
|
||||
<v-layout row>
|
||||
<v-flex pb-1 xs12>
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pr-2 xs12>
|
||||
Yakin, mau konfirmasi regenerate jurnal <span class="font-weight-bold">{{ msgalertgenerate }}</span> ?
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="error" flat @click="dialogregenerate = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="doRegenerateJurnal()"
|
||||
>
|
||||
Ya
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<one-dialog-print :title="printtitle" :width="printwidth" :height="700" :status="openprint" :urlprint="urlprint"
|
||||
@close-dialog-print="openprint = false"></one-dialog-print>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-print': httpVueLoader('../../common/oneDialogPrintX.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("journal/getPeriode")
|
||||
.then(() => {
|
||||
// Setelah `selected_periode` diupdate dengan data pertama
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.$store.state.journal.xdate,
|
||||
periodeid: this.$store.state.journal.selected_periode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error fetching periode:", error);
|
||||
});
|
||||
|
||||
},
|
||||
data: () => ({
|
||||
menufilterdate: false,
|
||||
menufilterdateend: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
search_city: "",
|
||||
oldlabel: "",
|
||||
selectedData: {},
|
||||
debit: 0,
|
||||
credit: 0,
|
||||
btnUpload: false,
|
||||
xperiodeid: "",
|
||||
search_item_periode: "",
|
||||
xyearandmonth: "",
|
||||
xperiode: "",
|
||||
formatreport: "pdf",
|
||||
urlprint: "",
|
||||
printtitle: '',
|
||||
printwidth: '100%',
|
||||
dialogregenerate: false,
|
||||
msgalertgenerate: "",
|
||||
xbranchCode: "",
|
||||
xsearchDate: "",
|
||||
xFa_ItemID: "",
|
||||
xname: "",
|
||||
headers: [
|
||||
{
|
||||
text: "CODE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "5%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "NAME",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "NILAI PEROLEHAN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "NILAI BUKU SAAT INI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "DEPRESIASI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKUMULASI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
|
||||
{
|
||||
text: "NILAI SAAT INI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text",
|
||||
}
|
||||
],
|
||||
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: {
|
||||
isLoading() {
|
||||
return this.$store.state.journal.search_status === 1;
|
||||
},
|
||||
periodeList() {
|
||||
return this.$store.state.journal.periodeList
|
||||
},
|
||||
dialogperiode() {
|
||||
return this.$store.state.journal.dialog_form_periode
|
||||
},
|
||||
dialogconfirm() {
|
||||
return this.$store.state.journal.dialog_form_confirm
|
||||
},
|
||||
selectedPeriode: {
|
||||
get() {
|
||||
return this.$store.state.journal.selected_periode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_selected_periode", val)
|
||||
},
|
||||
},
|
||||
dialogformdetail() {
|
||||
return this.$store.state.journal.dialog_form_detail
|
||||
},
|
||||
xjournals() {
|
||||
return this.$store.state.journal.journals
|
||||
},
|
||||
xsummary() {
|
||||
return this.$store.state.journal.summary
|
||||
},
|
||||
ishide: {
|
||||
get() {
|
||||
return this.$store.state.journal.ishide
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_ishide", val)
|
||||
}
|
||||
},
|
||||
xdate: {
|
||||
get() {
|
||||
return this.$store.state.journal.xdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_xdate", val)
|
||||
}
|
||||
},
|
||||
xdateend: {
|
||||
get() {
|
||||
return this.$store.state.journal.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_end_date", val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormatted() {
|
||||
return this.formatDate(this.xdate)
|
||||
},
|
||||
filterComputedDateFormattedEnd() {
|
||||
return this.formatDate(this.xdateend)
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.journal.current_page;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_current_page", val);
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.$store.state.journal.xdate,
|
||||
periodeid: this.$store.state.journal.selected_periode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
});
|
||||
},
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.journal.total_journal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_total_journal", val);
|
||||
},
|
||||
},
|
||||
selected_journal: {
|
||||
get() {
|
||||
return this.$store.state.journal.selected_journal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_selected_journal", val);
|
||||
},
|
||||
},
|
||||
user() {
|
||||
return this.$store.state.journal.user
|
||||
},
|
||||
xjurnaldetails() {
|
||||
return this.$store.state.journal.jurnaldetails
|
||||
},
|
||||
openprint: {
|
||||
get() {
|
||||
return this.$store.state.journal.open_print;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_open_print", val);
|
||||
},
|
||||
},
|
||||
dialogerror: {
|
||||
get() {
|
||||
return this.$store.state.journal.dialog_error_jurnal;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_dialog_error_jurnal", val);
|
||||
},
|
||||
},
|
||||
msgerrjurnallist() {
|
||||
return this.$store.state.journal.msgerrjurnallist;
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.journal.alert_success;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_alert_success", val);
|
||||
},
|
||||
},
|
||||
msgSnackbar() {
|
||||
return this.$store.state.journal.msg_success;
|
||||
},
|
||||
dialog_error: {
|
||||
get() {
|
||||
return this.$store.state.journal.alert_error;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("journal/update_alert_error", val);
|
||||
},
|
||||
},
|
||||
msgError() {
|
||||
return this.$store.state.journal.save_error_message;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
convertMoney(money){
|
||||
return one_money(money)
|
||||
},
|
||||
doPrint(val) {
|
||||
// console.log(val)
|
||||
this.printwidth = 1028
|
||||
this.printtitle = ""
|
||||
let user = one_user()
|
||||
tm = Date.now()
|
||||
var rptname = 'rpt_jurnal_pendapatan_001'
|
||||
var formatrpt = this.formatreport
|
||||
|
||||
this.urlprint = "/birt/run?__report=report/one/accounting/" + rptname + ".rptdesign&__format=" + formatrpt + "&PID=" + val.Fa_ItemID + "&username=" + user.M_StaffName + "&tm=" + tm
|
||||
// console.log(this.urlprint)
|
||||
|
||||
this.$store.commit("journal/update_open_print", true)
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.Fa_ItemID == this.$store.state.journal.selected_journal.Fa_ItemID;
|
||||
},
|
||||
selectMe(sc) {
|
||||
this.$store.commit("journal/update_selected_journal", sc);
|
||||
console.log(sc)
|
||||
this.$store.commit("journal/update_branchlists", sc.branchlists)
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.xdate,
|
||||
periodeid: this.selectedPeriode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
})
|
||||
}, 1000),
|
||||
closeDialogPeriode() {
|
||||
this.$store.commit("journal/update_dialog_form_periode", false)
|
||||
},
|
||||
openDialogPeriode() {
|
||||
this.$store.commit("journal/update_dialog_form_periode", true)
|
||||
},
|
||||
openDialogConfirm() {
|
||||
this.$store.commit("journal/update_dialog_form_confirm", true)
|
||||
},
|
||||
closeDialogConfirm() {
|
||||
this.$store.commit("journal/update_dialog_form_confirm", false)
|
||||
},
|
||||
addConfirm() {
|
||||
this.xperiodeid = this.$store.state.journal.selected_periode.id
|
||||
this.xyearandmonth = this.$store.state.journal.selected_periode.yearandmonth
|
||||
this.xperiode = this.$store.state.journal.selected_periode.periode
|
||||
this.$store.commit("journal/update_dialog_form_confirm", false)
|
||||
|
||||
this.$store.dispatch("journal/addConfirm", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.xdate,
|
||||
periodeid: this.selectedPeriode.id,
|
||||
details : this.$store.state.journal.journals
|
||||
})
|
||||
},
|
||||
choosePeriode() {
|
||||
this.xperiodeid = this.$store.state.journal.selected_periode.id
|
||||
this.xyearandmonth = this.$store.state.journal.selected_periode.yearandmonth
|
||||
this.xperiode = this.$store.state.journal.selected_periode.periode
|
||||
// console.log(this.xperiodeid)
|
||||
this.$store.commit("journal/update_dialog_form_periode", false)
|
||||
this.$store.dispatch("journal/search", {
|
||||
current_page: this.$store.state.journal.current_page,
|
||||
xdate: this.xdate,
|
||||
periodeid: this.selectedPeriode.id,
|
||||
branchid: this.$store.state.journal.user.M_BranchID,
|
||||
regionalid: this.$store.state.journal.user.S_RegionalID,
|
||||
})
|
||||
},
|
||||
closeDialogFormDetail() {
|
||||
this.$store.commit("journal/update_dialog_form_detail", false)
|
||||
},
|
||||
vieDetail(val) {
|
||||
this.$store.commit("journal/update_dialog_form_detail", true)
|
||||
this.$store.commit("journal/update_jurnaldetails", val.detailtx)
|
||||
|
||||
let totalDebit = 0;
|
||||
let totalKredit = 0;
|
||||
for (let item = 0; item < val.detailtx.length; item++) {
|
||||
const element = val.detailtx[item];
|
||||
totalDebit += parseFloat(element.jurnalTxDebit || '0');
|
||||
totalKredit += parseFloat(element.jurnalTxCredit || '0');
|
||||
}
|
||||
|
||||
let totalBalance = totalDebit - totalKredit;
|
||||
let summary = {
|
||||
debit: totalDebit,
|
||||
credit: totalKredit,
|
||||
balance: totalBalance,
|
||||
};
|
||||
this.$store.commit("journal/update_summary", summary);
|
||||
},
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
isObjectEmpty(val) {
|
||||
let obj = val;
|
||||
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||
},
|
||||
isPeriodeEmpty() {
|
||||
return Object.keys(this.selectedPeriode).length === 0;
|
||||
},
|
||||
openDialogEdit(val) {
|
||||
this.selectedData = val;
|
||||
if (val.type == "DB") {
|
||||
this.debit = val.value;
|
||||
this.credit = 0;
|
||||
}
|
||||
if (val.type == "CR") {
|
||||
this.credit = val.value;
|
||||
this.debit = 0;
|
||||
}
|
||||
this.dialogEdit = true;
|
||||
},
|
||||
formatCurrency(val) {
|
||||
// Format the price above to USD using the locale, style, and currency.
|
||||
let price = parseFloat(val);
|
||||
let USDollar = new Intl.NumberFormat("id-ID", {
|
||||
style: "currency",
|
||||
currency: "IDR",
|
||||
});
|
||||
|
||||
// console.log(
|
||||
// `The formated version of ${price} is ${USDollar.format(price)}`
|
||||
// );
|
||||
return `${USDollar.format(price)}`;
|
||||
},
|
||||
resetInputFile() {
|
||||
document.getElementById("csv_file").value = null;
|
||||
this.dialogImport = false;
|
||||
},
|
||||
viewError(val) {
|
||||
this.$store.commit("journal/update_dialog_error_jurnal", true)
|
||||
this.$store.commit("journal/update_msgerrjurnallist", val.ErrMsg)
|
||||
},
|
||||
closeDialogError() {
|
||||
this.$store.commit("journal/update_dialog_error_jurnal", false)
|
||||
},
|
||||
openGenerate(val) {
|
||||
// console.log(val)
|
||||
this.xbranchCode = val.jurnalM_BranchCode
|
||||
this.xsearchDate = this.deFormatedDate(val.jurnalDate)
|
||||
this.xFa_ItemID = val.Fa_ItemID
|
||||
this.xname = val.jurnalTitle
|
||||
this.msgalertgenerate = val.jurnalTitle
|
||||
this.dialogregenerate = true
|
||||
},
|
||||
doRegenerateJurnal() {
|
||||
this.dialogregenerate = false
|
||||
|
||||
// console.log(prm)
|
||||
let user = one_user();
|
||||
console.log(user.M_BranchID)
|
||||
if (user.M_BranchID === 0 || user.M_BranchID === '0') {
|
||||
// generate regional
|
||||
this.$store.dispatch("journal/insertSales", {branchCode: 'ZZ', date: this.xsearchDate, jurnalno: this.selected_journal.jurnalNo})
|
||||
} else {
|
||||
// generate cabang
|
||||
this.$store.dispatch("journal/insertSales", {branchCode: this.xbranchCode, date: this.xsearchDate, jurnalno: this.selected_journal.jurnalNo})
|
||||
}
|
||||
},
|
||||
updateAlertSuccess(val) {
|
||||
this.$store.commit("journal/update_alert_success", val);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
xdate(val, old) {
|
||||
this.xdate = val
|
||||
this.thr_search()
|
||||
},
|
||||
xdateend(val, old) {
|
||||
this.xdateend = val
|
||||
this.thr_search()
|
||||
},
|
||||
// search_item_periode(val, old) {
|
||||
// if (val == old) return
|
||||
// if (!val) return
|
||||
|
||||
// if (val.length < 1) {
|
||||
// this.$store.dispatch("journal/getPeriode", this.search_item_periode)
|
||||
// return this.thr_search_periode()
|
||||
// }
|
||||
|
||||
// if (val.length > 1) {
|
||||
// this.$store.dispatch("journal/getPeriode", this.search_item_periode)
|
||||
// return this.thr_search_periode()
|
||||
// }
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
76
test/vuex/acc-one-jurnal-fixed-asset-v2/index.php
Normal file
76
test/vuex/acc-one-jurnal-fixed-asset-v2/index.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<!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 style="background: #F5E8DF!important;">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs8 class="left" fill-height pa-1>
|
||||
<one-media-journal></one-media-journal>
|
||||
</v-flex>
|
||||
<v-flex xs4 class="right" fill-height pa-1>
|
||||
<one-branch></one-branch>
|
||||
</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'),
|
||||
'one-branch': httpVueLoader('./components/oneBranchList.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
361
test/vuex/acc-one-jurnal-fixed-asset-v2/modules/journal.js
Normal file
361
test/vuex/acc-one-jurnal-fixed-asset-v2/modules/journal.js
Normal file
@@ -0,0 +1,361 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/journal.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search_status: 0,
|
||||
current_page: 1,
|
||||
x_search: "",
|
||||
search_error_message: "",
|
||||
last_id: -1,
|
||||
coas: [],
|
||||
total_coas: 0,
|
||||
selected_coa: {},
|
||||
dialog_form_coa: false,
|
||||
act: 'new',
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
errors: [],
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
alert_error: false,
|
||||
dialog_error: false,
|
||||
open_print: false,
|
||||
|
||||
// ----
|
||||
xdate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
end_date: moment(new Date()).format('YYYY-MM-DD'),
|
||||
journals: [
|
||||
// {
|
||||
// "journalID": "1",
|
||||
// "journalNo": "JM002/08",
|
||||
// "date": "31-08-2024",
|
||||
// "name": "budhi/budhi",
|
||||
// "account": "508501001",
|
||||
// "title": "MS BESIN, SOLAR, PARKIR, TOL, TRANSPORT",
|
||||
// "description": "ACCRUED PARKIR AGST 24",
|
||||
// "debit": "275000",
|
||||
// "credit": "0",
|
||||
// "posted": "Y"
|
||||
// },
|
||||
// {
|
||||
// "journalID": "2",
|
||||
// "journalNo": "JM002/08",
|
||||
// "date": "31-08-2024",
|
||||
// "name": "budhi/budhi",
|
||||
// "account": "2004009",
|
||||
// "title": "ACCRUED EXP OTHERS",
|
||||
// "description": "ACCRUED PARKIR AGST 24",
|
||||
// "debit": "0",
|
||||
// "credit": "275000",
|
||||
// "posted": "Y"
|
||||
// }
|
||||
],
|
||||
selected_journal: {},
|
||||
summary: {"debit": 0, "credit": 0, "balance": 0},
|
||||
dialog_form_detail: false,
|
||||
periodeList: [],
|
||||
selected_periode: {},
|
||||
loading: false,
|
||||
dialog_form_periode: false,
|
||||
dialog_form_confirm: false,
|
||||
autocomplete_status: 0,
|
||||
search_status: 0,
|
||||
search_error_message: "",
|
||||
total_journal: 0,
|
||||
user: one_user(),
|
||||
jurnaldetails: [],
|
||||
dialog_error_jurnal: false,
|
||||
msgerrjurnallist: [],
|
||||
user: one_user(),
|
||||
ishide: 'Y',
|
||||
branchlists: []
|
||||
},
|
||||
mutations: {
|
||||
update_ishide(state, val) {
|
||||
state.ishide = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
state.current_page = 1
|
||||
},
|
||||
update_search_error_message(state, val) {
|
||||
state.search_error_message = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_coas(state, val) {
|
||||
state.coas = val
|
||||
},
|
||||
update_total_coas(state, val) {
|
||||
state.total_coas = val
|
||||
},
|
||||
update_selected_coa(state, val) {
|
||||
state.selected_coa = val
|
||||
},
|
||||
update_dialog_form_coa(state, val) {
|
||||
state.dialog_form_coa = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_alert_error(state, val) {
|
||||
state.alert_error = val
|
||||
},
|
||||
update_dialog_error(state, val) {
|
||||
state.dialog_error = val
|
||||
},
|
||||
update_open_print(state, value) {
|
||||
state.open_print = value
|
||||
},
|
||||
|
||||
// ---
|
||||
update_xdate(state, val) {
|
||||
state.xdate = val
|
||||
},
|
||||
update_end_date(state, val) {
|
||||
state.end_date = val
|
||||
},
|
||||
update_journals(state, val) {
|
||||
state.journals = val
|
||||
},
|
||||
update_branchlists(state, val) {
|
||||
state.branchlists = val
|
||||
},
|
||||
update_selected_journal(state, val) {
|
||||
state.selected_journal = val
|
||||
},
|
||||
update_summary(state, val) {
|
||||
state.summary = val
|
||||
},
|
||||
update_dialog_form_detail(state, val) {
|
||||
state.dialog_form_detail = val
|
||||
},
|
||||
update_periodeList(state, val) {
|
||||
state.periodeList = val
|
||||
},
|
||||
update_selected_periode(state, val) {
|
||||
state.selected_periode = val
|
||||
},
|
||||
update_loading(state, val) {
|
||||
state.loading = val
|
||||
},
|
||||
update_dialog_form_periode(state, val) {
|
||||
state.dialog_form_periode = val
|
||||
},
|
||||
update_dialog_form_confirm(state, val) {
|
||||
state.dialog_form_confirm = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_search_error_message(state, val) {
|
||||
state.search_error_message = val
|
||||
},
|
||||
update_total_journal(state, val) {
|
||||
state.total_journal = val
|
||||
},
|
||||
update_user(state, val) {
|
||||
state.user = val
|
||||
},
|
||||
update_jurnaldetails(state, val) {
|
||||
state.jurnaldetails = val
|
||||
},
|
||||
update_dialog_error_jurnal(state, val) {
|
||||
state.dialog_error_jurnal = val
|
||||
},
|
||||
update_msgerrjurnallist(state, val) {
|
||||
state.msgerrjurnallist = val
|
||||
},
|
||||
update_user(state, val) {
|
||||
state.user = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async getPeriode(context) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let prm = {}
|
||||
prm.token = one_token()
|
||||
let resp = await api.getPeriode(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = resp.data
|
||||
|
||||
context.commit("update_periodeList", data)
|
||||
// Ambil bulan dan tahun sekarang
|
||||
let now = new Date();
|
||||
let currentMonth = now.getMonth() + 1; // getMonth() dimulai dari 0 (Jan = 0)
|
||||
let currentYear = now.getFullYear().toString(); // Ambil tahun dalam bentuk string
|
||||
|
||||
// Cari data dengan periodeMonth dan periodeYear yang cocok
|
||||
let selectedPeriode = data.find(p => p.periodeMonth == currentMonth.toString() && p.periodeYear == currentYear);
|
||||
|
||||
// Jika tidak ditemukan, gunakan data pertama sebagai default
|
||||
if (!selectedPeriode) {
|
||||
selectedPeriode = data[0];
|
||||
}
|
||||
|
||||
context.commit("update_selected_periode", selectedPeriode)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
// var prm = {
|
||||
// token: one_token(),
|
||||
// periodeid: context.state.selected_periode.id
|
||||
// }
|
||||
// var prm = {}
|
||||
// prm.one_token()
|
||||
let resp = await api.search(one_token(), prm.xdate, prm.periodeid, prm.branchid, prm.regionalid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
context.commit("update_journals", data.records)
|
||||
context.commit("update_ishide", data.records[0].ishide)
|
||||
context.commit("update_total_journal", data.total)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async getdetail(context, prm) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
// var prm = {
|
||||
// token: one_token(),
|
||||
// periodeid: context.state.selected_periode.id
|
||||
// }
|
||||
// var prm = {}
|
||||
prm.token = one_token()
|
||||
let resp = await api.getdetail(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
context.commit("update_branchlists", data.records)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
}
|
||||
},
|
||||
|
||||
async insertSales(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let branchCode = prm.branchCode;
|
||||
let date = prm.date;
|
||||
let jurnalno = prm.jurnalno
|
||||
let resp = await api.insertSales(branchCode, date, jurnalno)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_error", true)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
context.commit("update_alert_success", true)
|
||||
var msg = resp.data.msg
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("search", {
|
||||
current_page: context.state.current_page,
|
||||
xdate: context.state.xdate,
|
||||
periodeid: context.state.selected_periode.id
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
context.commit("update_alert_error", true)
|
||||
}
|
||||
},
|
||||
async addConfirm(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.addConfirm(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_error", true)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
context.commit("update_alert_success", true)
|
||||
var msg = " Fixed aset periode " + context.state.selected_periode.periode + " berhasil dikonfirmasi"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("search", {
|
||||
current_page: context.state.current_page,
|
||||
xdate: context.state.xdate,
|
||||
periodeid: context.state.selected_periode.id
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
context.commit("update_alert_error", true)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
23
test/vuex/acc-one-jurnal-fixed-asset-v2/store.js
Normal file
23
test/vuex/acc-one-jurnal-fixed-asset-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