Commit b5b79350 authored by Riri Novita's avatar Riri Novita

calculate LOCF-LOV

parent 0930e0a2
...@@ -148,6 +148,9 @@ export default class LOCF extends Component { ...@@ -148,6 +148,9 @@ export default class LOCF extends Component {
let datas = array[array.length -1] let datas = array[array.length -1]
this.setState({ dataTable: this.props.dataTablelocf, diff: datas[46], perBS: datas[48]}) this.setState({ dataTable: this.props.dataTablelocf, diff: datas[46], perBS: datas[48]})
} }
if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild})
}
} }
handleGetFor(type) { handleGetFor(type) {
...@@ -1562,7 +1565,7 @@ export default class LOCF extends Component { ...@@ -1562,7 +1565,7 @@ export default class LOCF extends Component {
} }
const handleChange = (value, tableMeta, column, typeChange, typeDrop) => { const handleChange = (value, tableMeta, column, typeChange, typeDrop) => {
console.log(column); console.log(column, value);
let val = '' let val = ''
if (typeChange == 'date') { if (typeChange == 'date') {
dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd') dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd')
...@@ -1578,9 +1581,6 @@ export default class LOCF extends Component { ...@@ -1578,9 +1581,6 @@ export default class LOCF extends Component {
} }
console.log(value);
console.log(value.value);
if (value.value !== undefined) { if (value.value !== undefined) {
this.setState({ loading: true}) this.setState({ loading: true})
if (value.value == 'Investment Loan') { if (value.value == 'Investment Loan') {
......
...@@ -148,7 +148,10 @@ export default class LOV extends Component { ...@@ -148,7 +148,10 @@ export default class LOV extends Component {
let array = this.props.dataTablelov let array = this.props.dataTablelov
let datas = array[array.length - 1] let datas = array[array.length - 1]
console.log(datas); console.log(datas);
this.setState({ dataTable: this.props.dataTablelov }) this.setState({ dataTable: this.props.dataTablelov, diff: datas[16], perBS: datas[18]})
}
if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild})
} }
} }
...@@ -688,7 +691,7 @@ export default class LOV extends Component { ...@@ -688,7 +691,7 @@ export default class LOV extends Component {
let body = { let body = {
group: 'INVESTMENT', group: 'INVESTMENT',
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
type: 'TYPE_OF_INVESTEMENT', type: 'TYPE_OF_INVESTMENT',
currency_id: this.props.defaultCurrency.id, currency_id: this.props.defaultCurrency.id,
} }
this.setState({ dataLoaded: false }) this.setState({ dataLoaded: false })
...@@ -734,7 +737,7 @@ export default class LOV extends Component { ...@@ -734,7 +737,7 @@ export default class LOV extends Component {
downloadTemplate = async () => { downloadTemplate = async () => {
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/lov/monthly_report/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&months=${this.props.month.month_id}&&currency_id=${this.props.defaultCurrency.id}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/lov/monthly_report/download_template?report_id=${this.props.report_id}&company_id=${this.props.company.company_id}&year=${this.props.periode}&months=${this.props.month.month_id}&currency_id=${this.props.defaultCurrency.id}`
) )
res = await res.blob() res = await res.blob()
// console.log(this.props.report_id) // console.log(this.props.report_id)
...@@ -1262,6 +1265,7 @@ export default class LOV extends Component { ...@@ -1262,6 +1265,7 @@ export default class LOV extends Component {
} }
const handleChange = (value, tableMeta, column, typeChange, typeDrop) => { const handleChange = (value, tableMeta, column, typeChange, typeDrop) => {
console.log(column, value);
let val = '' let val = ''
if (typeChange == 'date') { if (typeChange == 'date') {
dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd') dataTable2[tableMeta.rowIndex][column] = format(value, 'yyyy-MM-dd')
...@@ -1269,15 +1273,14 @@ export default class LOV extends Component { ...@@ -1269,15 +1273,14 @@ export default class LOV extends Component {
this.setState({ loading: false }) this.setState({ loading: false })
}) })
} else { } else {
console.log(value);
dataTable2[tableMeta.rowIndex][column] = value dataTable2[tableMeta.rowIndex][column] = value
// if (column != 6 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45) { if (column != 6 && column != 7 && column != 8 && column != 10 && column != 12 && column != 15) {
// val = String(value).split(",").join("") val = String(value).split(",").join("")
// val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val) val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val)
// } else { } else {
// val = String(value).split(",").join("") val = String(value).split(",").join("")
// } }
if (value.value !== undefined) { if (value.value !== undefined) {
this.setState({ loading: true }) this.setState({ loading: true })
...@@ -1305,9 +1308,12 @@ export default class LOV extends Component { ...@@ -1305,9 +1308,12 @@ export default class LOV extends Component {
this.setState({ loading: false }) this.setState({ loading: false })
dataTable2[tableMeta.rowIndex][column] = value dataTable2[tableMeta.rowIndex][column] = value
} else { } else {
dataTable2[tableMeta.rowIndex][column] = value dataTable2[tableMeta.rowIndex][column] = val
} }
} }
console.log(dataTable2[tableMeta.rowIndex][column]);
console.log(value)
console.log(String(value).split(",").join(""))
} }
const handleValueDropDown = (value, type, tableMeta) => { const handleValueDropDown = (value, type, tableMeta) => {
...@@ -1913,7 +1919,7 @@ export default class LOV extends Component { ...@@ -1913,7 +1919,7 @@ export default class LOV extends Component {
disabled={this.props.get_for == 'view'} disabled={this.props.get_for == 'view'}
value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(tableMeta.rowData[13]), 1) == 0.0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)) : (Number(tableMeta.rowData[13]) == 0.0 ? "0.0" : Number(tableMeta.rowData[13]))} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(tableMeta.rowData[13]), 1) == 0.0 ? "0.0" : fixNumber(Number(tableMeta.rowData[13]), 1)) : (Number(tableMeta.rowData[13]) == 0.0 ? "0.0" : Number(tableMeta.rowData[13]))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 14) handleChange(event.target.value, tableMeta, 13)
}} }}
/> />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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