Commit dce04942 authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 0678e8d4 ff1c173f
......@@ -38,7 +38,7 @@ const create = (type = "") => {
'Content-Type': 'application/json',
},
// 40 second timeout...
timeout: 100000
timeout: 40000
})
break;
default:
......
......@@ -744,9 +744,10 @@ export default class BudgetTahunan extends Component {
})
// // console.log(JSON.stringify(data));
api.create('UPLOAD').createSubmitReport(data).then(response => {
// // console.log(response);
if (response.data) {
if (response.data.status === "success") {
if (response.ok) {
if (response.data.status === 'success') {
this.getSubmission()
} else {
this.setState({ loading: false }, () => {
......@@ -755,7 +756,13 @@ export default class BudgetTahunan extends Component {
})
}
} else {
this.setState({ loading: false }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false}, () => {
this.getSubmission()
document.body.style.overflow = 'unset';
})
}
} else {
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false }, () => {
this.getSubmission()
document.body.style.overflow = 'unset';
})
......
......@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -183,7 +183,7 @@ export default class CashFlow extends Component {
// } else {
api.create().getDetailReportCF(payload).then(response => {
let dataTable = []
// console.log(response)
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -278,7 +278,7 @@ export default class CashFlow extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
}
})
// }
......
......@@ -269,7 +269,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
}
......@@ -670,7 +670,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -195,7 +195,7 @@ export default class FixedAssetsMovement extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
}
})
}
......@@ -447,7 +447,7 @@ export default class FixedAssetsMovement extends Component {
} else {
// this.setState({ loading: false })
// alert(response.problem)
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -205,7 +205,7 @@ export default class ProfitLoss extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error', loading: false })
}
})
......@@ -447,7 +447,7 @@ export default class ProfitLoss extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
this.setState({ alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error', loading: false })
}
})
}
......
......@@ -230,7 +230,7 @@ export default class TaxPlanning extends Component {
})
}
} else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
this.setState({ dataTable, loading: false, buttonError: true, editable: true, alert: true, messageAlert: 'Connection Timeout, please check your Connection', tipeAlert: 'error'})
}
})
}
......@@ -632,7 +632,7 @@ export default class TaxPlanning extends Component {
// alert(response.data.status)
}
} else {
this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
this.setState({ loading: false, alert: true, messageAlert: 'Data is not saved, please check your Connection', tipeAlert: 'error' })
}
})
}
......
import React, { Component } from 'react';
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider } from '@material-ui/core'
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider, TextareaAutosize } from '@material-ui/core'
import MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images';
import api from '../../api';
......@@ -794,7 +794,7 @@ export default class ListOfCreditFacilities extends Component {
let payload = {
"report_id": this.props.report_id,
"revision": this.props.revision,
"periode": this.props.periode,
"periode": 2021,
"company_id": this.props.company.company_id,
"submission_id": this.state.submissionID
}
......@@ -1228,7 +1228,28 @@ export default class ListOfCreditFacilities extends Component {
})
console.log(dataTable2)
} else {
if (value.value !== undefined) {
if (value.value == 'Investment Loan') {
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
dataTable2[tableMeta.rowIndex][18] = ""
dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'Revolving Loan (KMK)') {
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][18] = ""
dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'others') {
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
}
}
dataTable2[tableMeta.rowIndex][column] = value
console.log(dataTable2)
}
}
......@@ -1238,7 +1259,6 @@ export default class ListOfCreditFacilities extends Component {
if (type == 'bankName' && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != null && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != "") {
indexNyasar = true
}
if (value == null) {
index = -1
} else {
......@@ -1524,7 +1544,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ padding: 0, margin: 0}}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 150, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
<textarea style={{ borderColor: 'white', width: 150, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} />
</div>
}
/>
......@@ -1558,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ padding: 0, margin: 0 }}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} />
</div>
}
/>
......@@ -1581,22 +1601,28 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ textAlign: 'right', width: 90 }}>
{ tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }}
type="text"
placeholder=""
disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
defaultValue={tableMeta.rowData[8]}
onBlur={(event) => {
// // // console.log(event.target.value)
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, tableMeta.columnIndex)
// // // console.log(dataTable2)
}}
/>
</ThemeProvider>
<div style={{ padding: 0, margin: 0 }}>
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" defaultValue={tableMeta.rowData[8]}
onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
</div>
// <ThemeProvider theme={theme}>
// <Input
// disableUnderline={true}
// style={{color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }}
// type="text"
// placeholder=""
// disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
// defaultValue={tableMeta.rowData[8]}
// multiline
// rowsMax={3}
// onBlur={(event) => {
// // // // console.log(event.target.value)
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta, tableMeta.columnIndex)
// // // // console.log(dataTable2)
// }}
// />
// </ThemeProvider>
}
</div>
......@@ -1675,7 +1701,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={val}
value={Number(val).toFixed(2)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
maxLength={4}
onBlur={(event) => {
......@@ -3516,13 +3542,13 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
{!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</MuiThemeProvider>}
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5}}>
......@@ -3530,7 +3556,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{padding: 5}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Total Outstanding Loan</Typography>
</div>
<div style={{border: '1px solid black', padding: 5}}>
<div style={{border: '1px solid black', padding: 5, minWidth: 200}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalOutStand}</Typography>
</div>
</div>
......@@ -3540,7 +3566,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{padding: 5}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Diff</Typography>
</div>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5}}>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.diff}</Typography>
</div>
</div>
......@@ -3660,7 +3686,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent}
{this.state.dataLoaded && <MuiThemeProvider theme={getMuiTheme()}>
{this.state.dataLoaded && !this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
......
......@@ -140,12 +140,14 @@ export default class TaxPlanningMR extends Component {
fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction,
tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal,
},
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
0,
item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb,
item.tax_planning.actual_formula,
item.order,
{ tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf },
{ tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf },
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
])
}
if (item.children !== null) {
......@@ -172,12 +174,13 @@ export default class TaxPlanningMR extends Component {
fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction,
tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal,
},
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
0,
item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb,
item.tax_planning.actual_formula,
item.order,
{ tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf },
{ tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf },
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -335,18 +338,19 @@ export default class TaxPlanningMR extends Component {
fcp: item.fiscal_correction === null ? "0.0" : item.fiscal_correction === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.fiscal_correction).toFixed(2) : Number(item.fiscal_correction).toFixed(1),
tbf: item.trial_balance_fiscal === null ? "0.0" : item.trial_balance_fiscal === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal).toFixed(2) : Number(item.trial_balance_fiscal).toFixed(1),
},
item.trial_balance_fiscal_actual === null ? "0.0" : item.trial_balance_fiscal_actual === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_actual).toFixed(2) : Number(item.trial_balance_fiscal_actual).toFixed(1),
0,
item.trial_balance_fiscal_mb === null ? "0.0" : item.trial_balance_fiscal_mb === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_mb).toFixed(2) : Number(item.trial_balance_fiscal_mb).toFixed(1),
item.actual_formula,
item.orders,
{ tbc: item.condition_it_should_be.tbc, fcp: item.condition_it_should_be.fcp, tbf: item.condition_it_should_be.tbf },
{ tbc: item.condition_if_wrong.tbc, fcp: item.condition_if_wrong.fcp, tbf: item.condition_if_wrong.tbf },
item.trial_balance_fiscal_actual === null ? "0.0" : item.trial_balance_fiscal_actual === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_actual).toFixed(2) : Number(item.trial_balance_fiscal_actual).toFixed(1),
item.error
]
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => {
this.state.dataTable.map(item => {
if (item[16].length > 0) {
if (item[18].length > 0) {
// console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true })
}
......@@ -493,7 +497,6 @@ export default class TaxPlanningMR extends Component {
render() {
let dataTable2 = this.state.dataTable
const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => {
// console.log(xntd)
let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
let splitFormula = String(form).split('@')
let baru = []
......@@ -512,13 +515,7 @@ export default class TaxPlanningMR extends Component {
}
})
// if (forecast !== undefined) {
// console.log(splitFormula)
// }
if (tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29" || forecast !== undefined) {
// form.replace("(", "")
// form.replace(")", "")
let opgab = []
baru.map((item, index) => {
if( item.length > 1 && (item.includes("+") || item.includes("-") || item.includes("*") || item.includes("/"))){
......@@ -532,7 +529,9 @@ export default class TaxPlanningMR extends Component {
baru = opgab
}
}
let totalShldBeNil = 0
console.log(baru)
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
......@@ -567,12 +566,14 @@ export default class TaxPlanningMR extends Component {
}
} else {
let data = tableMeta.rowData[12]
// console.log(data);
console.log(data);
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
console.log(indexID);
if (indexID !== -1) {
let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
console.log(anjay)
}
}
} else {
......@@ -726,27 +727,18 @@ export default class TaxPlanningMR extends Component {
}
}
const handleTotal = (value, tableMeta, dex) => {
console.log(value)
let total = 0
// console.log(tableMeta)
let total = value
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 9) {
let valItemFCP = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
// console.log(valItemFCP)
total = Number(value) + Number(valItemFCP)
total = Number(tableMeta.rowData[16]) + Number(valItemFCP)
}
})
if (dex == 4) {
console.log('masuk')
dataTable2[tableMeta.rowIndex][10] = Number(total).toFixed(1)
console.log(dataTable2[tableMeta.rowIndex][10])
console.log(total)
return total
} else {
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
}
}
const handleParent = (tableMeta, type) => {
......@@ -1288,7 +1280,7 @@ export default class TaxPlanningMR extends Component {
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(value, tableMeta, 5)).toFixed(2) : Number(handleTotal(value, tableMeta, 5)).toFixed(1)}
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value).toFixed(2) : Number(value).toFixed(1)}
/>
}
/>
......@@ -1317,6 +1309,18 @@ export default class TaxPlanningMR extends Component {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
]
const loadingComponent = (
......
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