Commit a6868e92 authored by r.kurnia's avatar r.kurnia

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

parents 3c45b48f 52335ff8
......@@ -126,15 +126,20 @@ export default class BudgetTahunan extends Component {
let defaultProps = {
options: companyData,
getOptionLabel: (option) => titleCase(option.company_name),
};
this.setState({ listCompany: defaultProps, company: companyData[0] }, () => {
}
let indexID = null
if (this.state.rawData !== undefined) {
indexID = companyData.findIndex((val) => val.company_id == this.state.rawData.company_id)
}
this.setState({ listCompany: defaultProps, company: indexID == null? companyData[0] : companyData[indexID]}, () => {
// console.log(response.data.data);
if (response.data.data.length > 0) {
this.getRevision()
} else {
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false })
}
//
//
})
} else {
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, ()=> {
......@@ -195,14 +200,17 @@ export default class BudgetTahunan extends Component {
item.revision
]
})
let dataTableRevision = response.data.data.map((item, index) => {
return [
let dataTableRevision = []
response.data.data.map((item, index) => {
if (item.report_name !== 'Cash Flow') {
dataTableRevision.push([
item.report_id,
item.report_name === 'CAT' ? 'Corporate Annual Target' : item.report_name,
""
]
])
}
})
// console.log(dataTable);
// console.log(dataTableRevision);
this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data }, ()=> {
document.body.style.overflow = 'unset';
})
......@@ -802,7 +810,7 @@ export default class BudgetTahunan extends Component {
: null
}
>
{/* {this.state.isApprover == true ?
{/* {this.state.isApprover == true ?
(tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(this.state.lastRevision == 0 ? (tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(tableMeta.rowData[3] !== 'submitted' ? '#5198ea' : 'GrayText'))} */}
......
......@@ -58,7 +58,6 @@ export default class BalanceSheet extends Component {
componentDidMount() {
this.getLatestUpdate()
this.getSettingControl()
// console.log(this.props);
}
getSettingControl() {
......@@ -436,7 +435,7 @@ export default class BalanceSheet extends Component {
total_more_year: i[0] === 3 && i[21] === "" ? "0.0" : String(Number(i[21]).toFixed(1)),
})
})
console.log(JSON.stringify(data))
// console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -446,7 +445,7 @@ export default class BalanceSheet extends Component {
"status": "submitted"
}
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
// console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
} else {
......@@ -691,7 +690,7 @@ export default class BalanceSheet extends Component {
})
total = R.equals(total, NaN) ? "0.0" : total
// console.log(dataTable2[tableMeta.rowIndex][22])
// console.log(tableMeta.rowData[5])
// console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == 'Beginning Balance') {
// console.log(baru)
// console.log(anjay)
......@@ -2680,7 +2679,7 @@ export default class BalanceSheet extends Component {
}
]
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -87,7 +87,7 @@ export default class FixedAssetsMovement extends Component {
"submission_id": this.props.submissionID
}
api.create().getDetailReportMB(payload).then(response => {
// // console.log(response);
// console.log(response);
let dataTable = []
if (response.data) {
let res = response.data.data
......@@ -118,7 +118,8 @@ export default class FixedAssetsMovement extends Component {
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year,
item.order,
item.fixed_asset_movement.forecast_formula
item.fixed_asset_movement.forecast_formula,
item.fixed_asset_movement.before_formula
])
}
if (item.children !== null) {
......@@ -154,7 +155,8 @@ export default class FixedAssetsMovement extends Component {
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year,
item.order,
item.fixed_asset_movement.forecast_formula
item.fixed_asset_movement.forecast_formula,
item.fixed_asset_movement.before_formula
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -330,6 +332,7 @@ export default class FixedAssetsMovement extends Component {
item.total_more_year,
item.orders,
item.forecast_formula,
item.before_formula,
item.error
]
})
......@@ -463,7 +466,7 @@ export default class FixedAssetsMovement extends Component {
render() {
let dataTable2 = this.state.dataTable
const handleValueFormula = (value, tableMeta) => {
const handleValueFormula = (value, tableMeta, Bfr) => {
let splitFormula = String(tableMeta.rowData[3]).split('@')
let baru = []
let anjay = []
......@@ -495,7 +498,17 @@ export default class FixedAssetsMovement extends Component {
anjay.push(item)
} else {
if (String(item).includes('#')) {
if (String(item).includes('[M-1]')) {
if (Bfr !== undefined) {
let data = 24
let period = Number(this.props.periode) - 1
console.log(dataTable2[tableMeta.rowIndex][data])
anjay.push(0)
let indexID = dataTable2[tableMeta.rowIndex][data].findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == period)
if (indexID !== -1) {
let valuezz = dataTable2[tableMeta.rowIndex][data][indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
} else if (String(item).includes('[M-1]')) {
let tst = String(item).replace('[M-1]', '')
let data = tableMeta.columnIndex == 7 ? 18 : tableMeta.columnIndex - 1
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
......@@ -526,7 +539,7 @@ export default class FixedAssetsMovement extends Component {
tambahan = false
opet = ""
}
} else {
} else {
if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == "" ? 0 : valuezz)
......@@ -571,7 +584,7 @@ export default class FixedAssetsMovement extends Component {
})
total = R.equals(total, NaN) ? "0.0" : total
// // console.log(dataTable2[tableMeta.rowIndex][22])
// // console.log(tableMeta.rowData[5])
// // console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == 'Beginning Balance') {
// console.log(baru)
// console.log(anjay)
......@@ -607,20 +620,13 @@ export default class FixedAssetsMovement extends Component {
const handleForecast = (tableMeta, periode) => {
let total = 0
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == 'gain/ (loss) on fixed assets' || String(tableMeta.rowData[5]).toLocaleLowerCase() == 'ending balance' || String(tableMeta.rowData[5]).toLocaleLowerCase() == 'beginning balance') {
// // console.log(dataTable2[tableMeta.rowIndex][23])
// // console.log()
let indexID = dataTable2[tableMeta.rowIndex][23].findIndex((val) => val.periode == periode)
if (indexID !== -1) {
total = dataTable2[tableMeta.rowIndex][23][indexID].value
}
} else {
total = handleValueFormula(tableMeta.columnIndex, tableMeta)
// // console.log(dataTable2[tableMeta.rowIndex])
}
// if (String(tableMeta.rowData[5]).toLocaleLowerCase() == 'beginning balance') {
// total = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex - 1]
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
// }
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return total
}
......@@ -659,6 +665,13 @@ export default class FixedAssetsMovement extends Component {
// // console.log(indexParent);
return a
}
const handleBfr = (value,tableMeta) => {
let total = 0
total = handleValueFormula(value, tableMeta, 'before')
return total
}
const handleFormula = (data, tableMeta, month) => {
let rilFormula = String(tableMeta.rowData[3])
if (rilFormula.includes("#")) {
......@@ -765,6 +778,7 @@ export default class FixedAssetsMovement extends Component {
return a
}
}
const columns = [{
name: "",
options: {
......@@ -802,8 +816,8 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{tableMeta.rowData[24] ?
tableMeta.rowData[24].length > 0 ?
{tableMeta.rowData[25] ?
tableMeta.rowData[25].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
......@@ -843,6 +857,24 @@ export default class FixedAssetsMovement extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleBfr(value,tableMeta)).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -2401,7 +2433,7 @@ export default class FixedAssetsMovement extends Component {
// disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......
......@@ -180,7 +180,7 @@ export default class ProfitLoss extends Component {
}
}
})
console.log(dataTable)
// console.log(dataTable)
this.setState({ dataTable, loading: false, buttonError: true, editable: true }, () => {
// console.log(dataTable)
})
......
......@@ -595,7 +595,7 @@ export default class ReportItems extends Component {
getData() {
this.setState({ loading: true })
api.create().getReportItems().then((response) => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......
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