Commit 7edd0970 authored by faisalhamdi's avatar faisalhamdi

merge master

parents 01593e64 9627018c
......@@ -753,9 +753,9 @@ export default class BudgetTahunan extends Component {
borderColor: 'transparent'
}}
onClick={() =>
// tableMeta.rowData[5] == true ?
tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
// : null
: null
}
>
{/* {this.state.isApprover == true ?
......@@ -1032,7 +1032,8 @@ export default class BudgetTahunan extends Component {
</div>
{!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}>
{this.state.listAttachment.length > 0 ?
{
this.state.listAttachment.length > 0 ?
this.state.listAttachment.map((item) => {
return (
<button
......
......@@ -327,7 +327,7 @@ export default class CreateManagementDoc extends Component {
);
return (
<div>
<div className="test app-popup-show" style={{ zIndex: 120 }}>
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
......
......@@ -93,7 +93,7 @@ export default class DocumentManagement extends Component {
}
createDocument(payload, settingID, menuName) {
// this.setState({ visibleCreate: false, loading: true })
this.setState({ loading: true })
api.create().uploadDocument(payload).then(response => {
console.log(response)
if (response.data) {
......@@ -227,7 +227,7 @@ export default class DocumentManagement extends Component {
render() {
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: 'absolute', zIndex: 1500, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
......
......@@ -104,7 +104,6 @@ export default class ProfitLossOLPA extends Component {
item.formula,
item.level,
item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january,
item.profit_loss.february,
......@@ -119,8 +118,6 @@ export default class ProfitLossOLPA extends Component {
item.profit_loss.november,
item.profit_loss.december,
item.profit_loss.total_current_year,
item.profit_loss.total_next_year,
item.profit_loss.total_more_year,
item.order
])
}
......@@ -140,7 +137,6 @@ export default class ProfitLossOLPA extends Component {
item.formula,
item.level,
item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january,
item.profit_loss.february,
......@@ -155,8 +151,6 @@ export default class ProfitLossOLPA extends Component {
item.profit_loss.november,
item.profit_loss.december,
item.profit_loss.total_current_year,
item.profit_loss.total_next_year,
item.profit_loss.total_more_year,
item.order
])
if (item.children !== null) {
......@@ -206,23 +200,20 @@ export default class ProfitLossOLPA extends Component {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
total_actual_before: String(Number(i[7]).toFixed(1)),
january: String(Number(i[8]).toFixed(1)),
february: String(Number(i[9]).toFixed(1)),
march: String(Number(i[10]).toFixed(1)),
april: String(Number(i[11]).toFixed(1)),
may: String(Number(i[12]).toFixed(1)),
june: String(Number(i[13]).toFixed(1)),
july: String(Number(i[14]).toFixed(1)),
august: String(Number(i[15]).toFixed(1)),
september: String(Number(i[16]).toFixed(1)),
october: String(Number(i[17]).toFixed(1)),
november: String(Number(i[18]).toFixed(1)),
december: String(Number(i[19]).toFixed(1)),
total_current_year: String(Number(i[20]).toFixed(1)),
total_next_year: String(Number(i[21]).toFixed(1)),
total_more_year: String(Number(i[22]).toFixed(1))
total_actual_before: String(Number(i[6]).toFixed(1)),
january: String(Number(i[7]).toFixed(1)),
february: String(Number(i[8]).toFixed(1)),
march: String(Number(i[9]).toFixed(1)),
april: String(Number(i[10]).toFixed(1)),
may: String(Number(i[11]).toFixed(1)),
june: String(Number(i[12]).toFixed(1)),
july: String(Number(i[13]).toFixed(1)),
august: String(Number(i[14]).toFixed(1)),
september: String(Number(i[15]).toFixed(1)),
october: String(Number(i[16]).toFixed(1)),
november: String(Number(i[17]).toFixed(1)),
december: String(Number(i[18]).toFixed(1)),
total_current_year: String(Number(i[19]).toFixed(1)),
})
})
let payload = {
......@@ -285,8 +276,6 @@ export default class ProfitLossOLPA extends Component {
november: i[13] === undefined ? "0" : reg.test(String(i[13])) === false ? "0" : String(i[13]).trim(),
december: i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
total_current_year: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
total_next_year: i[16] === undefined ? "0" : reg.test(String(i[16])) === false ? "0" : String(i[16]).trim(),
total_more_year: i[17] === undefined ? "0" : reg.test(String(i[17])) === false ? "0" : String(i[17]).trim()
})
}
})
......@@ -317,7 +306,6 @@ export default class ProfitLossOLPA extends Component {
item.formula,
item.level,
item.item_report,
item.notes,
item.total_actual_before,
item.january,
item.february,
......@@ -332,15 +320,13 @@ export default class ProfitLossOLPA extends Component {
item.november,
item.december,
item.total_current_year,
item.total_next_year,
item.total_more_year,
item.orders,
item.error
]
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => {
if (item[24].length > 0) {
if (item[21].length > 0) {
console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
......@@ -357,6 +343,7 @@ export default class ProfitLossOLPA extends Component {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
<<<<<<< HEAD
total_actual_before: String(Number(i[7]).toFixed(1)),
january: String(Number(i[8]).toFixed(1)),
february: String(Number(i[9]).toFixed(1)),
......@@ -373,6 +360,22 @@ export default class ProfitLossOLPA extends Component {
total_current_year: String(Number(i[20]).toFixed(1)),
total_next_year: String(Number(i[21]).toFixed(1)),
total_more_year: String(Number(i[22]).toFixed(1)),
=======
total_actual_before: String(Number(i[6]).toFixed(1)),
january: String(Number(i[7]).toFixed(1)),
february: String(Number(i[8]).toFixed(1)),
march: String(Number(i[9]).toFixed(1)),
april: String(Number(i[10]).toFixed(1)),
may: String(Number(i[11]).toFixed(1)),
june: String(Number(i[12]).toFixed(1)),
july: String(Number(i[13]).toFixed(1)),
august: String(Number(i[14]).toFixed(1)),
september: String(Number(i[15]).toFixed(1)),
october: String(Number(i[16]).toFixed(1)),
november: String(Number(i[17]).toFixed(1)),
december: String(Number(i[18]).toFixed(1)),
total_current_year: String(Number(i[19]).toFixed(1)),
>>>>>>> 9627018c1b5062903316e927a20a6470a0e137cf
})
})
let body = {
......@@ -424,23 +427,20 @@ export default class ProfitLossOLPA extends Component {
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
total_actual_before: String(i[7]),
january: i[0] === 3 && i[8] === "" ? "0" : String(i[8]),
february: i[0] === 3 && i[9] === "" ? "0" : String(i[9]),
march: i[0] === 3 && i[10] === "" ? "0" : String(i[10]),
april: i[0] === 3 && i[11] === "" ? "0" : String(i[11]),
may: i[0] === 3 && i[12] === "" ? "0" : String(i[12]),
june: i[0] === 3 && i[13] === "" ? "0" : String(i[13]),
july: i[0] === 3 && i[14] === "" ? "0" : String(i[14]),
august: i[0] === 3 && i[15] === "" ? "0" : String(i[15]),
september: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
october: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
november: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
december: i[0] === 3 && i[19] === "" ? "0" : String(i[19]),
total_current_year: i[0] === 3 && i[20] === "" ? "0" : String(i[20]),
total_next_year: i[0] === 3 && i[21] === "" ? "0" : String(i[21]),
total_more_year: i[0] === 3 && i[22] === "" ? "0" : String(i[22])
total_actual_before: String(i[6]),
january: i[0] === 3 && i[7] === "" ? "0" : String(i[7]),
february: i[0] === 3 && i[8] === "" ? "0" : String(i[8]),
march: i[0] === 3 && i[9] === "" ? "0" : String(i[9]),
april: i[0] === 3 && i[10] === "" ? "0" : String(i[10]),
may: i[0] === 3 && i[11] === "" ? "0" : String(i[11]),
june: i[0] === 3 && i[12] === "" ? "0" : String(i[12]),
july: i[0] === 3 && i[13] === "" ? "0" : String(i[13]),
august: i[0] === 3 && i[14] === "" ? "0" : String(i[14]),
september: i[0] === 3 && i[15] === "" ? "0" : String(i[15]),
october: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
november: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
december: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
total_current_year: i[0] === 3 && i[19] === "" ? "0" : String(i[19])
})
})
let payload = {
......@@ -488,31 +488,27 @@ export default class ProfitLossOLPA extends Component {
const handleTotal = (tableMeta) => {
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 8 && index <= 19) {
if (index >= 7 && index <= 18) {
let valItem = item == undefined || item == "" ? 0 : item
total += Number(valItem)
}
})
let indexParent = dataTable2.findIndex((val) => val[1] == tableMeta.rowData[2] )
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
let value = Number(dataTable2[tableMeta.rowIndex - 2][20]) / Number(dataTable2[tableMeta.rowIndex - 1][20])
dataTable2[tableMeta.rowIndex][20] = R.equals(value, NaN) ? "0.0" : value
let value = Number(dataTable2[tableMeta.rowIndex - 2][19]) / Number(dataTable2[tableMeta.rowIndex - 1][19])
dataTable2[tableMeta.rowIndex][19] = R.equals(value, NaN) ? "0.0" : value
return R.equals(value, NaN) ? "0.0" : value
} else if (indexParent !== -1 && String(dataTable2[indexParent][5]).toLocaleUpperCase() == "GROSS PROFIT MARGIN (% OF REVENUE)") {
return handleFormula(0, tableMeta, 0)
}
else {
dataTable2[tableMeta.rowIndex][20] = total
dataTable2[tableMeta.rowIndex][19] = total
return total
}
// console.log(total);
}
const handleNotes = (value, tableMeta) => {
console.log(value)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
console.log(dataTable2[tableMeta.rowIndex]);
}
const handleValue = (data) => {
let total = 0
dataTable2.map((item, index) => {
......@@ -529,7 +525,7 @@ export default class ProfitLossOLPA extends Component {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = []
arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[23] == item)
let index = dataTable2.findIndex((val) => val[20] == item)
if (index > 0) {
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
} else {
......@@ -607,8 +603,8 @@ export default class ProfitLossOLPA extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{tableMeta.rowData[24] ?
tableMeta.rowData[24].length > 0 ?
{tableMeta.rowData[21] ?
tableMeta.rowData[21].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
......@@ -633,44 +629,6 @@ export default class ProfitLossOLPA extends Component {
)
}
}
}, {
name: "Notes",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
control={
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover? 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)}
defaultValue={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleNotes(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>}
</div>
</div>
)
}
}
}, {
name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
options: {
......@@ -1834,186 +1792,6 @@ export default class ProfitLossOLPA extends Component {
)
}
}
}, {
name: `31 Dec ${Number(this.props.periode) + 1} Total`,
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover? 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(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 2 ?
<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)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(value, tableMeta, 13)).toFixed(1)}ue={handleFormula(value, tableMeta)}
/>
// null
:
tableMeta.rowData[0] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(value, tableMeta, 13)).toFixed(1)}ue={handleFormula(value, tableMeta)}
/>
// null
:
tableMeta.rowData[0] === 1 ?
// value === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value)}
// />
null
:
null
}
</div>
)
}
}
}, {
name: `31 Dec ${Number(this.props.periode) + 2} Total`,
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover? 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(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 2 ?
<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)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(value, tableMeta, 14)).toFixed(1)}ue={handleFormula(value, tableMeta)}
/>
// null
:
tableMeta.rowData[0] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(value, tableMeta, 14)).toFixed(1)}ue={handleFormula(value, tableMeta)}
/>
// null
:
tableMeta.rowData[0] === 1 ?
// value === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value)}
// />
null
:
null
}
</div>
)
}
}
},
{
name: "",
......
......@@ -721,22 +721,6 @@ export default class TaxPlanningOLPA extends Component {
}
}
// async downloadAllData() {
// let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
// console.log(url);
// let res = await fetch(
// `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id === null ? "" : this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
// )
// res = await res.blob()
// this.setState({ loading: false })
// if (res.size > 0) {
// let url = window.URL.createObjectURL(res);
// let a = document.createElement('a');
// a.href = url;
// a.download = 'Outlook Performance Appraisal Tax Planning.xlsx';
// a.click();
// }
// }
async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
......@@ -3017,7 +3001,7 @@ export default class TaxPlanningOLPA extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - TAX PLANNING" ?
this.state.judul === "OUTLOOK PA - TAX PLANNING" ?
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