Commit 0b9aea16 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

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

parents 3adec4a4 10d4bf81
...@@ -191,6 +191,7 @@ const create = (type = "") => { ...@@ -191,6 +191,7 @@ const create = (type = "") => {
const getPeriodeTransaction = () => api.get('transaction/get_periode') const getPeriodeTransaction = () => api.get('transaction/get_periode')
const deleteAttachment = (id) => api.post(`transaction/delete_attachment/${id}`) const deleteAttachment = (id) => api.post(`transaction/delete_attachment/${id}`)
const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body) const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body)
const getLastestUpdateMB = (body) => api.post('/transaction/master_budget/get_latest_update', body)
const createSubmitReport = (body) => api.post('transaction/master_budget/create_submission_report', body) const createSubmitReport = (body) => api.post('transaction/master_budget/create_submission_report', body)
const getSubmission = (body) => api.post('transaction/get_submission_id', body) const getSubmission = (body) => api.post('transaction/get_submission_id', body)
const checkUploadMB = (body) => api.post('transaction/master_budget/check_import', body) const checkUploadMB = (body) => api.post('transaction/master_budget/check_import', body)
...@@ -348,7 +349,8 @@ const create = (type = "") => { ...@@ -348,7 +349,8 @@ const create = (type = "") => {
deleteAllItemReport, deleteAllItemReport,
validateSubmitReport, validateSubmitReport,
checkUploadOperatingInd, checkUploadOperatingInd,
uploadOperatingInd uploadOperatingInd,
getLastestUpdateMB
} }
} }
......
...@@ -349,7 +349,7 @@ export default class BudgetTahunan extends Component { ...@@ -349,7 +349,7 @@ export default class BudgetTahunan extends Component {
render() { render() {
const columns = ["#", "Jenis Laporan", const columns = ["#", "Report Type",
{ {
name: "Revision", name: "Revision",
options: { options: {
...@@ -464,12 +464,12 @@ export default class BudgetTahunan extends Component { ...@@ -464,12 +464,12 @@ export default class BudgetTahunan extends Component {
{this.state.visibleBudgetTahunan && ( {this.state.visibleBudgetTahunan && (
<div> <div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Master Budget Submission</Typography>
</div> </div>
<div style={{ padding: 20, width: '100%' }}> <div style={{ padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10 }}> <Paper style={{ paddingTop: 10 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div>
...@@ -484,7 +484,7 @@ export default class BudgetTahunan extends Component { ...@@ -484,7 +484,7 @@ export default class BudgetTahunan extends Component {
disableClearable disableClearable
style={{ width: 250 }} style={{ width: 250 }}
renderInput={(params) => renderInput={(params) =>
<TextField {...params} label="Periode" margin="normal" style={{ marginTop: 7 }} <TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }}
/>} />}
value={this.state.periode} value={this.state.periode}
/> />
......
...@@ -44,7 +44,8 @@ export default class BalanceSheet extends Component { ...@@ -44,7 +44,8 @@ export default class BalanceSheet extends Component {
disabledSave: true, disabledSave: true,
editable: false, editable: false,
buttonError: false, buttonError: false,
judulColumn: null judulColumn: null,
updateBy: '-'
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -52,9 +53,29 @@ export default class BalanceSheet extends Component { ...@@ -52,9 +53,29 @@ export default class BalanceSheet extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
console.log(this.props); console.log(this.props);
} }
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
}
api.create().getLastestUpdateMB(payload).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
}
}
})
}
getItemHierarki() { getItemHierarki() {
this.setState({ loading: true, judulColumn: null }) this.setState({ loading: true, judulColumn: null })
let payload = { let payload = {
...@@ -177,22 +198,22 @@ export default class BalanceSheet extends Component { ...@@ -177,22 +198,22 @@ export default class BalanceSheet extends Component {
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
total_actual_before: String(i[6]), total_actual_before: String(Number(i[6]).toFixed(1)),
january: String(i[7]), january: String(Number(i[7]).toFixed(1)),
february: String(i[8]), february: String(Number(i[8]).toFixed(1)),
march: String(i[9]), march: String(Number(i[9]).toFixed(1)),
april: String(i[10]), april: String(Number(i[10]).toFixed(1)),
may: String(i[11]), may: String(Number(i[11]).toFixed(1)),
june: String(i[12]), june: String(Number(i[12]).toFixed(1)),
july: String(i[13]), july: String(Number(i[13]).toFixed(1)),
august: String(i[14]), august: String(Number(i[14]).toFixed(1)),
september: String(i[15]), september: String(Number(i[15]).toFixed(1)),
october: String(i[16]), october: String(Number(i[16]).toFixed(1)),
november: String(i[17]), november: String(Number(i[17]).toFixed(1)),
december: String(i[18]), december: String(Number(i[18]).toFixed(1)),
total_current_year: String(i[19]), total_current_year: String(Number(i[19]).toFixed(1)),
total_next_year: String(i[20]), total_next_year: String(Number(i[20]).toFixed(1)),
total_more_year: String(i[21]) total_more_year: String(Number(i[21]).toFixed(1))
}) })
}) })
let payload = { let payload = {
...@@ -218,7 +239,7 @@ export default class BalanceSheet extends Component { ...@@ -218,7 +239,7 @@ export default class BalanceSheet extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Template Balance Sheet.xlsx'; a.download = 'Template Master Budget Balance Sheet.xlsx';
a.click(); a.click();
} }
} }
...@@ -319,27 +340,27 @@ export default class BalanceSheet extends Component { ...@@ -319,27 +340,27 @@ export default class BalanceSheet extends Component {
}) })
} }
uploadBalanceSheet() { uploadBalanceSheet(type) {
let data = [] let data = []
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
total_actual_before: String(i[6]), total_actual_before: String(Number(i[6]).toFixed(1)),
january: String(i[7]), january: String(Number(i[7]).toFixed(1)),
february: String(i[8]), february: String(Number(i[8]).toFixed(1)),
march: String(i[9]), march: String(Number(i[9]).toFixed(1)),
april: String(i[10]), april: String(Number(i[10]).toFixed(1)),
may: String(i[11]), may: String(Number(i[11]).toFixed(1)),
june: String(i[12]), june: String(Number(i[12]).toFixed(1)),
july: String(i[13]), july: String(Number(i[13]).toFixed(1)),
august: String(i[14]), august: String(Number(i[14]).toFixed(1)),
september: String(i[15]), september: String(Number(i[15]).toFixed(1)),
october: String(i[16]), october: String(Number(i[16]).toFixed(1)),
november: String(i[17]), november: String(Number(i[17]).toFixed(1)),
december: String(i[18]), december: String(Number(i[18]).toFixed(1)),
total_current_year: String(i[19]), total_current_year: String(Number(i[19]).toFixed(1)),
total_next_year: String(i[20]), total_next_year: String(Number(i[20]).toFixed(1)),
total_more_year: String(i[21]) total_more_year: String(Number(i[21]).toFixed(1))
}) })
}) })
let body = { let body = {
...@@ -347,9 +368,10 @@ export default class BalanceSheet extends Component { ...@@ -347,9 +368,10 @@ export default class BalanceSheet extends Component {
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
report_id: this.props.report_id, report_id: this.props.report_id,
balance_sheet: data balance_sheet: data,
status: type
} }
console.log(data); // console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
...@@ -360,13 +382,14 @@ export default class BalanceSheet extends Component { ...@@ -360,13 +382,14 @@ export default class BalanceSheet extends Component {
alert(response.data.status) alert(response.data.status)
} }
} else { } else {
this.setState({ loading: false })
alert(response.problem) alert(response.problem)
} }
}) })
} }
async downloadAllData() { async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url); console.log(url);
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
...@@ -377,36 +400,36 @@ export default class BalanceSheet extends Component { ...@@ -377,36 +400,36 @@ export default class BalanceSheet extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Balance Sheet.xlsx'; a.download = 'Master Budget Balance Sheet.xlsx';
a.click(); a.click();
} }
} }
handleValidate() { handleValidate() {
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[1], item_report_id: i[1],
total_actual_before: String(i[6]), total_actual_before: String(i[6]),
january: String(i[7]), january: i[0] === 3 && i[7] === "" ? "0" : String(i[7]),
february: String(i[8]), february: i[0] === 3 && i[8] === "" ? "0" : String(i[8]),
march: String(i[9]), march: i[0] === 3 && i[9] === "" ? "0" : String(i[9]),
april: String(i[10]), april: i[0] === 3 && i[10] === "" ? "0" : String(i[10]),
may: String(i[11]), may: i[0] === 3 && i[11] === "" ? "0" : String(i[11]),
june: String(i[12]), june: i[0] === 3 && i[12] === "" ? "0" : String(i[12]),
july: String(i[13]), july: i[0] === 3 && i[13] === "" ? "0" : String(i[13]),
august: String(i[14]), august: i[0] === 3 && i[14] === "" ? "0" : String(i[14]),
september: String(i[15]), september: i[0] === 3 && i[15] === "" ? "0" : String(i[15]),
october: String(i[16]), october: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
november: String(i[17]), november: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
december: String(i[18]), december: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
total_current_year: String(i[19]), total_current_year: i[0] === 3 && i[19] === "" ? "0" : String(i[19]),
total_next_year: String(i[20]), total_next_year: i[0] === 3 && i[20] === "" ? "0" : String(i[20]),
total_more_year: String(i[21]) total_more_year: i[0] === 3 && i[21] === "" ? "0" : String(i[21]),
}) })
}) })
console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
let payload = { let payload = {
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -448,14 +471,7 @@ export default class BalanceSheet extends Component { ...@@ -448,14 +471,7 @@ export default class BalanceSheet extends Component {
} }
} }
const handleTotal = (tableMeta) => { const handleTotal = (tableMeta) => {
let total = 0 let total = dataTable2[tableMeta.rowIndex][19] = dataTable2[tableMeta.rowIndex][18]
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 7 && index <= 18) {
let valItem = item == undefined || item == "" ? 0 : item
total += Number(valItem)
}
})
dataTable2[tableMeta.rowIndex][19] = total
return total return total
// console.log(total); // console.log(total);
} }
...@@ -605,7 +621,7 @@ export default class BalanceSheet extends Component { ...@@ -605,7 +621,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={value} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -635,11 +651,10 @@ export default class BalanceSheet extends Component { ...@@ -635,11 +651,10 @@ export default class BalanceSheet extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
decimalSeparator={"."}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) console.log(dataTable2)
...@@ -656,7 +671,7 @@ export default class BalanceSheet extends Component { ...@@ -656,7 +671,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -670,7 +685,7 @@ export default class BalanceSheet extends Component { ...@@ -670,7 +685,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -680,7 +695,7 @@ export default class BalanceSheet extends Component { ...@@ -680,7 +695,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -725,7 +740,7 @@ export default class BalanceSheet extends Component { ...@@ -725,7 +740,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -743,7 +758,7 @@ export default class BalanceSheet extends Component { ...@@ -743,7 +758,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -757,7 +772,7 @@ export default class BalanceSheet extends Component { ...@@ -757,7 +772,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -767,7 +782,7 @@ export default class BalanceSheet extends Component { ...@@ -767,7 +782,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -812,7 +827,7 @@ export default class BalanceSheet extends Component { ...@@ -812,7 +827,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -830,7 +845,7 @@ export default class BalanceSheet extends Component { ...@@ -830,7 +845,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -844,7 +859,7 @@ export default class BalanceSheet extends Component { ...@@ -844,7 +859,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -854,7 +869,7 @@ export default class BalanceSheet extends Component { ...@@ -854,7 +869,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -899,7 +914,7 @@ export default class BalanceSheet extends Component { ...@@ -899,7 +914,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -917,7 +932,7 @@ export default class BalanceSheet extends Component { ...@@ -917,7 +932,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -931,7 +946,7 @@ export default class BalanceSheet extends Component { ...@@ -931,7 +946,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -941,7 +956,7 @@ export default class BalanceSheet extends Component { ...@@ -941,7 +956,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -986,7 +1001,7 @@ export default class BalanceSheet extends Component { ...@@ -986,7 +1001,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1004,7 +1019,7 @@ export default class BalanceSheet extends Component { ...@@ -1004,7 +1019,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1018,7 +1033,7 @@ export default class BalanceSheet extends Component { ...@@ -1018,7 +1033,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1028,7 +1043,7 @@ export default class BalanceSheet extends Component { ...@@ -1028,7 +1043,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1073,7 +1088,7 @@ export default class BalanceSheet extends Component { ...@@ -1073,7 +1088,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1091,7 +1106,7 @@ export default class BalanceSheet extends Component { ...@@ -1091,7 +1106,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1105,7 +1120,7 @@ export default class BalanceSheet extends Component { ...@@ -1105,7 +1120,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1115,7 +1130,7 @@ export default class BalanceSheet extends Component { ...@@ -1115,7 +1130,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1160,7 +1175,7 @@ export default class BalanceSheet extends Component { ...@@ -1160,7 +1175,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1178,7 +1193,7 @@ export default class BalanceSheet extends Component { ...@@ -1178,7 +1193,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1192,7 +1207,7 @@ export default class BalanceSheet extends Component { ...@@ -1192,7 +1207,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1202,7 +1217,7 @@ export default class BalanceSheet extends Component { ...@@ -1202,7 +1217,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1247,7 +1262,7 @@ export default class BalanceSheet extends Component { ...@@ -1247,7 +1262,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1265,7 +1280,7 @@ export default class BalanceSheet extends Component { ...@@ -1265,7 +1280,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1279,7 +1294,7 @@ export default class BalanceSheet extends Component { ...@@ -1279,7 +1294,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1289,7 +1304,7 @@ export default class BalanceSheet extends Component { ...@@ -1289,7 +1304,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1334,7 +1349,7 @@ export default class BalanceSheet extends Component { ...@@ -1334,7 +1349,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1352,7 +1367,7 @@ export default class BalanceSheet extends Component { ...@@ -1352,7 +1367,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1366,7 +1381,7 @@ export default class BalanceSheet extends Component { ...@@ -1366,7 +1381,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1376,7 +1391,7 @@ export default class BalanceSheet extends Component { ...@@ -1376,7 +1391,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1421,7 +1436,7 @@ export default class BalanceSheet extends Component { ...@@ -1421,7 +1436,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1439,7 +1454,7 @@ export default class BalanceSheet extends Component { ...@@ -1439,7 +1454,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1453,7 +1468,7 @@ export default class BalanceSheet extends Component { ...@@ -1453,7 +1468,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1463,7 +1478,7 @@ export default class BalanceSheet extends Component { ...@@ -1463,7 +1478,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1508,7 +1523,7 @@ export default class BalanceSheet extends Component { ...@@ -1508,7 +1523,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1526,7 +1541,7 @@ export default class BalanceSheet extends Component { ...@@ -1526,7 +1541,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1540,7 +1555,7 @@ export default class BalanceSheet extends Component { ...@@ -1540,7 +1555,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1550,7 +1565,7 @@ export default class BalanceSheet extends Component { ...@@ -1550,7 +1565,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1595,7 +1610,7 @@ export default class BalanceSheet extends Component { ...@@ -1595,7 +1610,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1613,7 +1628,7 @@ export default class BalanceSheet extends Component { ...@@ -1613,7 +1628,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1627,7 +1642,7 @@ export default class BalanceSheet extends Component { ...@@ -1627,7 +1642,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1637,7 +1652,7 @@ export default class BalanceSheet extends Component { ...@@ -1637,7 +1652,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1680,7 +1695,7 @@ export default class BalanceSheet extends Component { ...@@ -1680,7 +1695,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> : </span> :
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
...@@ -1690,7 +1705,7 @@ export default class BalanceSheet extends Component { ...@@ -1690,7 +1705,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleTotal(tableMeta)} value={Number(handleTotal(tableMeta)).toFixed(1)}
/> />
</span>} </span>}
</div> </div>
...@@ -1720,7 +1735,7 @@ export default class BalanceSheet extends Component { ...@@ -1720,7 +1735,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1738,7 +1753,7 @@ export default class BalanceSheet extends Component { ...@@ -1738,7 +1753,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1752,7 +1767,7 @@ export default class BalanceSheet extends Component { ...@@ -1752,7 +1767,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1762,7 +1777,7 @@ export default class BalanceSheet extends Component { ...@@ -1762,7 +1777,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1807,7 +1822,7 @@ export default class BalanceSheet extends Component { ...@@ -1807,7 +1822,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={value} value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1825,7 +1840,7 @@ export default class BalanceSheet extends Component { ...@@ -1825,7 +1840,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1839,7 +1854,7 @@ export default class BalanceSheet extends Component { ...@@ -1839,7 +1854,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -1849,7 +1864,7 @@ export default class BalanceSheet extends Component { ...@@ -1849,7 +1864,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleFormula(value, tableMeta)} value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
...@@ -1893,7 +1908,7 @@ export default class BalanceSheet extends Component { ...@@ -1893,7 +1908,7 @@ export default class BalanceSheet extends Component {
return ( return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Master Budget Submission</Typography>
</div> </div>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}> <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}> <Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
...@@ -1905,7 +1920,7 @@ export default class BalanceSheet extends Component { ...@@ -1905,7 +1920,7 @@ export default class BalanceSheet extends Component {
{this.state.visibleBalanceSheet === true ? {this.state.visibleBalanceSheet === true ?
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <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 }}>Budget Tahunan - Balance Sheet</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Balance Sheet</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' }}>
...@@ -1977,22 +1992,17 @@ export default class BalanceSheet extends Component { ...@@ -1977,22 +1992,17 @@ export default class BalanceSheet extends Component {
/> />
</MuiThemeProvider> </MuiThemeProvider>
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
</div> </div>
<div className="grid grid-2x" style={{ marginTop: 20 }}> <div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1"> <div className="col-1">
<button <button
type="button" type="button"
onClick={() => this.state.editable === true ? onClick={() => this.setState({ loading: true }, () => {
this.setState({ loading: true }, () => { setTimeout(() => {
setTimeout(() => { this.props.onClickClose()
this.backToMasterBudget('draft') }, 100);
}, 100); })}
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
...@@ -2001,7 +2011,7 @@ export default class BalanceSheet extends Component { ...@@ -2001,7 +2011,7 @@ export default class BalanceSheet extends Component {
}} }}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2016,14 +2026,16 @@ export default class BalanceSheet extends Component { ...@@ -2016,14 +2026,16 @@ export default class BalanceSheet extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() => {
setTimeout(() => { this.setState({ loading: true }, () => {
this.props.onClickClose() setTimeout(() => {
}, 100); this.handleValidate()
})} }, 100);
})
}}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>
<button <button
...@@ -2036,21 +2048,25 @@ export default class BalanceSheet extends Component { ...@@ -2036,21 +2048,25 @@ export default class BalanceSheet extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.handleValidate() this.backToMasterBudget('draft')
}, 100); }, 100);
}) }) :
}} this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
> >
<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' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div> </div>
</button> </button>
<button <button
type="button" type="button"
// disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => { onClick={() => {
this.state.buttonError ? this.state.buttonError ?
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
...@@ -2068,7 +2084,7 @@ export default class BalanceSheet extends Component { ...@@ -2068,7 +2084,7 @@ export default class BalanceSheet extends Component {
}} }}
> >
<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' }}>Save</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2096,56 +2112,75 @@ export default class BalanceSheet extends Component { ...@@ -2096,56 +2112,75 @@ export default class BalanceSheet extends Component {
</div> </div>
)} )}
</div> </div>
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}>
<button <div className="grid grid-2x" style={{ marginTop: 20 }}>
type="button" <div className="col-1">
onClick={() => this.setState({ loading: true, visibleBalanceSheet: true }, () => { <button
setTimeout(() => { type="button"
this.getItemHierarki() onClick={() => this.setState({ loading: true, visibleBalanceSheet: true }, () => {
}, 100);
})}
style={{ marginRight: 20 }}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography>
</div>
</button>
<button
className="button"
type="button"
disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false }) this.getItemHierarki()
}, 100); }, 100);
}) })}
}} style={{ marginRight: 20 }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
</button> </button>
<button </div>
type="button" <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
disabled={this.state.buttonError} <button
onClick={() => this.setState({ loading: true }, () => { className="button"
setTimeout(() => { type="button"
this.uploadBalanceSheet() disabled={this.state.buttonError}
}, 100); style={{
})} backgroundColor: 'transparent',
> cursor: this.state.buttonError === true ? 'default' : 'pointer',
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> borderColor: 'transparent',
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> outline: 'none',
</div> marginRight: 20
</button> }}
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
}, 100);
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadBalanceSheet('draft')
}, 100);
})}
style={{ marginRight: 20}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div>
</button>
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadBalanceSheet('submitted')
}, 100);
})}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
</div> </div>
</div> </div>
</Paper>} </Paper>}
......
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