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
1f9227b1
Commit
1f9227b1
authored
May 05, 2021
by
Faisal Hamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'faisal' into 'master'
issue ro bs! See merge request
!1460
parents
9b65fcff
5dc98f13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
98 deletions
+44
-98
BalanceSheetRO.js
src/container/RollingOutlook/BalanceSheetRO.js
+44
-98
No files found.
src/container/RollingOutlook/BalanceSheetRO.js
View file @
1f9227b1
...
...
@@ -57,7 +57,8 @@ export default class BalanceSheetRO extends Component {
tipeAlert
:
''
,
messageAlert
:
''
,
visibleUpload
:
false
,
visibleBSRO
:
true
visibleBSRO
:
true
,
kansas
:
0
}
}
...
...
@@ -396,98 +397,42 @@ export default class BalanceSheetRO extends Component {
}
})
}
handleValidate
()
{
let
data
=
[]
let
err
=
false
let
errorContrl
=
false
let
editAble
=
this
.
state
.
editAble
let
dataTable
=
this
.
state
.
dataTable
let
kansas
=
this
.
state
.
kansas
console
.
log
(
dataTable
[
dataTable
.
length
-
1
])
// dataTable.map((i, index) => {
// if(i[0] === 3) {
// if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
// console.log('msk 2');
// err = true
// }
// }
// if (String(i[5]) == "Control (should be nil)") {
// if (Number(i[9]) < this.state.minValue || Number(i[9]) > this.state.maxValue ) {
// errorContrl = true
// editAble = true
// }
// }
// data.push({
// "item_report_id": i[1],
// "rolling_outlook": i[6],
// "master_budget": i[7],
// "rolling_budget": i[8],
// "actual": i[9],
// "actual_previous_month": i[10],
// "amount_act_vs_previous_month": i[11],
// "percent_act_vs_previous_month": i[12],
// "amount_act_vs_mb": i[13],
// "percent_act_vs_mb": i[14],
// "amount_act_vs_rb": i[15],
// "percent_act_vs_rb": i[16],
// "mtd_vs_previous_month": i[17],
// "mtd_vs_mb": i[18],
// "mtd_vs_rb": i[19]
// })
// })
// let payload = {
// "monthly_report_id": this.props.monthlyReportId,
// "company_id": this.props.company.company_id,
// "periode": this.props.periode,
// "report_id": this.props.report_id,
// "status": "submitted",
// "months": this.props.month.month_id,
// "balance_sheet": data
// }
// api.create().validateSubmitReportBS(payload).then((response) => {
// console.log(response.data.data.result)
// console.log(err);
// console.log(errorContrl);
// if (response.data) {
// if (response.data.status === "success") {
// if (response.data.data.result && err === false && errorContrl === false ) {
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
// if (kansas == 0) {
// this.setState({kansas: 1, loading: true}, () => {
// this.handleValidate()
// })
// } else {
// this.setState({kansas: 0})
// }
// } else {
// this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
// if (kansas == 0) {
// this.setState({kansas: 1, loading: true}, () => {
// this.handleValidate()
// })
// } else {
// this.setState({kansas: 0})
// }
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
// }
// })
let
dataTable
=
this
.
state
.
dataTable
// console.log(this.state.dataTable)
dataTable
.
map
((
i
,
index
)
=>
{
if
(
String
(
i
[
5
])
==
"Control (should be nil)"
)
{
this
.
setState
({
loading
:
true
})
let
n
=
0
for
(
n
=
(
this
.
props
.
quarter
==
'q1'
?
10
:
(
this
.
props
.
quarter
==
'q2'
?
13
:
16
));
n
<=
18
;
n
++
)
{
if
((
Number
(
i
[
n
])
<
Number
(
this
.
state
.
minValue
)
||
Number
(
i
[
n
])
>
Number
(
this
.
state
.
maxValue
)))
{
err
=
true
}
}
}
})
console
.
log
(
err
)
if
(
err
===
false
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
if
(
kansas
==
0
)
{
this
.
setState
({
kansas
:
1
,
loading
:
true
},
()
=>
{
this
.
handleValidate
()
})
}
else
{
this
.
setState
({
kansas
:
0
})
}
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
true
})
if
(
kansas
==
0
)
{
this
.
setState
({
kansas
:
1
,
loading
:
true
},
()
=>
{
this
.
handleValidate
()
})
}
else
{
this
.
setState
({
kansas
:
0
})
}
}
}
closeAlert
()
{
...
...
@@ -708,16 +653,17 @@ export default class BalanceSheetRO extends Component {
}
const
handleTotal
=
(
tableMeta
)
=>
{
let
total
=
0
let
total
=
0
tableMeta
.
rowData
.
map
((
item
,
index
)
=>
{
if
(
index
==
18
)
{
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"r/e (cummulative)"
)
{
total
=
String
(
Number
(
tableMeta
.
rowData
[
7
]).
toFixed
(
1
))
dataTable2
[
tableMeta
.
rowIndex
][
19
]
=
total
}
else
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"profit (loss) mtd"
)
{
if
(
index
>=
7
&&
index
<=
18
)
{
total
+=
Number
(
item
.
value
)
}
}
else
if
(
index
==
18
)
{
total
=
isNaN
(
item
)
?
Number
(
item
.
value
)
:
Number
(
item
)
// if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "profit (loss) mtd") {
// total = Number(item.value)
// } else {
// total = Number(item)
// }
}
})
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
total
...
...
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