Commit 3b2e5ca5 authored by EKSAD's avatar EKSAD

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents ce343f1d 1c026c14
...@@ -199,14 +199,16 @@ const create = (type = "") => { ...@@ -199,14 +199,16 @@ const create = (type = "") => {
const validateSubmitReport = (body) => api.post('transaction/master_budget/validate_save', body) const validateSubmitReport = (body) => api.post('transaction/master_budget/validate_save', body)
const getMonthTransaction = () => api.get('transaction/get_default_month') const getMonthTransaction = () => api.get('transaction/get_default_month')
const countingFormula = (body) => api.post('transaction/counting_formula', body) const countingFormula = (body) => api.post('transaction/counting_formula', body)
const submitMasterBudget = (body) => api.post('transaction/master_budget/submit_master_budget', body)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body) const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body)
const getAllOperatingInd = (body) => api.post('transaction/get_all_operating_indicator_report', body) const getAllOperatingInd = (body) => api.post('transaction/get_all_operating_indicator_report', body)
const getOperatingIndDetail = (body) => api.post('transaction/operating_indicator/get_operating_indicator_report_hierarki', body) const getOperatingIndDetail = (body) => api.post('transaction/operating_indicator/get_operating_indicator_report_hierarki', body)
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body) const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body)
const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body) const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body)
const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body) const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body)
const getDashboard = (body) => api.get('transaction/master_budget/get_dashboard')
//Template //Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`) const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
...@@ -352,7 +354,10 @@ const create = (type = "") => { ...@@ -352,7 +354,10 @@ const create = (type = "") => {
checkUploadOperatingInd, checkUploadOperatingInd,
uploadOperatingInd, uploadOperatingInd,
getLastestUpdateMB, getLastestUpdateMB,
countingFormula countingFormula,
submitMasterBudget,
getIdDeleteFromExcel,
getDashboard
} }
} }
......
...@@ -17,6 +17,7 @@ import { format } from 'date-fns'; ...@@ -17,6 +17,7 @@ import { format } from 'date-fns';
import Constant from '../library/Constant'; import Constant from '../library/Constant';
import PropagateLoader from "react-spinners/PropagateLoader" import PropagateLoader from "react-spinners/PropagateLoader"
import CashFlow from './BudgetTahunan/CashFlow'; import CashFlow from './BudgetTahunan/CashFlow';
import { validate } from '@material-ui/pickers';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -289,7 +290,7 @@ export default class BudgetTahunan extends Component { ...@@ -289,7 +290,7 @@ export default class BudgetTahunan extends Component {
visibleTP: false, visibleTP: false,
visibleCF: false, visibleCF: false,
}) })
} else if (item === "Cash Flow"){ } else if (item === "Cash Flow") {
this.setState({ this.setState({
visibleBudgetTahunan: false, visibleBudgetTahunan: false,
visibleBS: false, visibleBS: false,
...@@ -372,6 +373,21 @@ export default class BudgetTahunan extends Component { ...@@ -372,6 +373,21 @@ export default class BudgetTahunan extends Component {
}) })
} }
validate() {
let array = []
this.state.dataTable.map(item => {
if (item[3].includes("not-yet") || item[3].includes("draft")) {
array.push(item[3])
} else {
array.push(item[3])
}
})
if (array.includes("not-yet" || "draft")) {
console.log('gagal');
} else {
console.log('masuk');
}
}
render() { render() {
const columns = ["#", "Report Type", const columns = ["#", "Report Type",
...@@ -606,9 +622,19 @@ export default class BudgetTahunan extends Component { ...@@ -606,9 +622,19 @@ export default class BudgetTahunan extends Component {
</div> </div>
</div> </div>
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} > <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => this.validate()}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography>
</div> </div>
</button>
</div> </div>
</Paper> </Paper>
......
...@@ -284,6 +284,19 @@ export default class CorporateAnnualTarget extends Component { ...@@ -284,6 +284,19 @@ export default class CorporateAnnualTarget extends Component {
} }
checkUpload() { checkUpload() {
let dataDelete = this.state.dataDelete
api.create().getIdDeleteFromExcel(this.state.payload).then((response) => {
if (response.data) {
let idDelete = response.data.data.item_report_id
if (idDelete.length > 0) {
idDelete.map((item,index) => {
dataDelete.push(item)
})
this.setState({dataDelete})
}
}
})
api.create().checkUploadMB(this.state.payload).then(response => { api.create().checkUploadMB(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // console.log(JSON.stringify(this.state.payload));
console.log(response) console.log(response)
...@@ -343,11 +356,24 @@ export default class CorporateAnnualTarget extends Component { ...@@ -343,11 +356,24 @@ export default class CorporateAnnualTarget extends Component {
} }
uploadCAT(type) { uploadCAT(type) {
let payload = {"item_report_id": this.state.dataDelete}
if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => {
this.functionUpload(type)
})
} else {
this.functionUpload(type)
}
}
functionUpload(type) {
let data = [] let data = []
console.log(this.state.dataTable) console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
"item_report_id": i[0], "item_report_id": i[1],
"item_report": String(i[6]), "item_report": String(i[6]),
"weight": String(i[7]), "weight": String(i[7]),
"uom": String(i[8]), "uom": String(i[8]),
...@@ -534,6 +560,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -534,6 +560,7 @@ export default class CorporateAnnualTarget extends Component {
// }) // })
}) })
} else { } else {
console.log('sini jing')
// api.create().validateSubmitReport(payloadBro).then((response) => { // api.create().validateSubmitReport(payloadBro).then((response) => {
// console.log(response) // console.log(response)
// if (response.data.data.result) { // if (response.data.data.result) {
...@@ -732,7 +759,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -732,7 +759,7 @@ export default class CorporateAnnualTarget extends Component {
const handleAction = (idParent) => { const handleAction = (idParent) => {
if (idParent !== null) { if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent) let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL PERSPECTIVE') { if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
return true return true
} else { } else {
return false return false
...@@ -1901,7 +1928,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1901,7 +1928,7 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleCAT? <Paper style={{ paddingTop: 10, paddingBottom: 20 }}> {this.state.visibleCAT? <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget Submission - Corporate Annual Target</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Corporate Annual Target</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
...@@ -2068,6 +2095,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2068,6 +2095,7 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
{this.state.dataLoaded && ( {this.state.dataLoaded && (
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
......
...@@ -121,7 +121,8 @@ export default class TaxPlanning extends Component { ...@@ -121,7 +121,8 @@ export default class TaxPlanning extends Component {
{tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf}, {tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf},
item.tax_planning.total_current_year, item.tax_planning.total_current_year,
{tbc : item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf}, {tbc : item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf},
{tbc : item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf} {tbc : item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf},
item.order
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -158,7 +159,8 @@ export default class TaxPlanning extends Component { ...@@ -158,7 +159,8 @@ export default class TaxPlanning extends Component {
{tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf}, {tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf},
item.tax_planning.total_current_year, item.tax_planning.total_current_year,
{tbc : item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf}, {tbc : item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf},
{tbc : item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf} {tbc : item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf},
item.order
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -800,7 +802,7 @@ export default class TaxPlanning extends Component { ...@@ -800,7 +802,7 @@ export default class TaxPlanning extends Component {
let reg = /^\d+$/ let reg = /^\d+$/
splitOperator.map((item) => { splitOperator.map((item) => {
if (reg.test(item) === true) { if (reg.test(item) === true) {
let i = dataTable2.findIndex((val) => val[23] == item) let i = dataTable2.findIndex((val) => val[24] == item)
if (i > 0) { if (i > 0) {
rilFormula = rilFormula.replace(item, dataTable2[i][tableMeta.columnIndex] === "" ? "0" : dataTable2[i][tableMeta.columnIndex]) rilFormula = rilFormula.replace(item, dataTable2[i][tableMeta.columnIndex] === "" ? "0" : dataTable2[i][tableMeta.columnIndex])
} }
...@@ -846,7 +848,7 @@ export default class TaxPlanning extends Component { ...@@ -846,7 +848,7 @@ export default class TaxPlanning extends Component {
let arrayFormula = kondisi.match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g) let arrayFormula = kondisi.match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = [] let arrayJumlah = []
arrayFormula.map((item, indexs) => { arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[23] == item) let index = dataTable2.findIndex((val) => val[24] == item)
if (index > 0) { if (index > 0) {
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex]) arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
} else { } else {
......
...@@ -282,9 +282,11 @@ export default class EditManagementDoc extends Component { ...@@ -282,9 +282,11 @@ export default class EditManagementDoc extends Component {
const formData = new FormData(); const formData = new FormData();
if (this.state.file == this.state.filePath){ if (this.state.file == this.state.filePath){
formData.append("updated", 0); formData.append("updated", 0);
} formData.append("file", null);
} else {
formData.append("updated", 1); formData.append("updated", 1);
formData.append("file", this.state.file); formData.append("file", this.state.file);
}
formData.append("companyId", this.state.getPerusahaan.company_id); formData.append("companyId", this.state.getPerusahaan.company_id);
formData.append("settingId", this.state.getDocument.document_category_id); formData.append("settingId", this.state.getDocument.document_category_id);
formData.append("documentMonth", this.state.monthId.month_id); formData.append("documentMonth", this.state.monthId.month_id);
...@@ -295,7 +297,12 @@ export default class EditManagementDoc extends Component { ...@@ -295,7 +297,12 @@ export default class EditManagementDoc extends Component {
this.setState({ formData }, () => { this.setState({ formData }, () => {
this.props.updateDocument(this.state.formData) this.props.updateDocument(this.state.formData)
}) })
console.log(JSON.stringify(formData)) var object = {};
formData.forEach(function(value, key){
object[key] = value;
});
var json = JSON.stringify(object);
console.log(json)
} }
} }
......
...@@ -13,7 +13,8 @@ class HomePage extends Component { ...@@ -13,7 +13,8 @@ class HomePage extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
userData: null userData: null,
listDashboard: []
} }
} }
...@@ -28,10 +29,24 @@ class HomePage extends Component { ...@@ -28,10 +29,24 @@ class HomePage extends Component {
} }
} }
}) })
this.getDashboard()
}
getDashboard() {
let listDashboard = []
api.create().getDashboard().then((response) => {
if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data
data.map((item,index) => {
listDashboard.push([index+1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status])
})
this.setState({listDashboard})
}
})
} }
render() { render() {
const columns = ["#", "Nama Perusahaan", "Revisi", "Status", { const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
name: "Action", name: "Action",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
...@@ -123,7 +138,7 @@ class HomePage extends Component { ...@@ -123,7 +138,7 @@ class HomePage extends Component {
<div> <div>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={data} data={this.state.listDashboard}
columns={columns} columns={columns}
options={options} options={options}
/> />
......
...@@ -2,7 +2,6 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,6 @@ import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel } from '@material-ui/core'; import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel } from '@material-ui/core';
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import Images from '../assets/Images'; import Images from '../assets/Images';
import BalanceSheet from './BudgetTahunan/BalanceSheet';
import api from '../api'; import api from '../api';
import Autocomplete from '@material-ui/lab/Autocomplete'; import Autocomplete from '@material-ui/lab/Autocomplete';
import { titleCase } from '../library/Utils'; import { titleCase } from '../library/Utils';
...@@ -13,6 +12,7 @@ import CorporateAnnualTarget from './BudgetTahunan/CorporateAnnualTarget'; ...@@ -13,6 +12,7 @@ import CorporateAnnualTarget from './BudgetTahunan/CorporateAnnualTarget';
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../library/Upload"; import UploadFile from "../library/Upload";
import { format } from 'date-fns'; import { format } from 'date-fns';
import BalanceSheetMR from './MonthlyReport/BalanceSheetMR';
export default class MonthlyReport extends Component { export default class MonthlyReport extends Component {
constructor(props) { constructor(props) {
...@@ -161,8 +161,12 @@ export default class MonthlyReport extends Component { ...@@ -161,8 +161,12 @@ export default class MonthlyReport extends Component {
}) })
} }
clickDetail(item, id) { clickDetail(item, id, revision, status) {
this.setState({ report_id: id }) this.setState({
report_id: id,
revisionTable: revision,
status: status
}, () => {
if (item === 'Balance Sheet') { if (item === 'Balance Sheet') {
this.setState({ this.setState({
visibleMonthlyReport: false, visibleMonthlyReport: false,
...@@ -209,6 +213,7 @@ export default class MonthlyReport extends Component { ...@@ -209,6 +213,7 @@ export default class MonthlyReport extends Component {
visibleTP: false visibleTP: false
}) })
} }
})
} }
handleChange(value, tableMeta) { handleChange(value, tableMeta) {
...@@ -312,9 +317,9 @@ export default class MonthlyReport extends Component { ...@@ -312,9 +317,9 @@ export default class MonthlyReport extends Component {
cursor: tableMeta.rowData[5] ? 'pointer' : null, cursor: tableMeta.rowData[5] ? 'pointer' : null,
borderColor: 'transparent' borderColor: 'transparent'
}} }}
// onClick={() => onClick={() =>
// tableMeta.rowData[5] ? this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4]) : null tableMeta.rowData[5] ? this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3]) : null
// } }
> >
<Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography> <Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
</button> </button>
...@@ -530,10 +535,18 @@ export default class MonthlyReport extends Component { ...@@ -530,10 +535,18 @@ export default class MonthlyReport extends Component {
)} )}
{this.state.visibleBS && ( {this.state.visibleBS && (
<BalanceSheet <BalanceSheetMR
open={this.props.open}
report_id={this.state.report_id} report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company} company={this.state.company}
onClickClose={() => this.setState({ visibleBS: false, visibleMonthlyReport: true })} revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
// saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleBudgetTahunan: true })}
// getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
{this.state.visiblePL && ( {this.state.visiblePL && (
......
This diff is collapsed.
...@@ -261,6 +261,12 @@ export default class OperatingIndicator extends Component { ...@@ -261,6 +261,12 @@ export default class OperatingIndicator extends Component {
}) })
} }
saveOperatingInd(payload) {
api.create().createOpetaingInd(payload).then((response) => {
this.getReport()
})
}
render() { render() {
const columns = ["#", "Jenis Laporan", const columns = ["#", "Jenis Laporan",
// { // {
...@@ -453,6 +459,9 @@ export default class OperatingIndicator extends Component { ...@@ -453,6 +459,9 @@ export default class OperatingIndicator extends Component {
height={this.props.height} height={this.props.height}
width={this.props.width} width={this.props.width}
onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, this.forceUpdate())} onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, this.forceUpdate())}
getReport={() => this.getReport()}
saveOperatingInd={this.saveOperatingInd.bind(this)}
/> />
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment