Commit d1228715 authored by Riri Novita's avatar Riri Novita

Merge branch 'dev/riri' into 'ENV-DEV'

Setting Currency - Company

See merge request !1788
parents d7116481 b12280c3
...@@ -80,6 +80,8 @@ export default class Perusahaan extends Component { ...@@ -80,6 +80,8 @@ export default class Perusahaan extends Component {
"unit_bisnis": item[2] === undefined ? "" : item[2], "unit_bisnis": item[2] === undefined ? "" : item[2],
"start_date": item[3] === undefined ? "" : item[3], "start_date": item[3] === undefined ? "" : item[3],
"end_date": item[4] === undefined ? "" :item[4], "end_date": item[4] === undefined ? "" :item[4],
"currency": item[5] === undefined ? "" :item[5],
"default_currency": item[6] === undefined ? "" :item[6],
}) })
} }
}) })
...@@ -106,6 +108,8 @@ export default class Perusahaan extends Component { ...@@ -106,6 +108,8 @@ export default class Perusahaan extends Component {
item.unit_bisnis, item.unit_bisnis,
item.start_date, item.start_date,
item.end_date, item.end_date,
item.currency,
item.default_currency,
item.error item.error
] ]
}) })
...@@ -115,16 +119,16 @@ export default class Perusahaan extends Component { ...@@ -115,16 +119,16 @@ export default class Perusahaan extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[5] != null) { if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[5].findIndex((val) => val.field.includes('company_name')) check = tableMeta.rowData[7].findIndex((val) => val.field.includes('company_name'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[5] != null && check > -1 ? {tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[5][check].message} data-for="company_name"> <a data-tip={tableMeta.rowData[7][check].message} data-for="company_name">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
...@@ -140,16 +144,16 @@ export default class Perusahaan extends Component { ...@@ -140,16 +144,16 @@ export default class Perusahaan extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[5] != null) { if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[5].findIndex((val) => val.field.includes('company_parent')) check = tableMeta.rowData[7].findIndex((val) => val.field.includes('company_parent'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[5] != null && check > -1 ? {tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[5][check].message} data-for="company_parent"> <a data-tip={tableMeta.rowData[7][check].message} data-for="company_parent">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
...@@ -165,16 +169,16 @@ export default class Perusahaan extends Component { ...@@ -165,16 +169,16 @@ export default class Perusahaan extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[5] != null) { if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[5].findIndex((val) => val.field.includes('unit_bisnis')) check = tableMeta.rowData[7].findIndex((val) => val.field.includes('unit_bisnis'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[5] != null && check > -1 ? {tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[5][check].message} data-for="unit_bisnis"> <a data-tip={tableMeta.rowData[7][check].message} data-for="unit_bisnis">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
...@@ -190,16 +194,16 @@ export default class Perusahaan extends Component { ...@@ -190,16 +194,16 @@ export default class Perusahaan extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[5] != null) { if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[5].findIndex((val) => val.field.includes('start_date')) check = tableMeta.rowData[7].findIndex((val) => val.field.includes('start_date'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[5] != null && check > -1 ? {tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[5][check].message} data-for="startdate"> <a data-tip={tableMeta.rowData[7][check].message} data-for="startdate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
...@@ -215,16 +219,16 @@ export default class Perusahaan extends Component { ...@@ -215,16 +219,16 @@ export default class Perusahaan extends Component {
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
let check = null let check = null
if (tableMeta.rowData[5] != null) { if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[5].findIndex((val) => val.field.includes('end_date')) check = tableMeta.rowData[7].findIndex((val) => val.field.includes('end_date'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
} }
} }
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[5] != null && check > -1 ? {tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[5][check].message} data-for="enddate"> <a data-tip={tableMeta.rowData[7][check].message} data-for="enddate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
...@@ -235,6 +239,56 @@ export default class Perusahaan extends Component { ...@@ -235,6 +239,56 @@ export default class Perusahaan extends Component {
} }
} }
}, },
{
name: "Currency",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('unit_bisnis'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="unit_bisnis">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
}
<ReactTooltip border={true} id="unit_bisnis" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Default Currency",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('unit_bisnis'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="unit_bisnis">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
}
<ReactTooltip border={true} id="unit_bisnis" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{ {
name: "", name: "",
options: { options: {
......
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