Commit fcf9d9b5 authored by Deni Rinaldi's avatar Deni Rinaldi

pormula

parent f2d49c8a
...@@ -318,11 +318,12 @@ export default class BudgetTahunan extends Component { ...@@ -318,11 +318,12 @@ export default class BudgetTahunan extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getReport() this.getReport()
this.getSubmission() this.getSubmission()
this.setState({ loading: false })
} else { } else {
this.setState({ loading: true }) this.setState({ loading: false })
} }
} else { } else {
this.setState({ loading: true }) this.setState({ loading: false })
} }
}) })
} }
......
...@@ -65,6 +65,7 @@ export default class BalanceSheet extends Component { ...@@ -65,6 +65,7 @@ export default class BalanceSheet extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
let dataTable = [] let dataTable = []
response.data.data.map((item, index) => { response.data.data.map((item, index) => {
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
...@@ -779,6 +780,32 @@ export default class BalanceSheet extends Component { ...@@ -779,6 +780,32 @@ export default class BalanceSheet extends Component {
// console.log(indexParent); // console.log(indexParent);
return a return a
} }
const handleFormula = (data, tableMeta, column) => {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = []
let operator = []
arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[1] == item)
if (index > 0) {
arrayJumlah.push(dataTable2[index][column])
} else {
arrayJumlah.push(item)
}
// if (indexs % 2 !== 0) {
// operator.push(item)
// }
})
let a = arrayJumlah.join("")
console.log(arrayJumlah);
// if (arrayJumlah.length > 0) {
// console.log(arrayJumlah);
// let a = Number(arrayJumlah[0]) + Number(arrayJumlah[1])
// return a
// } else {
// return 'Formula'
// }
}
const columns = [{ const columns = [{
name: "", name: "",
options: { options: {
...@@ -879,7 +906,7 @@ export default class BalanceSheet extends Component { ...@@ -879,7 +906,7 @@ export default class BalanceSheet extends Component {
<span>Formula</span> <span>Formula</span>
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span> <span>{handleFormula(value, tableMeta, 6)}</span>
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
value === "" ? value === "" ?
...@@ -2004,14 +2031,14 @@ export default class BalanceSheet extends Component { ...@@ -2004,14 +2031,14 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Balance Sheet</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Balance Sheet</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between'}}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%'}}> <div style={{ width: '50%' }}>
<div style={{justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
......
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