Commit c540b6a5 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'GGMAC' into 'master'

update ro pl & mr cf

See merge request !1253
parents 67f70ffb 86d08524
...@@ -336,7 +336,7 @@ export default class CashFlow extends Component { ...@@ -336,7 +336,7 @@ export default class CashFlow extends Component {
olahDataCashFlow(dataTable2) { olahDataCashFlow(dataTable2) {
console.log(dataTable2) console.log(dataTable2)
let listCF = [] let listCF = []
dataTable2.map((item,index) => { dataTable2.map((item, index) => {
listCF.push( listCF.push(
{ {
"item_report_id": item[1], "item_report_id": item[1],
...@@ -377,7 +377,7 @@ export default class CashFlow extends Component { ...@@ -377,7 +377,7 @@ export default class CashFlow extends Component {
let payload = { let payload = {
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"periode": this.props.periode.periode, "periode": this.props.periode,
"report_id": 6, "report_id": 6,
"status": "submitted", "status": "submitted",
"cash_flow": dbcf "cash_flow": dbcf
......
...@@ -72,6 +72,7 @@ export default class MonthlyReport extends Component { ...@@ -72,6 +72,7 @@ export default class MonthlyReport extends Component {
isApprovedMB: false, isApprovedMB: false,
textRevision: '', textRevision: '',
dbCF: [], dbCF: [],
dbPL: [],
PLBSFAMSubmitted: false, PLBSFAMSubmitted: false,
PLID: null, PLID: null,
monthHome: null monthHome: null
...@@ -624,9 +625,11 @@ export default class MonthlyReport extends Component { ...@@ -624,9 +625,11 @@ export default class MonthlyReport extends Component {
// // console.log(this.state.lastStatus); // // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
// this.getCashFlow(type)
// this.getPL(type)
if (type != undefined) { if (type != undefined) {
this.getCashFlow(type) // this.getCashFlow(type)
this.getPL(type) // this.getPL(type)
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false })
} }
...@@ -1363,7 +1366,7 @@ export default class MonthlyReport extends Component { ...@@ -1363,7 +1366,7 @@ export default class MonthlyReport extends Component {
}) })
// console.log(listCF) console.log(this.state.dbCF)
this.setState({ dbCF: listCF }, () => { this.setState({ dbCF: listCF }, () => {
if (type != undefined) { if (type != undefined) {
if (type == 'BS' || type == 'FAM' || type == 'PL') { if (type == 'BS' || type == 'FAM' || type == 'PL') {
...@@ -1374,33 +1377,11 @@ export default class MonthlyReport extends Component { ...@@ -1374,33 +1377,11 @@ export default class MonthlyReport extends Component {
}) })
} }
createCashFlow() { createCashFlow(payload) {
let payload = {
"monthly_report_id": this.state.monthlyReportId,
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"report_id": 13,
"status": "submitted",
"months": this.state.month.month_id,
"cash_flow": this.state.dbCF
}
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
api.create().createMonthlyReportCF(payload).then((res) => { api.create().createMonthlyReportCF(payload).then((res) => {
this.saveToMonthlyReport()
console.log(res) console.log(res)
// if (response.data) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport()
// } else {
// this.setState({ loading: false }, () => {
// this.props.saveToMonthlyReport()
// })
// }
// } else {
// this.setState({ loading: false }, () => {
// // this.getSubmission()
// document.body.style.overflow = 'unset';
// })
// }
}) })
} }
...@@ -1448,28 +1429,28 @@ export default class MonthlyReport extends Component { ...@@ -1448,28 +1429,28 @@ export default class MonthlyReport extends Component {
item.level, item.level,
item.description, item.description,
this.state.month.month_id == 1 ? this.state.month.month_id == 1 ?
{ value: item.profit_detail.january, formula: item.profit_detail.january_formula } : { value: item.profit_detail.january, formula: item.profit_detail.january_formula, value_ro: 0 } :
this.state.month.month_id == 2 ? this.state.month.month_id == 2 ?
{ value: item.profit_detail.february, formula: item.profit_detail.february_formula } : { value: item.profit_detail.february, formula: item.profit_detail.february_formula, value_ro: 0 } :
this.state.month.month_id == 3 ? this.state.month.month_id == 3 ?
{ value: item.profit_detail.march, formula: item.profit_detail.march_formula } : { value: item.profit_detail.march, formula: item.profit_detail.march_formula, value_ro: 0 } :
this.state.month.month_id == 4 ? this.state.month.month_id == 4 ?
{ value: item.profit_detail.april, formula: item.profit_detail.april_formula } : { value: item.profit_detail.april, formula: item.profit_detail.april_formula, value_ro: 0 } :
this.state.month.month_id == 5 ? this.state.month.month_id == 5 ?
{ value: item.profit_detail.may, formula: item.profit_detail.may_formula } : { value: item.profit_detail.may, formula: item.profit_detail.may_formula, value_ro: 0 } :
this.state.month.month_id == 6 ? this.state.month.month_id == 6 ?
{ value: item.profit_detail.june, formula: item.profit_detail.june_formula } : { value: item.profit_detail.june, formula: item.profit_detail.june_formula, value_ro: 0 } :
this.state.month.month_id == 7 ? this.state.month.month_id == 7 ?
{ value: item.profit_detail.july, formula: item.profit_detail.july_formula } : { value: item.profit_detail.july, formula: item.profit_detail.july_formula, value_ro: 0 } :
this.state.month.month_id == 8 ? this.state.month.month_id == 8 ?
{ value: item.profit_detail.august, formula: item.profit_detail.august_formula } : { value: item.profit_detail.august, formula: item.profit_detail.august_formula, value_ro: 0 } :
this.state.month.month_id == 9 ? this.state.month.month_id == 9 ?
{ value: item.profit_detail.september, formula: item.profit_detail.september_formula } : { value: item.profit_detail.september, formula: item.profit_detail.september_formula, value_ro: 0 } :
this.state.month.month_id == 10 ? this.state.month.month_id == 10 ?
{ value: item.profit_detail.october, formula: item.profit_detail.october_formula } : { value: item.profit_detail.october, formula: item.profit_detail.october_formula, value_ro: 0 } :
this.state.month.month_id == 11 ? this.state.month.month_id == 11 ?
{ value: item.profit_detail.november, formula: item.profit_detail.november_formula } : { value: item.profit_detail.november, formula: item.profit_detail.november_formula, value_ro: 0 } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula }, { value: item.profit_detail.december, formula: item.profit_detail.december_formula, value_ro: 0 },
item.order, item.order,
item.profit_detail.notes item.profit_detail.notes
]) ])
...@@ -1491,28 +1472,28 @@ export default class MonthlyReport extends Component { ...@@ -1491,28 +1472,28 @@ export default class MonthlyReport extends Component {
item.level, item.level,
item.description, item.description,
this.state.month.month_id == 1 ? this.state.month.month_id == 1 ?
{ value: item.profit_detail.january, formula: item.profit_detail.january_formula } : { value: item.profit_detail.january, formula: item.profit_detail.january_formula, value_ro: 0 } :
this.state.month.month_id == 2 ? this.state.month.month_id == 2 ?
{ value: item.profit_detail.february, formula: item.profit_detail.february_formula } : { value: item.profit_detail.february, formula: item.profit_detail.february_formula, value_ro: 0 } :
this.state.month.month_id == 3 ? this.state.month.month_id == 3 ?
{ value: item.profit_detail.march, formula: item.profit_detail.march_formula } : { value: item.profit_detail.march, formula: item.profit_detail.march_formula, value_ro: 0 } :
this.state.month.month_id == 4 ? this.state.month.month_id == 4 ?
{ value: item.profit_detail.april, formula: item.profit_detail.april_formula } : { value: item.profit_detail.april, formula: item.profit_detail.april_formula, value_ro: 0 } :
this.state.month.month_id == 5 ? this.state.month.month_id == 5 ?
{ value: item.profit_detail.may, formula: item.profit_detail.may_formula } : { value: item.profit_detail.may, formula: item.profit_detail.may_formula, value_ro: 0 } :
this.state.month.month_id == 6 ? this.state.month.month_id == 6 ?
{ value: item.profit_detail.june, formula: item.profit_detail.june_formula } : { value: item.profit_detail.june, formula: item.profit_detail.june_formula, value_ro: 0 } :
this.state.month.month_id == 7 ? this.state.month.month_id == 7 ?
{ value: item.profit_detail.july, formula: item.profit_detail.july_formula } : { value: item.profit_detail.july, formula: item.profit_detail.july_formula, value_ro: 0 } :
this.state.month.month_id == 8 ? this.state.month.month_id == 8 ?
{ value: item.profit_detail.august, formula: item.profit_detail.august_formula } : { value: item.profit_detail.august, formula: item.profit_detail.august_formula, value_ro: 0 } :
this.state.month.month_id == 9 ? this.state.month.month_id == 9 ?
{ value: item.profit_detail.september, formula: item.profit_detail.september_formula } : { value: item.profit_detail.september, formula: item.profit_detail.september_formula, value_ro: 0 } :
this.state.month.month_id == 10 ? this.state.month.month_id == 10 ?
{ value: item.profit_detail.october, formula: item.profit_detail.october_formula } : { value: item.profit_detail.october, formula: item.profit_detail.october_formula, value_ro: 0 } :
this.state.month.month_id == 11 ? this.state.month.month_id == 11 ?
{ value: item.profit_detail.november, formula: item.profit_detail.november_formula } : { value: item.profit_detail.november, formula: item.profit_detail.november_formula, value_ro: 0 } :
{ value: item.profit_detail.december, formula: item.profit_detail.december_formula }, { value: item.profit_detail.december, formula: item.profit_detail.december_formula, value_ro: 0 },
item.order, item.order,
item.profit_detail.notes item.profit_detail.notes
]) ])
...@@ -1541,14 +1522,14 @@ export default class MonthlyReport extends Component { ...@@ -1541,14 +1522,14 @@ export default class MonthlyReport extends Component {
} else { } else {
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false }) this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false })
} }
console.log(dataTable); // console.log(dataTable);
}) })
}) })
}) })
} }
handleValueFormulaDBPLMR = (value, tableMeta, column, periode, forecast) => { handleValueFormulaDBPLMR = (value, tableMeta, column, typeRO) => {
let splitFormula = String(tableMeta[3]).split(/([()@])/) let splitFormula = String(tableMeta[3]).split(/([()@])/)
// let splitFormula = String(tableMeta.rowData[3]).split('@') // let splitFormula = String(tableMeta.rowData[3]).split('@')
let baru = [] let baru = []
...@@ -1579,15 +1560,16 @@ export default class MonthlyReport extends Component { ...@@ -1579,15 +1560,16 @@ export default class MonthlyReport extends Component {
anjay.push(item) anjay.push(item)
} else { } else {
if (String(item).includes('#')) { if (String(item).includes('#')) {
if (forecast !== undefined) { // if (typeRO !== undefined) {
let forecastt = 0 // let forecastt = 0
forecast.map((items, index) => { // val.item_formula
if (items.periode == periode) { // forecast.map((items, index) => {
forecastt += Number(items.value) // if (items.periode == periode) {
} // forecastt += Number(items.value)
}) // }
anjay.push(forecastt) // })
} else { // anjay.push(forecastt)
// } else {
if (String(item).includes('[M-1]')) { if (String(item).includes('[M-1]')) {
// let tst = String(item).replace('[M-1]', '') // let tst = String(item).replace('[M-1]', '')
// let data = column == 7 ? 18 : column - 1 // let data = column == 7 ? 18 : column - 1
...@@ -1599,29 +1581,27 @@ export default class MonthlyReport extends Component { ...@@ -1599,29 +1581,27 @@ export default class MonthlyReport extends Component {
// anjay.push(valuezz == "" ? 0 : valuezz) // anjay.push(valuezz == "" ? 0 : valuezz)
// } // }
} else { } else {
// console.log(item)
// console.log(value.formula)
let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.state.periode.periode)) let indexID = value.formula.findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == Number(this.state.periode.periode))
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = value.formula[indexID].value let valuezz = 0
anjay.push(valuezz == "" ? 0 : valuezz) if (typeRO != undefined) {
valuezz = value.formula[indexID].value_ro
} else {
valuezz = value.formula[indexID].value
} }
anjay.push(valuezz == "" ? 0 : valuezz)
} }
} }
// }
} else { } else {
let indexID = dataTable2.findIndex((val) => val[22] == item) let indexID = dataTable2.findIndex((val) => val[7] == item)
if (indexID !== -1) { if (indexID !== -1) {
// if (forecast !== undefined) { let valuezz = 0
// console.log(dataTable2[indexID]) if (typeRO != undefined) {
// console.log(column) valuezz = dataTable2[indexID][column].value_ro == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value_ro
// console.log(dataTable2[indexID][column]) } else {
valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
// }
if (forecast != undefined) {
// console.log(dataTable2[indexID][column])
} }
let valuezz = dataTable2[indexID][column].value == undefined ? dataTable2[indexID][column] : dataTable2[indexID][column].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} else { } else {
if (item === '(-1)') { if (item === '(-1)') {
...@@ -1750,6 +1730,14 @@ export default class MonthlyReport extends Component { ...@@ -1750,6 +1730,14 @@ export default class MonthlyReport extends Component {
} }
}) })
if (tableMeta[5] == "Direct Material" && typeRO != undefined) {
console.log(splitFormula)
console.log(baru)
console.log(anjay)
console.log(anjay2)
console.log(total)
}
total = R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
return total return total
...@@ -1759,6 +1747,7 @@ export default class MonthlyReport extends Component { ...@@ -1759,6 +1747,7 @@ export default class MonthlyReport extends Component {
dbPL.map((item, index) => { dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6) { if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6) item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
item[6].value_ro = this.handleValueFormulaDBPLMR(item[6], item, 6, 'ro')
} }
}) })
// console.log(dbPL) // console.log(dbPL)
...@@ -1770,29 +1759,31 @@ export default class MonthlyReport extends Component { ...@@ -1770,29 +1759,31 @@ export default class MonthlyReport extends Component {
payloadPL(type) { payloadPL(type) {
let listPL = [] let listPL = []
this.state.dbPL.map((item, index) => { this.state.dbPL.map((item, index) => {
if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") { // if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6) item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
item[6].value_ro = this.handleValueFormulaDBPLMR(item[6], item, 6, 'ro')
listPL.push({ listPL.push({
"item_report_id": item[1], "item_report_id": item[1],
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1), "actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1),
"rolling_outlook": item[0] == 1 ? "" : Number(item[6].value_ro).toFixed(1), "rolling_outlook": item[0] == 1 ? "" : Number(item[6].value_ro).toFixed(1),
"notes": item[8] "notes": item[8]
}) })
} else { // } else {
listPL.push({ // item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
"item_report_id": item[1], // listPL.push({
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1), // "item_report_id": item[1],
"rolling_outlook": item[0] == 1 ? "" : Number(item[6].value_ro).toFixed(1), // "actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1),
"notes": item[8] // "rolling_outlook": item[0] == 1 ? "" : Number(item[6].value_ro).toFixed(1),
}) // "notes": item[8]
} // })
// }
}) })
// console.log(this.state.dbPL)
console.log(listPL)
this.setState({ dbPL: listPL }, () => { this.setState({ dbPL: listPL }, () => {
if (type != undefined) { if (type != undefined) {
if ( type == 'PL') { if (type == 'PL') {
// console.log(this.state.dbPL)
// this.setState({ loading: false })
console.log('tarik sis') console.log('tarik sis')
this.createPL() this.createPL()
} }
...@@ -1814,6 +1805,7 @@ export default class MonthlyReport extends Component { ...@@ -1814,6 +1805,7 @@ export default class MonthlyReport extends Component {
} }
api.create().createReportPLMR(payload).then((res) => { api.create().createReportPLMR(payload).then((res) => {
console.log(res) console.log(res)
// console.log(this.state.dbPL)
this.setState({ loading: false }) this.setState({ loading: false })
// if (response.data) { // if (response.data) {
// if (response.data.status === "success") { // if (response.data.status === "success") {
...@@ -3016,7 +3008,10 @@ export default class MonthlyReport extends Component { ...@@ -3016,7 +3008,10 @@ export default class MonthlyReport extends Component {
onClickClose={() => this.setState({ visibleCF: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleCF: false, visibleMonthlyReport: true })}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
PLBSFAMSubmitted={this.state.PLBSFAMSubmitted} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
PLBSFAMSubmitted={false}
createCashFlow={this.createCashFlow.bind(this)}
/> />
)} )}
......
...@@ -47,13 +47,51 @@ export default class CashFlowMR extends Component { ...@@ -47,13 +47,51 @@ export default class CashFlowMR extends Component {
visibleCFMR: true, visibleCFMR: true,
// valueThreshold: 0, // valueThreshold: 0,
minValue: 0, minValue: 0,
maxValue: 0 maxValue: 0,
viewOnly: true
} }
} }
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
if (this.props.isApprover) {
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
if (this.props.prevRevision) {
checkPrevRev = true
} else {
checkPrevRev = false
}
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'drat' || this.props.status === 'submitted') {
checkStatus = true
} else {
checkStatus = false
}
// console.log(checkStatus)
// console.log(checkLastStatus)
// console.log(checkApprover)
// console.log(checkPrevRev)
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev})
}
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
console.log(this.props.PLBSFAMSubmitted) console.log(this.props.PLBSFAMSubmitted)
this.handleViewOnly()
this.getSettingControl() this.getSettingControl()
} }
...@@ -170,6 +208,40 @@ export default class CashFlowMR extends Component { ...@@ -170,6 +208,40 @@ export default class CashFlowMR extends Component {
} }
} }
payloadCF(dataTable2) {
let listCF = []
console.log(dataTable2)
dataTable2.map((item, index) => {
// if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
// item[6].value = this.handleValueFormula(item, index)
listCF.push({
"item_report_id": item[1],
"actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1)
})
// } else {
// listCF.push({
// "item_report_id": item[1],
// "actual": item[0] == 1 ? "" : Number(item[6].value).toFixed(1)
// })
// }
})
this.createCashFlow(listCF)
}
createCashFlow(listCF) {
let payload = {
"monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": 13,
"status": "submitted",
"months": this.props.month.month_id,
"cash_flow": listCF
}
this.props.createCashFlow(payload)
}
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
...@@ -225,7 +297,7 @@ export default class CashFlowMR extends Component { ...@@ -225,7 +297,7 @@ export default class CashFlowMR extends Component {
// console.log(valuezz); // console.log(valuezz);
} }
} else { } else {
let data = tableMeta.rowData[6].formula == null? [] : tableMeta.rowData[6].formula let data = tableMeta.rowData[6].formula == null ? [] : tableMeta.rowData[6].formula
// console.log(data) // console.log(data)
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`)) let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) { if (indexID !== -1) {
...@@ -249,7 +321,7 @@ export default class CashFlowMR extends Component { ...@@ -249,7 +321,7 @@ export default class CashFlowMR extends Component {
if (item == '-' || item == '+' || item == '/' || item == '*') { if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item opet = item
} else { } else {
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item)))) anjay.push(opet == '' ? Number(item) : Number(String(opet + String(item))))
tambahan = false tambahan = false
opet = "" opet = ""
} }
...@@ -523,7 +595,7 @@ export default class CashFlowMR extends Component { ...@@ -523,7 +595,7 @@ export default class CashFlowMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) :Number(handleValueFormula(tableMeta, 6)).toFixed(1)} value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) : Number(handleValueFormula(tableMeta, 6)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? null : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? null : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -540,7 +612,7 @@ export default class CashFlowMR extends Component { ...@@ -540,7 +612,7 @@ export default class CashFlowMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) :Number(handleValueFormula(tableMeta, 6)).toFixed(1)} value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) : Number(handleValueFormula(tableMeta, 6)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: null} : null}
...@@ -645,63 +717,17 @@ export default class CashFlowMR extends Component { ...@@ -645,63 +717,17 @@ export default class CashFlowMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{/* <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {this.state.viewOnly && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false })
// this.handleValidate()
}, 100);
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft === true ?
null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMonthlyReport('draft')
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div>
</button>
<button <button
type="button" type="button"
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
onClick={() => onClick={() =>
this.state.buttonError ? // this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) // this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
: // :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1 }, () => {
this.backToMonthlyReport('submitted') this.payloadCF(dataTable2)
})} })}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -714,10 +740,8 @@ export default class CashFlowMR extends Component { ...@@ -714,10 +740,8 @@ export default class CashFlowMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
</div> */} </div>}
</div> </div>
{/* : null
} */}
</div> </div>
</Paper> </Paper>
</div> </div>
......
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