Commit f24bc235 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'GGMAC' into 'master'

update isssue 8jun

See merge request !1501
parents f6806dd5 a5f95184
...@@ -218,7 +218,7 @@ export default class TaxPlanning extends Component { ...@@ -218,7 +218,7 @@ export default class TaxPlanning 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 })
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -355,6 +355,7 @@ export default class TaxPlanning extends Component { ...@@ -355,6 +355,7 @@ export default class TaxPlanning extends Component {
"tax_planning": data "tax_planning": data
} }
// console.log(payload); // console.log(payload);
// console.log(JSON.stringify(data))
this.props.saveToMasterBudget(payload) this.props.saveToMasterBudget(payload)
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -7559,7 +7560,7 @@ export default class TaxPlanning extends Component { ...@@ -7559,7 +7560,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover == true ? 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)} disabled={this.props.isApprover == true ? 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)}
value={Number(handleNewFormula(tableMeta, 3, "@11-@13-@35+@53+@60")).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleNewFormula(tableMeta, 3, "@11-@13-@35+@53+@60")).toFixed(1)}
/> />
} }
/> />
...@@ -7577,7 +7578,7 @@ export default class TaxPlanning extends Component { ...@@ -7577,7 +7578,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover == true ? 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)} disabled={this.props.isApprover == true ? 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)}
value={Number(handleNewFormula(tableMeta, 3, "@77-@81")).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleNewFormula(tableMeta, 3, "@77-@81")).toFixed(1)}
/> />
} }
/> />
...@@ -7595,7 +7596,7 @@ export default class TaxPlanning extends Component { ...@@ -7595,7 +7596,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover == true ? 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)} disabled={this.props.isApprover == true ? 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)}
value={Number(handleNewFormula(tableMeta, 3, "@83*@87#TP2")).toFixed(2)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(2) : Number(handleNewFormula(tableMeta, 3, "@83*@87#TP2")).toFixed(2)}
/> />
} }
/> />
...@@ -7613,7 +7614,7 @@ export default class TaxPlanning extends Component { ...@@ -7613,7 +7614,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover == true ? 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)} disabled={this.props.isApprover == true ? 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)}
value={Number(handleNewFormula(tableMeta, 3, "@87+@88")).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleNewFormula(tableMeta, 3, "@87+@88")).toFixed(1)}
/> />
} }
/> />
...@@ -7631,21 +7632,21 @@ export default class TaxPlanning extends Component { ...@@ -7631,21 +7632,21 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover == true ? 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)} disabled={this.props.isApprover == true ? 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)}
value={Number(handleNewFormula(tableMeta, 3, "@89-(@92+@93+@94+@95)")).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleNewFormula(tableMeta, 3, "@89-(@92+@93+@94+@95)")).toFixed(1)}
/> />
} }
/> />
</div> </div>
: :
tableMeta.rowData[8] === "Control (should be nil)" ? tableMeta.rowData[8] === "Control (should be nil)" ?
(Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1) >= Number(this.state.minValue) && Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1) <= Number(this.state.maxValue)) ? (Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotalControl(tableMeta, 1, this.props.periode).toFixed(1)) >= Number(this.state.minValue) && Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotalControl(tableMeta, 1, this.props.periode).toFixed(1)) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -7654,7 +7655,7 @@ export default class TaxPlanning extends Component { ...@@ -7654,7 +7655,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -7665,7 +7666,7 @@ export default class TaxPlanning extends Component { ...@@ -7665,7 +7666,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 1)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotal(tableMeta, 1)).toFixed(1)}
/> />
: :
tableMeta.rowData[3] === 3 ? tableMeta.rowData[3] === 3 ?
...@@ -7680,7 +7681,7 @@ export default class TaxPlanning extends Component { ...@@ -7680,7 +7681,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover == true ? 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)} disabled={this.props.isApprover == true ? 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)}
value={Number(handleTotal(tableMeta, 3)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotal(tableMeta, 3)).toFixed(1)}
/> />
} }
/> />
...@@ -7693,7 +7694,7 @@ export default class TaxPlanning extends Component { ...@@ -7693,7 +7694,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 2)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotal(tableMeta, 2)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -7707,7 +7708,7 @@ export default class TaxPlanning extends Component { ...@@ -7707,7 +7708,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 6)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotal(tableMeta, 6)).toFixed(1)}
/> />
: :
tableMeta.rowData[3] === 5 ? tableMeta.rowData[3] === 5 ?
...@@ -7717,21 +7718,21 @@ export default class TaxPlanning extends Component { ...@@ -7717,21 +7718,21 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 5)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotal(tableMeta, 5)).toFixed(1)}
/> />
: :
tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 1 ?
null null
: :
tableMeta.rowData[3] === 7 ? tableMeta.rowData[3] === 7 ?
(Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ? (Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(this.props.status === 'CLOSED' ? Number(value).toFixed(1) : handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 1, this.props.periode)).toFixed(1)} value={this.props.status === 'CLOSED' ? Number(value).toFixed(1) : Number(handleTotal(tableMeta, 1, this.props.periode)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
......
...@@ -212,6 +212,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -212,6 +212,7 @@ export default class CorporateAnnualTargetMR extends Component {
if (indexIDzz === -1) { if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE' let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
let weight = String(item.weight).substr(0, String(item.weight).length - 1) let weight = String(item.weight).substr(0, String(item.weight).length - 1)
let weightTB = String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)
// console.log(weight) // console.log(weight)
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
...@@ -221,7 +222,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -221,7 +222,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.level, item.level,
item.description, item.description,
// item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1), // item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
parentTrue ? weight : item.corporate_annual_target.weight, parentTrue ? weight : weightTB,
parentTrue ? item.corporate_annual_target.uom : item.uom, parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.jenis_kpi == "" ? null : item.corporate_annual_target.jenis_kpi : item.jenis_kpi == "" ? null : item.kpi_type, parentTrue ? item.corporate_annual_target.jenis_kpi == "" ? null : item.corporate_annual_target.jenis_kpi : item.jenis_kpi == "" ? null : item.kpi_type,
// parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type }, // parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
...@@ -330,8 +331,9 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -330,8 +331,9 @@ export default class CorporateAnnualTargetMR extends Component {
} }
downloadTemplate = async () => { downloadTemplate = async () => {
console.log(`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/monthly_report/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&${this.props.periode}`)
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/monthly_report/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=2021` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cat/monthly_report/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&${this.props.periode}`
) )
console.log(res); console.log(res);
res = await res.blob() res = await res.blob()
...@@ -417,7 +419,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -417,7 +419,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula, item.formula,
item.level, item.level,
item.item_report, item.item_report,
String(item.weight).includes("%") ? String(item.weight).substr(0, String(item.weight).length - 1) : item.weight, String(item.weight).includes("%") ? String(item.weight).trim().substr(0, String(item.weight).trim().length - 1) : item.weight,
item.uom, item.uom,
item.jenis_kpi, item.jenis_kpi,
item.max_ach, item.max_ach,
......
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