Commit 07388a7d authored by rifkaki's avatar rifkaki

issuess

parent ff1c173f
......@@ -98,7 +98,7 @@ export default class FixedAssetsMovementMR extends Component {
}
api.create().getHierarkiMontlyReportFAM(payload).then(response => {
// console.log(payload);
// console.log(response);
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
......@@ -164,7 +164,7 @@ export default class FixedAssetsMovementMR extends Component {
}
}
})
// console.log(dataTable);
console.log(dataTable);
this.setState({ dataTable, loading: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -1476,7 +1476,7 @@ export default class FixedAssetsMovementMR extends Component {
type="button"
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
this.getItemHierarki()
}, 100);
})}
style={{
......
......@@ -196,7 +196,7 @@ export default class ProfitLossMR extends Component {
item.profit_loss.master_budget === null ? "0.0" : item.profit_loss.master_budget === "" ? "0.0" : item.profit_loss.master_budget,
item.profit_loss.rolling_budget === null ? "0.0" : item.profit_loss.rolling_budget === "" ? "0.0" : item.profit_loss.rolling_budget,
item.profit_loss.actual === null ? "0.0" : item.profit_loss.actual === "" ? "0.0" : item.profit_loss.actual,
item.profit_loss.ytd_actual === null ? "0.0" : item.profit_loss.ytd_actual === "" ? "0.0" : item.profit_loss.ytd_actual,
0,
item.profit_loss.actual_previous_month === null ? "0.0" : item.profit_loss.actual_previous_month === "" ? "0.0" : item.profit_loss.actual_previous_month,
item.profit_loss.amount_act_vs_previous_month === null ? "0.0" : item.profit_loss.amount_act_vs_previous_month === "" ? "0.0" : item.profit_loss.amount_act_vs_previous_month,
item.profit_loss.percent_act_vs_previous_month === null ? "0.0" : item.profit_loss.percent_act_vs_previous_month === "" ? "0.0" : item.profit_loss.percent_act_vs_previous_month,
......@@ -208,6 +208,7 @@ export default class ProfitLossMR extends Component {
item.profit_loss.mtd_vs_mb === null ? "" : item.profit_loss.mtd_vs_mb,
item.profit_loss.mtd_vs_rb === null ? "" : item.profit_loss.mtd_vs_rb,
item.order,
item.profit_loss.ytd_actual === null ? "0.0" : item.profit_loss.ytd_actual === "" ? "0.0" : item.profit_loss.ytd_actual,
])
}
if (item.children !== null) {
......@@ -231,7 +232,7 @@ export default class ProfitLossMR extends Component {
item.profit_loss.master_budget === null ? "0.0" : item.profit_loss.master_budget === "" ? "0.0" : item.profit_loss.master_budget,
item.profit_loss.rolling_budget === null ? "0.0" : item.profit_loss.rolling_budget === "" ? "0.0" : item.profit_loss.rolling_budget,
item.profit_loss.actual === null ? "0.0" : item.profit_loss.actual === "" ? "0.0" : item.profit_loss.actual,
item.profit_loss.ytd_actual === null ? "0.0" : item.profit_loss.ytd_actual === "" ? "0.0" : item.profit_loss.ytd_actual,
0,
item.profit_loss.actual_previous_month === null ? "0.0" : item.profit_loss.actual_previous_month === "" ? "0.0" : item.profit_loss.actual_previous_month,
item.profit_loss.amount_act_vs_previous_month === null ? "0.0" : item.profit_loss.amount_act_vs_previous_month === "" ? "0.0" : item.profit_loss.amount_act_vs_previous_month,
item.profit_loss.percent_act_vs_previous_month === null ? "0.0" : item.profit_loss.percent_act_vs_previous_month === "" ? "0.0" : item.profit_loss.percent_act_vs_previous_month,
......@@ -243,6 +244,7 @@ export default class ProfitLossMR extends Component {
item.profit_loss.mtd_vs_mb === null ? "" : item.profit_loss.mtd_vs_mb,
item.profit_loss.mtd_vs_rb === null ? "" : item.profit_loss.mtd_vs_rb,
item.order,
item.profit_loss.ytd_actual === null ? "0.0" : item.profit_loss.ytd_actual === "" ? "0.0" : item.profit_loss.ytd_actual,
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -398,7 +400,7 @@ export default class ProfitLossMR extends Component {
item.master_budget === "" ? "" : item.master_budget,
item.rolling_budget === "" ? "" : item.rolling_budget,
item.actual === "" ? "" : item.actual,
item.ytd_actual === null ? "" : item.ytd_actual === "" ? "" : item.ytd_actual,
0,
item.actual_previous_month === null ? "" : item.actual_previous_month === "" ? "" : item.actual_previous_month,
0,
0,
......@@ -416,12 +418,13 @@ export default class ProfitLossMR extends Component {
item.mtd_vs_mb ,
item.mtd_vs_rb ,
item.orders,
item.ytd_actual === null ? "" : item.ytd_actual === "" ? "" : item.ytd_actual,
item.error
]
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
this.state.dataTable.map(item => {
if (item[23].length > 0) {
if (item[24].length > 0) {
// console.log('masuk')
this.setState({ buttonError: true, errorPreview: true })
}
......@@ -738,6 +741,21 @@ export default class ProfitLossMR extends Component {
return total
}
const handleTotal = (value, tableMeta) => {
// console.log(tableMeta)
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 10) {
let itemActual = item == undefined || item == "" || item == "undefined" ? 0.0 : item
total = Number(tableMeta.rowData[23]) + Number(itemActual)
}
})
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
}
let columns = [
{
name: "",
......@@ -1194,7 +1212,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[11]).toFixed(1)}
value={Number(handleTotal(tableMeta.rowData[11], tableMeta)).toFixed(1)}
/>
}
/>
......@@ -1739,6 +1757,12 @@ export default class ProfitLossMR extends Component {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
......
......@@ -350,7 +350,7 @@ export default class TaxPlanningMR extends Component {
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => {
this.state.dataTable.map(item => {
if (item[18].length > 0) {
if (item[17].length > 0) {
// console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true })
}
......@@ -531,7 +531,6 @@ export default class TaxPlanningMR extends Component {
}
let totalShldBeNil = 0
console.log(baru)
baru.map((item, index) => {
if (item == '-' || item == '+' || item == '/' || item == '*' || item == '(' || item == ')') {
anjay.push(item)
......@@ -566,14 +565,11 @@ export default class TaxPlanningMR extends Component {
}
} else {
let data = tableMeta.rowData[12]
console.log(data);
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.props.periode))
console.log(indexID);
let indexID = data.findIndex((val) => val.item_formula == String(`${item}`) && val.periode == Number(this.props.periode))
if (indexID !== -1) {
let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz)
}
console.log(anjay)
}
}
} else {
......@@ -728,7 +724,7 @@ export default class TaxPlanningMR extends Component {
}
const handleTotal = (value, tableMeta, dex) => {
// console.log(tableMeta)
let total = value
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 9) {
......
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