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