Commit e57dcc56 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'faisal' into 'master'

update fam 240920 sore

See merge request !368
parents b6066f57 b9f82eca
...@@ -46,7 +46,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -46,7 +46,8 @@ export default class FixedAssetsMovement 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);
...@@ -54,9 +55,29 @@ export default class FixedAssetsMovement extends Component { ...@@ -54,9 +55,29 @@ export default class FixedAssetsMovement 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 }) this.setState({ loading: true })
let payload = { let payload = {
...@@ -180,22 +201,22 @@ export default class FixedAssetsMovement extends Component { ...@@ -180,22 +201,22 @@ export default class FixedAssetsMovement 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))
}) })
}) })
...@@ -207,7 +228,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -207,7 +228,7 @@ export default class FixedAssetsMovement extends Component {
"status": type, "status": type,
"fixed_asset_movement": data "fixed_asset_movement": data
} }
console.log(data); // console.log(data);
this.props.saveToMasterBudget(payload) this.props.saveToMasterBudget(payload)
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -222,7 +243,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -222,7 +243,7 @@ export default class FixedAssetsMovement 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 Fixed Assets Movement.xlsx'; a.download = 'Template Master Budget Fixed Assets Movement.xlsx';
a.click(); a.click();
} }
} }
...@@ -264,10 +285,12 @@ export default class FixedAssetsMovement extends Component { ...@@ -264,10 +285,12 @@ export default class FixedAssetsMovement extends Component {
} }
}) })
let body = { let body = {
submission_id: this.props.submissionID,
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,
fixed_asset_movement: payload fixed_asset_movement: payload
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
...@@ -370,7 +393,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -370,7 +393,8 @@ export default class FixedAssetsMovement extends Component {
} }
async downloadAllData() { async downloadAllData() {
console.log(this.props) 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);
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}`
) )
...@@ -380,45 +404,45 @@ export default class FixedAssetsMovement extends Component { ...@@ -380,45 +404,45 @@ export default class FixedAssetsMovement 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 = 'Fixed Assets Movement.xlsx'; a.download = 'Master Budget Fixed Assets Movement.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,
periode: this.props.periode, "periode": this.props.periode,
report_id: this.props.report_id, "report_id": this.props.report_id,
fixed_asset_movement: data, "fixed_asset_movement": data,
status: "submitted" "status": "submitted"
} }
console.log(payload) // console.log(payload)
api.create().validateSubmitReport(payload).then((response) => { api.create().validateSubmitReport(payload).then((response) => {
console.log(response) console.log(response)
if (response.data.data.result) { if (response.data.data.result) {
...@@ -609,7 +633,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -609,7 +633,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={value} value={Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -642,7 +666,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -642,7 +666,7 @@ export default class FixedAssetsMovement 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) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
console.log(dataTable2) console.log(dataTable2)
...@@ -659,7 +683,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -659,7 +683,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -730,7 +754,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -730,7 +754,7 @@ export default class FixedAssetsMovement 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)
...@@ -748,7 +772,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -748,7 +772,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -819,7 +843,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -819,7 +843,7 @@ export default class FixedAssetsMovement 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)
...@@ -837,7 +861,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -837,7 +861,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -908,7 +932,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -908,7 +932,7 @@ export default class FixedAssetsMovement 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)
...@@ -926,7 +950,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -926,7 +950,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -997,7 +1021,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -997,7 +1021,7 @@ export default class FixedAssetsMovement 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)
...@@ -1015,7 +1039,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1015,7 +1039,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1086,7 +1110,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1086,7 +1110,7 @@ export default class FixedAssetsMovement 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)
...@@ -1104,7 +1128,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1104,7 +1128,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1175,7 +1199,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1175,7 +1199,7 @@ export default class FixedAssetsMovement 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)
...@@ -1193,7 +1217,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1193,7 +1217,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1264,7 +1288,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1264,7 +1288,7 @@ export default class FixedAssetsMovement 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)
...@@ -1282,7 +1306,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1282,7 +1306,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1353,7 +1377,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1353,7 +1377,7 @@ export default class FixedAssetsMovement 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)
...@@ -1371,7 +1395,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1371,7 +1395,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1442,7 +1466,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1442,7 +1466,7 @@ export default class FixedAssetsMovement 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)
...@@ -1460,7 +1484,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1460,7 +1484,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1531,7 +1555,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1531,7 +1555,7 @@ export default class FixedAssetsMovement 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)
...@@ -1549,7 +1573,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1549,7 +1573,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1620,7 +1644,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1620,7 +1644,7 @@ export default class FixedAssetsMovement 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)
...@@ -1638,7 +1662,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1638,7 +1662,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1707,7 +1731,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1707,7 +1731,7 @@ export default class FixedAssetsMovement 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' }}>
...@@ -1717,7 +1741,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1717,7 +1741,7 @@ export default class FixedAssetsMovement 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>
...@@ -1747,7 +1771,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1747,7 +1771,7 @@ export default class FixedAssetsMovement 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)
...@@ -1765,7 +1789,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1765,7 +1789,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1836,7 +1860,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1836,7 +1860,7 @@ export default class FixedAssetsMovement 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)
...@@ -1854,7 +1878,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1854,7 +1878,7 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={handleValue(tableMeta)} value={Number(handleValue(tableMeta)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1918,19 +1942,19 @@ export default class FixedAssetsMovement extends Component { ...@@ -1918,19 +1942,19 @@ export default class FixedAssetsMovement 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}>
{this.state.messageAlert} {this.state.messageAlert}
</Alert> </Alert>
</Snackbar> </Snackbar>
{this.state.loading && loadingComponent} {/* {this.state.loading && loadingComponent} */}
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleFixedAssetsMovement === true ? {this.state.visibleFixedAssetsMovement === 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 - Fixed Assets Movement</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Fixed Assets Movement</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' }}>
...@@ -1993,43 +2017,19 @@ export default class FixedAssetsMovement extends Component { ...@@ -1993,43 +2017,19 @@ export default class FixedAssetsMovement extends Component {
</div> </div>
<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 && <MuiThemeProvider theme={getMuiTheme()}> {this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</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
type="button"
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
>
<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>
</div>
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%'}}>
<button <button
className="button" className="button"
type="button" type="button"
...@@ -2046,10 +2046,12 @@ export default class FixedAssetsMovement extends Component { ...@@ -2046,10 +2046,12 @@ export default class FixedAssetsMovement extends Component {
}, 100); }, 100);
})} })}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#019ce5', 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: '#fff', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
</button> </button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%'}}>
<button <button
className="button" className="button"
type="button" type="button"
...@@ -2073,6 +2075,32 @@ export default class FixedAssetsMovement extends Component { ...@@ -2073,6 +2075,32 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>
<button
className="button"
type="button"
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
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 <button
type="button" type="button"
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
...@@ -2110,13 +2138,14 @@ export default class FixedAssetsMovement extends Component { ...@@ -2110,13 +2138,14 @@ export default class FixedAssetsMovement 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 && <MuiThemeProvider theme={getMuiTheme()}> {this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider>} </MuiThemeProvider>
</div> </div>
)} )}
</div> </div>
......
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