Commit 2837bd7f authored by Riri Novita's avatar Riri Novita

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

parents 206f5f5a 93cac74f
......@@ -3701,7 +3701,7 @@ export default class BalanceSheet extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - BALANCE SHEET" ?
String(this.state.judul).includes("MASTER BUDGET - BALANCE SHEET") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
......@@ -3526,7 +3526,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - CAT" ?
String(this.state.judul).includes("MASTER BUDGET - CAT") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
......@@ -2850,7 +2850,7 @@ export default class FixedAssetsMovement extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - FIXED ASSETS MOVEMENT" ?
String(this.state.judul).includes("MASTER BUDGET - FIXED ASSETS MOVEMENT") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
......@@ -3038,7 +3038,7 @@ export default class ProfitLoss extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - PROFIT LOSS" ?
String(this.state.judul).includes("MASTER BUDGET - PROFIT LOSS") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
......@@ -9156,7 +9156,7 @@ export default class TaxPlanning extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - TAX PLANNING" ?
String(this.state.judul).includes("MASTER BUDGET - TAX PLANNING") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
......@@ -206,6 +206,43 @@ export default class FixedAssetsMovementMR extends Component {
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, type) => {
let val = String(value).split(",").join("")
if (type === "actual") {
dataTable2[tableMeta.rowIndex][8] = Number(val).toFixed(1)
} else {
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
dataTable2[tableMeta.rowIndex][9] = Number(val).toFixed(1)
let jagain = Number(dataTable2[indexParent][8]).toFixed(1)
dataTable2[indexParent][9] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(Number(jagain) + Number(val)).toFixed(1)
// if (tableMeta.rowData[5] === 'Cash & Bank Balance') {
// console.log(value);
// console.log(a);
// console.log(jagain);
// console.log(dataTable2[indexParent]);
// }
} else {
dataTable2[tableMeta.rowIndex][8] = Number(val).toFixed(1)
}
}
}
const handleValue = (data, type) => {
let total = 0
dataTable2.map((item, index) => {
if (data.rowData[1] === item[2]) {
let itemVal = item[data.columnIndex + type].value !== undefined ? Number(item[data.columnIndex + type].value) : Number(item[data.columnIndex + type])
total = item[data.columnIndex + type] === undefined ? Number(total) + 0 : Number(total) + itemVal
}
})
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[data.rowIndex][2])
dataTable2[data.rowIndex][data.columnIndex + type] = Number(total).toFixed(1)
// console.log(indexParent);
return total
}
const handleValueFormula = (data, type) => {
let total = 0
dataTable2.map((item, index) => {
......@@ -263,7 +300,6 @@ export default class FixedAssetsMovementMR extends Component {
customBodyRender: (value, tableMeta) => {
return (
<div style={{ width: 300 }}>
{console.log(tableMeta)}
{tableMeta.rowData[24] ?
tableMeta.rowData[24].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
......@@ -322,35 +358,46 @@ export default class FixedAssetsMovementMR extends Component {
{
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 0)).toFixed(1)}
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[6]).toFixed(1)}
/>
}
/>
</span> :
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[6]).toFixed(1)}
/>
}
</div> :
tableMeta.rowData[0] === 5 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)}
/>
</div> :
null
</span> :
tableMeta.rowData[0] === 6 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)}
/>
</span> :
null
}
</div>
</div>
......@@ -367,7 +414,7 @@ export default class FixedAssetsMovementMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 0)).toFixed(1)}
value={Number(handleValueFormula(tableMeta, 1)).toFixed(1)}
/>
</span> :
tableMeta.rowData[0] === 3 ?
......@@ -395,18 +442,7 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}>
{
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(tableMeta, 0)).toFixed(1)}
/>
</span> :
null :
tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
......@@ -415,16 +451,41 @@ export default class FixedAssetsMovementMR extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
disabled={false}
value={Number(tableMeta.rowData[8]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
/>
}
/>
</div> :
null
tableMeta.rowData[0] === 5 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/>
</span> :
tableMeta.rowData[0] === 6 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 90, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/>
</span> :
null
}
</div>
</div>
......
......@@ -94,8 +94,8 @@ export default class TaxPlanningMR extends Component {
"months": this.props.month.month_id
}
api.create().getHierarkiMontlyReportTP(payload).then(response => {
// console.log(response);
// console.log(payload);
console.log(response);
console.log(payload);
let dataTable = []
if (response.data) {
if (response.data.status == 'success') {
......@@ -495,7 +495,8 @@ export default class TaxPlanningMR extends Component {
async downloadAllData() {
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 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}`
// console.log(url);
console.log(urls);
console.log(url);
let res = await fetch(
this.props.monthlyReportId == null ? url : urls
)
......@@ -1525,7 +1526,7 @@ export default class TaxPlanningMR extends Component {
</div>
{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(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') ? */}
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', marginTop: 20 }}>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
type="button"
......@@ -1750,7 +1751,7 @@ export default class TaxPlanningMR extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "TAX PLANNING - MONTHLY REPORT" ?
String(this.state.judul).includes("TAX PLANNING - MONTHLY REPORT") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
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