Commit 953bb3e8 authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-STAGING' of http://103.44.149.204/d.arizona/tia-dev into ENV-STAGING

parents cb9491df 66c49bdc
...@@ -190,6 +190,7 @@ const create = (type = "") => { ...@@ -190,6 +190,7 @@ const create = (type = "") => {
const deleteParameter = (id) => api.post(`setting/delete_setting/${id}`) const deleteParameter = (id) => api.post(`setting/delete_setting/${id}`)
const getDataReport = () => api.get('setting_type/get_all_setting_type_by_report_submit_period_group') const getDataReport = () => api.get('setting_type/get_all_setting_type_by_report_submit_period_group')
const getFormatValue = () => api.get('setting_type/get_all_setting_type_by_money_format_group') const getFormatValue = () => api.get('setting_type/get_all_setting_type_by_money_format_group')
const getThreshold = () => api.get('/setting_type/get_all_setting_type_by_threshold_control')
// MASTER DATA - CAT // MASTER DATA - CAT
const getAllMasterDataCat = () => api.get('item_report_company/get_all_item_report_company') const getAllMasterDataCat = () => api.get('item_report_company/get_all_item_report_company')
...@@ -651,6 +652,7 @@ const create = (type = "") => { ...@@ -651,6 +652,7 @@ const create = (type = "") => {
deleteParameter, deleteParameter,
getDataReport, getDataReport,
getFormatValue, getFormatValue,
getThreshold,
deletePerusahaan, deletePerusahaan,
getDataCurrency, getDataCurrency,
deleteReportItems, deleteReportItems,
......
...@@ -2513,14 +2513,15 @@ export default class BudgetTahunan extends Component { ...@@ -2513,14 +2513,15 @@ export default class BudgetTahunan extends Component {
} }
handleDownloadReport(tableMeta) { handleDownloadReport(tableMeta) {
let { selectReport, company, periode, month } = this.state let { selectReport, company, periode, month, defaultCurrency } = this.state
let payload = { let payload = {
"company_id": company.company_id, "company_id": company.company_id,
"year": periode.periode, "year": periode.periode,
"report_id": selectReport, "report_id": selectReport,
"month": "", "month": "",
"quartal": "", "quartal": "",
"type_report_name": "Master Budget" "type_report_name": "Master Budget",
"currency_id" : defaultCurrency.id
} }
// console.log(payload); // console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
......
...@@ -665,14 +665,14 @@ export default class BalanceSheetMR extends Component { ...@@ -665,14 +665,14 @@ export default class BalanceSheetMR extends Component {
// // console.log(i); // // console.log(i);
// err = true // err = true
// } else // } else
if (i[18] === "" && (this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[14]), 1) : Number(i[14]) < this.state.minValue || this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[14]), 1) : Number(i[14]) > this.state.maxValue)) { if (i[18] === "" && (fixNumber(Number(i[14]), 1) < this.state.minValue || fixNumber(Number(i[14]), 1) > this.state.maxValue)) {
console.log('msk 2'); console.log('msk 2');
err = true err = true
} }
} }
if (String(i[5]) == "Control (should be nil)") { if (String(i[5]) == "Control (should be nil)") {
if (this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[9]), 1) : Number(i[9]) < this.state.minValue || this.props.defaultCurrency.id == 1 ? fixNumber(Number(i[9]), 1) : Number(i[9]) > this.state.maxValue) { if (fixNumber(Number(i[9]), 1) < this.state.minValue || fixNumber(Number(i[9]), 1) > this.state.maxValue) {
errorContrl = true errorContrl = true
editAble = true editAble = true
} }
...@@ -1307,7 +1307,15 @@ export default class BalanceSheetMR extends Component { ...@@ -1307,7 +1307,15 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
// this.state.get_for == 'view'? this.state.get_for == 'view'?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[7]), 1) : Number(tableMeta.rowData[7]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[7]))}
/>:
<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' }}
...@@ -1404,7 +1412,15 @@ export default class BalanceSheetMR extends Component { ...@@ -1404,7 +1412,15 @@ export default class BalanceSheetMR extends Component {
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 7 ?
null : null :
// this.state.get_for == 'view'? this.state.get_for == 'view'?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[8]), 1) : Number(tableMeta.rowData[8]) == 0 ? "0.0" : fixNumber(Number(tableMeta.rowData[8]))}
/>:
<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' }}
......
...@@ -1536,14 +1536,14 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1536,14 +1536,14 @@ export default class ListOfCreditFacilities extends Component {
if (this.props.defaultCurrency.id == 1) { if (this.props.defaultCurrency.id == 1) {
this.setState({ loading: false, dataTable: newData, diff: this.state.diff == null ? "0.0" : fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS), 1), perBS: this.state.totalOutStand == null ? "0.0" : this.state.totalOutStand }) this.setState({ loading: false, dataTable: newData, diff: this.state.diff == null ? "0.0" : fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS), 1), perBS: this.state.totalOutStand == null ? "0.0" : this.state.totalOutStand })
} else { } else {
this.setState({ loading: false, dataTable: newData, diff: this.state.diff == null ? "0.0" : Number(Number(totalLoan) - this.state.perBS), perBS: this.state.totalOutStand == null ? "0.0" : this.state.totalOutStand }) this.setState({ loading: false, dataTable: newData, diff: this.state.diff == null ? "0.0" : fixNumber(Number(Number(totalLoan) - this.state.perBS),1), perBS: this.state.totalOutStand == null ? "0.0" : this.state.totalOutStand })
} }
} else { } else {
if (this.props.defaultCurrency.id == 1) { if (this.props.defaultCurrency.id == 1) {
this.setState({ loading: false, dataTable: newData, diff: fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS), 1), saveDraft: false, saveComp: Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == 0 || Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == "-0.0" ? false : true }) this.setState({ loading: false, dataTable: newData, diff: fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS), 1), saveDraft: false, saveComp: Number(fixNumber(Number(totalLoan), 1) - this.state.perBS) == 0 || fixNumber(Number(fixNumber(Number(totalLoan), 1) - this.state.perBS),1) == "-0.0" ? false : true })
} else { } else {
this.setState({ loading: false, dataTable: newData, diff: Number(Number(totalLoan) - this.state.perBS), saveDraft: false, saveComp: Number(Number(totalLoan) - this.state.perBS) == 0 || Number(Number(totalLoan) - this.state.perBS) == "-0.0" ? false : true }) this.setState({ loading: false, dataTable: newData, diff: fixNumber(Number(Number(totalLoan) - this.state.perBS),1), saveDraft: false, saveComp: Number(Number(totalLoan) - this.state.perBS) == 0 || fixNumber(Number(Number(totalLoan) - this.state.perBS),1) == "-0.0" ? false : true })
} }
} }
......
...@@ -2304,14 +2304,15 @@ export default class MonthlyReport extends Component { ...@@ -2304,14 +2304,15 @@ export default class MonthlyReport extends Component {
} }
handleDownloadReport(tableMeta) { handleDownloadReport(tableMeta) {
let { selectReport, company, periode, month } = this.state let { selectReport, company, periode, month, defaultCurrency } = this.state
let payload = { let payload = {
"company_id": company.company_id, "company_id": company.company_id,
"year": periode.periode, "year": periode.periode,
"report_id": selectReport, "report_id": selectReport,
"month": month ? String(month.month_id).toString() : "", "month": month ? String(month.month_id).toString() : "",
"quartal": "", "quartal": "",
"type_report_name": "Monthly Report" "type_report_name": "Monthly Report",
"currency_id" : defaultCurrency.id
} }
console.log(payload); console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
......
...@@ -651,14 +651,15 @@ export default class OperatingIndicator extends Component { ...@@ -651,14 +651,15 @@ export default class OperatingIndicator extends Component {
} }
handleDownloadReport(tableMeta) { handleDownloadReport(tableMeta) {
let { selectReport, company, periode, month } = this.state let { selectReport, company, periode, month, defaultCurrency } = this.state
let payload = { let payload = {
"company_id": company.company_id, "company_id": company.company_id,
"year": periode.periode, "year": periode.periode,
"report_id": selectReport, "report_id": selectReport,
"month": "", "month": "",
"quartal": "", "quartal": "",
"type_report_name": "Operating Indicator" "type_report_name": "Operating Indicator",
"currency_id" : defaultCurrency.id
} }
console.log(payload); console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
......
...@@ -1538,14 +1538,15 @@ export default class OutlookPA extends Component { ...@@ -1538,14 +1538,15 @@ export default class OutlookPA extends Component {
} }
handleDownloadReport(tableMeta) { handleDownloadReport(tableMeta) {
let { selectReport, company, periode, month } = this.state let { selectReport, company, periode, month, defaultCurrency } = this.state
let payload = { let payload = {
"company_id": company.company_id, "company_id": company.company_id,
"year": periode.periode, "year": periode.periode,
"report_id": selectReport, "report_id": selectReport,
"month": "", "month": "",
"quartal": "", "quartal": "",
"type_report_name": "Outlook PA" "type_report_name": "Outlook PA",
"currency_id" : defaultCurrency.id
} }
console.log(payload); console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
......
...@@ -1231,7 +1231,8 @@ export default class BalanceSheetRO extends Component { ...@@ -1231,7 +1231,8 @@ 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={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val == "" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val == "" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)}
// value={this.props.defaultCurrency.id == 1 ? (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val == "" ? "" : fixNumber(Number(val), 1)) : fixNumber(Number(val), 1)) : (this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val == "" ? "" : Number(val) == 0 ? "0.0" : Number(val)) : Number(val) == 0 ? "0.0" : Number(val))}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -2720,7 +2721,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2720,7 +2721,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : Number(val)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 1) : Number(val) == 0 ? "0.0" : fixNumber(Number(val),1)}
/> />
: :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[0] === 2 ?
......
...@@ -1553,14 +1553,15 @@ export default class RollingOutlook extends Component { ...@@ -1553,14 +1553,15 @@ export default class RollingOutlook extends Component {
} }
handleDownloadReport(tableMeta) { handleDownloadReport(tableMeta) {
let { selectReport, company, periode, quarter } = this.state let { selectReport, company, periode, quarter, defaultCurrency } = this.state
let payload = { let payload = {
"company_id": company.company_id, "company_id": company.company_id,
"year": periode.periode, "year": periode.periode,
"report_id": selectReport, "report_id": selectReport,
"month": "", "month": "",
"quartal": quarter ? quarter.value : "", "quartal": quarter ? quarter.value : "",
"type_report_name": "Rolling Outlook" "type_report_name": "Rolling Outlook",
"currency_id" : defaultCurrency.id
} }
console.log(payload); console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
......
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