Commit cab2c395 authored by Riri Novita's avatar Riri Novita

Merge branch 'dev/riri' into 'ENV-DEV'

Currency - View MB

See merge request !1797
parents d9163c6c 3e43fc8f
......@@ -63,6 +63,7 @@ export default class BalanceSheet extends Component {
}
componentDidMount() {
console.log(this.props);
this.getLatestUpdate()
this.getSettingControl()
}
......@@ -75,7 +76,7 @@ export default class BalanceSheet extends Component {
}
api.create().getAllSettingByType(body).then(response => {
// console.log(response);
console.log(response);
if (response.data) {
if (response.data.status === 'success') {
this.setState({
......@@ -106,7 +107,8 @@ export default class BalanceSheet 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
}
api.create().getLastestUpdateMB(payload).then(response => {
if (response.data) {
......@@ -137,7 +139,8 @@ export default class BalanceSheet 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
}
let response = await api.create().getDetailReportMB(payload)
console.log(response);
......
......@@ -77,7 +77,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') {
......
......@@ -105,7 +105,8 @@ export default class CorporateAnnualTarget 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))
api.create().getDetailReportMB(payload).then(response => {
......@@ -1006,7 +1007,8 @@ export default class CorporateAnnualTarget 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
}
api.create().getLastestUpdateMB(payload).then(response => {
if (response.data) {
......
......@@ -65,7 +65,8 @@ export default class FixedAssetsMovement 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
}
api.create().getLastestUpdateMB(payload).then(response => {
if (response.data) {
......@@ -96,7 +97,8 @@ export default class FixedAssetsMovement 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
}
api.create().getDetailReportMB(payload).then(response => {
console.log(response);
......
......@@ -8,7 +8,7 @@ import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
import { Alert, Autocomplete } from '@material-ui/lab';
import * as R from 'ramda';
import Constant from '../../library/Constant';
......@@ -63,7 +63,8 @@ export default class ProfitLoss extends Component {
updateBy: [],
buttonDraft: true,
handleDoubleClick: 0,
fromUpload: false
fromUpload: false,
defaultCurrencyUpload: this.props.defaultCurrency
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -349,14 +350,18 @@ export default class ProfitLoss extends Component {
profit_loss: payload,
status: 'submitted'
}
// console.log(isi)
console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
}
});
}
checkUpload() {
api.create().checkUploadMB(this.state.payload).then(response => {
let payload = {
...this.state.payload,
currency_id : this.state.defaultCurrencyUpload?.id
}
api.create().checkUploadMB(payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
console.log(response)
if (response.data) {
......@@ -3193,21 +3198,48 @@ export default class ProfitLoss extends Component {
</button>
</div>
</div>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
result={this.state.result}
acceptedFiles={["xlsx"]}
onHandle={(dt) => {
this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
String(this.state.judul).includes("MASTER") && String(this.state.judul).includes("BUDGET") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
/>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ padding: '20px 30px' }}>
<div className="column-1">
<Autocomplete
id="tipe"
disableClearable
options={this.props.currency}
getOptionLabel={(option) => option.value}
value={this.state.defaultCurrencyUpload}
onChange={(event, newInputValue) => this.setState({ defaultCurrencyUpload: newInputValue })}
renderInput={(params) =>
<TextField
{...params}
variant="standard"
label="Default Currency"
margin="normal"
style={{ marginBottom: 10 }}
// InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
// InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
}
/>
</div>
</div>
<div style={{ padding: '10px 30px' }}>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
result={this.state.result}
acceptedFiles={["xlsx"]}
onHandle={(dt) => {
this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
String(this.state.judul).includes("MASTER") && String(this.state.judul).includes("BUDGET") && String(this.state.judul).includes("PROFIT") && String(this.state.judul).includes("LOSS") ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
/>
</div>
</div>
</div>
)}
......
......@@ -92,7 +92,8 @@ export default class TaxPlanning 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
}
api.create().getLastestUpdateMB(payload).then(response => {
console.log(response)
......@@ -124,7 +125,8 @@ export default class TaxPlanning 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
}
api.create().getDetailReportMB(payload).then(response => {
console.log(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