Commit f33cb776 authored by d.arizona's avatar d.arizona

update banyak

parent 1a040778
...@@ -1125,7 +1125,7 @@ export default class OutlookPA extends Component { ...@@ -1125,7 +1125,7 @@ export default class OutlookPA extends Component {
} }
}) })
if(String(tableMeta[5]) == "Cost of Goods Sold (COGS)" && column == 20) { if (String(tableMeta[5]) == "Cost of Goods Sold (COGS)" && column == 20) {
console.log(splitFormula) console.log(splitFormula)
console.log(baru) console.log(baru)
console.log(anjay) console.log(anjay)
...@@ -1754,7 +1754,41 @@ export default class OutlookPA extends Component { ...@@ -1754,7 +1754,41 @@ export default class OutlookPA extends Component {
</div> </div>
)} )}
</div> </div>
{this.state.checkApprover === true ? {this.state.isAdmin && this.state.lastStatus == 'APPROVED' ?
<div className="grid grid-2x" style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', }}>
<div className="col-1" />
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ visibleRevision: true })}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Revision</Typography>
</div>
</button>
{/* <button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => this.approvalSubmission('approve')}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Approve</Typography>
</div>
</button> */}
</div>
</div>
:
this.state.checkApprover === true ?
this.state.lastStatus === 'WAITING FOR REVIEW' ? this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} > <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button <button
...@@ -1954,7 +1988,7 @@ export default class OutlookPA extends Component { ...@@ -1954,7 +1988,7 @@ export default class OutlookPA extends Component {
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED'? true : false} PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED' ? true : false}
/> />
)} )}
{this.state.visibleCAT && ( {this.state.visibleCAT && (
......
...@@ -265,7 +265,7 @@ export default class RollingOutlook extends Component { ...@@ -265,7 +265,7 @@ export default class RollingOutlook extends Component {
item.number, item.number,
item.report_name, item.report_name,
item.revision, item.revision,
this.state.quarter.value == 'q1' && !this.state.isApprovedMB? "CLOSED" : (this.state.quarter.value != 'q1' && !this.state.isApprovedRO ? "CLOSED" : (this.state.isSubmit === false ? "CLOSED" : item.current_status)), this.state.quarter.value == 'q1' && !this.state.isApprovedMB ? "CLOSED" : (this.state.quarter.value != 'q1' && !this.state.isApprovedRO ? "CLOSED" : (this.state.isSubmit === false ? "CLOSED" : item.current_status)),
item.report_id, item.report_id,
// Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload, // Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload), item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
...@@ -330,7 +330,7 @@ export default class RollingOutlook extends Component { ...@@ -330,7 +330,7 @@ export default class RollingOutlook extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
// this.setState({ tempData: response.data.data, privileges: response.data.data.privileges }) // this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
// // // console.log(response.data.data) console.log(response.data.data)
if (String(response.data.data.role_name).toLocaleLowerCase() == 'superadmin') { if (String(response.data.data.role_name).toLocaleLowerCase() == 'superadmin') {
this.setState({ isAdmin: true }) this.setState({ isAdmin: true })
} }
...@@ -561,7 +561,7 @@ export default class RollingOutlook extends Component { ...@@ -561,7 +561,7 @@ export default class RollingOutlook extends Component {
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }) this.setState({ isApprover: true, checkApprover: true })
} else { } else {
this.setState({ isApprover: this.state.lastStatus == 'SUBMITTED'? true : false, checkApprover: false }) this.setState({ isApprover: this.state.lastStatus == 'SUBMITTED' ? true : false, checkApprover: false })
} }
}) })
...@@ -1183,7 +1183,7 @@ export default class RollingOutlook extends Component { ...@@ -1183,7 +1183,7 @@ export default class RollingOutlook extends Component {
} }
}) })
if(String(tableMeta[5]) == "Cost of Goods Sold (COGS)" && column == 20) { if (String(tableMeta[5]) == "Cost of Goods Sold (COGS)" && column == 20) {
console.log(splitFormula) console.log(splitFormula)
console.log(baru) console.log(baru)
console.log(anjay) console.log(anjay)
...@@ -1830,7 +1830,41 @@ export default class RollingOutlook extends Component { ...@@ -1830,7 +1830,41 @@ export default class RollingOutlook extends Component {
</div> </div>
)} )}
</div> </div>
{this.state.checkApprover === true ? {this.state.isAdmin && this.state.lastStatus == 'APPROVED' ?
<div className="grid grid-2x" style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', }}>
<div className="col-1" />
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ visibleRevision: true })}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Revision</Typography>
</div>
</button>
{/* <button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => this.approvalSubmission('approve')}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Approve</Typography>
</div>
</button> */}
</div>
</div>
:
this.state.checkApprover === true ?
this.state.lastStatus === 'WAITING FOR REVIEW' ? this.state.lastStatus === 'WAITING FOR REVIEW' ?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} > <div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button <button
...@@ -2032,7 +2066,7 @@ export default class RollingOutlook extends Component { ...@@ -2032,7 +2066,7 @@ export default class RollingOutlook extends Component {
quarter={this.state.quarter.value} quarter={this.state.quarter.value}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED'? true : false} PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED' ? true : false}
/> />
)} )}
...@@ -2053,7 +2087,7 @@ export default class RollingOutlook extends Component { ...@@ -2053,7 +2087,7 @@ export default class RollingOutlook extends Component {
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED'? true : false} PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED' ? true : false}
/> />
)} )}
......
...@@ -1488,7 +1488,7 @@ export default class CashFlow extends Component { ...@@ -1488,7 +1488,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={ this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)} value={ this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1500,11 +1500,11 @@ export default class CashFlow extends Component { ...@@ -1500,11 +1500,11 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
(this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ? (this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1519,7 +1519,7 @@ export default class CashFlow extends Component { ...@@ -1519,7 +1519,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1536,7 +1536,7 @@ export default class CashFlow extends Component { ...@@ -1536,7 +1536,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[15].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[15], tableMeta, 15)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1557,7 +1557,7 @@ export default class CashFlow extends Component { ...@@ -1557,7 +1557,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1569,11 +1569,11 @@ export default class CashFlow extends Component { ...@@ -1569,11 +1569,11 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
((this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)) <= Number(this.state.maxValue)) ? ((this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1588,7 +1588,7 @@ export default class CashFlow extends Component { ...@@ -1588,7 +1588,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1605,7 +1605,7 @@ export default class CashFlow extends Component { ...@@ -1605,7 +1605,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[16].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[16], tableMeta, 16)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1626,7 +1626,7 @@ export default class CashFlow extends Component { ...@@ -1626,7 +1626,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1638,11 +1638,11 @@ export default class CashFlow extends Component { ...@@ -1638,11 +1638,11 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
/> />
: :
tableMeta.rowData[0] === 7 ? tableMeta.rowData[0] === 7 ?
((this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)) <= Number(this.state.maxValue)) ? ((this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)) >= Number(this.state.minValue) && (Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1657,7 +1657,7 @@ export default class CashFlow extends Component { ...@@ -1657,7 +1657,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[23]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1674,7 +1674,7 @@ export default class CashFlow extends Component { ...@@ -1674,7 +1674,7 @@ export default class CashFlow extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17]).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)} value={this.props.PLBSFAMSubmitted? Number(tableMeta.rowData[17].value).toFixed(1) : Number(handleValueFormula(tableMeta.rowData[17], tableMeta, 17)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
......
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