Commit 4445c8ad authored by fahrur huzain's avatar fahrur huzain

update issue parameter referenceid

parent 32500bd3
......@@ -744,7 +744,7 @@ export default class CreateParameter extends Component {
}else if (this.state.getTypes.setting_group_name == "CURRENCY_MONEY_FORMAT"){
if (R.isNil(this.state.getFormatData)){
}else {
this.updateParameter()
this.updateParameterCurrebcyMoneyFormat()
}
} else if (this.state.getTypes.setting_group_name == "REPORT_SUBMIT_PERIOD") {
if (R.isEmpty(data.maxValue) || data.maxValue == "" ) {
......@@ -769,7 +769,7 @@ export default class CreateParameter extends Component {
}else if (this.state.getTypes.setting_group_name == "CURRENCY_MONEY_FORMAT"){
if (R.isNil(this.state.getFormatData)){
}else {
this.createParameter()
this.createParameterCurrebcyMoneyFormat()
}
} else if (this.state.getTypes.setting_group_name == "REPORT_SUBMIT_PERIOD") {
if (R.isEmpty(data.maxValue) || data.maxValue == "" ) {
......@@ -7024,6 +7024,28 @@ export default class CreateParameter extends Component {
this.props.updateParameter(body)
}
updateParameterCurrebcyMoneyFormat() {
// let char = this.state.value
// let arrayChar = char.split('');
// console.log(char);
let body = {
"setting_id": this.state.tempData.setting_id,
"setting_group_id": this.state.getTypes.setting_group_id,
"setting_type_id": this.state.getParameter.setting_type_id,
"company_id": this.state.getPerusahaan.company_id,
"reference_id": this.state.getFormatData == null ? null : this.state.getFormatData.setting_type_id,
"description": this.state.tempData.description,
"orders": this.state.tempData.order,
"value": this.state.tempData.value,
"max_value": this.state.tempData.max_value,
"min_value": this.state.tempData.min_value,
"start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date
}
console.log(body);
this.props.updateParameter(body)
}
createParameter() {
let char = this.state.value
let arrayChar = char.split('');
......@@ -7047,6 +7069,29 @@ export default class CreateParameter extends Component {
this.props.createParameter(body)
}
createParameterCurrebcyMoneyFormat() {
let char = this.state.value
let arrayChar = char.split('');
console.log(char);
let body = {
"setting_group_id": this.state.getTypes.setting_group_id,
"setting_type_id": this.state.getParameter.setting_type_id,
"company_id": this.state.getPerusahaan.company_id,
"reference_id": this.state.getFormatData == null ? null : this.state.getFormatData.setting_type_id,
"description": this.state.description,
"orders": this.state.order,
"value": this.state.value,
// convert IDR to IDR mn
"value": this.state.enableReportName ? this.state.value.includes(".") || arrayChar.length == 2 ? this.state.value : this.state.value / 1000 : this.state.value,
"max_value": this.state.maxValue,
"min_value": this.state.minValue,
"start_date": this.state.startDate,
"end_date": this.state.endDate
}
console.log(body);
this.props.createParameter(body)
}
render() {
let { type } = this.props
return type === 'edit' ? this.renderEdit() : this.renderCreate()
......
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