const URL = "/one-api/mockup/masterdata/accounting/";

export async function get_listing_type(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/listpresentasecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function get_list_detail_type(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/detailpresentasecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function insert_type_presentase(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/inserttypepresentasecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function edit_type_presentase(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/edittypepresentasecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function delete_type_presentase(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/deletetypepresentasecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function get_list_regional(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/getlistregional', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function get_regional_branch(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/getregionalbranch', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function insert_detail_precab(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/insertdetailprecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function get_current_value_detail(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/getvaluedetailprecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function edit_detail_precab(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/editdetailprecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function delete_detail_precab(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/deletedetailprecost', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}

export async function search_coa(params) {
    try {
        var resp = await axios.post(URL + 'presentasecost/searchcoa', params)
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.message
            }
        }
        let data = resp.data
        return data
    } catch (error) {
        return {
            status: "ERR",
            message: error.message
        }
    }
}