Commit 5d3d6aea authored by Riri Novita's avatar Riri Novita

hardcode Company

parent ee725aba
...@@ -127,6 +127,8 @@ const create = (type = "") => { ...@@ -127,6 +127,8 @@ const create = (type = "") => {
const uploadPerusahaan = (body) => api.post('company/import_company', body) const uploadPerusahaan = (body) => api.post('company/import_company', body)
const searchPerusahaan = (body) => api.post('company/search_company', body) const searchPerusahaan = (body) => api.post('company/search_company', body)
const deletePerusahaan = (id) => api.post(`company/delete_company/${id}`) const deletePerusahaan = (id) => api.post(`company/delete_company/${id}`)
const getDataCurrency = () => api.get('multi_currency/get_all_currency')
// APPROVAL MATRIX // APPROVAL MATRIX
const getAM = () => api.get('approval_matrix/get_all_approval_matrix') const getAM = () => api.get('approval_matrix/get_all_approval_matrix')
...@@ -611,6 +613,7 @@ const create = (type = "") => { ...@@ -611,6 +613,7 @@ const create = (type = "") => {
deleteParameter, deleteParameter,
getDataReport, getDataReport,
deletePerusahaan, deletePerusahaan,
getDataCurrency,
deleteReportItems, deleteReportItems,
getCarfmDocumentBySubmenu, getCarfmDocumentBySubmenu,
getDocumentCategory, getDocumentCategory,
......
...@@ -44,6 +44,18 @@ export default class CreatePerusahaan extends Component { ...@@ -44,6 +44,18 @@ export default class CreatePerusahaan extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
listCurrency: [
{
"currency_id": 0,
"currency_name": "IDR"
},
{
"currency_id": 1,
"currency_name": "USD"
}
],
selectedCurrency: null,
listDefault: []
} }
} }
...@@ -85,7 +97,8 @@ export default class CreatePerusahaan extends Component { ...@@ -85,7 +97,8 @@ export default class CreatePerusahaan extends Component {
endDate: response.data.data.end_date, endDate: response.data.data.end_date,
totalReport: response.data.data.total_report, totalReport: response.data.data.total_report,
created: response.data.data.created, created: response.data.data.created,
updated: response.data.data.updated === null ? "" : response.data.data.updated updated: response.data.data.updated === null ? "" : response.data.data.updated,
currencyID: response.data.data.currency_id,
}, () => { }, () => {
// setTimeout(() => { // setTimeout(() => {
this.getAllUnitBisnis() this.getAllUnitBisnis()
...@@ -211,6 +224,10 @@ export default class CreatePerusahaan extends Component { ...@@ -211,6 +224,10 @@ export default class CreatePerusahaan extends Component {
}) })
} }
getDefaultCurrency(data) {
this.setState({ listDefault: data })
}
// getParentCompany() { // getParentCompany() {
// api.create().getPerusahaanActive().then((response) => { // api.create().getPerusahaanActive().then((response) => {
// if (response.data.status === 'success') { // if (response.data.status === 'success') {
...@@ -617,6 +634,32 @@ export default class CreatePerusahaan extends Component { ...@@ -617,6 +634,32 @@ export default class CreatePerusahaan extends Component {
/> />
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
multiple
id="tags-standard"
options={this.state.listCurrency}
getOptionLabel={(option) => option.currency_name}
onChange={(event, newInputValue) => {
this.setState({ selectedCurrency: newInputValue }, () => {
this.getDefaultCurrency(newInputValue)
})
}}
renderInput={(params) => (
<TextField
{...params}
variant="standard"
label="Currency"
margin="normal"
style={{ marginTop: 0 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
)}
value={this.state.getCurrency}
/>
</div>
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<DatePicker <DatePicker
margin="normal" margin="normal"
...@@ -713,6 +756,37 @@ export default class CreatePerusahaan extends Component { ...@@ -713,6 +756,37 @@ export default class CreatePerusahaan extends Component {
value={this.state.perusahaan} value={this.state.perusahaan}
/> />
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listDefault}
debug
id="tipe"
options={this.state.listDefault}
getOptionLabel={(option) => option.currency_name}
onChange={(event, newInputValue) => {
this.setState({ selectedCurrency: newInputValue }, () => {
this.getDefaultCurrency(newInputValue)
})
}}
onChange={(event, newInputValue) => {
this.setState({ getDefault: newInputValue }, () => {
console.log(newInputValue);
this.clearError()
})
}}
renderInput={(params) =>
<TextField
{...params}
label="Default Currency"
margin="normal"
style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
}
/>
</div>
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
<DatePicker <DatePicker
margin="normal" margin="normal"
......
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