Commit 346c1b44 authored by rifkaki's avatar rifkaki

bs

parent 5a218f22
......@@ -140,6 +140,7 @@ export default class BalanceSheetMR extends Component {
"get_for" : this.state.get_for
}
api.create().getHierarkiMontlyReportBS(payload).then(response => {
console.log(payload);
console.log(response);
let dataTable = []
let err = false
......@@ -148,7 +149,7 @@ export default class BalanceSheetMR extends Component {
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (item.type_report_id === 3 && item.level === 2) {
if (item.type_report_id === 3) {
if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
err = true
}
......@@ -196,7 +197,7 @@ export default class BalanceSheetMR extends Component {
}
}
res.map((item, index) => {
if (item.type_report_id === 3 && item.level === 2) {
if (item.type_report_id === 3) {
if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
err = true
}
......@@ -418,6 +419,7 @@ export default class BalanceSheetMR extends Component {
}
// console.log(JSON.stringify(body));
console.log(body)
api.create('UPLOAD').uploadMonthlyReportBS(body).then(response => {
console.log(response);
if (response.data) {
......@@ -473,7 +475,7 @@ export default class BalanceSheetMR extends Component {
}
api.create('UPLOAD').createMonthlyReportBS(payload).then(response => {
console.log(response);
console.log(JSON.stringify(payload))
// console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.saveToMonthlyReport()
......@@ -492,8 +494,8 @@ export default class BalanceSheetMR extends Component {
let data = []
let err = false
this.state.dataTable.map((i, index) => {
if(i[0] === 3 && i[4] === 2) {
console.log(i);
if(i[0] === 3) {
// console.log(i);
if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) {
console.log('msk 1');
// console.log(i);
......@@ -524,7 +526,7 @@ export default class BalanceSheetMR extends Component {
"mtd_vs_rb": i[19]
})
})
console.log(JSON.stringify(data));
// console.log(JSON.stringify(data));
// data.map(i => {
// if (i.mtd_vs_previous_month === "" && (Number(i.percent_act_vs_previous_month) < this.state.minValue || Number(i.percent_act_vs_previous_month) > this.state.maxValue)) {
// console.log('msk 1');
......@@ -556,7 +558,7 @@ export default class BalanceSheetMR extends Component {
"months": this.props.month.month_id,
"balance_sheet": data
}
console.log(JSON.stringify(payload));
// console.log(JSON.stringify(payload));
console.log(this.state.dataTable)
api.create().validateSubmitReportBS(payload).then((response) => {
console.log(response)
......
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