Commit 56a6e542 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

- valdiasi preview

See merge request !301
parents 05195493 ad5e4aec
This diff is collapsed.
......@@ -777,6 +777,21 @@ export default class ProfitLoss extends Component {
this.props.onClickClose()
}
downloadTemplate = async () => {
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
)
res = await res.blob()
console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Template Profit Loss.xlsx';
a.click();
}
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -2357,7 +2372,7 @@ export default class ProfitLoss extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
onClick={() => this.downloadTemplate()}
>
<img src={Images.template} />
</button>
......
......@@ -22,7 +22,8 @@ const style = {
const style2 = {
position: "sticky",
background: "white",
zIndex: 100
zIndex: 100,
top: 0
};
export default class TaxPlanning extends Component {
......@@ -1443,6 +1444,21 @@ export default class TaxPlanning extends Component {
this.props.onClickClose()
}
downloadTemplate = async () => {
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
)
res = await res.blob()
console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Template Tax Planning.xlsx';
a.click();
}
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -1843,11 +1859,11 @@ export default class TaxPlanning extends Component {
name: "Feb 2021",
options: {
customHeadRender: (columnMeta) => (
<th style={{ backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
{/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
{/* <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div> */}
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span>
......@@ -5362,7 +5378,7 @@ export default class TaxPlanning extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
onClick={() => this.downloadTemplate()}
>
<img src={Images.template} />
</button>
......
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