Commit b9f82eca authored by faisalhamdi's avatar faisalhamdi

digit decimal

parent ef9c2a57
...@@ -201,22 +201,22 @@ export default class FixedAssetsMovement extends Component { ...@@ -201,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))
}) })
}) })
...@@ -228,7 +228,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -228,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()
} }
...@@ -411,38 +411,38 @@ export default class FixedAssetsMovement extends Component { ...@@ -411,38 +411,38 @@ export default class FixedAssetsMovement extends Component {
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) {
...@@ -633,7 +633,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -633,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)}
/> />
} }
/> />
...@@ -666,7 +666,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -666,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)
...@@ -683,7 +683,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -683,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>
: :
...@@ -754,7 +754,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -754,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)
...@@ -772,7 +772,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -772,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>
: :
...@@ -843,7 +843,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -843,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)
...@@ -861,7 +861,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -861,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>
: :
...@@ -932,7 +932,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -932,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)
...@@ -950,7 +950,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -950,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>
: :
...@@ -1021,7 +1021,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1021,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)
...@@ -1039,7 +1039,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1039,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>
: :
...@@ -1110,7 +1110,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1110,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)
...@@ -1128,7 +1128,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1128,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>
: :
...@@ -1199,7 +1199,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1199,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)
...@@ -1217,7 +1217,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1217,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>
: :
...@@ -1288,7 +1288,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1288,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)
...@@ -1306,7 +1306,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1306,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>
: :
...@@ -1377,7 +1377,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1377,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)
...@@ -1395,7 +1395,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1395,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>
: :
...@@ -1466,7 +1466,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1466,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)
...@@ -1484,7 +1484,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1484,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>
: :
...@@ -1555,7 +1555,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1555,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)
...@@ -1573,7 +1573,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1573,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>
: :
...@@ -1644,7 +1644,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1644,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)
...@@ -1662,7 +1662,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1662,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>
: :
...@@ -1731,7 +1731,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1731,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' }}>
...@@ -1741,7 +1741,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1741,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>
...@@ -1771,7 +1771,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1771,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)
...@@ -1789,7 +1789,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1789,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>
: :
...@@ -1860,7 +1860,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1860,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)
...@@ -1878,7 +1878,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -1878,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>
: :
......
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