Commit 77e9d6ff authored by Riri Novita's avatar Riri Novita

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

parents 2f766a03 6b62ed99
......@@ -492,6 +492,11 @@ const create = (type = "") => {
const getDetailDocument = (id) => api.get(`document/get_document_by_id/${id}`)
const deleteDocument = (id) => api.post(`document/delete_document/${id}`)
const uploadCarfmDocument = (body) => api.post('document/upload_cafrm_document', body)
const getChcmDocumentBySubmenu = (body) => api.post('document/get_chcm_document_by_submenu', body);
const uploadChcmDocument = (body) => api.post('document/upload_chcm_document', body)
const deleteReportChcm = (id) => api.post(`document/delete_chcm_document/${id}`)
const getDetailReportChcm = (id) => api.get(`document/get_chcm_document_by_id/${id}`)
const updateReportChcm = (body) => api.post('document/update_chcm_document', body)
// Monitoring
......@@ -673,6 +678,11 @@ const create = (type = "") => {
getAllDocument,
uploadDocument,
uploadCarfmDocument,
getChcmDocumentBySubmenu,
uploadChcmDocument,
deleteReportChcm,
getDetailReportChcm,
updateReportChcm,
updateDocument,
downloadDocument,
getPerusahaanUserActive,
......
......@@ -2,6 +2,11 @@
background-color: #273b80 !important;
}
/* for staging */
/* .main-color{
background-color: #0b6b24 !important;
} */
.sub-color{
background-color: #f0f1f3 !important;
}
......@@ -553,7 +553,8 @@ export default class BudgetTahunan extends Component {
getOptionLabel: (option) => option.periode,
};
// ubah code dibawah ini jika mau mengubah default periode jadi tahun saat ini
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.lastPeriod)
// let periode = (this.state.lastPeriod == "" ? String(Number(currentYear)) : this.state.lastPeriod)
let periode = String(Number(currentYear))
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
// // console.log(this.props.location.state.rawData)
// console.log(this.state.lastPeriod)
......
......@@ -799,6 +799,12 @@ export default class CorporateAnnualTarget extends Component {
// console.log(i[7])
let b = []
// console.log(i[13].value == undefined? 'Y' : 'N')
if (String(i[6]) == "Revenue"){
console.log(Number(i[30]))
console.log(String(Number(i[30][2]?.value)/1000))
}
data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
"item_name": String(i[6]),
......@@ -1644,6 +1650,7 @@ export default class CorporateAnnualTarget extends Component {
return (valz == 'SUM' ? total : (valz == 'AVG' ? (total / 12) : lastValz))
// }
}
// console.log(dataTable2)
const columns = [{
name: "",
......
......@@ -149,7 +149,7 @@ export default class CafrmDocument extends Component {
let compActive = []
let userCompActive = []
this.state.userCompany.map((item, index) => {
if (index !== -1 && String(data[index].status).toLocaleLowerCase() == 'active'){
if (index !== -1 && String(data[index]?.status).toLocaleLowerCase() == 'active'){
userCompActive.push(item)
}
})
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import React, { Component } from 'react';
import Images from '../../assets/Images';
import { Typography } from '@material-ui/core';
import api from "../../api";
import Constant from '../../library/Constant';
export default class PopUpDelete extends Component {
constructor(props) {
super(props)
this.state = {
id: '',
getApprovedBy: null,
getTypes: null,
}
}
componentDidMount() {
console.log(this.props);
if (this.props.type === 'delete') {
// console.log(this.props.idoc)
// console.log(this.props.data)
}
}
onClickDelete() {
if (this.props.type == 'delete') {
let payload = this.props.idoc
this.props.deleteDoc(payload)
}
}
render() {
return (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'center', paddingTop: 20 }}>
<img src={Images.failed} />
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20, paddingBottom: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', fontFamily: 'Nunito Sans, sans-serif' }}>
Delete {this.props.data[1]} ?
</span>
</div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1" style={{ alignSelf: 'center' }}>
<button
type="button"
onClick={() => this.props.onClickClose()}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div>
</button>
</div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button
type="button"
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.onClickDelete()
}, 100);
})
}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Delete</span>
</div>
</button>
</div>
</div>
</div>
</div>
);
}
}
This diff is collapsed.
......@@ -822,6 +822,8 @@ export default class CreateParameter extends Component {
}
} else if (this.state.getTypes.setting_group_name == "CURRENCY") {
this.setState({ errorValue: true, msgErrorValue: 'Incorrect value format, example : 15000' })
} else if (this.state.getTypes.setting_group_name == "DAY_OFF") {
this.setState({ errorValue: true, msgErrorValue: 'Incorrect value format, example : 2023' })
}
}
}
......@@ -907,6 +909,28 @@ export default class CreateParameter extends Component {
}
}
}
} else if (this.state.getTypes.setting_group_name == "DAY_OFF"){
console.log(this.state.errorMaxValue)
if (R.isEmpty(data.value)) {
}else {
if (data.value.match(response.regexValue) && data.value.length <= response.valueLength) {
if (R.isEmpty(data.minValue)) {
} else {
if (data.minValue.match(minMaxValidasi.minMaxRegex) && data.minValue.substring(0, 1) != "0" && data.minValue.length <= minMaxValidasi.minLength) {
if (R.isEmpty(data.maxValue)) {
} else {
if (data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0, 1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength) {
if (data.maxValue.slice(-4)==data.value){
this.updateParameter()
}else {
this.setState({ errorValue: true, msgErrorValue: 'Incorrect value format, value must same with a year of max value' })
}
}
}
}
}
}
}
} else {
if (R.isNil(this.state.getParameter)) {
} else {
......@@ -994,6 +1018,28 @@ export default class CreateParameter extends Component {
}
}
}
} else if (this.state.getTypes.setting_group_name == "DAY_OFF"){
console.log(this.state.errorMaxValue)
if (R.isEmpty(data.value)) {
}else {
if (data.value.match(response.regexValue) && data.value.length <= response.valueLength) {
if (R.isEmpty(data.minValue)) {
} else {
if (data.minValue.match(minMaxValidasi.minMaxRegex) && data.minValue.substring(0, 1) != "0" && data.minValue.length <= minMaxValidasi.minLength) {
if (R.isEmpty(data.maxValue)) {
} else {
if (data.maxValue.match(minMaxValidasi.minMaxRegex) && data.maxValue.substring(0, 1) != "0" && data.maxValue.length <= minMaxValidasi.maxLength) {
if (data.maxValue.slice(-4)==data.value){
this.createParameter()
}else {
this.setState({ errorValue: true, msgErrorValue: 'Incorrect value format, value must same with a year of max value' })
}
}
}
}
}
}
}
} else {
if (R.isNil(this.state.getParameter)) {
} else {
......@@ -1055,6 +1101,8 @@ export default class CreateParameter extends Component {
obj = { regexValue: (/Q1\s\d{4}/), valueLength: 7 }
}
}
}else if (this.state.getTypes.setting_group_name === "DAY_OFF"){
obj = {regexValue: (/\b\d{4}\b/), valueLength: 4}
}else{
obj = { regexValue: (/null.*$/), valueLength: 20 }
}
......@@ -1084,6 +1132,12 @@ export default class CreateParameter extends Component {
case "THRESHOLD_VARIANCE":
this.setState({ errorMaxValue: true, msgErrorMaxValue: 'Incorrect max value format, example : 99999999' })
break
case "DAY_OFF":
this.setState({
errorMaxValue: true,
msgErrorMaxValue: 'Incorrect max value format, example : 31 Jan 2023'
})
break
default:
this.setState({ errorMaxValue: false, msgErrorMaxValue: '' })
}
......@@ -1112,6 +1166,9 @@ export default class CreateParameter extends Component {
case "THRESHOLD_VARIANCE":
this.setState({ errorMinValue: true, msgErrorMinValue: 'Incorrect min value format, example : -99999999' })
break
case "DAY_OFF":
this.setState({ errorMinValue: true, msgErrorMinValue: 'Incorrect min value format, example : 1 Jan 2023' })
break
default:
this.setState({ errorMinValue: false, msgErrorMinValue: '' })
}
......@@ -1196,6 +1253,11 @@ export default class CreateParameter extends Component {
case "THRESHOLD_CONTROL":
obj = { minMaxRegex: (/^-?\d+(\.\d+)?$/), minLength: this.state.minValue.length, maxLength: this.state.maxValue.length }
break
case "DAY_OFF":
obj = {
minMaxRegex: (/\b\d{1,2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\b/),
minLength: 11, maxLength: 11
}
default:
obj = { regexValue: null, minLength: 11, maxLength: 11 }
}
......
......@@ -87,7 +87,11 @@ const useStyles = makeStyles((theme) => ({
},
padding: 20,
display: 'flex',
<<<<<<< HEAD
backgroundColor: '#273b80'
=======
backgroundColor: '#319c23'
>>>>>>> 6b62ed9909ab356afa97d180033088819e3e7c03
},
drawerOpen: {
width: drawerWidth,
......
......@@ -318,7 +318,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
})
// console.log(dataTable);
console.log(dataTable);
this.setState({ dataTable, loading: false, saveDraft: true }, () => {
this.handleCalculate(dataTable)
})
......
......@@ -149,7 +149,7 @@ export default class LOCF extends Component {
if (this.props.dataTablelocf !== prevProps.dataTablelocf) {
let array = this.props.dataTablelocf
let datas = array[array.length - 1]
this.setState({ dataTable: this.props.dataTablelocf, diff: datas[47], loanTotal: datas[48], perBS: datas[49] })
this.setState({ dataTable: this.props.dataTablelocf, diff: this.props.defaultCurrency.id == 1 ? fixNumber(Number(datas[47]), 1) : datas[47], loanTotal: datas[48], perBS: this.props.defaultCurrency.id == 1 ? fixNumber(Number(datas[49]), 1) : datas[49] })
}
if (this.props.loadingChild !== prevProps.loadingChild) {
this.setState({ loading: this.props.loadingChild })
......@@ -353,7 +353,7 @@ export default class LOCF extends Component {
// let sortingTable = dataTable.sort((a, b) => a[6].value - b[6].value)
// console.log(sortingTable);
let lastArray = dataTable[res.length - 1]
this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.setState({ dataTable, diff: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[47]), 1) : lastArray[47], loanTotal: lastArray[48], perBS: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[49]), 1) : lastArray[49], loading: false, visibleLOCFMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF')
})
}
......@@ -565,10 +565,8 @@ export default class LOCF extends Component {
console.log(dataTable);
let lastArray = dataTable[dataTable.length - 1]
console.log(lastArray);
this.setState({ dataTable, diff: lastArray[47], loanTotal: lastArray[48], perBS: lastArray[49], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
console.log(this.state.visibleLOCFMR);
this.props.sendToParent(dataTable, lastArray , 'LOCF', 'upload', this.state.visibleLOCFMR)
this.setState({ dataTable, diff: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[47]), 1) : lastArray[47], loanTotal: lastArray[48], perBS: this.props.defaultCurrency.id == 1 ? fixNumber(Number(lastArray[49]), 1) : lastArray[49], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOCF', 'upload', this.state.visibleLOCFMR)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
......@@ -3619,7 +3617,7 @@ export default class LOCF extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b' }}>Diff</Typography>
</div>
<div style={{ borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '14px', color: Number(this.state.diff) > 0 ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
<Typography style={{ fontSize: '14px', color: Number(this.state.diff) > '0.0' || Number(this.state.diff) < '0.0' ? 'red' : '#4b4b4b' }}><NumberFormat value={this.state.diff == 0 ? "0.0" : this.state.diff} displayType={'text'} thousandSeparator={true} prefix={''} /></Typography>
</div>
</div>
</div>
......
......@@ -360,15 +360,15 @@ export default class LOV extends Component {
payload.push({
"item_report_id": i[1],
"company_name": this.props.company.company_name,
"institution_name": i[3],
"type_of_investment": i[4],
"remarks": i[5],
"placement_date": i[6] !== undefined ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : null,
"tenor": i[7],
"expected_return": i[8],
"currency": i[9],
"investment_amount_ori": i[10] !== undefined ? Number(i[10]) : i[10],
"investment_amount_cur": i[11] !== undefined ? Number(i[11]) : i[11],
"institution_name": i[3] !== undefined ? (i[3]) : "",
"type_of_investment": i[4] !== undefined ? (i[4]) : "",
"remarks": i[5] !== undefined ? (i[5]) : "",
"placement_date": i[6] !== undefined ? tgl[2] + '-' + tgl[1] + '-' + tgl[0] : "",
"tenor": i[7] !== undefined ? (i[7]) : "",
"expected_return": i[8] !== undefined ? (i[8]) : "",
"currency": i[9] !== undefined ? (i[9]) : "",
"investment_amount_ori": i[10] !== undefined ? Number(i[10]) : "",
"investment_amount_cur": i[11] !== undefined ? Number(i[11]) : "",
"notes": i[12],
})
}
......
......@@ -21,6 +21,7 @@ import { ExcelRenderer } from 'react-excel-renderer';
import { fixNumber, roundMath } from "../../library/Utils";
import LOCF from './LOCFMR';
import LOV from './LOVMR';
import PopUpValidationLOV from '../../library/PopUpValidationLOV';
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
......@@ -142,6 +143,7 @@ export default class ListOfCreditFacilities extends Component {
alert: false,
tipeAlert: '',
messageAlert: '',
emptyData: false,
}
}
......@@ -947,14 +949,19 @@ export default class ListOfCreditFacilities extends Component {
if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
error = true
this.setState({ emptyData: true})
}
if ((i[7]?.value == 'Government bonds' && i[8] == '') || (i[7]?.value == 'Stocks' && i[8] == '') || (i[7]?.value == 'Mutual funds' && i[8] == '') || (i[7]?.value == 'Investment in associate' && i[8] == '') || (i[7]?.value == 'Investment in joint venture' && i[8] == '') || (i[7]?.value == 'Investment in subsidiary' && i[8] == '') || (i[7]?.value == 'Corporate bonds' && i[8] == '') || (i[7]?.value == 'Others' && i[8] == '')) {
error = true
}else {
if ((i[7].value == 'Government bonds' && i[8] == '') || (i[7].value == 'Stocks' && i[8] == '') || (i[7].value == 'Mutual funds' && i[8] == '') || (i[7].value == 'Investment in associate' && i[8] == '') || (i[7].value == 'Investment in joint venture' && i[8] == '') || (i[7].value == 'Investment in subsidiary' && i[8] == '') || (i[7].value == 'Corporate bonds' && i[8] == '') || (i[7].value == 'Others' && i[8] == '')) {
error = true
this.setState({ emptyData: true})
} else {
error = false
}
}
// if (i[7].value == 'Government bonds' || i[7].value == 'Stocks' || i[7].value == 'Mutual funds' || i[7].value == 'Investment in associate' || i[7].value == 'Investment in joint venture' || i[7].value == 'Investment in subsidiary' || i[7].value == 'Corporate bonds' || i[7].value == 'Others' && i[8] == '' ) {
// error = true
// }
......@@ -1764,7 +1771,11 @@ export default class ListOfCreditFacilities extends Component {
</div>
</Paper>}
</div>
{this.state.emptyData && (
<PopUpValidationLOV
onClickClose={() => this.setState({ emptyData: false })}
/>
)}
{
this.state.visibleAlertSave && (
<div className="test app-popup-show">
......
......@@ -100,6 +100,7 @@ class ReportProgress extends Component {
MB.push({ name: String(i + 1), value: i + 1})
}
}
console.log(MB);
let defaultPropsMB = {
options: MB,
......@@ -108,7 +109,8 @@ class ReportProgress extends Component {
this.setState({
listPeriodeMB: defaultPropsMB,
periodeMB: MB[MB.length - 1],
// periodeMB: MB[MB.length - 1],
periodeMB: MB[MB.length - 2],
}, () => {
this.getReportType()
// console.log(this.state.listMonth)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
import React, { Component } from 'react';
import Images from '../assets/Images';
import { Typography } from '@material-ui/core';
export default class PopUpValidationLOV extends Component {
render() {
return (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<img src={Images.failedCopy} />
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`There is empty value`}
</span>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please fill the blank`}
</span>
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 24 }}>
<button
className={"btn-save"}
onClick={()=> this.props.onClickClose()}
>
<span style={{ color: 'white' }}>OK</span>
</button>
</div>
</div>
</div>
);
}
}
\ No newline at end of file
......@@ -25,6 +25,7 @@ import CafrmDocument from "../container/CAFRM/CafrmDocument";
import ReportCafrm from "../container/ReportCarfm/RepotrCafrm";
import Maintenance from "../container/Auth/Maintenance";
import DownloadReport from "../container/DownloadReport/DownloadReport"
import ChcmDocument from '../container/CHCM/ChcmDocument';
const routes = [
{
......@@ -139,6 +140,14 @@ const routes = [
path: "/home/download-report",
main: DownloadReport
},
{
path: "/home/report-talent-management-tm",
main: ChcmDocument
},
{
path: "/home/report-trec",
main: ChcmDocument
},
{
path: "*",
main: screen404
......
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