Commit a02ecab2 authored by Riri Novita's avatar Riri Novita

update

parent 542416fd
...@@ -173,9 +173,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -173,9 +173,7 @@ export default class FixedAssetsMovement extends Component {
item.level, item.level,
item.description, item.description,
item.fixed_asset_movement.total_actual_before === null ? "0" : item.fixed_asset_movement.total_actual_before === "" ? "0" : item.fixed_asset_movement.total_actual_before, item.fixed_asset_movement.total_actual_before === null ? "0" : item.fixed_asset_movement.total_actual_before === "" ? "0" : item.fixed_asset_movement.total_actual_before,
// for simulasi //for simulasi
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula } : Number(item.fixed_asset_movement.january).toFixed(1),
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula } : Number(item.fixed_asset_movement.february).toFixed(1),
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula } : Number(item.fixed_asset_movement.january).toFixed(1), item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.january, formula: item.fixed_asset_movement.january_formula } : Number(item.fixed_asset_movement.january).toFixed(1),
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula } : Number(item.fixed_asset_movement.february).toFixed(1), item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.february, formula: item.fixed_asset_movement.february_formula } : Number(item.fixed_asset_movement.february).toFixed(1),
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.march, formula: item.fixed_asset_movement.march_formula } : Number(item.fixed_asset_movement.march).toFixed(1), item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.fixed_asset_movement.march, formula: item.fixed_asset_movement.march_formula } : Number(item.fixed_asset_movement.march).toFixed(1),
...@@ -216,7 +214,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -216,7 +214,7 @@ export default class FixedAssetsMovement extends Component {
} }
} }
}) })
console.log(dataTable) // console.log(dataTable)
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -917,15 +915,9 @@ export default class FixedAssetsMovement extends Component { ...@@ -917,15 +915,9 @@ export default class FixedAssetsMovement extends Component {
total = tableMeta.columnIndex == 21 ? dataTable2[indexID][20] : dataTable2[indexID][18].value total = tableMeta.columnIndex == 21 ? dataTable2[indexID][20] : dataTable2[indexID][18].value
} }
} else { } else {
// simulasi let indexID = dataTable2[tableMeta.rowIndex][23].findIndex((val) => val.periode == periode)
let indexID = dataTable2[tableMeta.rowIndex][25].findIndex((val) => val.periode == periode)
// Asli
// let indexID = dataTable2[tableMeta.rowIndex][23].findIndex((val) => val.periode == periode)
if (indexID !== -1) { if (indexID !== -1) {
// simulasi total = dataTable2[tableMeta.rowIndex][23][indexID].value
total = dataTable2[tableMeta.rowIndex][25][indexID].value
// Asli
// total = dataTable2[tableMeta.rowIndex][23][indexID].value
} }
} }
} else { } else {
...@@ -2606,6 +2598,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -2606,6 +2598,7 @@ export default class FixedAssetsMovement extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(tableMeta);
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{ {
......
This diff is collapsed.
...@@ -808,6 +808,7 @@ export default class TaxPlanning extends Component { ...@@ -808,6 +808,7 @@ export default class TaxPlanning extends Component {
}) })
} }
}) })
let body = { let body = {
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
...@@ -815,6 +816,7 @@ export default class TaxPlanning extends Component { ...@@ -815,6 +816,7 @@ export default class TaxPlanning extends Component {
tax_planning: payload, tax_planning: payload,
status: 'submitted' status: 'submitted'
} }
// 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] })
} }
}); });
...@@ -955,6 +957,7 @@ export default class TaxPlanning extends Component { ...@@ -955,6 +957,7 @@ export default class TaxPlanning extends Component {
item.error item.error
] ]
}) })
console.log(dataTable);
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[27].length > 0) { if (item[27].length > 0) {
...@@ -1941,22 +1944,21 @@ export default class TaxPlanning extends Component { ...@@ -1941,22 +1944,21 @@ export default class TaxPlanning extends Component {
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) { if (index >= 9 && index <= 20) {
if (this.props.status === 'CLOSED') { // if (this.props.status === 'CLOSED') {
let indexChild = item.tbf // let indexChild = item.tbf
if (indexChild !== -1) { // if (indexChild !== -1) {
total += Number(item.tbf) // total += Number(item.tbf)
} // }
} else { // } else {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode) let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode)
if (indexChild !== -1) { if (indexChild !== -1) {
total += Number(item.tbf.formula[indexChild].value) total += Number(item.tbf.formula[indexChild].value)
} }
} // }
} }
}) })
let nilai = Number(total) + Number(dataTable2[88][21]) let nilai = Number(total) + Number(dataTable2[88][21])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = nilai dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = nilai
// console.log(nilai);
return nilai return nilai
} }
...@@ -8399,7 +8401,8 @@ export default class TaxPlanning extends Component { ...@@ -8399,7 +8401,8 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[3] === 7 ? tableMeta.rowData[3] === 7 ?
(Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ? // (Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
(Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -10131,7 +10134,7 @@ export default class TaxPlanning extends Component { ...@@ -10131,7 +10134,7 @@ export default class TaxPlanning extends Component {
result={this.state.result} result={this.state.result}
acceptedFiles={["xlsx"]} acceptedFiles={["xlsx"]}
onHandle={(dt) => { onHandle={(dt) => {
this.fileHandler(dt) this.fileHandlerSimulasi(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => { onUpload={() => {
......
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