Commit fa3f1797 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'faisal' into 'master'

update fam 220920 malam

See merge request !354
parents d92ca86a 8c08f7a7
......@@ -346,6 +346,7 @@ export default class FixedAssetsMovement extends Component {
})
})
let body = {
submission_id: this.props.submissionID,
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
......@@ -383,6 +384,50 @@ export default class FixedAssetsMovement extends Component {
}
}
handleValidate() {
let data = []
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
total_actual_before: String(i[6]),
january: String(i[7]),
february: String(i[8]),
march: String(i[9]),
april: String(i[10]),
may: String(i[11]),
june: String(i[12]),
july: String(i[13]),
august: String(i[14]),
september: String(i[15]),
october: String(i[16]),
november: String(i[17]),
december: String(i[18]),
total_current_year: String(i[19]),
total_next_year: String(i[20]),
total_more_year: String(i[21])
})
})
// console.log(JSON.stringify(data))
let payload = {
submission_id: this.props.submissionID,
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
fixed_asset_movement: data,
status: "submitted"
}
console.log(payload)
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: true })
} else {
this.setState({ loading: false, buttonError: true, editable: true })
}
})
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, type) => {
......@@ -507,8 +552,6 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{/* {console.log(val)} */}
{/* {console.log(tableMeta)} */}
{tableMeta.rowData[22] ?
tableMeta.rowData[22].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
......@@ -547,8 +590,6 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{console.log(tableMeta)}
{console.log(value)}
{tableMeta.rowData[0] === 4 ?
null
:
......@@ -2012,7 +2053,8 @@ export default class FixedAssetsMovement extends Component {
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true })
// this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate()
}, 100);
})
}}
......
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