update proses add akun pusat media jurnal & move barcode to serah terima
This commit is contained in:
282
test/vuex/acc-one-jurnal-penerimaan-barang/api/journal.js
Normal file
282
test/vuex/acc-one-jurnal-penerimaan-barang/api/journal.js
Normal file
@@ -0,0 +1,282 @@
|
||||
const URL = "/one-api/mockup/masterdata/accounting/";
|
||||
|
||||
export async function getPeriode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/getPeriode", prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search(
|
||||
token,
|
||||
xdate,
|
||||
periodeid,
|
||||
current_page,
|
||||
search,
|
||||
branchCode,
|
||||
regionalId
|
||||
) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/search", {
|
||||
token: token,
|
||||
xdate: xdate,
|
||||
periodeid: periodeid,
|
||||
current_page: current_page,
|
||||
search: search,
|
||||
branchCode: branchCode,
|
||||
regionalId: regionalId
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function insertSales(branchCode, date, jurnalno) {
|
||||
try {
|
||||
var resp = await axios.get(
|
||||
URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getRegional(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/getRegional", prm);
|
||||
if (resp.status !== 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getBranch(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/getBranch", prm);
|
||||
if (resp.status !== 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getUserApproveLevel(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/getUserApproveLevel", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getListingCOA(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/getListingCOA", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function requestEditJurnal(params) {
|
||||
try {
|
||||
const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
|
||||
if (resp.status !== 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
const data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveEditJurnal(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function changeJurnalToPosted(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/changeJurnalToPosted", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getTotalJurnalNotPostedPerPeriod(params) {
|
||||
try {
|
||||
var resp = await axios.post(
|
||||
URL + "Journalgoodreceive/getTotalJurnalNotPostedPerPeriod",
|
||||
params
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function closeJurnalPerPeriode(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "Journalgoodreceive/closeJurnalPerPeriode", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getDataJurnalNotClosedPerPeriod(params) {
|
||||
try {
|
||||
var resp = await axios.post(
|
||||
URL + "Journalgoodreceive/getDataJurnalNotClosedPerPeriod",
|
||||
params
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user