Commit 930e603a authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'faisal' into 'master'

validasi parent company

See merge request !221
parents 984ac64b 42ba2cac
...@@ -653,7 +653,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -653,7 +653,7 @@ export default class FixedAssetsMovement extends Component {
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Fixed Assets Movement</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Fixed Assets Movement</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div>
...@@ -685,7 +685,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -685,7 +685,7 @@ export default class FixedAssetsMovement extends Component {
onClick={() => this.props.onClickClose()} onClick={() => this.props.onClickClose()}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Kembali</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
......
...@@ -249,6 +249,8 @@ export default class CreatePerusahaan extends Component { ...@@ -249,6 +249,8 @@ export default class CreatePerusahaan extends Component {
validasiEdit() { validasiEdit() {
if (R.isEmpty(this.state.company)) { if (R.isEmpty(this.state.company)) {
this.setState({ errorNP: true, msgErrorNP: 'Company Name Cannot be Empty.' }) this.setState({ errorNP: true, msgErrorNP: 'Company Name Cannot be Empty.' })
} else if (R.isNil(this.state.getPerusahaan)) {
this.setState({ errorPC: true, msgErrorPC: 'Parent Company Cannot be Empty.' })
} else if (R.isNil(this.state.getTypes)) { } else if (R.isNil(this.state.getTypes)) {
this.setState({ errorUB: true, msgErrorUB: 'Business Unit Cannot be Empty.' }) this.setState({ errorUB: true, msgErrorUB: 'Business Unit Cannot be Empty.' })
} else if (R.isNil(this.state.startDate)) { } else if (R.isNil(this.state.startDate)) {
...@@ -260,7 +262,8 @@ export default class CreatePerusahaan extends Component { ...@@ -260,7 +262,8 @@ export default class CreatePerusahaan extends Component {
"company_id": this.state.companyID, "company_id": this.state.companyID,
"company_name": this.state.company, "company_name": this.state.company,
"business_unit_id": this.state.getTypes.business_unit_id, "business_unit_id": this.state.getTypes.business_unit_id,
"parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id, // "parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id,
"parent": this.state.getPerusahaan.company_id,
"start_date": this.state.startDate, "start_date": this.state.startDate,
"end_date": this.state.endDate "end_date": this.state.endDate
} }
...@@ -271,6 +274,8 @@ export default class CreatePerusahaan extends Component { ...@@ -271,6 +274,8 @@ export default class CreatePerusahaan extends Component {
validasi() { validasi() {
if (R.isEmpty(this.state.company)) { if (R.isEmpty(this.state.company)) {
this.setState({ errorNP: true, msgErrorNP: 'Company Name Cannot be Empty.' }) this.setState({ errorNP: true, msgErrorNP: 'Company Name Cannot be Empty.' })
} else if (R.isNil(this.state.getPerusahaan)) {
this.setState({ errorPC: true, msgErrorPC: 'Parent Company Cannot be Empty.' })
} else if (R.isNil(this.state.getTypes)) { } else if (R.isNil(this.state.getTypes)) {
this.setState({ errorUB: true, msgErrorUB: 'Business Unit Cannot be Empty.' }) this.setState({ errorUB: true, msgErrorUB: 'Business Unit Cannot be Empty.' })
} else if (R.isNil(this.state.startDate)) { } else if (R.isNil(this.state.startDate)) {
...@@ -281,7 +286,8 @@ export default class CreatePerusahaan extends Component { ...@@ -281,7 +286,8 @@ export default class CreatePerusahaan extends Component {
else { else {
let payload = { let payload = {
"company_name": this.state.company, "company_name": this.state.company,
"parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id, // "parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id,
"parent": this.state.getPerusahaan.company_id,
"business_unit_id": this.state.getTypes.business_unit_id, "business_unit_id": this.state.getTypes.business_unit_id,
"start_date": this.state.startDate, "start_date": this.state.startDate,
"end_date": this.state.endDate "end_date": this.state.endDate
...@@ -452,8 +458,17 @@ export default class CreatePerusahaan extends Component { ...@@ -452,8 +458,17 @@ export default class CreatePerusahaan extends Component {
{...this.state.perusahaan} {...this.state.perusahaan}
debug debug
id="tipe" id="tipe"
onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue })} onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, ()=> this.clearError())}
renderInput={(params) => <TextField {...params} InputProps={{ ...params.InputProps, style: { fontSize: 11 } }} InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }} label="Parent Company" />} renderInput={(params) =>
<TextField
{...params}
label="Parent Company"
error={this.state.errorPC}
helperText={this.state.msgErrorPC}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
}
value={this.state.getPerusahaan} value={this.state.getPerusahaan}
/> />
</div> </div>
...@@ -662,9 +677,18 @@ export default class CreatePerusahaan extends Component { ...@@ -662,9 +677,18 @@ export default class CreatePerusahaan extends Component {
{...this.state.perusahaan} {...this.state.perusahaan}
debug debug
id="tipe" id="tipe"
onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue })} onChange={(event, newInputValue) => this.setState({ getPerusahaan: newInputValue }, ()=> this.clearError())}
renderInput={(params) => <TextField {...params} InputProps={{ ...params.InputProps, style: { fontSize: 11 } }} InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }} label="Parent Company" />} renderInput={(params) =>
value={this.state.getPerusahaan} <TextField
{...params}
label="Parent Company"
error={this.state.errorPC}
helperText={this.state.msgErrorPC}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
/>
}
value={this.state.perusahaan}
/> />
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}> <div style={{ padding: 10, borderRadius: 5 }}>
......
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