Commit 8d1f4573 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'GGMAC' into 'master'

update banyak

See merge request !1332
parents 81c79c34 ca353319
...@@ -251,6 +251,9 @@ const create = (type = "") => { ...@@ -251,6 +251,9 @@ const create = (type = "") => {
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver', body) const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver', body)
const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body) const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body)
const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`) const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`)
const approvalRolling = (body) => api.post('transaction/rolling_outlook/approval_rolling', body)
const createPeriodeRevisionRO = (body) => api.post('transaction/rolling_outlook/create_periode_revision', body)
const historyApprovalRO = (body) => api.post('transaction/rolling_outlook/history_approval', body)
const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body) const getRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/get_report_hierarki', body)
const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body) const checkImportRollingOutlookBS = (body) => api.post('transaction/balance_sheet/rolling_outlook/check_import', body)
...@@ -770,7 +773,10 @@ const create = (type = "") => { ...@@ -770,7 +773,10 @@ const create = (type = "") => {
uploadRollingOutlookOI, uploadRollingOutlookOI,
submitRollingOutlook, submitRollingOutlook,
getRollingOutlookCompanySubmitted, getRollingOutlookCompanySubmitted,
createPeriodeRevisionOLPA createPeriodeRevisionOLPA,
approvalRolling,
createPeriodeRevisionRO,
historyApprovalRO
} }
} }
......
...@@ -382,7 +382,7 @@ export default class OutlookPA extends Component { ...@@ -382,7 +382,7 @@ export default class OutlookPA extends Component {
"is_approver": this.state.isApprover "is_approver": this.state.isApprover
} }
api.create().getOutlookPAID(payload).then(response => { api.create().getOutlookPAID(payload).then(response => {
// console.log(response) console.log(response)
if (response) { if (response) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
......
...@@ -555,9 +555,10 @@ export default class RollingOutlook extends Component { ...@@ -555,9 +555,10 @@ export default class RollingOutlook extends Component {
historyApproval() { historyApproval() {
let body = { let body = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode "periode": this.state.periode.periode,
"quartal": this.state.quarter.value
} }
api.create().historyApproval(body).then(response => { api.create().historyApprovalRO(body).then(response => {
console.log(response); console.log(response);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
let dataTableHistory = response.data.data.map(item => { let dataTableHistory = response.data.data.map(item => {
...@@ -569,7 +570,7 @@ export default class RollingOutlook extends Component { ...@@ -569,7 +570,7 @@ export default class RollingOutlook extends Component {
item.history_approval_date item.history_approval_date
] ]
}) })
this.setState({ dataTableHistory, visibleTableHistory: false }) this.setState({ dataTableHistory, visibleTableHistory: true })
} }
}) })
} }
...@@ -580,21 +581,23 @@ export default class RollingOutlook extends Component { ...@@ -580,21 +581,23 @@ export default class RollingOutlook extends Component {
let body = { let body = {
"approval_id": this.props.location.state == undefined ? this.state.approverID : this.state.rawData.approval_id, "approval_id": this.props.location.state == undefined ? this.state.approverID : this.state.rawData.approval_id,
"status": type, "status": type,
"detail": this.state.detailRevisiCheck "detail": this.state.detailRevisiCheck,
"quartal": this.state.quarter.value
} }
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'), "min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'),
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD') "max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD'),
"quartal": this.state.quarter.value
} }
console.log(payload) console.log(payload)
api.create().approvalSubmission(body).then((res) => { api.create().approvalRolling(body).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getRollingOutlookID() this.getRollingOutlookID()
}) })
if (type == 'revision') { if (type == 'revision') {
api.create().createPeriodeRevision(payload).then((res) => console.log(res)) api.create().createPeriodeRevisionRO(payload).then((res) => console.log(res))
} }
}) })
} }
...@@ -785,7 +788,7 @@ export default class RollingOutlook extends Component { ...@@ -785,7 +788,7 @@ export default class RollingOutlook extends Component {
api.create().submitRollingOutlook(body).then(response => { api.create().submitRollingOutlook(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "Success") { if (response.data.status === "success") {
this.getRollingOutlookID() this.getRollingOutlookID()
} }
} }
......
...@@ -97,15 +97,15 @@ export default class BalanceSheetRO extends Component { ...@@ -97,15 +97,15 @@ export default class BalanceSheetRO extends Component {
} else { } else {
checkStatus = false checkStatus = false
} }
// console.log(this.props.isApprover); console.log(this.props.isApprover);
// console.log(this.props.lastStatus); console.log(this.props.lastStatus);
// console.log(this.props.prevRevision); console.log(this.props.prevRevision);
// console.log(this.props.status); console.log(this.props.status);
// console.log(!checkApprover); console.log(!checkApprover);
// console.log(checkLastStatus); console.log(checkLastStatus);
// console.log(checkStatus); console.log(checkStatus);
// console.log(checkPrevRev); console.log(checkPrevRev);
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev }) this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
} }
...@@ -1153,7 +1153,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1153,7 +1153,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)} value={val === "0" ? "" : Number(handleValue(tableMeta, 0)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1170,7 +1170,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1170,7 +1170,7 @@ export default class BalanceSheetRO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1190,7 +1190,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1190,7 +1190,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> />
} }
/> />
...@@ -1210,7 +1210,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1210,7 +1210,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1227,7 +1227,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1227,7 +1227,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 7)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 7)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1242,7 +1242,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1242,7 +1242,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1284,7 +1284,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1284,7 +1284,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)} value={val === "0" ? "" : Number(handleValue(tableMeta, 0)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1301,7 +1301,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1301,7 +1301,7 @@ export default class BalanceSheetRO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1321,7 +1321,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1321,7 +1321,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> />
} }
/> />
...@@ -1341,7 +1341,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1341,7 +1341,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1358,7 +1358,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1358,7 +1358,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 8)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 8)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1373,7 +1373,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1373,7 +1373,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1415,7 +1415,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1415,7 +1415,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValue(tableMeta, 0)).toFixed(1)} value={val === "0" ? "" : Number(handleValue(tableMeta, 0)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -1432,7 +1432,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1432,7 +1432,7 @@ export default class BalanceSheetRO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1452,7 +1452,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1452,7 +1452,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> />
} }
/> />
...@@ -1472,7 +1472,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1472,7 +1472,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[21]}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1489,7 +1489,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1489,7 +1489,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 9)).toFixed(1)} value={val === "0" ? "" : Number(handleValueFormula(tableMeta, 9)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1504,7 +1504,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1504,7 +1504,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(val).toFixed(1)} value={val === "0" ? "" : Number(val).toFixed(1)}
/> />
} }
/> />
...@@ -1563,7 +1563,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1563,7 +1563,7 @@ export default class BalanceSheetRO extends Component {
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1'? false : true}
value={Number(val).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3'? (val == ""? "" : Number(val).toFixed(1)) : Number(val).toFixed(1) }
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1583,7 +1583,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1583,7 +1583,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(tableMeta, 10)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3'? (val == ""? "" : Number(handleValueFormula(tableMeta, 10)).toFixed(1)) : Number(handleValueFormula(tableMeta, 10)).toFixed(1)}
/> />
} }
/> />
......
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