Commit 687f5707 authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

fixing formula oi dan push notif

See merge request !1676
parents 9097b3a5 f17cb2c6
......@@ -493,6 +493,9 @@ const create = (type = "") => {
const createMaintenanceMode = (body) => api.post('maintenance/mode/create_maintenance_mode', body)
const updateMaintenanceMode = (body) => api.post('maintenance/mode/update_maintenance_mode', body)
// Reminder Manual
const sendEmail = (body) => api.post('transaction/monitoring/reminder_progress_report', body)
// Superadmin Approve
const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`)
......
......@@ -535,7 +535,7 @@ export default class BalanceSheet extends Component {
} else if (item == '-' || item == '+' || item == '/' || item == '*') {
arrayFormulaConvert.push(item)
} else {
let indexID = dataTable2.findIndex((val) => val[21] == item)
let indexID = dataTable2.findIndex((val) => val[23] == item)
if (tambahan) {
if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item
......
......@@ -201,7 +201,7 @@ class ReportProgress extends Component {
// report
// ])
// })
console.log(dataTable)
// console.log(dataTable)
this.setState({dataTable, loading: false})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -560,8 +560,10 @@ class ReportProgress extends Component {
// dataTable={this.state.dataTable}
periode={this.state.periode ? this.state.periode.periode : null}
quarter={this.state.quarter.name}
month={this.state.month.month_id}
company={this.state.company}
typeReport={String(this.state.reportType.name).toLocaleUpperCase()}
year={this.state.periodeMB.value}
/>
)}
</div>
......
import React, { Component } from "react";
import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, TableCell, Typography } from "@material-ui/core";
import MUIDataTable from "mui-datatables";
import api from '../../api';
import Constant from '../../library/Constant';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable4());
......@@ -26,7 +29,46 @@ export default class TableProgressReport extends Component {
}
}
handleSendEmail(idCompany) {
// console.log(this.props);
let data = this.props
let q1 = data.reportType === 2 && data.quarter === "Q1"
let q2 = data.reportType === 2 && data.quarter === "Q2"
let q3 = data.reportType === 2 && data.quarter === "Q3"
console.log(q1);
let payload = {
"company_id": idCompany,
"setting_type_name": data.reportType === 0 ? "master_budget" : data.reportType === 1 ? "monthly_report" : q1 ? "outlook_q1" : q2 ? "outlook_q2" : q3 ? "outlook_q3" : data.reportType === 3 ? "outlook_pa" : null,
"year": data.year,
"month": data.reportType === 1 ? data.month : null
}
// api.create().sendEmail(payload).then(response => {
// if (response.data) {
// if (response.ok) {
// if (response.data.status == 'success') {
// this.getData()
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
// }
// })
}
render() {
let dataTable2 = this.props.dataTable;
// console.log(this.props);
const handleValue = (tableMeta, itemName) => {
......@@ -142,7 +184,7 @@ export default class TableProgressReport extends Component {
<button
type="button"
style={{ background: 'white' }}
onClick={() => alert(tableMeta.rowData[5])}
onClick={() => this.handleSendEmail(tableMeta.rowData[5])}
>
<div style={{ width: 85, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>{tableMeta.rowData[3] === null || tableMeta.rowData[3] === 0 ? "Send Email" : "Sent"}</span>
......@@ -300,7 +342,7 @@ export default class TableProgressReport extends Component {
<button
type="button"
style={{ background: 'white' }}
onClick={() => alert(tableMeta.rowData[5])}
onClick={() => this.handleSendEmail(tableMeta.rowData[5])}
>
<div style={{ width: 85, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>{tableMeta.rowData[3] === null || tableMeta.rowData[3] === 0 ? "Send Email" : "Sent"}</span>
......@@ -442,7 +484,7 @@ export default class TableProgressReport extends Component {
<button
type="button"
style={{ background: 'white' }}
onClick={() => alert(tableMeta.rowData[5])}
onClick={() => this.handleSendEmail(tableMeta.rowData[5])}
>
<div style={{ width: 85, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>{tableMeta.rowData[3] === null || tableMeta.rowData[3] === 0 ? "Send Email" : "Sent"}</span>
......@@ -584,7 +626,7 @@ export default class TableProgressReport extends Component {
<button
type="button"
style={{ background: 'white' }}
onClick={() => alert(tableMeta.rowData[5])}
onClick={() => this.handleSendEmail(tableMeta.rowData[5])}
>
<div style={{ width: 85, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>{tableMeta.rowData[3] === null || tableMeta.rowData[3] === 0 ? "Send Email" : "Sent"}</span>
......
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