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

hardcode Company

parent ee725aba
......@@ -127,6 +127,8 @@ const create = (type = "") => {
const uploadPerusahaan = (body) => api.post('company/import_company', body)
const searchPerusahaan = (body) => api.post('company/search_company', body)
const deletePerusahaan = (id) => api.post(`company/delete_company/${id}`)
const getDataCurrency = () => api.get('multi_currency/get_all_currency')
// APPROVAL MATRIX
const getAM = () => api.get('approval_matrix/get_all_approval_matrix')
......@@ -611,6 +613,7 @@ const create = (type = "") => {
deleteParameter,
getDataReport,
deletePerusahaan,
getDataCurrency,
deleteReportItems,
getCarfmDocumentBySubmenu,
getDocumentCategory,
......
......@@ -44,6 +44,18 @@ export default class CreatePerusahaan extends Component {
alert: false,
tipeAlert: '',
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 {
endDate: response.data.data.end_date,
totalReport: response.data.data.total_report,
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(() => {
this.getAllUnitBisnis()
......@@ -211,6 +224,10 @@ export default class CreatePerusahaan extends Component {
})
}
getDefaultCurrency(data) {
this.setState({ listDefault: data })
}
// getParentCompany() {
// api.create().getPerusahaanActive().then((response) => {
// if (response.data.status === 'success') {
......@@ -617,6 +634,32 @@ export default class CreatePerusahaan extends Component {
/>
</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 }}>
<DatePicker
margin="normal"
......@@ -713,6 +756,37 @@ export default class CreatePerusahaan extends Component {
value={this.state.perusahaan}
/>
</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 }}>
<DatePicker
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