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 { ...@@ -126,15 +126,20 @@ export default class BudgetTahunan extends Component {
let defaultProps = { let defaultProps = {
options: companyData, options: companyData,
getOptionLabel: (option) => titleCase(option.company_name), 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); // console.log(response.data.data);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
this.getRevision() this.getRevision()
} else { } else {
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false }) this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false })
} }
// //
}) })
} else { } else {
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, ()=> { this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, ()=> {
...@@ -195,14 +200,17 @@ export default class BudgetTahunan extends Component { ...@@ -195,14 +200,17 @@ export default class BudgetTahunan extends Component {
item.revision item.revision
] ]
}) })
let dataTableRevision = response.data.data.map((item, index) => { let dataTableRevision = []
return [ response.data.data.map((item, index) => {
if (item.report_name !== 'Cash Flow') {
dataTableRevision.push([
item.report_id, item.report_id,
item.report_name === 'CAT' ? 'Corporate Annual Target' : item.report_name, 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 }, ()=> { this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data }, ()=> {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
...@@ -802,7 +810,7 @@ export default class BudgetTahunan extends Component { ...@@ -802,7 +810,7 @@ export default class BudgetTahunan extends Component {
: null : null
} }
> >
{/* {this.state.isApprover == true ? {/* {this.state.isApprover == true ?
(tableMeta.rowData[5] ? '#5198ea' : 'GrayText') : (tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(this.state.lastRevision == 0 ? (tableMeta.rowData[5] ? '#5198ea' : 'GrayText') : (this.state.lastRevision == 0 ? (tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(tableMeta.rowData[3] !== 'submitted' ? '#5198ea' : 'GrayText'))} */} (tableMeta.rowData[3] !== 'submitted' ? '#5198ea' : 'GrayText'))} */}
......
...@@ -58,7 +58,6 @@ export default class BalanceSheet extends Component { ...@@ -58,7 +58,6 @@ export default class BalanceSheet extends Component {
componentDidMount() { componentDidMount() {
this.getLatestUpdate() this.getLatestUpdate()
this.getSettingControl() this.getSettingControl()
// console.log(this.props);
} }
getSettingControl() { getSettingControl() {
...@@ -436,7 +435,7 @@ export default class BalanceSheet extends Component { ...@@ -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)), 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 = { 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,
...@@ -446,7 +445,7 @@ export default class BalanceSheet extends Component { ...@@ -446,7 +445,7 @@ export default class BalanceSheet extends Component {
"status": "submitted" "status": "submitted"
} }
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) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
} else { } else {
...@@ -691,7 +690,7 @@ export default class BalanceSheet extends Component { ...@@ -691,7 +690,7 @@ export default class BalanceSheet extends Component {
}) })
total = R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
// console.log(dataTable2[tableMeta.rowIndex][22]) // console.log(dataTable2[tableMeta.rowIndex][22])
// console.log(tableMeta.rowData[5]) // console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == 'Beginning Balance') { // if (tableMeta.rowData[5] == 'Beginning Balance') {
// console.log(baru) // console.log(baru)
// console.log(anjay) // console.log(anjay)
...@@ -2680,7 +2679,7 @@ export default class BalanceSheet extends Component { ...@@ -2680,7 +2679,7 @@ export default class BalanceSheet extends Component {
} }
] ]
const loadingComponent = ( 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 <PropagateLoader
// css={override} // css={override}
size={20} 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 { ...@@ -87,7 +87,7 @@ export default class FixedAssetsMovement extends Component {
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
// // console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
...@@ -118,7 +118,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -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_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year, item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year,
item.order, 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 !== null) {
...@@ -154,7 +155,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -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_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year, item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.fixed_asset_movement.total_more_year,
item.order, 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 !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -330,6 +332,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -330,6 +332,7 @@ export default class FixedAssetsMovement extends Component {
item.total_more_year, item.total_more_year,
item.orders, item.orders,
item.forecast_formula, item.forecast_formula,
item.before_formula,
item.error item.error
] ]
}) })
...@@ -463,7 +466,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -463,7 +466,7 @@ export default class FixedAssetsMovement extends Component {
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleValueFormula = (value, tableMeta) => { const handleValueFormula = (value, tableMeta, Bfr) => {
let splitFormula = String(tableMeta.rowData[3]).split('@') let splitFormula = String(tableMeta.rowData[3]).split('@')
let baru = [] let baru = []
let anjay = [] let anjay = []
...@@ -495,7 +498,17 @@ export default class FixedAssetsMovement extends Component { ...@@ -495,7 +498,17 @@ export default class FixedAssetsMovement extends Component {
anjay.push(item) anjay.push(item)
} else { } else {
if (String(item).includes('#')) { 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 tst = String(item).replace('[M-1]', '')
let data = tableMeta.columnIndex == 7 ? 18 : tableMeta.columnIndex - 1 let data = tableMeta.columnIndex == 7 ? 18 : tableMeta.columnIndex - 1
let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode let period = data == 18 ? Number(this.props.periode) - 1 : this.props.periode
...@@ -526,7 +539,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -526,7 +539,7 @@ export default class FixedAssetsMovement extends Component {
tambahan = false tambahan = false
opet = "" opet = ""
} }
} else { } else {
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
...@@ -571,7 +584,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -571,7 +584,7 @@ export default class FixedAssetsMovement extends Component {
}) })
total = R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
// // console.log(dataTable2[tableMeta.rowIndex][22]) // // console.log(dataTable2[tableMeta.rowIndex][22])
// // console.log(tableMeta.rowData[5]) // // console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == 'Beginning Balance') { // if (tableMeta.rowData[5] == 'Beginning Balance') {
// console.log(baru) // console.log(baru)
// console.log(anjay) // console.log(anjay)
...@@ -607,20 +620,13 @@ export default class FixedAssetsMovement extends Component { ...@@ -607,20 +620,13 @@ export default class FixedAssetsMovement extends Component {
const handleForecast = (tableMeta, periode) => { const handleForecast = (tableMeta, periode) => {
let total = 0 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') { 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) let indexID = dataTable2[tableMeta.rowIndex][23].findIndex((val) => val.periode == periode)
if (indexID !== -1) { if (indexID !== -1) {
total = dataTable2[tableMeta.rowIndex][23][indexID].value total = dataTable2[tableMeta.rowIndex][23][indexID].value
} }
} else { } else {
total = handleValueFormula(tableMeta.columnIndex, tableMeta) 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 dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return total return total
} }
...@@ -659,6 +665,13 @@ export default class FixedAssetsMovement extends Component { ...@@ -659,6 +665,13 @@ export default class FixedAssetsMovement extends Component {
// // console.log(indexParent); // // console.log(indexParent);
return a return a
} }
const handleBfr = (value,tableMeta) => {
let total = 0
total = handleValueFormula(value, tableMeta, 'before')
return total
}
const handleFormula = (data, tableMeta, month) => { const handleFormula = (data, tableMeta, month) => {
let rilFormula = String(tableMeta.rowData[3]) let rilFormula = String(tableMeta.rowData[3])
if (rilFormula.includes("#")) { if (rilFormula.includes("#")) {
...@@ -765,6 +778,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -765,6 +778,7 @@ export default class FixedAssetsMovement extends Component {
return a return a
} }
} }
const columns = [{ const columns = [{
name: "", name: "",
options: { options: {
...@@ -802,8 +816,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -802,8 +816,8 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{tableMeta.rowData[24] ? {tableMeta.rowData[25] ?
tableMeta.rowData[24].length > 0 ? tableMeta.rowData[25].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
...@@ -843,6 +857,24 @@ export default class FixedAssetsMovement extends Component { ...@@ -843,6 +857,24 @@ export default class FixedAssetsMovement extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null 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 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -2401,7 +2433,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -2401,7 +2433,7 @@ export default class FixedAssetsMovement extends Component {
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
......
...@@ -180,7 +180,7 @@ export default class ProfitLoss extends Component { ...@@ -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 }, () => { this.setState({ dataTable, loading: false, buttonError: true, editable: true }, () => {
// console.log(dataTable) // console.log(dataTable)
}) })
......
...@@ -595,7 +595,7 @@ export default class ReportItems extends Component { ...@@ -595,7 +595,7 @@ export default class ReportItems extends Component {
getData() { getData() {
this.setState({ loading: true }) this.setState({ loading: true })
api.create().getReportItems().then((response) => { api.create().getReportItems().then((response) => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { 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