Commit 51b644cc authored by d.arizona's avatar d.arizona

apdet

parent 99a47381
// contents of .env // contents of .env
REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-dev REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-dev
REACT_APP_URL_MAIN_FE=/tia-web-dev REACT_APP_URL_MAIN_FE=/tia-web-dev
\ No newline at end of file
"cpy_file_build_windows" : "robocopy E:\tia-web\src\tia-dev\src E:\tia-web\src /e",
"cpy_sya_bundar": "public, build, package, packaglock, src to src"
\ No newline at end of file
...@@ -53,6 +53,7 @@ export default class BalanceSheetMR extends Component { ...@@ -53,6 +53,7 @@ export default class BalanceSheetMR extends Component {
updateBy: '-', updateBy: '-',
notes: "", notes: "",
judulColumn: null, judulColumn: null,
get_for: "view"
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -135,15 +136,29 @@ export default class BalanceSheetMR extends Component { ...@@ -135,15 +136,29 @@ export default class BalanceSheetMR extends Component {
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id "months": this.props.month.month_id,
"get_for" : this.state.get_for
} }
api.create().getHierarkiMontlyReportBS(payload).then(response => { api.create().getHierarkiMontlyReportBS(payload).then(response => {
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
let err = false
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (item.type_report_id === 3 && item.level === 2) {
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
}
if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
err = true
}
}
if (indexIDzz === -1) { if (indexIDzz === -1) {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
...@@ -179,6 +194,17 @@ export default class BalanceSheetMR extends Component { ...@@ -179,6 +194,17 @@ export default class BalanceSheetMR extends Component {
} }
} }
res.map((item, index) => { res.map((item, index) => {
if (item.type_report_id === 3 && item.level === 2) {
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
}
if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
err = true
}
}
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
...@@ -211,6 +237,9 @@ export default class BalanceSheetMR extends Component { ...@@ -211,6 +237,9 @@ export default class BalanceSheetMR extends Component {
} }
} }
}) })
if (err === true) {
this.setState({ bebas: true })
}
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true }) this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true })
} }
console.log(dataTable); console.log(dataTable);
...@@ -249,6 +278,13 @@ export default class BalanceSheetMR extends Component { ...@@ -249,6 +278,13 @@ export default class BalanceSheetMR extends Component {
} }
} }
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getSettingControl()
this.getLatestUpdate()
})
}
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
...@@ -344,6 +380,7 @@ export default class BalanceSheetMR extends Component { ...@@ -344,6 +380,7 @@ export default class BalanceSheetMR extends Component {
uploadBalanceSheet(type) { uploadBalanceSheet(type) {
let data = [] let data = []
this.setState({loading: true})
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
...@@ -449,6 +486,20 @@ export default class BalanceSheetMR extends Component { ...@@ -449,6 +486,20 @@ export default class BalanceSheetMR extends Component {
let data = [] let data = []
let err = false let err = false
this.state.dataTable.map((i, index) => { this.state.dataTable.map((i, index) => {
if(i[0] === 3 && i[4] === 2) {
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);
err = true
} else if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
console.log('msk 2');
err = true
} else if ( i[19] === "" && (Number(i[16]) < this.state.minValue || Number(i[16]) > this.state.maxValue)) {
console.log('msk 3');
err = true
}
}
data.push({ data.push({
"item_report_id": i[1], "item_report_id": i[1],
"rolling_outlook": i[6], "rolling_outlook": i[6],
...@@ -468,19 +519,19 @@ export default class BalanceSheetMR extends Component { ...@@ -468,19 +519,19 @@ export default class BalanceSheetMR extends Component {
}) })
}) })
console.log(JSON.stringify(data)); console.log(JSON.stringify(data));
data.map(i => { // 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)) { // 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'); // console.log('msk 1');
console.log(i); // console.log(i);
err = true // err = true
} else if (i.mtd_vs_mb === "" && (Number(i.percent_act_vs_mb) < this.state.minValue || Number(i.percent_act_vs_mb) > this.state.maxValue)) { // } else if (i.mtd_vs_mb === "" && (Number(i.percent_act_vs_mb) < this.state.minValue || Number(i.percent_act_vs_mb) > this.state.maxValue)) {
console.log('msk 2'); // console.log('msk 2');
err = true // err = true
} else if (i.mtd_vs_rb === "" && (Number(i.percent_act_vs_rb) < this.state.minValue || Number(i.percent_act_vs_rb) > this.state.maxValue)) { // } else if (i.mtd_vs_rb === "" && (Number(i.percent_act_vs_rb) < this.state.minValue || Number(i.percent_act_vs_rb) > this.state.maxValue)) {
console.log('msk 3'); // console.log('msk 3');
err = true // err = true
} // }
}) // })
// if (err === true) { // if (err === true) {
// console.log('error'); // console.log('error');
// this.setState({ loading: false, buttonError: true, saveDraft: false }) // this.setState({ loading: false, buttonError: true, saveDraft: false })
...@@ -648,14 +699,14 @@ export default class BalanceSheetMR extends Component { ...@@ -648,14 +699,14 @@ export default class BalanceSheetMR extends Component {
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 indexID = dataTable2.findIndex((val) => val[21] == tst) // let indexID = dataTable2.findIndex((val) => val[21] == tst)
let data = tableMeta.rowData[20] let data = tableMeta.rowData[20] == null? [] : tableMeta.rowData[20]
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) {
let valuezz = data[indexID].value let valuezz = data[indexID].value
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
} else { } else {
let data = tableMeta.rowData[20] let data = tableMeta.rowData[20] == null? [] : tableMeta.rowData[20]
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) {
console.log(tableMeta) console.log(tableMeta)
...@@ -1108,10 +1159,10 @@ export default class BalanceSheetMR extends Component { ...@@ -1108,10 +1159,10 @@ export default class BalanceSheetMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view' ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1490,6 +1541,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1490,6 +1541,7 @@ export default class BalanceSheetMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// disabled={false} // disabled={false}
defaultValue={tableMeta.rowData[17]} defaultValue={tableMeta.rowData[17]}
inputProps={{ inputProps={{
...@@ -1511,6 +1563,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1511,6 +1563,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[12]) < this.state.minValue || Number(tableMeta.rowData[12]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[17]} defaultValue={tableMeta.rowData[17]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1543,6 +1596,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1543,6 +1596,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={false} // disabled={false}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1563,6 +1617,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1563,6 +1617,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[18]} defaultValue={tableMeta.rowData[18]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1595,6 +1650,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1595,6 +1650,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={false} // disabled={false}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1615,6 +1671,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1615,6 +1671,7 @@ export default class BalanceSheetMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1725,7 +1782,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1725,7 +1782,7 @@ export default class BalanceSheetMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true ? {this.props.isApprover === true || this.state.get_for == 'view'?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -1843,7 +1900,27 @@ export default class BalanceSheetMR extends Component { ...@@ -1843,7 +1900,27 @@ export default class BalanceSheetMR extends Component {
<div className="col-2"> <div className="col-2">
</div> : </div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
<button {this.state.get_for == 'view' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<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' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -1864,8 +1941,8 @@ export default class BalanceSheetMR extends Component { ...@@ -1864,8 +1941,8 @@ export default class BalanceSheetMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for === 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -1885,10 +1962,15 @@ export default class BalanceSheetMR extends Component { ...@@ -1885,10 +1962,15 @@ export default class BalanceSheetMR extends Component {
} }
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> {this.state.saveDraft?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div> </div>
</button> </button>}
<button {this.state.get_for === 'edit' && <button
type="button" type="button"
disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => onClick={() =>
...@@ -1907,9 +1989,14 @@ export default class BalanceSheetMR extends Component { ...@@ -1907,9 +1989,14 @@ export default class BalanceSheetMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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 & Complete</Typography> {this.state.buttonError?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div> </div>
</button> </button>}
</div> </div>
} }
</div> </div>
...@@ -1937,11 +2024,12 @@ export default class BalanceSheetMR extends Component { ...@@ -1937,11 +2024,12 @@ export default class BalanceSheetMR extends Component {
</MuiThemeProvider> </MuiThemeProvider>
)} )}
</div> </div>
<div className="grid grid-2x" style={{ marginTop: 20 }}> </div>
<div className="col-1"> <div className="grid grid-2x" style={{ marginTop: 10, padding: 20}}>
<div className="col-1" style={{paddingLeft: 0}}>
<button <button
type="button" type="button"
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true, visibleBSMR: true }, () => {
setTimeout(() => { setTimeout(() => {
this.getItemHierarki() this.getItemHierarki()
}, 100); }, 100);
...@@ -1958,7 +2046,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1958,7 +2046,7 @@ export default class BalanceSheetMR extends Component {
</div> </div>
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
<button <button
className="button" className="button"
type="button" type="button"
...@@ -2001,7 +2089,12 @@ export default class BalanceSheetMR extends Component { ...@@ -2001,7 +2089,12 @@ export default class BalanceSheetMR extends Component {
} }
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> {this.state.saveDraft?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div> </div>
</button> </button>
<button <button
...@@ -2023,12 +2116,16 @@ export default class BalanceSheetMR extends Component { ...@@ -2023,12 +2116,16 @@ export default class BalanceSheetMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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 & Complete</Typography> {this.state.buttonError?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip> :
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div> </div>
</button> </button>
</div> </div>
</div> </div>
</div>
</Paper> </Paper>
} }
</div> </div>
......
...@@ -47,7 +47,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -47,7 +47,8 @@ export default class FixedAssetsMovementMR extends Component {
loading: true, loading: true,
visibleFAMMR: true, visibleFAMMR: true,
updateBy: '-', updateBy: '-',
notesUpdate: '-' notesUpdate: '-',
get_for: 'view'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -57,6 +58,13 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -57,6 +58,13 @@ export default class FixedAssetsMovementMR extends Component {
this.getLatestUpdate() this.getLatestUpdate()
} }
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getItemHierarki()
this.getLatestUpdate()
})
}
getLatestUpdate() { getLatestUpdate() {
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
...@@ -96,7 +104,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -96,7 +104,8 @@ export default class FixedAssetsMovementMR extends Component {
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id "months": this.props.month.month_id,
"get_for": this.state.get_for
} }
api.create().getHierarkiMontlyReportFAM(payload).then(response => { api.create().getHierarkiMontlyReportFAM(payload).then(response => {
// console.log(payload); // console.log(payload);
...@@ -450,7 +459,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -450,7 +459,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(valuezz); // console.log(valuezz);
} }
} else { } else {
let data = tableMeta.rowData[16] let data = tableMeta.rowData[16] == null? [] : tableMeta.rowData[16]
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) {
let valuezz = data[indexID].value let valuezz = data[indexID].value
...@@ -875,10 +884,10 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -875,10 +884,10 @@ export default class FixedAssetsMovementMR extends Component {
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={Number(tableMeta.rowData[8]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 8) handleChange(event.target.value, tableMeta, 8)
...@@ -1275,7 +1284,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1275,7 +1284,7 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true ? {this.props.isApprover === true || this.state.get_for == 'view'?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -1389,7 +1398,27 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1389,7 +1398,27 @@ export default class FixedAssetsMovementMR extends Component {
<div className="col-2"></div> <div className="col-2"></div>
: :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
<button {this.state.get_for == 'view' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<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' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -1411,8 +1440,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1411,8 +1440,8 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -1440,8 +1469,8 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1440,8 +1469,8 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
} }
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
type="button" type="button"
disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => onClick={() =>
...@@ -1468,7 +1497,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -1468,7 +1497,7 @@ export default class FixedAssetsMovementMR 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>
......
...@@ -91,7 +91,8 @@ export default class ProfitLossMR extends Component { ...@@ -91,7 +91,8 @@ export default class ProfitLossMR extends Component {
judulColumn: null, judulColumn: null,
handleTekTekTek: 0, handleTekTekTek: 0,
saveDraft: true, saveDraft: true,
buttonError: true buttonError: true,
get_for: 'view'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -103,6 +104,13 @@ export default class ProfitLossMR extends Component { ...@@ -103,6 +104,13 @@ export default class ProfitLossMR extends Component {
this.getSettingControl() this.getSettingControl()
} }
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getLatestUpdate()
this.getSettingControl()
})
}
getSettingControl() { getSettingControl() {
let body = { let body = {
group: 'THRESHOLD_VARIANCE', group: 'THRESHOLD_VARIANCE',
...@@ -179,7 +187,7 @@ export default class ProfitLossMR extends Component { ...@@ -179,7 +187,7 @@ export default class ProfitLossMR extends Component {
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id, "months": this.props.month.month_id,
"get_for": "edit" "get_for": this.state.get_for
} }
console.log(payload); console.log(payload);
api.create().getHierarkiMontlyReportPL(payload).then(response => { api.create().getHierarkiMontlyReportPL(payload).then(response => {
...@@ -1115,10 +1123,10 @@ export default class ProfitLossMR extends Component { ...@@ -1115,10 +1123,10 @@ export default class ProfitLossMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover} disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={Number(tableMeta.rowData[10]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, "actual") handleChange(event.target.value, tableMeta, "actual")
...@@ -1628,7 +1636,7 @@ export default class ProfitLossMR extends Component { ...@@ -1628,7 +1636,7 @@ export default class ProfitLossMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// value={tableMeta.rowData[19]} // value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
...@@ -1651,6 +1659,7 @@ export default class ProfitLossMR extends Component { ...@@ -1651,6 +1659,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[19]} // value={tableMeta.rowData[19]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1683,8 +1692,8 @@ export default class ProfitLossMR extends Component { ...@@ -1683,8 +1692,8 @@ export default class ProfitLossMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false}
// value={tableMeta.rowData[20]} // value={tableMeta.rowData[20]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[20]} defaultValue={tableMeta.rowData[20]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1706,6 +1715,7 @@ export default class ProfitLossMR extends Component { ...@@ -1706,6 +1715,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[20]} // value={tableMeta.rowData[20]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[20]} defaultValue={tableMeta.rowData[20]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1737,7 +1747,7 @@ export default class ProfitLossMR extends Component { ...@@ -1737,7 +1747,7 @@ export default class ProfitLossMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// value={tableMeta.rowData[21]} // value={tableMeta.rowData[21]}
defaultValue={tableMeta.rowData[21]} defaultValue={tableMeta.rowData[21]}
inputProps={{ inputProps={{
...@@ -1760,6 +1770,7 @@ export default class ProfitLossMR extends Component { ...@@ -1760,6 +1770,7 @@ export default class ProfitLossMR extends Component {
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[21]} // value={tableMeta.rowData[21]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[21]} defaultValue={tableMeta.rowData[21]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1844,7 +1855,7 @@ export default class ProfitLossMR extends Component { ...@@ -1844,7 +1855,7 @@ export default class ProfitLossMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true ? {this.props.isApprover === true || this.state.get_for == 'view'?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -1961,7 +1972,27 @@ export default class ProfitLossMR extends Component { ...@@ -1961,7 +1972,27 @@ export default class ProfitLossMR extends Component {
<div className="col-2"> <div className="col-2">
</div> : </div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
<button {this.state.get_for == 'view' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<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' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -1982,8 +2013,8 @@ export default class ProfitLossMR extends Component { ...@@ -1982,8 +2013,8 @@ export default class ProfitLossMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -2011,8 +2042,8 @@ export default class ProfitLossMR extends Component { ...@@ -2011,8 +2042,8 @@ export default class ProfitLossMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
} }
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
type="button" type="button"
// disabled={this.state.butto nError} // disabled={this.state.butto nError}
onClick={() => onClick={() =>
...@@ -2039,7 +2070,7 @@ export default class ProfitLossMR extends Component { ...@@ -2039,7 +2070,7 @@ export default class ProfitLossMR 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>
......
...@@ -53,7 +53,8 @@ export default class TaxPlanningMR extends Component { ...@@ -53,7 +53,8 @@ export default class TaxPlanningMR extends Component {
buttonDraft: true, buttonDraft: true,
handleTekTekTek: 0, handleTekTekTek: 0,
saveDraft: true, saveDraft: true,
buttonError: true buttonError: true,
get_for: 'view'
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -65,6 +66,13 @@ export default class TaxPlanningMR extends Component { ...@@ -65,6 +66,13 @@ export default class TaxPlanningMR extends Component {
this.getLatestUpdate() this.getLatestUpdate()
} }
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getSettingControl()
this.getLatestUpdate()
})
}
getSettingControl() { getSettingControl() {
let body = { let body = {
group: 'THRESHOLD_CONTROL', group: 'THRESHOLD_CONTROL',
...@@ -894,10 +902,10 @@ export default class TaxPlanningMR extends Component { ...@@ -894,10 +902,10 @@ export default class TaxPlanningMR extends Component {
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
decimalSeparator={"."} decimalSeparator={"."}
style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view' ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="input" placeholder="input"
disabled={this.props.isApprover} disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
value={Number(value.tbc).toFixed(1)} value={Number(value.tbc).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
...@@ -955,8 +963,9 @@ export default class TaxPlanningMR extends Component { ...@@ -955,8 +963,9 @@ export default class TaxPlanningMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
placeholder="input" placeholder="input"
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
...@@ -1014,8 +1023,9 @@ export default class TaxPlanningMR extends Component { ...@@ -1014,8 +1023,9 @@ export default class TaxPlanningMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
placeholder="input" placeholder="input"
value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf).toFixed(2) : Number(value.tbf).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf).toFixed(2) : Number(value.tbf).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
...@@ -1356,7 +1366,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1356,7 +1366,7 @@ export default class TaxPlanningMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true ? {this.props.isApprover === true || this.state.get_for == 'view'?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -1472,7 +1482,27 @@ export default class TaxPlanningMR extends Component { ...@@ -1472,7 +1482,27 @@ export default class TaxPlanningMR extends Component {
<div className="col-2"> <div className="col-2">
</div> : </div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button {this.state.get_for == 'view' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<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' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -1496,8 +1526,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1496,8 +1526,8 @@ export default class TaxPlanningMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <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> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
onClick={() => onClick={() =>
...@@ -1521,8 +1551,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1521,8 +1551,8 @@ export default class TaxPlanningMR extends Component {
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div> </div>
</button> </button>}
<button {this.state.get_for == 'edit' && <button
type="button" type="button"
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
onClick={() => onClick={() =>
...@@ -1546,7 +1576,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1546,7 +1576,7 @@ export default class TaxPlanningMR extends Component {
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 10 }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 10 }}>
<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>
......
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