Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
22c03ac0
Commit
22c03ac0
authored
Apr 07, 2021
by
faisalhamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into faisal
parents
8c2d63a0
1ecbe43f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3108 additions
and
98 deletions
+3108
-98
index.js
src/api/index.js
+5
-1
SubHolding.js
src/container/Laporan/SubHolding.js
+46
-24
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+753
-1
OutlookPA.js
src/container/OutlookPA.js
+175
-72
CashFlowOLPA.js
src/container/OutlookPA/CashFlowOLPA.js
+2129
-0
No files found.
src/api/index.js
View file @
22c03ac0
...
@@ -359,6 +359,8 @@ const create = (type = "") => {
...
@@ -359,6 +359,8 @@ const create = (type = "") => {
const
approvalSubmissionOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/approval_outlook'
,
body
)
const
approvalSubmissionOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/approval_outlook'
,
body
)
const
checkApproverOLPA
=
()
=>
api
.
get
(
'transaction/outlook_pa/is_approver'
)
const
checkApproverOLPA
=
()
=>
api
.
get
(
'transaction/outlook_pa/is_approver'
)
const
createPeriodeRevisionOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/create_periode_revision'
,
body
)
const
createPeriodeRevisionOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/create_periode_revision'
,
body
)
const
getHierarkiCFOLPA
=
(
body
)
=>
api
.
post
(
'transaction/cash_flow/outlook_pa/get_report_hierarki'
,
body
)
const
createCFOLPA
=
(
body
)
=>
api
.
post
(
'transaction/cash_flow/outlook_pa/create_outlook_report'
,
body
)
// Monthly
// Monthly
const
getMonthlyReport
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/get_all_report'
,
body
)
const
getMonthlyReport
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/get_all_report'
,
body
)
...
@@ -788,7 +790,9 @@ const create = (type = "") => {
...
@@ -788,7 +790,9 @@ const create = (type = "") => {
createPeriodeRevisionRO
,
createPeriodeRevisionRO
,
historyApprovalRO
,
historyApprovalRO
,
getRollingOutlookCF
,
getRollingOutlookCF
,
createRollingOutlookCF
createRollingOutlookCF
,
getHierarkiCFOLPA
,
createCFOLPA
}
}
}
}
...
...
src/container/Laporan/SubHolding.js
View file @
22c03ac0
...
@@ -545,18 +545,29 @@ export default class SubHolding extends Component {
...
@@ -545,18 +545,29 @@ export default class SubHolding extends Component {
item
.
profit_loss
.
ol_q3_october
,
item
.
profit_loss
.
ol_q3_october
,
item
.
profit_loss
.
ol_q3_november
,
item
.
profit_loss
.
ol_q3_november
,
item
.
profit_loss
.
ol_q3_december
,
item
.
profit_loss
.
ol_q3_december
,
// item.profit_loss.ol_pa_january,
item
.
profit_loss
.
ol_pa_january
,
// item.profit_loss.ol_pa_february,
item
.
profit_loss
.
ol_pa_february
,
// item.profit_loss.ol_pa_march,
item
.
profit_loss
.
ol_pa_march
,
// item.profit_loss.ol_pa_april,
item
.
profit_loss
.
ol_pa_april
,
// item.profit_loss.ol_pa_may,
item
.
profit_loss
.
ol_pa_may
,
// item.profit_loss.ol_pa_june,
item
.
profit_loss
.
ol_pa_june
,
// item.profit_loss.ol_pa_july,
item
.
profit_loss
.
ol_pa_july
,
// item.profit_loss.ol_pa_august,
item
.
profit_loss
.
ol_pa_august
,
// item.profit_loss.ol_pa_september,
item
.
profit_loss
.
ol_pa_september
,
// item.profit_loss.ol_pa_october,
item
.
profit_loss
.
ol_pa_october
,
// item.profit_loss.ol_pa_november,
item
.
profit_loss
.
ol_pa_november
,
// item.profit_loss.ol_pa_december,
item
.
profit_loss
.
ol_pa_december
,
item
.
profit_loss
.
historialLast10YearList
// item.profit_loss.historialLast10YearList[0].value === null ? "0" : item.profit_loss.historialLast10YearList[0].value,
// item.profit_loss.historialLast10YearList[1].value === null ? "0" : item.profit_loss.historialLast10YearList[1].value,
// item.profit_loss.historialLast10YearList[2].value === null ? "0" : item.profit_loss.historialLast10YearList[2].value,
// item.profit_loss.historialLast10YearList[3].value === null ? "0" : item.profit_loss.historialLast10YearList[3].value,
// item.profit_loss.historialLast10YearList[4].value === null ? "0" : item.profit_loss.historialLast10YearList[4].value,
// item.profit_loss.historialLast10YearList[5].value === null ? "0" : item.profit_loss.historialLast10YearList[5].value,
// item.profit_loss.historialLast10YearList[6].value === null ? "0" : item.profit_loss.historialLast10YearList[6].value,
// item.profit_loss.historialLast10YearList[7].value === null ? "0" : item.profit_loss.historialLast10YearList[7].value,
// item.profit_loss.historialLast10YearList[8].value === null ? "0" : item.profit_loss.historialLast10YearList[8].value,
// item.profit_loss.historialLast10YearList[9].value === null ? "0" : item.profit_loss.historialLast10YearList[9].value
])
])
}
}
...
@@ -666,18 +677,29 @@ export default class SubHolding extends Component {
...
@@ -666,18 +677,29 @@ export default class SubHolding extends Component {
item
.
profit_loss
.
ol_q3_october
,
item
.
profit_loss
.
ol_q3_october
,
item
.
profit_loss
.
ol_q3_november
,
item
.
profit_loss
.
ol_q3_november
,
item
.
profit_loss
.
ol_q3_december
,
item
.
profit_loss
.
ol_q3_december
,
// item.profit_loss.ol_pa_january,
item
.
profit_loss
.
ol_pa_january
,
// item.profit_loss.ol_pa_february,
item
.
profit_loss
.
ol_pa_february
,
// item.profit_loss.ol_pa_march,
item
.
profit_loss
.
ol_pa_march
,
// item.profit_loss.ol_pa_april,
item
.
profit_loss
.
ol_pa_april
,
// item.profit_loss.ol_pa_may,
item
.
profit_loss
.
ol_pa_may
,
// item.profit_loss.ol_pa_june,
item
.
profit_loss
.
ol_pa_june
,
// item.profit_loss.ol_pa_july,
item
.
profit_loss
.
ol_pa_july
,
// item.profit_loss.ol_pa_august,
item
.
profit_loss
.
ol_pa_august
,
// item.profit_loss.ol_pa_september,
item
.
profit_loss
.
ol_pa_september
,
// item.profit_loss.ol_pa_october,
item
.
profit_loss
.
ol_pa_october
,
// item.profit_loss.ol_pa_november,
item
.
profit_loss
.
ol_pa_november
,
// item.profit_loss.ol_pa_december,
item
.
profit_loss
.
ol_pa_december
,
item
.
profit_loss
.
historialLast10YearList
// item.profit_loss.historialLast10YearList[0].value === null ? "0" : item.profit_loss.historialLast10YearList[0].value,
// item.profit_loss.historialLast10YearList[1].value === null ? "0" : item.profit_loss.historialLast10YearList[1].value,
// item.profit_loss.historialLast10YearList[2].value === null ? "0" : item.profit_loss.historialLast10YearList[2].value,
// item.profit_loss.historialLast10YearList[3].value === null ? "0" : item.profit_loss.historialLast10YearList[3].value,
// item.profit_loss.historialLast10YearList[4].value === null ? "0" : item.profit_loss.historialLast10YearList[4].value,
// item.profit_loss.historialLast10YearList[5].value === null ? "0" : item.profit_loss.historialLast10YearList[5].value,
// item.profit_loss.historialLast10YearList[6].value === null ? "0" : item.profit_loss.historialLast10YearList[6].value,
// item.profit_loss.historialLast10YearList[7].value === null ? "0" : item.profit_loss.historialLast10YearList[7].value,
// item.profit_loss.historialLast10YearList[8].value === null ? "0" : item.profit_loss.historialLast10YearList[8].value,
// item.profit_loss.historialLast10YearList[9].value === null ? "0" : item.profit_loss.historialLast10YearList[9].value
])
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
...
...
src/container/Laporan/TableSubHolding.js
View file @
22c03ac0
...
@@ -7058,7 +7058,759 @@ export default class TableSubHolding extends Component {
...
@@ -7058,7 +7058,759 @@ export default class TableSubHolding extends Component {
options: {
options: {
display: false
display: false
}
}
},
}, {
name: `OL PA ${this.props.periode}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
{/* <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> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"1"}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"2"}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"3"}</span>
</div>
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"4"}</span>
</div>
</div>
<div className="column-2 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"5"}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"6"}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"7"}</span>
</div>
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"8"}</span>
</div>
</div>
<div className="column-3 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"9"}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"10"}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"11"}</span>
</div>
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
<span>{"12"}</span>
</div>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div>
<div className="grid grid-3x content-center">
<div className="grid grid-4x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea' , fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[96]) === "" ? "" : Number(tableMeta.rowData[96]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[97]) === "" ? "" : Number(tableMeta.rowData[97]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[98]) === "" ? "" : Number(tableMeta.rowData[98]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[99]) === "" ? "" : Number(tableMeta.rowData[99]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
<div className="grid grid-4x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[100]) === "" ? "" : Number(tableMeta.rowData[100]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[101]) === "" ? "" : Number(tableMeta.rowData[101]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[102]) === "" ? "" : Number(tableMeta.rowData[102]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[103]) === "" ? "" : Number(tableMeta.rowData[103]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
<div className="grid grid-4x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[104]) === "" ? "" : Number(tableMeta.rowData[104]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[105]) === "" ? "" : Number(tableMeta.rowData[105]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[106]) === "" ? "" : Number(tableMeta.rowData[106]).toFixed(1)}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.approveMonthly ? '#000000de' : '#5198ea', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={String(tableMeta.rowData[107]) === "" ? "" : Number(tableMeta.rowData[107]).toFixed(1)}
/>
}
/>
</div>
}
</div>
</div>
</div>
</div>
)
}
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: `Historial`,
options: {
// display: false,
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
{/* <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> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-2x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1 grid grid-5x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#1c71b8' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 10}`}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 9}`}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 8}`}</span>
</div>
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 7}`}</span>
</div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 6}`}</span>
</div>
</div>
<div className="column-2 grid grid-5x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#1c71b8' }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 5}`}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 4}`}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 3}`}</span>
</div>
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 2}`}</span>
</div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#1c71b8' }}>
<span>{`${Number(this.props.periode) - 1}`}</span>
</div>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
// console.log(tableMeta)
return (
<div>
<div className="grid grid-2x content-center">
<div className="grid grid-5x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 80, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][0]) === "0" ? "" : Number(tableMeta.rowData[108][0]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][1]) === "0" ? "" : Number(tableMeta.rowData[108][1]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][2]) === "0" ? "" : Number(tableMeta.rowData[108][2]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][3]) === "0" ? "" : Number(tableMeta.rowData[108][3]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][4]) === "0" ? "" : Number(tableMeta.rowData[108][4]).toFixed(1))}
/>
}
/>
</div>
}
</div>
</div>
<div className="grid grid-5x content-center">
<div className="col-1">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][5]) === "0" ? "" : Number(tableMeta.rowData[108][5]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-2">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][6]) === "0" ? "" : Number(tableMeta.rowData[108][6]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-3">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][7]) === "0" ? "" : Number(tableMeta.rowData[108][7]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-4">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][8]) === "0" ? "" : Number(tableMeta.rowData[108][8]).toFixed(1))}
/>
}
/>
</div>
}
</div>
<div className="col-5">
{tableMeta.rowData[0] === 4 ?
null
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[108] == null ? "" : (String(tableMeta.rowData[108][9]) === "0" ? "" : Number(tableMeta.rowData[108][9]).toFixed(1))}
/>
}
/>
</div>
}
</div>
</div>
</div>
</div>
)
}
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}
]
]
const columnDBPL = [{
const columnDBPL = [{
src/container/OutlookPA.js
View file @
22c03ac0
...
@@ -8,6 +8,7 @@ import MuiAlert from '@material-ui/lab/Alert';
...
@@ -8,6 +8,7 @@ import MuiAlert from '@material-ui/lab/Alert';
import
{
titleCase
}
from
'../library/Utils'
;
import
{
titleCase
}
from
'../library/Utils'
;
import
ProfitLossOLPA
from
'./OutlookPA/ProfitLossOLPA'
;
import
ProfitLossOLPA
from
'./OutlookPA/ProfitLossOLPA'
;
import
TaxPlanning
from
'./OutlookPA/TaxPlanningOLPA'
;
import
TaxPlanning
from
'./OutlookPA/TaxPlanningOLPA'
;
import
CashFlow
from
'./OutlookPA/CashFlowOLPA'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../library/Upload"
;
import
UploadFile
from
"../library/Upload"
;
import
{
format
}
from
'date-fns'
;
import
{
format
}
from
'date-fns'
;
...
@@ -38,6 +39,7 @@ export default class OutlookPA extends Component {
...
@@ -38,6 +39,7 @@ export default class OutlookPA extends Component {
report_id
:
null
,
report_id
:
null
,
visibleBS
:
false
,
visibleBS
:
false
,
visiblePL
:
false
,
visiblePL
:
false
,
visibleCF
:
false
,
listAttachment
:
[],
listAttachment
:
[],
visibleUpload
:
false
,
visibleUpload
:
false
,
revisionTable
:
null
,
revisionTable
:
null
,
...
@@ -60,7 +62,9 @@ export default class OutlookPA extends Component {
...
@@ -60,7 +62,9 @@ export default class OutlookPA extends Component {
latestPeriode
:
''
,
latestPeriode
:
''
,
minDateRevision
:
new
Date
(),
minDateRevision
:
new
Date
(),
maxDateRevision
:
new
Date
(),
maxDateRevision
:
new
Date
(),
btnApprove
:
false
btnApprove
:
false
,
listStatus
:
[],
selectedStatus
:
[],
}
}
this
.
myRef
=
React
.
createRef
()
this
.
myRef
=
React
.
createRef
()
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -82,55 +86,77 @@ export default class OutlookPA extends Component {
...
@@ -82,55 +86,77 @@ export default class OutlookPA extends Component {
}
}
checkApprover
()
{
checkApprover
()
{
let
listStatus1
=
[
{
name
:
'Open'
,
value
:
'not-yet'
},
{
name
:
'Submitted'
,
value
:
'approval_review'
},
{
name
:
'Waiting for Review / Approval'
,
value
:
'approval_proccess'
},
{
name
:
'Approved'
,
value
:
'approved'
},
]
let
listStatus2
=
[
{
name
:
'Open'
,
value
:
'not-yet'
},
{
name
:
'Submitted'
,
value
:
'approval_review'
},
{
name
:
'Approved'
,
value
:
'approved'
},
]
api
.
create
().
checkApproverOLPA
().
then
(
response
=>
{
api
.
create
().
checkApproverOLPA
().
then
(
response
=>
{
// console.log(response);
// console.log(response);
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
,
listStatus
:
listStatus1
,
selectedStatus
:
listStatus1
},
()
=>
this
.
getPeriode
())
this
.
getPeriode
())
}
else
{
}
else
{
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
},
()
=>
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
,
listStatus
:
listStatus2
,
selectedStatus
:
listStatus2
},
()
=>
this
.
get
DetailUser
())
this
.
get
Periode
())
}
}
})
})
}
}
getCompanySubmitted
()
{
getCompanySubmitted
()
{
let
selectedStatus
=
this
.
state
.
selectedStatus
.
map
((
item
)
=>
{
return
item
.
value
})
let
body
=
{
let
body
=
{
"periode"
:
this
.
state
.
periode
.
periode
"periode"
:
this
.
state
.
periode
.
periode
,
"status"
:
selectedStatus
}
}
api
.
create
().
getCompanySubmittedOLPA
(
body
).
then
(
response
=>
{
api
.
create
().
getCompanySubmittedOLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
if
(
response
.
data
.
data
.
length
>
0
)
{
let
companyData
=
data
.
map
((
item
)
=>
{
let
data
=
response
.
data
.
data
return
{
let
companyData
=
data
.
map
((
item
)
=>
{
company_id
:
item
.
company_id
,
return
{
company_name
:
item
.
company_name
,
company_id
:
item
.
company_id
,
}
company_name
:
item
.
company_name
,
})
}
})
if
(
companyData
.
length
>
0
)
{
if
(
companyData
.
length
>
0
)
{
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
}
}
let
defaultProps
=
{
let
defaultProps
=
{
options
:
companyData
,
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
};
let
indexID
=
null
let
indexID
=
null
if
(
this
.
state
.
rawData
!==
undefined
)
{
if
(
this
.
state
.
rawData
!==
undefined
)
{
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
rawData
.
company_id
)
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
rawData
.
company_id
)
}
this
.
setState
({
listCompany
:
defaultProps
,
company
:
indexID
==
null
?
companyData
[
0
]
:
companyData
[
indexID
]
},
()
=>
{
// // console.log(response.data.data);
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
}
else
{
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
})
}
}
//
this
.
setState
({
listCompany
:
defaultProps
,
company
:
indexID
==
null
?
companyData
[
0
]
:
companyData
[
indexID
]
},
()
=>
{
})
console
.
log
(
response
.
data
.
data
);
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
}
else
{
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
})
}
//
})
}
else
{
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
listCompany
:
null
,
company
:
null
,
dataTable
:
[],
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
@@ -244,11 +270,41 @@ export default class OutlookPA extends Component {
...
@@ -244,11 +270,41 @@ export default class OutlookPA extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
getRole
(
response
.
data
.
data
.
role_id
)
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
getCompanyActive
()
this
.
getCompanySubmitted
()
})
}
}
}
})
}
getRole
(
id
)
{
api
.
create
().
getDetailRole
(
id
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
// this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
// // // console.log(response.data.data)
if
(
String
(
response
.
data
.
data
.
role_name
).
toLocaleLowerCase
()
==
'superadmin'
)
{
this
.
setState
({
isAdmin
:
true
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -268,7 +324,7 @@ export default class OutlookPA extends Component {
...
@@ -268,7 +324,7 @@ export default class OutlookPA extends Component {
})
})
if
(
companyData
.
length
>
0
)
{
if
(
companyData
.
length
>
0
)
{
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
}
}
let
arrayBaru
=
[]
let
arrayBaru
=
[]
...
@@ -280,12 +336,12 @@ export default class OutlookPA extends Component {
...
@@ -280,12 +336,12 @@ export default class OutlookPA extends Component {
})
})
if
(
arrayBaru
.
length
>
0
)
{
if
(
arrayBaru
.
length
>
0
)
{
arrayBaru
=
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
arrayBaru
=
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
}
}
console
.
log
(
companyData
)
console
.
log
(
companyData
)
console
.
log
(
arrayBaru
)
console
.
log
(
arrayBaru
)
let
defaultProps
=
{
let
defaultProps
=
{
options
:
arrayBaru
,
options
:
arrayBaru
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
...
@@ -315,7 +371,7 @@ export default class OutlookPA extends Component {
...
@@ -315,7 +371,7 @@ export default class OutlookPA extends Component {
// console.log(response);
// console.log(response);
let
currentYear
=
new
Date
().
getFullYear
()
let
currentYear
=
new
Date
().
getFullYear
()
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
lastPeriod
:
Number
(
response
.
data
.
data
.
last_periode
)
<
Number
(
currentYear
)?
String
(
currentYear
)
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
setState
({
lastPeriod
:
Number
(
response
.
data
.
data
.
last_periode
)
<
Number
(
currentYear
)
?
String
(
currentYear
)
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
getPeriode
()
this
.
getPeriode
()
})
})
}
}
...
@@ -333,11 +389,11 @@ export default class OutlookPA extends Component {
...
@@ -333,11 +389,11 @@ export default class OutlookPA extends Component {
let
data
=
[]
let
data
=
[]
response
.
data
.
data
.
map
((
item
)
=>
{
response
.
data
.
data
.
map
((
item
)
=>
{
if
(
this
.
state
.
isApprover
)
{
if
(
this
.
state
.
isApprover
)
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)))
{
data
.
push
(
item
)
data
.
push
(
item
)
}
}
}
else
{
}
else
{
if
((
item
>=
2000
)
&&
(
item
==
Number
(
this
.
state
.
lastPeriod
)
||
item
<
Number
(
this
.
state
.
lastPeriod
)
))
{
if
((
item
>=
2000
)
&&
(
item
==
currentYear
||
item
<=
currentYear
))
{
data
.
push
(
item
)
data
.
push
(
item
)
}
}
}
}
...
@@ -351,18 +407,19 @@ export default class OutlookPA extends Component {
...
@@ -351,18 +407,19 @@ export default class OutlookPA extends Component {
options
:
periodeData
,
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriodProps
==
undefined
?
Number
(
this
.
state
.
lastPeriod
)
:
this
.
state
.
lastPeriodProps
)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
)
:
this
.
state
.
lastPeriodProps
==
undefined
?
Number
(
this
.
state
.
lastPeriod
)
:
this
.
state
.
lastPeriodProps
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
periode
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
periode
)
// console.log(data)
// console.log(data)
// console.log(this.state.lastPeriod)
// console.log(this.state.lastPeriod)
// console.log(periode)
// console.log(periode)
// console.log(index)
// console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
// if (this.state.isApprover === true) {
this
.
getCompanySubmitted
()
// this.getCompanySubmitted()
}
else
{
// } else {
this
.
getRevision
()
// this.getRevision()
}
// }
this
.
getDetailUser
()
})
})
}
}
}
}
...
@@ -437,7 +494,7 @@ export default class OutlookPA extends Component {
...
@@ -437,7 +494,7 @@ export default class OutlookPA extends Component {
},
1000
);
},
1000
);
}
}
})
})
}
}
}
else
{
}
else
{
this
.
setState
({
outlook_pa_id
:
null
,
loading
:
false
})
this
.
setState
({
outlook_pa_id
:
null
,
loading
:
false
})
}
}
...
@@ -481,7 +538,7 @@ export default class OutlookPA extends Component {
...
@@ -481,7 +538,7 @@ export default class OutlookPA extends Component {
"max_periode"
:
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYY-MM-DD'
)
"max_periode"
:
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYY-MM-DD'
)
}
}
// console.log(payload)
// console.log(payload)
api
.
create
().
approvalSubmissionOLPA
(
body
).
then
((
res
)
=>
{
api
.
create
().
approvalSubmissionOLPA
(
body
).
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getOutlookPAID
()
this
.
getOutlookPAID
()
...
@@ -514,31 +571,40 @@ export default class OutlookPA extends Component {
...
@@ -514,31 +571,40 @@ export default class OutlookPA extends Component {
visibleBS
:
true
,
visibleBS
:
true
,
visiblePL
:
false
,
visiblePL
:
false
,
visibleTP
:
false
,
visibleTP
:
false
,
visibleCF
:
false
})
})
}
else
}
else
if
(
item
===
'Profit Loss'
)
{
if
(
item
===
'Profit Loss'
)
{
this
.
setState
({
this
.
setState
({
visibleOutlookPA
:
false
,
visibleOutlookPA
:
false
,
visibleBS
:
false
,
visibleBS
:
false
,
visiblePL
:
true
,
visiblePL
:
true
,
visibleTP
:
false
,
visibleTP
:
false
,
visibleCF
:
false
})
})
}
}
else
if
(
item
===
'Tax Planning'
)
{
else
if
(
item
===
'Tax Planning'
)
{
this
.
setState
({
this
.
setState
({
visibleOutlookPA
:
false
,
visibleOutlookPA
:
false
,
visibleBS
:
false
,
visibleBS
:
false
,
visiblePL
:
false
,
visiblePL
:
false
,
visibleTP
:
true
,
visibleTP
:
true
,
visibleCF
:
false
})
})
}
}
else
if
(
item
===
'Cash Flow'
)
{
this
.
setState
({
visibleOutlookPA
:
false
,
visibleBS
:
false
,
visiblePL
:
false
,
visibleTP
:
false
,
visibleCF
:
true
})
}
})
})
}
}
validateRevision
(){
validateRevision
()
{
let
arrayRevisi
=
this
.
state
.
detailRevisiCheck
let
arrayRevisi
=
this
.
state
.
detailRevisiCheck
let
remarksKosong
=
0
let
remarksKosong
=
0
arrayRevisi
.
map
((
item
,
index
)
=>
{
arrayRevisi
.
map
((
item
,
index
)
=>
{
if
(
item
.
remarks
==
""
)
{
if
(
item
.
remarks
==
""
)
{
remarksKosong
+=
1
remarksKosong
+=
1
}
}
...
@@ -589,7 +655,7 @@ export default class OutlookPA extends Component {
...
@@ -589,7 +655,7 @@ export default class OutlookPA extends Component {
},
1000
);
},
1000
);
}
}
})
})
}
}
}
}
})
})
}
}
...
@@ -608,7 +674,7 @@ export default class OutlookPA extends Component {
...
@@ -608,7 +674,7 @@ export default class OutlookPA extends Component {
},
1000
);
},
1000
);
}
}
})
})
}
}
}
}
})
})
}
}
...
@@ -792,9 +858,9 @@ export default class OutlookPA extends Component {
...
@@ -792,9 +858,9 @@ export default class OutlookPA extends Component {
borderColor
:
'transparent'
borderColor
:
'transparent'
}}
}}
onClick
=
{()
=>
onClick
=
{()
=>
tableMeta
.
rowData
[
5
]
==
true
?
//
tableMeta.rowData[5] == true ?
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
4
],
tableMeta
.
rowData
[
2
],
tableMeta
.
rowData
[
3
])
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
4
],
tableMeta
.
rowData
[
2
],
tableMeta
.
rowData
[
3
])
:
null
//
: null
}
}
>
>
{
/* {this.state.isApprover == true ?
{
/* {this.state.isApprover == true ?
...
@@ -974,11 +1040,12 @@ export default class OutlookPA extends Component {
...
@@ -974,11 +1040,12 @@ export default class OutlookPA extends Component {
{...
this
.
state
.
listPeriode
}
{...
this
.
state
.
listPeriode
}
id
=
"periode"
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
// console.log(this.state.isApprover, this.state.company);
this
.
setState
({
visibleTableHistory
:
false
})
if
(
this
.
state
.
isApprover
===
true
)
{
if
(
this
.
state
.
listCompany
==
null
)
{
console
.
log
(
'yak'
)
this
.
getCompanySubmitted
()
this
.
getCompanySubmitted
()
}
else
{
}
else
{
this
.
setState
({
visibleTableHistory
:
false
}
)
console
.
log
(
'zz'
)
this
.
getRevision
()
this
.
getRevision
()
}
}
})}
})}
...
@@ -991,6 +1058,23 @@ export default class OutlookPA extends Component {
...
@@ -991,6 +1058,23 @@ export default class OutlookPA extends Component {
value
=
{
this
.
state
.
periode
}
value
=
{
this
.
state
.
periode
}
/
>
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Autocomplete
multiple
id
=
"tags-standard"
options
=
{
this
.
state
.
listStatus
}
getOptionLabel
=
{(
option
)
=>
option
.
name
}
style
=
{{
width
:
250
}}
onChange
=
{(
event
,
newInputValue
)
=>
{
this
.
setState
({
selectedStatus
:
newInputValue
,
loading
:
true
},
()
=>
{
console
.
log
(
newInputValue
);
this
.
getCompanySubmitted
()
})
}}
value
=
{
this
.
state
.
selectedStatus
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Submission Status"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
/>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listCompany
}
{...
this
.
state
.
listCompany
}
...
@@ -1334,6 +1418,25 @@ export default class OutlookPA extends Component {
...
@@ -1334,6 +1418,25 @@ export default class OutlookPA extends Component {
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
/
>
)}
)}
{
this
.
state
.
visibleCF
&&
(
<
CashFlow
open
=
{
this
.
props
.
open
}
report_id
=
{
this
.
state
.
report_id
}
height
=
{
this
.
props
.
height
}
width
=
{
this
.
props
.
width
}
company
=
{
this
.
state
.
company
}
revision
=
{
this
.
state
.
revisionTable
}
periode
=
{
this
.
state
.
periode
.
periode
}
outlook_pa_id
=
{
this
.
state
.
outlook_pa_id
}
saveToOLPA
=
{
this
.
saveToOLPA
.
bind
(
this
)}
onClickClose
=
{()
=>
this
.
setState
({
visibleCF
:
false
,
visibleOutlookPA
:
true
})}
getReport
=
{
this
.
getOutlookPAID
.
bind
(
this
)}
status
=
{
this
.
state
.
status
}
isApprover
=
{
this
.
state
.
isApprover
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
/
>
)}
{
this
.
state
.
visibleRevision
&&
(
{
this
.
state
.
visibleRevision
&&
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
...
...
src/container/OutlookPA/CashFlowOLPA.js
0 → 100644
View file @
22c03ac0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment