Commit 9a03510b authored by ardiansyah's avatar ardiansyah

Merge branch 'ENV-DEV' into 'BACKUP-DEV'

Backup 2023-07-25

See merge request !1922
parents 26423b4c 70228d62
// contents of .env
REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-staging
REACT_APP_URL_MAIN_FE=/web
\ No newline at end of file
......@@ -55,14 +55,18 @@
"start": "react-scripts start",
"build": "react-scripts --max_old_space_size=8192 build",
"build_dev": "copy .env_dev .env && react-scripts --max_old_space_size=8192 build",
"build_staging": "copy .env_staging .env && react-scripts --max_old_space_size=8192 build",
"build_prod": "copy .env_prod .env && react-scripts --max_old_space_size=8192 build",
"build_dev_linux": "cp .env_dev .env && react-scripts --max_old_space_size=8192 build",
"build_staging_linux": "cp .env_staging .env && react-scripts --max_old_space_size=8192 build",
"build_prod_linux": "cp .env_prod .env && react-scripts --max_old_space_size=8192 build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"dev": "copy .env_dev .env && react-scripts start",
"staging": "copy .env_staging .env && react-scripts start",
"prod": "copy .env_prod .env && react-scripts start",
"dev_linux": "cp .env_dev .env && react-scripts start",
"staging_linux": "cp .env_staging .env && react-scripts start",
"prod_linux": "cp .env_prod .env && react-scripts start"
},
"eslintConfig": {
......
This diff is collapsed.
......@@ -56,6 +56,8 @@ const Images = {
dotOverdue: require('./dot-overdue.svg'),
dotOpen: require('./dot-open.svg'),
zip: require('./zip.png'),
warning: require('./warning.png'),
simulasiUpload: require('./upload-simulasi.png'),
}
export default Images
\ No newline at end of file
......@@ -51,7 +51,7 @@ export default class EditApprovalMatrix extends Component {
getDetailAM() {
api.create().getDetailAM(this.props.data[1]).then(response => {
// console.log(response)
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
......@@ -89,6 +89,8 @@ export default class EditApprovalMatrix extends Component {
getUserData() {
api.create().getApprovedByAM().then((response) => {
console.log(response);
console.log(this.state.getUserId);
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......
......@@ -48,7 +48,6 @@ class Login extends Component {
componentDidMount() {
this.getUser()
var email = localStorage.getItem(Constant.EMAIL)
console.log(email)
}
getWindowDimensions() {
......@@ -112,6 +111,7 @@ class Login extends Component {
} else {
localStorage.setItem(Constant.TOKEN, datas.token)
localStorage.setItem(Constant.USER, datas.user_id)
localStorage.setItem(Constant.ROLE, datas.role_id)
if (this.state.rememberMe) {
localStorage.setItem(Constant.EMAIL, this.state.email)
localStorage.setItem(Constant.PASSWORD, this.state.password)
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ import Images from '../../assets/Images';
import * as R from 'ramda'
import { PropagateLoader } from 'react-spinners';
import Constant from '../../library/Constant';
import { Alert } from '@material-ui/lab';
import { Alert, Autocomplete } from '@material-ui/lab';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -42,7 +42,9 @@ export default class CashFlow extends Component {
loading: false,
minValue: "0",
maxValue: "0",
handleDoubleClick: 0
handleDoubleClick: 0,
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false
}
}
......@@ -77,7 +79,8 @@ export default class CashFlow extends Component {
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
"submission_id": this.props.submissionID,
"currency_id": this.props.defaultCurrency.id
}
// console.log(JSON.stringify(payload))
// if (this.props.status === 'CLOSED') {
......@@ -333,7 +336,7 @@ export default class CashFlow extends Component {
this.setState({ alert: false })
}
olahDataCashFlow(dataTable2) {
olahDataCashFlow(dataTable2, trigger) {
console.log(dataTable2)
let listCF = []
dataTable2.map((item, index) => {
......@@ -370,22 +373,23 @@ export default class CashFlow extends Component {
})
console.log(listCF)
this.createCashFlow(listCF)
this.createCashFlow(listCF, trigger)
}
createCashFlow(dbcf) {
createCashFlow(dbcf, trigger) {
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": 6,
"currency_id": this.props.defaultCurrency.id,
"status": "submitted",
"cash_flow": dbcf
}
console.log(dbcf)
console.log(JSON.stringify(payload))
this.props.createCashFlow(payload)
this.props.onClickClose()
this.props.createCashFlow(payload, trigger)
// this.props.onClickClose()
}
render() {
......@@ -3273,7 +3277,11 @@ export default class CashFlow extends Component {
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
{this.props.defaultCurrency.id === 1 ?
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
:
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
}
</div>
{/* <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
......@@ -3331,9 +3339,32 @@ export default class CashFlow extends Component {
</div>
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.olahDataCashFlow(dataTable2, "simulasi")
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 15
}}
>
<div style={{ backgroundColor: '#cd5c5c', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save Data Simulasi</Typography>
</div>
</button>
{this.props.isApprover === true || dataTable2.length == 0 ? null :
(!this.props.truelyApprover) && (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ?
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
......@@ -3356,10 +3387,10 @@ export default class CashFlow extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
: null}
</div>
</div>
</div>
</Paper>
</div>
</div>
......
This diff is collapsed.
This diff is collapsed.
......@@ -97,6 +97,10 @@ class DownloadReport extends Component {
return () => clearInterval(interval);
}
closeAlert() {
this.setState({ alert: false })
}
getListDownload() {
api.create().getListDownload().then((response) => {
// console.log(response);
......
This diff is collapsed.
......@@ -34,6 +34,7 @@ export default class EditPerusahaan extends Component {
msgErrorSD: '',
msgErrorED: '',
msgErrorJL: '',
optionCurrecy: []
}
}
......
......@@ -72,7 +72,18 @@ export default class CreateReportItems extends Component {
maxAchValue: null,
formulaYTDValue: null,
kpiDisable: true,
maxAchDisable: true
maxAchDisable: true,
convertible: null,
listConvert: [
{
"id": 0,
"value": "No"
},
{
"id": 1,
"value": "Yes"
}
],
}
}
......@@ -209,7 +220,8 @@ export default class CreateReportItems extends Component {
"max_ach": this.state.maxAchValue ? this.state.maxAchValue.value : null,
"formula_ytd": this.state.formulaYTDValue,
"start_date": this.state.startDate,
"end_date": this.state.endDate
"end_date": this.state.endDate,
"is_can_convert_value": this.state.convertible.id
}
// console.log(payload)
this.props.createReportItems(payload)
......@@ -1047,6 +1059,28 @@ export default class CreateReportItems extends Component {
<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.listConvert}
getOptionLabel={(option) => option.value}
onChange={(event, newInputValue) => this.setState({ convertible: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
label="Convertible"
margin="normal"
style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
}
/>
</div>
</div>
<div className="column-2" style={{ marginTop: 7}}>
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
......
......@@ -72,7 +72,18 @@ export default class EditReportItems extends Component {
formulaYtd: ['SUM', 'AVG', 'LAST', 'FORMULA'],
kpiTypeValue: null,
maxAchValue: null,
formulaYTDValue: null
formulaYTDValue: null,
convertible: null,
listConvert: [
{
"id": 0,
"value": "No"
},
{
"id": 1,
"value": "Yes"
}
],
}
}
......@@ -183,7 +194,8 @@ export default class EditReportItems extends Component {
"max_ach": this.state.tempData.max_ach,
"formula_ytd": this.state.tempData.formula_ytd,
"start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date
"end_date": this.state.tempData.end_date,
"is_can_convert_value": this.state.convertible.id
}
// console.log(payload)
this.props.updateReportItems(payload)
......@@ -191,17 +203,20 @@ export default class EditReportItems extends Component {
getDetailReportItems() {
api.create().getDetailReportItems(this.props.data[1]).then((response) => {
console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let data = response.data.data
let index = this.state.listConvert.findIndex((val) => val.id === data.is_can_convert_value)
this.setState({
tempData: response.data.data,
getCompanyID: data.company_id
getCompanyID: data.company_id,
convertible: index === -1 ? null : this.state.listConvert[index]
}, () => this.getInputType(),
this.getPerusahaan(),
this.getReportType())
// console.log(response.data.data)
// console.log(this.state.convertible)
} 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")) {
......@@ -328,7 +343,7 @@ export default class EditReportItems extends Component {
getOptionLabel: (option) => titleCase(option.value),
};
let index = inputKPI.findIndex((val) => val.value === this.state.tempData.kpi_type)
this.setState({ listKPI: defaultProps, inputKPI: response.data.data, KPIValue: index === -1 ? null : inputKPI[index]})
this.setState({ listKPI: defaultProps, inputKPI: response.data.data, KPIValue: index === -1 ? null : inputKPI[index] })
} 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")) {
......@@ -1017,6 +1032,29 @@ export default class EditReportItems extends Component {
</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.listConvert}
getOptionLabel={(option) => option.value}
value={this.state.convertible}
onChange={(event, newInputValue) => this.setState({ convertible: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
label="Convertible"
margin="normal"
style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
}
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
......
......@@ -48,7 +48,9 @@ export default class CashFlowMR extends Component {
// valueThreshold: 0,
minValue: 0,
maxValue: 0,
viewOnly: true
viewOnly: true,
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false
}
}
......@@ -94,7 +96,7 @@ export default class CashFlowMR extends Component {
componentDidMount() {
// this.getItemHierarki()
console.log(this.props.PLBSFAMSubmitted)
this.handleViewOnly()
// this.handleViewOnly()
this.getSettingControl()
}
......@@ -139,6 +141,7 @@ export default class CashFlowMR extends Component {
"company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"get_for": "edit"
}
......@@ -211,7 +214,7 @@ export default class CashFlowMR extends Component {
}
}
payloadCF(dataTable2) {
payloadCF(dataTable2, trigger) {
let listCF = []
console.log(dataTable2)
dataTable2.map((item, index) => {
......@@ -229,10 +232,10 @@ export default class CashFlowMR extends Component {
// }
})
this.createCashFlow(listCF)
this.createCashFlow(listCF, trigger)
}
createCashFlow(listCF) {
createCashFlow(listCF, trigger) {
let payload = {
"monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id,
......@@ -240,9 +243,10 @@ export default class CashFlowMR extends Component {
"report_id": 13,
"status": "submitted",
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"cash_flow": listCF
}
this.props.createCashFlow(payload)
this.props.createCashFlow(payload, trigger)
}
render() {
......@@ -696,7 +700,11 @@ export default class CashFlowMR extends Component {
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {String(this.props.month.month_value).toLocaleUpperCase()} {this.props.periode} (rev.{this.props.revision})</Typography>
{this.props.defaultCurrency.id === 1 ?
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
:
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
}
</div>
{/* <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
......@@ -757,8 +765,31 @@ export default class CashFlowMR extends Component {
</div>
</button>
</div>
{this.state.viewOnly &&
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.payloadCF(dataTable2, "simulasi")
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 15
}}
>
<div style={{ backgroundColor: '#cd5c5c', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save Data Simulasi</Typography>
</div>
</button>
{this.state.viewOnly &&
<button
type="button"
// disabled={this.state.buttonError}
......@@ -781,10 +812,10 @@ export default class CashFlowMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
}
</div>
</div>
</div>
</Paper>
</div>
</div>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
const Constant = {
TOKEN: null,
USER: 0,
ROLE: 'role_id',
EMAIL: 'TOKEN',
PASSWORD: 'PASSWORD',
URL_BE_DEV: '${process.env.REACT_APP_URL_MAIN_BE}',
URL_BE_STAGING: 'https://tia.eksad.com/tia-reporting-staging',
URL_BE_DEMO: 'https://tia.eksad.com/tia-reporting-demo',
URL_BE_PROD: 'https://dashboard.triputra-group.com/tia-reporting',
URL_FE_DEV: 'https://tia.eksad.com/tia-web-dev',
URL_FE_STAGING: 'https://tia.eksad.com/tia-web-staging',
URL_FE_DEMO: 'https://tia.eksad.com/tia-web-demo',
URL_FE_PROD: 'https://dashboard.triputra-group.com/tia-web',
DATACAT: 'datacat'
......
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