Commit 53c9d882 authored by Deni Rinaldi's avatar Deni Rinaldi

ganti logo home~

parent ed753a6d
...@@ -811,6 +811,50 @@ export default class ProfitLoss extends Component { ...@@ -811,6 +811,50 @@ export default class ProfitLoss extends Component {
// console.log(indexParent); // console.log(indexParent);
return a return a
} }
const handleFormula = (data, tableMeta) => {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = []
arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[1] == item)
if (index > 0) {
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
} else {
arrayJumlah.push(item)
}
// if (indexs % 2 !== 0) {
// operator.push(item)
// }
})
let array = arrayJumlah
let total = 0
let opt = ""
array.map((item, index) => {
if (item == "+") {
opt = "tambah"
} else if (item == "-") {
opt = "kurang"
} else if (item == "*") {
opt = "kali"
} else if (item == "/") {
opt = "bagi"
} else {
if (opt == "tambah") {
total = Number(total) + Number(item)
} else if (opt == "kurang") {
total = Number(total) - Number(item)
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = Number(total) / Number(item)
} else {
total += item
}
}
})
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total)
return a
}
const columns = [{ const columns = [{
name: "", name: "",
options: { options: {
...@@ -945,10 +989,24 @@ export default class ProfitLoss extends Component { ...@@ -945,10 +989,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1017,10 +1075,24 @@ export default class ProfitLoss extends Component { ...@@ -1017,10 +1075,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1089,10 +1161,24 @@ export default class ProfitLoss extends Component { ...@@ -1089,10 +1161,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1161,10 +1247,24 @@ export default class ProfitLoss extends Component { ...@@ -1161,10 +1247,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1233,10 +1333,24 @@ export default class ProfitLoss extends Component { ...@@ -1233,10 +1333,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1305,10 +1419,24 @@ export default class ProfitLoss extends Component { ...@@ -1305,10 +1419,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1377,10 +1505,24 @@ export default class ProfitLoss extends Component { ...@@ -1377,10 +1505,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1449,10 +1591,24 @@ export default class ProfitLoss extends Component { ...@@ -1449,10 +1591,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1521,10 +1677,24 @@ export default class ProfitLoss extends Component { ...@@ -1521,10 +1677,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1593,10 +1763,24 @@ export default class ProfitLoss extends Component { ...@@ -1593,10 +1763,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1665,10 +1849,24 @@ export default class ProfitLoss extends Component { ...@@ -1665,10 +1849,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1737,10 +1935,24 @@ export default class ProfitLoss extends Component { ...@@ -1737,10 +1935,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1809,10 +2021,24 @@ export default class ProfitLoss extends Component { ...@@ -1809,10 +2021,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1881,10 +2107,24 @@ export default class ProfitLoss extends Component { ...@@ -1881,10 +2107,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -1953,10 +2193,24 @@ export default class ProfitLoss extends Component { ...@@ -1953,10 +2193,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -2025,10 +2279,24 @@ export default class ProfitLoss extends Component { ...@@ -2025,10 +2279,24 @@ export default class ProfitLoss extends Component {
null null
: :
tableMeta.rowData[0] === 6 ? tableMeta.rowData[0] === 6 ?
<span>Formula</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleFormula(value, tableMeta)}
/>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
......
...@@ -91,7 +91,8 @@ const useStyles = makeStyles((theme) => ({ ...@@ -91,7 +91,8 @@ const useStyles = makeStyles((theme) => ({
[theme.breakpoints.up('sm')]: { [theme.breakpoints.up('sm')]: {
width: theme.spacing(7) + 1, width: theme.spacing(7) + 1,
}, },
paddingLeft: 15, padding: 20,
display: 'flex',
backgroundColor: '#273b80' backgroundColor: '#273b80'
}, },
drawerOpen: { drawerOpen: {
...@@ -476,7 +477,11 @@ export default function MiniDrawer() { ...@@ -476,7 +477,11 @@ export default function MiniDrawer() {
[classes.hide]: open, [classes.hide]: open,
})} })}
> >
<img src={Images.triputraLogo} alt="React Logo" style={{ height: 30, width: 30, alignSelf: 'center', marginTop: 10 }} />
<a data-tip={"Main Menu"} data-for={"main-menu"}>
<MenuIcon style={{ fill: 'white', alignSelf: 'center' }} />
</a>
<ReactTooltip border={true} id={"main-menu"} place="bottom" type="light" effect="solid" />
</IconButton>} </IconButton>}
{open && {open &&
<div style={{ width: '100%', marginTop: 15, marginBottom: 60 }}> <div style={{ width: '100%', marginTop: 15, marginBottom: 60 }}>
...@@ -647,7 +652,7 @@ export default function MiniDrawer() { ...@@ -647,7 +652,7 @@ export default function MiniDrawer() {
key={index} key={index}
path={route.path} path={route.path}
// exact={route.exact} // exact={route.exact}
children={<route.main height={height} width={width} open={open}/>} children={<route.main height={height} width={width} open={open} />}
/> />
))} ))}
</Switch> </Switch>
......
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