Commit 114f58ab authored by Riri Novita's avatar Riri Novita

apdet pl

parent 98d66391
...@@ -123,7 +123,7 @@ export default class ProfitLossMR extends Component { ...@@ -123,7 +123,7 @@ export default class ProfitLossMR extends Component {
} else { } else {
checkLastStatus = false checkLastStatus = false
} }
if (this.props.prevRevision) { if (this.props.prevRevision) {
checkPrevRev = true checkPrevRev = true
} else { } else {
...@@ -136,7 +136,7 @@ export default class ProfitLossMR extends Component { ...@@ -136,7 +136,7 @@ export default class ProfitLossMR extends Component {
checkStatus = false checkStatus = false
} }
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev}) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
} }
handleGetFor(type) { handleGetFor(type) {
...@@ -289,7 +289,7 @@ export default class ProfitLossMR extends Component { ...@@ -289,7 +289,7 @@ export default class ProfitLossMR extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.profit_loss.notes == null || item.profit_loss.notes == "null" ? "" : item.profit_loss.notes, item.profit_loss.notes == null || item.profit_loss.notes == "null" ? "" : item.profit_loss.notes,
item.profit_loss.rolling_outlook === null ? "0.0" : item.profit_loss.rolling_outlook === "" ? "0.0" : item.profit_loss.rolling_outlook, item.profit_loss.rolling_outlook === null ? "0.0" : item.profit_loss.rolling_outlook === "" ? "0.0" : item.profit_loss.rolling_outlook,
item.profit_loss.master_budget === null ? "0.0" : item.profit_loss.master_budget === "" ? "0.0" : item.profit_loss.master_budget, 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.rolling_budget === null ? "0.0" : item.profit_loss.rolling_budget === "" ? "0.0" : item.profit_loss.rolling_budget,
...@@ -690,7 +690,7 @@ export default class ProfitLossMR extends Component { ...@@ -690,7 +690,7 @@ export default class ProfitLossMR extends Component {
if (type === "actual") { if (type === "actual") {
// console.log(val); // console.log(val);
dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][10] = Number(val).toFixed(1)
} }
// else { // else {
// let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2]) // let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) { // if (indexParent > 0) {
...@@ -936,7 +936,16 @@ export default class ProfitLossMR extends Component { ...@@ -936,7 +936,16 @@ export default class ProfitLossMR extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? tableMeta.rowData[6] : this.state.get_for == 'view' ?
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
defaultValue={tableMeta.rowData[6]}
/>
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={tableMeta.rowData[6]} // value={tableMeta.rowData[6]}
...@@ -1011,23 +1020,23 @@ export default class ProfitLossMR extends Component { ...@@ -1011,23 +1020,23 @@ export default class ProfitLossMR extends Component {
// /> // />
// </div> // </div>
// : // :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
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={true} disabled={true}
value={Number(tableMeta.rowData[7]).toFixed(1)} value={Number(tableMeta.rowData[7]).toFixed(1)}
decimalScale={1} decimalScale={1}
/> />
} }
/> />
</div> </div>
} }
</div> </div>
) )
...@@ -1082,23 +1091,23 @@ export default class ProfitLossMR extends Component { ...@@ -1082,23 +1091,23 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={tableMeta.rowData[8]} value={tableMeta.rowData[8]}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
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={true} disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1)} value={Number(tableMeta.rowData[8]).toFixed(1)}
decimalScale={1} decimalScale={1}
/>
}
/> />
</div> }
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1117,23 +1126,23 @@ export default class ProfitLossMR extends Component { ...@@ -1117,23 +1126,23 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={tableMeta.rowData[9]} value={tableMeta.rowData[9]}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
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={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1} decimalScale={1}
/>
}
/> />
</div> }
/>
</div>
} }
</div> </div>
</div> </div>
...@@ -1185,7 +1194,7 @@ export default class ProfitLossMR extends Component { ...@@ -1185,7 +1194,7 @@ export default class ProfitLossMR extends Component {
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
value={Number(handleValue(value, tableMeta)).toFixed(1)} value={Number(handleValue(value, tableMeta)).toFixed(1)}
// value={Number(handleValue(tableMeta, 2)).toFixed(1)} // value={Number(handleValue(tableMeta, 2)).toFixed(1)}
/> />
</span> : </span> :
tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 5 ?
...@@ -1317,23 +1326,23 @@ export default class ProfitLossMR extends Component { ...@@ -1317,23 +1326,23 @@ export default class ProfitLossMR extends Component {
decimalScale={1} decimalScale={1}
/> />
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={val} value={val}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
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={true} disabled={true}
value={Number(tableMeta.rowData[12]).toFixed(1)} value={Number(tableMeta.rowData[12]).toFixed(1)}
decimalScale={1} decimalScale={1}
/>
}
/> />
</div> }
/>
</div>
} }
</div> </div>
) )
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -274,28 +274,28 @@ export default class ProfitLossROO extends Component { ...@@ -274,28 +274,28 @@ export default class ProfitLossROO extends Component {
res.map((item, index) => { res.map((item, index) => {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
item.parent, item.parent,
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.profit_loss.notes, item.profit_loss.notes,
item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total, item.profit_loss.last_year_total === "" ? "0" : item.profit_loss.last_year_total,
item.profit_loss.january === "" ? "0" : item.profit_loss.january, item.profit_loss.january === "" ? "0" : item.profit_loss.january,
item.profit_loss.february === "" ? "0" : item.profit_loss.february, item.profit_loss.february === "" ? "0" : item.profit_loss.february,
item.profit_loss.march === "" ? "0" : item.profit_loss.march, item.profit_loss.march === "" ? "0" : item.profit_loss.march,
item.profit_loss.april === "" ? "0" : item.profit_loss.april, item.profit_loss.april === "" ? "0" : item.profit_loss.april,
item.profit_loss.may === "" ? "0" : item.profit_loss.may, item.profit_loss.may === "" ? "0" : item.profit_loss.may,
item.profit_loss.june === "" ? "0" : item.profit_loss.june, item.profit_loss.june === "" ? "0" : item.profit_loss.june,
item.profit_loss.july === "" ? "0" : item.profit_loss.july, item.profit_loss.july === "" ? "0" : item.profit_loss.july,
item.profit_loss.august === "" ? "0" : item.profit_loss.august, item.profit_loss.august === "" ? "0" : item.profit_loss.august,
item.profit_loss.september === "" ? "0" : item.profit_loss.september, item.profit_loss.september === "" ? "0" : item.profit_loss.september,
item.profit_loss.october === "" ? "0" : item.profit_loss.october, item.profit_loss.october === "" ? "0" : item.profit_loss.october,
item.profit_loss.november === "" ? "0" : item.profit_loss.november, item.profit_loss.november === "" ? "0" : item.profit_loss.november,
item.profit_loss.december === "" ? "0" : item.profit_loss.december, item.profit_loss.december === "" ? "0" : item.profit_loss.december,
item.profit_loss.current_year_total === "" ? "0" : item.profit_loss.current_year_total, item.profit_loss.current_year_total === "" ? "0" : item.profit_loss.current_year_total,
item.profit_loss.actual_formula === "" ? "0" : item.profit_loss.actual_formula, item.profit_loss.actual_formula === "" ? "0" : item.profit_loss.actual_formula,
item.order, item.order,
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -629,7 +629,7 @@ export default class ProfitLossROO extends Component { ...@@ -629,7 +629,7 @@ export default class ProfitLossROO extends Component {
// if (response.data) { // if (response.data) {
// if (response.data.status === "success") { // if (response.data.status === "success") {
// if (response.data.data.result && err === false) { // if (response.data.data.result && err === false) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
// } else { // } else {
// this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false }) // this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
// } // }
...@@ -856,7 +856,16 @@ export default class ProfitLossROO extends Component { ...@@ -856,7 +856,16 @@ export default class ProfitLossROO extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? value : this.state.get_for == 'view' ?
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
defaultValue={value}
/>
:
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={value}
...@@ -2414,27 +2423,27 @@ export default class ProfitLossROO extends Component { ...@@ -2414,27 +2423,27 @@ export default class ProfitLossROO 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 }}>
{this.state.get_for == 'view' && this.state.viewOnly && {this.state.get_for == 'view' && this.state.viewOnly &&
<button <button
className="button" className="button"
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => {
this.setState({ loading: true, refresh: true }, () => { this.setState({ loading: true, refresh: true }, () => {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}} }}
> >
<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' }}>Edit</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
</div> </div>
</button>} </button>}
{this.state.get_for == 'edit' && <button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
......
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