Commit da33b9d0 authored by qorri_di's avatar qorri_di

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

 Conflicts:
	src/container/BudgetTahunan/BalanceSheet.js
	src/container/BudgetTahunan/CorporateAnnualTarget.js
parents 69c56d85 d4933ae8
// contents of .env
REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-staging
REACT_APP_URL_MAIN_FE=/web-staging
\ No newline at end of file
REACT_APP_URL_MAIN_FE=/web
\ No newline at end of file
{
"name": "my-app",
"version": "0.1.0",
"homepage": "http://localhost:8080/web-staging/",
"homepage": "http://localhost:8080/web/",
"private": true,
"dependencies": {
"@date-io/date-fns": "^1.3.13",
......
......@@ -175,6 +175,7 @@ const create = (type = "") => {
const createAllItemReport = (body) => api.post('item_report/create_all_item_report', body)
const deleteAllItemReport = (body) => api.post('/item_report/delete_all_item_report', body)
const deleteAllItemReportLOCF = (body) => api.post('/item_report/delete_all_item_report_locf', body)
const getAllSettingBusinessBank = (body) => api.post('setting/get_all_setting_by_group_name', body)
//PARAMETER
const getAllParameter = () => api.get('/setting/get_all_setting')
......@@ -227,6 +228,7 @@ const create = (type = "") => {
const createPeriodeRevision = (body) => api.post('transaction/master_budget/create_periode_revision', body)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getIdDeleteFromExcelLOCF = (body) => api.post('transaction/locf/monthly_report/delete_from_excel', body)
const getIdDeleteFromExcelLOV = (body) => api.post('transaction/lov/monthly_report/delete_from_excel', body)
const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
const getDashboardUser = () => api.get('transaction/get_dashboard_sub_co')
......@@ -392,6 +394,7 @@ const create = (type = "") => {
// const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body)
const getHierarkiMontlyReportTP = (body) => api.post('transaction/tax_planning/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportLOCF = (body) => api.post('transaction/locf/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportInvesment = (body) => api.post('transaction/lov/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportFAM = (body) => api.post('transaction/fam/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportCF = (body) => api.post('transaction/cash_flow/monthly_report/get_report_hierarki', body)
const getHierarkiMontlyReportCAT = (body) => api.post('/transaction/cat/monthly_report/get_report_hierarki', body)
......@@ -431,7 +434,9 @@ const create = (type = "") => {
// const validateSubmitReportMRTP = (body) => api.post('transaction/monthly_report_tp/validate_save', body)
const validateSubmitReportMRTP = (body) => api.post('transaction/tax_planning/monthly_report/validate_save', body)
const getPerBSiMontlyReportLOCF = (body) => api.post('transaction/locf/monthly_report/get_per_bs', body)
const getPerBSiMontlyReportLOV = (body) => api.post('transaction/lov/monthly_report/get_per_bs', body)
const checkUploadMonthlyReportLOCF = (body) => api.post('transaction/locf/monthly_report/check_import', body)
const checkUploadMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/check_import', body)
const uploadMonthlyReportLOCF = (body) => api.post('transaction/locf/monthly_report/import_monthly_report', body)
const validateSubmitReportOI = (body) => api.post('transaction/operating_indicator/monthly_report/validate_save', body)
const validateSubmitReportFAM = (body) => api.post('transaction/fam/monthly_report/validate_save', body)
......@@ -545,6 +550,13 @@ const create = (type = "") => {
const uploadSimulasiMROI = (body) => api.post('transaction/operating_indicator/monthly_report/import_monthly_report/other_currency_existing', body)
const uploadSimulasiROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook/other_currency_existing', body)
// Investment
const getTypeOfInvestment = () => api.get('setting_type/get_all_setting_type_by_investment')
const validateSaveLOV = (body) => api.post('transaction/lov/monthly_report/validate_save', body)
const validateSaveLOCF = (body) => api.post('transaction/locf/monthly_report/validate_save', body)
const createMonthlyReportLOV = (body) => api.post('transaction/lov/monthly_report/save_monthly_report', body)
// Superadmin Approve
const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`)
......@@ -682,6 +694,7 @@ const create = (type = "") => {
createOpetaingInd,
uploadMasterBudget,
getAllSettingByType,
getAllSettingBusinessBank,
getOpetratingIndID,
createAllItemReport,
deleteAllItemReport,
......@@ -746,6 +759,7 @@ const create = (type = "") => {
getDetailHierarkiCF,
getHierarkiMontlyReportPL,
getHierarkiMontlyReportLOCF,
getHierarkiMontlyReportInvesment,
getHierarkiMontlyReportFAM,
getHierarkiMontlyReportCAT,
checkUploadMonthlyReportTP,
......@@ -766,13 +780,16 @@ const create = (type = "") => {
validateSubmitReportBS,
validateSubmitReportPL,
getPerBSiMontlyReportLOCF,
getPerBSiMontlyReportLOV,
checkUploadMonthlyReportLOCF,
checkUploadMonthlyReportLOV,
uploadMonthlyReportLOCF,
validateSubmitReportOI,
getMonthlyOI,
getParameterByGroupName,
getSubmitMonthlyReport,
getIdDeleteFromExcelLOCF,
getIdDeleteFromExcelLOV,
deleteAllItemReportLOCF,
submitMonthlyReport,
approvalMonthly,
......@@ -942,6 +959,10 @@ const create = (type = "") => {
uploadSimulasiOperatingInd,
uploadSimulasiMROI,
uploadSimulasiROOI,
getTypeOfInvestment,
validateSaveLOCF,
validateSaveLOV,
createMonthlyReportLOV
}
}
......
/* .main-color{
background-color: #273b80 !important;
} */
.main-color{
background-color: #0b6b24 !important;
background-color: #273b80 !important;
}
/* .main-color{
background-color: #1474CA !important;
} */
.sub-color{
background-color: #f0f1f3 !important;
}
......@@ -60,14 +60,27 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
alert: false,
tipeAlert: '',
messageAlert: ''
messageAlert: '',
notification: null,
listNotification: [
{
"id": 0,
"value": "No"
},
{
"id": 1,
"value": "Yes"
}
],
}
}
......@@ -101,11 +114,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
} else if (isDate && type === 'end_date') {
this.setState({
......@@ -115,11 +130,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
} else {
this.setState({
......@@ -129,11 +146,13 @@ export default class AddUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
}
}
......@@ -148,7 +167,7 @@ export default class AddUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -161,22 +180,24 @@ export default class AddUser extends Component {
})
let uniqueCompany = company.filter((val, id, array) => {
return array.indexOf(val) == id;
return array.indexOf(val) == id;
});
company = this.state.role == null? [] : this.state.role.role_id === 1? uniqueCompany : []
company = this.state.role == null ? [] : this.state.role.role_id === 1 ? uniqueCompany : []
// console.log(uniqueCompany)
this.setState({
errorFullname: false,
errorEmail: false,
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
company
}, () => {
// console.log(this.state.company)
......@@ -205,6 +226,8 @@ export default class AddUser extends Component {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} else if (this.state.company.length < 1) {
this.setState({ alert: true, messageAlert: 'Authorization company cannot be empty', tipeAlert: 'warning' })
} else if (R.isNil(this.state.notification)) {
this.setState({ errorNotification: true, msgErrorNotification: 'Email Notification Maintenance Cannot be Empty' })
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
......@@ -217,8 +240,10 @@ export default class AddUser extends Component {
"password": this.state.fullname,
"company": this.state.company,
"start_date": this.state.startDate,
"end_date": this.state.endDate
"end_date": this.state.endDate,
"mail_notif": this.state.notification.id
}
// console.log(payload);
this.props.createUser(payload)
}
}
......@@ -300,7 +325,7 @@ export default class AddUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -314,7 +339,7 @@ export default class AddUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handleSpliceChild(items)
})
}
......@@ -325,7 +350,7 @@ export default class AddUser extends Component {
company.push(item.id)
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -335,15 +360,15 @@ export default class AddUser extends Component {
company.splice(indexID, 1)
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handleSpliceChild(items)
})
}
}
}
// console.log(company)
this.setState({ company})
this.setState({ company })
}
renderChildren = (item, pad) => {
......@@ -679,6 +704,37 @@ export default class AddUser extends Component {
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-bottom-20px">
<Autocomplete
debug
id="tipe"
options={this.state.listNotification}
getOptionLabel={(option) => option.value}
onChange={(event, newInputValue) => this.setState({ notification: newInputValue }, () => this.clearError())}
renderInput={(params) =>
<TextField
{...params}
label="Email Notification Maintenance"
margin="normal"
style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorNotification}
helperText={this.state.msgErrorNotification}
/>
}
/>
</div>
</div>
<div className="column-2">
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-bottom-20px">
......
......@@ -54,14 +54,27 @@ export default class EditUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
alert: false,
tipeAlert: '',
messageAlert: ''
messageAlert: '',
notification: null,
listNotification: [
{
"id": 0,
"value": "No"
},
{
"id": 1,
"value": "Yes"
}
],
}
}
......@@ -85,11 +98,13 @@ export default class EditUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
} else if (isDate && type === 'end_date') {
this.setState({
......@@ -99,11 +114,13 @@ export default class EditUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
} else {
this.setState({
......@@ -113,11 +130,13 @@ export default class EditUser extends Component {
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
})
}
}
......@@ -132,7 +151,7 @@ export default class EditUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -145,34 +164,37 @@ export default class EditUser extends Component {
})
let uniqueCompany = company.filter((val, id, array) => {
return array.indexOf(val) == id;
return array.indexOf(val) == id;
});
company = this.state.role == null? [] : this.state.role.role_id === 1? uniqueCompany : []
company = this.state.role == null ? [] : this.state.role.role_id === 1 ? uniqueCompany : []
// console.log(uniqueCompany)
this.setState({
errorFullname: false,
errorEmail: false,
errorRoleName: false,
errorStartDate: false,
errorEndDate: false,
errorNotification: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '',
msgErrorSD: '',
msgErrorED: '',
msgErrorNotification: '',
company
})
}
getDetailUser() {
api.create().getDetailUser(this.state.paramsId).then((response) => {
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ tempData: response.data.data, company: response.data.data.company }, ()=>
this.getRole(response.data.data.role_id))
// console.log(response.data.data)
let index = this.state.listNotification.findIndex((val) => val.id === response.data.data.mail_notif)
this.setState({ tempData: response.data.data, company: response.data.data.company, notification: index === -1 ? null : this.state.listNotification[index] }, () =>
this.getRole(response.data.data.role_id))
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......@@ -215,6 +237,8 @@ export default class EditUser extends Component {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} else if (this.state.company.length < 1) {
this.setState({ alert: true, messageAlert: 'Authorization company cannot be empty', tipeAlert: 'warning' })
} else if (R.isNil(this.state.notification)) {
this.setState({ errorNotification: true, msgErrorNotification: 'Email Notification Maintenance Cannot be Empty' })
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
......@@ -224,7 +248,7 @@ export default class EditUser extends Component {
}
}
updateUser(){
updateUser() {
let payload = {
"user_id": this.state.tempData.user_id,
"role_id": this.state.role.role_id,
......@@ -232,7 +256,8 @@ export default class EditUser extends Component {
"fullname": this.state.tempData.fullname,
"company": this.state.company,
"start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date
"end_date": this.state.tempData.end_date,
"mail_notif": this.state.notification.id
}
this.props.updateUser(payload)
}
......@@ -281,8 +306,8 @@ export default class EditUser extends Component {
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let dataBaru = response.data.data.map((item,index) => {
return {...item, check: false}
let dataBaru = response.data.data.map((item, index) => {
return { ...item, check: false }
})
this.setState({ listCompany: dataBaru })
} else {
......@@ -319,7 +344,7 @@ export default class EditUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -333,7 +358,7 @@ export default class EditUser extends Component {
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handleSpliceChild(items)
})
}
......@@ -344,7 +369,7 @@ export default class EditUser extends Component {
company.push(item.id)
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
......@@ -354,15 +379,15 @@ export default class EditUser extends Component {
company.splice(indexID, 1)
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handleSpliceChild(items)
})
}
}
}
// console.log(company)
this.setState({ company})
this.setState({ company })
}
renderChildren = (item, pad) => {
......@@ -380,7 +405,7 @@ export default class EditUser extends Component {
return (
// <li>
<Collapse key={index} timeout="auto" unmountOnExit in={item.collapse}>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', paddingLeft: !R.isNil(data.children)? (data.children.length > 0? padding : padding + 30) : padding + 30}}>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', paddingLeft: !R.isNil(data.children) ? (data.children.length > 0 ? padding : padding + 30) : padding + 30 }}>
{R.isNil(data.children) ?
null
:
......@@ -472,7 +497,7 @@ export default class EditUser extends Component {
};
closeAlert() {
this.setState({ alert: false })
this.setState({ alert: false })
}
render() {
......@@ -600,14 +625,14 @@ export default class EditUser extends Component {
<Autocomplete
{...this.state.listRole}
id="role"
onChange={(event, newInputValue) => this.setState({ role: newInputValue }, ()=> this.clearError())}
onChange={(event, newInputValue) => this.setState({ role: newInputValue }, () => this.clearError())}
debug
renderInput={(params) => <TextField
{...params}
label="Role"
margin="normal"
style={{ marginTop: 7 }}
renderInput={(params) => <TextField
{...params}
label="Role"
margin="normal"
style={{ marginTop: 7 }}
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorRoleName}
helperText={this.state.msgErrorRN}
......@@ -619,7 +644,7 @@ export default class EditUser extends Component {
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
/>}
value={this.state.role}
/>
</div>
......@@ -693,6 +718,38 @@ export default class EditUser extends Component {
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
debug
id="tipe"
options={this.state.listNotification}
getOptionLabel={(option) => option.value}
value={this.state.notification}
onChange={(event, newInputValue) => this.setState({ notification: newInputValue }, () => this.clearError())}
renderInput={(params) =>
<TextField
{...params}
label="Email Notification Maintenance"
margin="normal"
style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
error={this.state.errorNotification}
helperText={this.state.msgErrorNotification}
/>
}
/>
</div>
</div>
<div className="column-2">
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-bottom-20px">
......
......@@ -2522,7 +2522,7 @@ export default class BudgetTahunan extends Component {
"month": "",
"quartal": "",
"type_report_name": "Master Budget",
"currency_id" : defaultCurrency.id
"currency_id": defaultCurrency.id
}
// console.log(payload);
api.create().createDownloadFile(payload).then((response) => {
......@@ -2570,34 +2570,43 @@ export default class BudgetTahunan extends Component {
let datas = data.findIndex((val) => val[4] == items)
let report = data[datas]
if (items === 6) {
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=${submissionID}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=&&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
try {
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=${submissionID}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/cash_flow/master_budget/export_master_budget?submission_id=&&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&report_id=${report[4]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let res = await fetch(
submissionID == null ? resNull : resReal
)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
}
if (res.status === 200) {
result = [...result, res];
let res = await fetch(
submissionID == null ? resNull : resReal
)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
}
if (res.status === 200) {
result = [...result, res];
}
} catch (error) {
alert(error)
}
} else {
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=${submissionID}&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
try {
let resReal = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=${submissionID}&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let resNull = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/master_budget/export_master_budget?submission_id=&report_id=${report[4]}&company_id=${company.company_id}&year=${periode.periode}&revision=${report[2]}&download_file_report_id=${downloadedFileReportId}&currency_id=${defaultCurrency.id}`
let res = await fetch(
submissionID == null ? resNull : resReal
)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
}
if (res.status === 200) {
result = [...result, res];
let res = await fetch(
submissionID == null ? resNull : resReal
)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
}
if (res.status === 200) {
result = [...result, res];
}
} catch (error) {
alert(error)
}
}
}
......
......@@ -89,6 +89,7 @@ class MaintenanceMode extends Component {
maintenanceStatus: 0,
mailStatusActive: 0,
mailStatusNonActive: 0,
visibleAlertSave: false
}
......@@ -203,6 +204,7 @@ class MaintenanceMode extends Component {
// ]
}
console.log(payload);
this.setState({ visibleAlertSave: true })
api.create().createMaintenanceMode(payload).then((response) => {
console.log(response)
this.setState({ loading: true })
......@@ -271,6 +273,7 @@ class MaintenanceMode extends Component {
// ]
}
console.log(payload);
this.setState({ visibleAlertSave: true })
api.create().updateMaintenanceMode(payload).then((response) => {
console.log(response)
this.setState({ loading: true })
......@@ -846,6 +849,43 @@ class MaintenanceMode extends Component {
</Paper>
</div>
</div>
{this.state.visibleAlertSave && (
<div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#D9D9D9', borderRadius: 10, width: 561, height: 233 }}>
<div style={{ margin: 25 }}>
<div style={{ display: 'flex', marginTop: 76, marginBottom: 43 }}>
<div style={{ alignSelf: 'center', marginRight: 25 }}>
<img src={Images.berhasil} />
</div>
<div style={{ justifyContent: 'center', fontSize: 20, color: '#1D2995', marginTop: 10 }}>
Maintenance mode deactivated successfully!
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<button
className="button"
type="button"
style={{
background: '#F6F7F9',
cursor: 'pointer',
border: '1px solid #3549609e',
outline: 'none',
marginRight: 20,
borderRadius: 9
}}
onClick={() => this.setState({ visibleAlertSave: false })}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
<Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
</div>
</button>
</div>
</div>
</div>
</div>
)
}
</div>
);
......
......@@ -71,7 +71,7 @@ const useStyles = makeStyles((theme) => ({
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen,
}),
backgroundColor: '#0b6b24'
backgroundColor: '#273b80'
},
topleftClose: {
borderRight: 0,
......@@ -87,7 +87,7 @@ const useStyles = makeStyles((theme) => ({
},
padding: 20,
display: 'flex',
backgroundColor: '#0b6b24'
backgroundColor: '#273b80'
},
drawerOpen: {
width: drawerWidth,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -301,7 +301,7 @@ export default class MonthlyReport extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
......@@ -951,7 +951,7 @@ export default class MonthlyReport extends Component {
visibleOI: false,
visibleCF: false,
})
} else if (item === 'List of Credit Facilities') {
} else if (item === 'List Of Credit Facilities and Investment') {
this.setState({
visibleMonthlyReport: false,
visibleBS: false,
......@@ -2312,7 +2312,7 @@ export default class MonthlyReport extends Component {
"month": month ? String(month.month_id).toString() : "",
"quartal": "",
"type_report_name": "Monthly Report",
"currency_id" : defaultCurrency.id
"currency_id": defaultCurrency.id
}
console.log(payload);
api.create().createDownloadFile(payload).then((response) => {
......@@ -2356,15 +2356,37 @@ export default class MonthlyReport extends Component {
let result = []
console.log('mulai hit')
for (const items of selectReport) {
let urlReport = items === 8 ? "profit_loss" : items === 12 ? "tax_planning" : items === 7 ? "balance_sheet" : items === 9 ? "fam" : items === 13 ? "cash_flow" : items === 11 ? "locf" : items === 10 ? "cat" : null
let urlReport = items === 8 ? "profit_loss" : items === 12 ? "tax_planning" : items === 7 ? "balance_sheet" : items === 9 ? "fam" : items === 13 ? "cash_flow" : items === 10 ? "cat" : null
let datas = data.findIndex((val) => val[4] == items)
let report = data[datas]
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId === null ? "" : monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res.status === 200) {
result = [...result, res];
if (items !== 11) {
try {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId === null ? "" : monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res.status === 200) {
result = [...result, res];
}
} catch (error) {
alert(error)
}
} else {
try {
let res1 = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/locf/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId === null ? "" : monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res1.status === 200) {
let res2 = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/lov/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId === null ? "" : monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res2.status === 200) {
result = [...result, res2];
}
}
} catch (error) {
alert(error)
}
}
}
......
......@@ -326,6 +326,7 @@ export default class ProfitLossMR extends Component {
// if (err === true) {
// this.setState({ bebas: true })
// }
console.log(dataTable);
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false })
} else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -968,12 +969,14 @@ export default class ProfitLossMR extends Component {
// }
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 10) {
// ytd = ytd actual balikan be + actual
let itemActual = item == undefined || item == "" || item == "undefined" ? 0.0 : item
total = Number(tableMeta.rowData[23]) + Number(itemActual)
}
})
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
// Sales Price = Unit Business / Sales Volume
let value = Number(dataTable2[tableMeta.rowIndex - 2][11]) / Number(dataTable2[tableMeta.rowIndex - 1][11])
dataTable2[tableMeta.rowIndex][11] = R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
......
......@@ -246,6 +246,7 @@ export default class SubHolding extends Component {
this.setState({
defaultCurrencyID: response.data.data.default_currency,
currency: datas,
usdBefore2024: response.data.data.usdBefore2024,
// report: response.data.data.default_currency == 2 && this.state.defaultCurrency == 1 ? this.state.reportType2[0] : this.state.reportType[0],
defaultCurrency: index == -1 ? null : datas[index]
})
......@@ -4262,7 +4263,7 @@ export default class SubHolding extends Component {
}
render() {
let { defaultCurrencyID, report } = this.state
let { defaultCurrencyID, report, usdBefore2024 } = this.state
const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
......@@ -4384,7 +4385,7 @@ export default class SubHolding extends Component {
// })
// console.log("report 2");
// }
let bizpar = defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
this.setState({ report: bizpar[0], reportType: bizpar })
this.getReportType()
......
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