Commit 8366935c authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'rifka' into 'master'

Rifka

See merge request !733
parents 1defd5cd 2d38aea2
...@@ -1269,9 +1269,16 @@ export default class TaxPlanning extends Component { ...@@ -1269,9 +1269,16 @@ export default class TaxPlanning extends Component {
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) { if (index >= 9 && index <= 20) {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode) if (this.props.status === 'CLOSED') {
if (indexChild !== -1) { let indexChild = item.tbf
total += Number(item.tbf.formula[indexChild].value) if (indexChild !== -1) {
total += Number(item.tbf)
}
} else {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode)
if (indexChild !== -1) {
total += Number(item.tbf.formula[indexChild].value)
}
} }
} }
}) })
...@@ -8131,22 +8138,59 @@ export default class TaxPlanning extends Component { ...@@ -8131,22 +8138,59 @@ export default class TaxPlanning extends Component {
} }
/> />
</div> : </div> :
<div style={{ flex: 1 }}> tableMeta.rowData[3] === 7 ?
<FormControlLabel (Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={value.tbf} thousandSeparator={true}
control={ style={{
<NumberFormat fontSize: 12,
thousandSeparator={true} textAlign: 'right',
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(1)}
/>
}
/>
</div>
: :
tableMeta.rowData[3] === 3 ? tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
...@@ -8660,22 +8704,59 @@ export default class TaxPlanning extends Component { ...@@ -8660,22 +8704,59 @@ export default class TaxPlanning extends Component {
} }
/> />
</div> : </div> :
<div style={{ flex: 1 }}> tableMeta.rowData[3] === 7 ?
<FormControlLabel (Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
style={{ margin: 0 }} <NumberFormat
value={value.tbf} thousandSeparator={true}
control={ style={{
<NumberFormat fontSize: 12,
thousandSeparator={true} textAlign: 'right',
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value.tbf).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1)}
/> />
} </LightTooltip>
/> :
</div> <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(1)}
/>
}
/>
</div>
: :
tableMeta.rowData[3] === 3 ? tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
......
...@@ -94,7 +94,7 @@ export default class TaxPlanningMR extends Component { ...@@ -94,7 +94,7 @@ export default class TaxPlanningMR extends Component {
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getHierarkiMontlyReportTP(payload).then(response => { api.create().getHierarkiMontlyReportTP(payload).then(response => {
console.log(response); // console.log(response);
console.log(payload); console.log(payload);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
...@@ -501,8 +501,8 @@ export default class TaxPlanningMR extends Component { ...@@ -501,8 +501,8 @@ export default class TaxPlanningMR extends Component {
async downloadAllData() { async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_tp/export_monthly_report?monthly_report_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&months=${this.props.month.month_id}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_tp/export_monthly_report?monthly_report_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&months=${this.props.month.month_id}`
let urls = `https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_tp/export_monthly_report?monthly_report_id=${this.props.monthlyReportId}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&months=${this.props.month.month_id}` let urls = `https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_tp/export_monthly_report?monthly_report_id=${this.props.monthlyReportId}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&months=${this.props.month.month_id}`
// console.log(urls); // console.log(url);
console.log(url); console.log(urls);
let res = await fetch( let res = await fetch(
this.props.monthlyReportId == null ? url : urls this.props.monthlyReportId == null ? url : urls
) )
...@@ -926,13 +926,12 @@ export default class TaxPlanningMR extends Component { ...@@ -926,13 +926,12 @@ export default class TaxPlanningMR extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[1] === 4 || tableMeta.rowData[1] ? {tableMeta.rowData[1] === 4 || tableMeta.rowData[1] === 1 ?
null : null :
tableMeta.rowData[1] === 2 ? tableMeta.rowData[1] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
......
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