Commit 340d80c1 authored by Deni Rinaldi's avatar Deni Rinaldi

uplot ++

parent fc565f8f
...@@ -738,7 +738,6 @@ export default class BalanceSheet extends Component { ...@@ -738,7 +738,6 @@ export default class BalanceSheet extends Component {
total_next_year: String(i[20]), total_next_year: String(i[20]),
total_more_year: String(i[21]) total_more_year: String(i[21])
}) })
}) })
let payload = { let payload = {
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
...@@ -803,32 +802,6 @@ export default class BalanceSheet extends Component { ...@@ -803,32 +802,6 @@ export default class BalanceSheet extends Component {
}) })
} }
}) })
let rows = isi.map((i, index) => {
return [
String(i[0]) === '-' ? 4 : 3,
0,
0,
"",
1,
i[0] === undefined ? "" : String(i[0]),
i[1] === undefined ? "" : String(i[1]),
i[2] === undefined ? "" : String(i[2]),
i[3] === undefined ? "" : String(i[3]),
i[4] === undefined ? "" : String(i[4]),
i[5] === undefined ? "" : String(i[5]),
i[6] === undefined ? "" : String(i[6]),
i[7] === undefined ? "" : String(i[7]),
i[8] === undefined ? "" : String(i[8]),
i[9] === undefined ? "" : String(i[9]),
i[10] === undefined ? "" : String(i[10]),
i[11] === undefined ? "" : String(i[11]),
i[12] === undefined ? "" : String(i[12]),
i[13] === undefined ? "" : String(i[13]),
i[14] === undefined ? "" : String(i[14]),
i[15] === undefined ? "" : String(i[15]),
i[16] === undefined ? "" : String(i[16])
]
})
let body = { let body = {
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
...@@ -890,7 +863,36 @@ export default class BalanceSheet extends Component { ...@@ -890,7 +863,36 @@ export default class BalanceSheet extends Component {
} }
uploadBalanceSheet() { uploadBalanceSheet() {
api.create('UPLOAD').uploadMasterBudget(this.state.payload).then(response => { let data = []
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
total_actual_before: String(i[6]),
january: String(i[7]),
february: String(i[8]),
march: String(i[9]),
april: String(i[10]),
may: String(i[11]),
june: String(i[12]),
july: String(i[13]),
august: String(i[14]),
september: String(i[15]),
october: String(i[16]),
november: String(i[17]),
december: String(i[18]),
total_current_year: String(i[19]),
total_next_year: String(i[20]),
total_more_year: String(i[21])
})
})
let body = {
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
balance_sheet: data
}
console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
......
...@@ -190,7 +190,7 @@ export default class DocumentManagement extends Component { ...@@ -190,7 +190,7 @@ export default class DocumentManagement extends Component {
<button <button
type="button" type="button"
onClick={() => this.setState({ visibleCreate: true, refresh: '' })} onClick={() => this.setState({ visibleCreate: true, refresh: '' })}
style={{ marginRight: 25 }} style={{ marginRight: 25, background: 'transparent' }}
> >
<img src={Images.add} /> <img src={Images.add} />
</button> </button>
......
...@@ -45,9 +45,6 @@ export default class EditManagementDoc extends Component { ...@@ -45,9 +45,6 @@ export default class EditManagementDoc extends Component {
componentDidMount() { componentDidMount() {
if (this.props.type === 'edit') { if (this.props.type === 'edit') {
this.getDetailDoc() this.getDetailDoc()
this.getDataCompany()
this.getDataDocument()
this.getPeriode()
} }
} }
...@@ -69,7 +66,10 @@ export default class EditManagementDoc extends Component { ...@@ -69,7 +66,10 @@ export default class EditManagementDoc extends Component {
// status: data.status, // status: data.status,
// created: data.created, // created: data.created,
// updated: data.updated === null ? "" : data.updated // updated: data.updated === null ? "" : data.updated
}, () => this.getDataCompany(), this.getDataDocument(), this.getPeriode()) }, () => {
this.getDataCompany()
this.getDataDocument()
this.getPeriode()})
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -100,16 +100,12 @@ export default class EditManagementDoc extends Component { ...@@ -100,16 +100,12 @@ export default class EditManagementDoc extends Component {
company_name: item.company_name company_name: item.company_name
} }
}) })
// typeData.push({
// company_id: 0,
// company_name: 'Default'
// })
let index = typeData.findIndex((val) => val.company_id == this.state.companyId)
let typeProps = { let typeProps = {
options: typeData.sort((a, b) => a.company_id - b.company_id), options: typeData,
getOptionLabel: (option) => option.company_name, getOptionLabel: (option) => option.company_name,
}; };
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? typeData[0]: typeData[index] }) let index = typeData.findIndex((val) => val.company_id == this.state.companyId)
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index === -1 ? typeData[0]: typeData[index] })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -145,10 +141,11 @@ export default class EditManagementDoc extends Component { ...@@ -145,10 +141,11 @@ export default class EditManagementDoc extends Component {
} }
}) })
let typeProps = { let typeProps = {
options: typeData.sort((a, b) => a.document_category_id - b.document_category_id), options: typeData,
getOptionLabel: (option) => option.document_category_name, getOptionLabel: (option) => option.document_category_name,
}; };
this.setState({ document: typeProps, documentData: response.data.data }) let index = typeData.findIndex((val) => val.document_category_id == this.state.categoryId)
this.setState({ document: typeProps, documentData: response.data.data, getDocument: index === -1 ? typeData[0]: typeData[index] })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
......
...@@ -183,7 +183,7 @@ export default class ManualBookTia extends Component { ...@@ -183,7 +183,7 @@ export default class ManualBookTia extends Component {
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} style={{ width: 33}} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
......
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