Browse Source

feat(project): add new field income yearly and value contract

pull/1/head
farhantock 6 months ago
parent
commit
978d8af20b
  1. 143
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js
  2. 166
      src/views/SimproV2/CreatedProyek/index.js

143
src/views/SimproV2/CreatedProyek/DialogFormProyek.js

@ -6,7 +6,7 @@ import axios from "../../../const/interceptorApi";
import moment from "moment"; import moment from "moment";
import { CKEditor } from '@ckeditor/ckeditor5-react'; import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import {NotificationManager} from "react-notifications"; import { NotificationManager } from "react-notifications";
import "antd/dist/antd.css"; import "antd/dist/antd.css";
import { formatNumber } from "../../../const/CustomFunc"; import { formatNumber } from "../../../const/CustomFunc";
import { import {
@ -33,9 +33,9 @@ const DialogFormProyek = ({
dataPM, dataPM,
projectImage, projectImage,
company_id, company_id,
role_name, role_name,
token, token,
companyList companyList
}) => { }) => {
const HEADER = { const HEADER = {
headers: { headers: {
@ -50,6 +50,8 @@ const DialogFormProyek = ({
const [late, setLateConsequence] = useState(""); const [late, setLateConsequence] = useState("");
const [assumtion, setAssumtion] = useState(""); const [assumtion, setAssumtion] = useState("");
const [biaya, setBiaya] = useState(""); const [biaya, setBiaya] = useState("");
const [valueProyek, setValueProyek] = useState("");
const [incomeYearly, setIncomeYearly] = useState("");
const [typeProject, setTypeproject] = useState(null); const [typeProject, setTypeproject] = useState(null);
const [phaseProject, setPhaseProject] = useState(null); const [phaseProject, setPhaseProject] = useState(null);
const [divisiProject, setDivisiProject] = useState(null); const [divisiProject, setDivisiProject] = useState(null);
@ -67,10 +69,9 @@ const DialogFormProyek = ({
const [scompany_id, setCompanyId] = useState(null); const [scompany_id, setCompanyId] = useState(null);
const [step, setStep] = useState(1); const [step, setStep] = useState(1);
const [currencyList, setCurrencyList] = useState(null); const [currencyList, setCurrencyList] = useState(null);
const [currency, setCurrency] = useState(""); // merge of code | symbol | name const [currencyCode, setCurrencyCode] = useState("IDR");
const [currencyCode, setCurrencyCode] = useState(""); const [currencySymbol, setCurrencySymbol] = useState("Rp");
const [currencySymbol, setCurrencySymbol] = useState("IDR|Rp|Indonesian rupiah"); const [currencyName, setCurrencyName] = useState("Indonesian rupiah");
const [currencyName, setCurrencyName] = useState("");
const [objectives, setObjectives] = useState(""); const [objectives, setObjectives] = useState("");
const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState(""); const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState("");
const [participants, setParticipants] = useState([]); const [participants, setParticipants] = useState([]);
@ -104,6 +105,8 @@ const DialogFormProyek = ({
setLateConsequence(val.late_consequence ? val.late_consequence : ""); setLateConsequence(val.late_consequence ? val.late_consequence : "");
setAssumtion(val.assumtion ? val.assumtion : ""); setAssumtion(val.assumtion ? val.assumtion : "");
setBiaya(val.rencana_biaya ? formatNumber(val.rencana_biaya) : ""); setBiaya(val.rencana_biaya ? formatNumber(val.rencana_biaya) : "");
setValueProyek(val.value_proyek ? formatNumber(val.value_proyek) : "");
setIncomeYearly(val.income_year ? formatNumber(val.income_year) : "");
setTypeproject(val.type_proyek_id); setTypeproject(val.type_proyek_id);
setPhaseProject(val.phase_id); setPhaseProject(val.phase_id);
setDivisiProject(val.divisi_id); setDivisiProject(val.divisi_id);
@ -115,7 +118,7 @@ const DialogFormProyek = ({
setProjectDuration(val.durasi_proyek); setProjectDuration(val.durasi_proyek);
setInvestor(val.investor); setInvestor(val.investor);
setCompany(val.company); setCompany(val.company);
setCompanyId(val.company_id) setCompanyId(val.company_id)
setFinance(val.finance); setFinance(val.finance);
setObjectives(val.project_objectives ? val.project_objectives : ""); setObjectives(val.project_objectives ? val.project_objectives : "");
setTestingEnv(val.testing_environment); setTestingEnv(val.testing_environment);
@ -207,11 +210,10 @@ const DialogFormProyek = ({
setDivisiProject(null); setDivisiProject(null);
setProjectStructureOrg(null); setProjectStructureOrg(null);
setCompany(""); setCompany("");
setCompanyId(null) setCompanyId(null)
setCurrency(""); setCurrencyCode("IDR");
setCurrencyCode(""); setCurrencySymbol("Rp");
setCurrencySymbol("IDR|Rp|Indonesian rupiah"); setCurrencyName("Indonesian rupiah");
setCurrencyName("");
setObjectives(""); setObjectives("");
setImage(""); setImage("");
setProjectIsConsideredSuccessful(""); setProjectIsConsideredSuccessful("");
@ -278,7 +280,9 @@ const DialogFormProyek = ({
currency_symbol: currencySymbol, currency_symbol: currencySymbol,
currency_code: currencyCode, currency_code: currencyCode,
currency_name: currencyName, currency_name: currencyName,
company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id),
value_proyek: valueProyek,
income_year: incomeYearly
}; };
data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval };
data.imageStructureOrg = organization ? organization : null; data.imageStructureOrg = organization ? organization : null;
@ -309,7 +313,9 @@ const DialogFormProyek = ({
currency_symbol: currencySymbol, currency_symbol: currencySymbol,
currency_code: currencyCode, currency_code: currencyCode,
currency_name: currencyName, currency_name: currencyName,
company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id),
value_proyek: valueProyek,
income_year: incomeYearly
}; };
data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval };
data.imageStructureOrg = organization ? organization : null; data.imageStructureOrg = organization ? organization : null;
@ -328,7 +334,7 @@ const DialogFormProyek = ({
setTypeproject(val); setTypeproject(val);
}; };
const onChangeCompanyProject = (val) => { const onChangeCompanyProject = (val) => {
setCompanyId(val); setCompanyId(val);
}; };
@ -381,6 +387,8 @@ const DialogFormProyek = ({
setCurrencyName(curr[2]); setCurrencyName(curr[2]);
}; };
console.log(currencyCode, currencySymbol, currencyName);
const handleDatePickerStart = (date, dateString) => { const handleDatePickerStart = (date, dateString) => {
setStartDate(date); setStartDate(date);
}; };
@ -410,7 +418,7 @@ const DialogFormProyek = ({
alert("End Date cannot be empty!"); alert("End Date cannot be empty!");
return false; return false;
} }
if (role_name === 'Super Admin' && !scompany_id || scompany_id === "") { if (role_name === 'Super Admin' && !scompany_id || scompany_id === "") {
alert("Company data cannot be empty!"); alert("Company data cannot be empty!");
return false; return false;
} }
@ -422,7 +430,7 @@ const DialogFormProyek = ({
alert("Currency Symbol cannot be empty!"); alert("Currency Symbol cannot be empty!");
return false; return false;
} }
if (!divisiProject || divisiProject === "") { if (!divisiProject || divisiProject === "") {
alert("Division cannot be empty!"); alert("Division cannot be empty!");
return false; return false;
} }
@ -768,31 +776,31 @@ const DialogFormProyek = ({
</Col> </Col>
</Row> </Row>
<Row> <Row>
{ {
role_name === 'Super Admin' && ( role_name === 'Super Admin' && (
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}>Assign Company Project<span style={{ color: "red" }}>*</span></Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Assign Company Project<span style={{ color: "red" }}>*</span></Label>
<Select <Select
showSearch showSearch
filterOption={(inputValue, option) => filterOption={(inputValue, option) =>
option.children.toLowerCase().includes(inputValue.toLowerCase()) option.children.toLowerCase().includes(inputValue.toLowerCase())
} }
value={scompany_id} value={scompany_id}
defaultValue={scompany_id} defaultValue={scompany_id}
onChange={onChangeCompanyProject} onChange={onChangeCompanyProject}
style={{ width: "100%" }} style={{ width: "100%" }}
> >
{companyList.map((res) => ( {companyList.map((res) => (
<Option key={res.id} value={res.id}> <Option key={res.id} value={res.id}>
{res.company_name} {res.company_name}
</Option> </Option>
))} ))}
</Select> </Select>
</FormGroup> </FormGroup>
</Col> </Col>
) )
} }
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}>Company</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Company</Label>
@ -803,10 +811,10 @@ const DialogFormProyek = ({
/> />
</FormGroup> </FormGroup>
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Budget<span style={{ color: "red" }}>*</span> Nilai Kontrak<span style={{ color: "red" }}>*</span>
</Label> </Label>
<Row> <Row>
<Col md={4}> <Col md={4}>
@ -824,14 +832,41 @@ const DialogFormProyek = ({
<Col md={8}> <Col md={8}>
<Input <Input
type="text" type="text"
value={biaya} value={valueProyek}
onChange={(e) => setBiaya(formatNumber(e.target.value))} onChange={(e) => setValueProyek(formatNumber(e.target.value))}
/> />
</Col> </Col>
</Row> </Row>
</FormGroup> </FormGroup>
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}>
Target Pendapatan/Tahun<span style={{ color: "red" }}>*</span>
</Label>
<Input
type="text"
value={incomeYearly}
onChange={(e) => setIncomeYearly(formatNumber(e.target.value))}
/>
</FormGroup>
</Col>
<Col md={6}>
<FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}>
Anggaran Biaya<span style={{ color: "red" }}>*</span>
</Label>
<Input
type="text"
value={biaya}
onChange={(e) => setBiaya(formatNumber(e.target.value))}
/>
</FormGroup>
</Col>
<Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}>Work Area</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Work Area</Label>
<Input <Input
@ -841,10 +876,10 @@ const DialogFormProyek = ({
/> />
</FormGroup> </FormGroup>
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Handled By Division<span style={{ color: "red" }}>*</span> Handled By MP<span style={{ color: "red" }}>*</span>
</Label> </Label>
<Select <Select
showSearch showSearch
@ -875,7 +910,7 @@ const DialogFormProyek = ({
/> />
</FormGroup> </FormGroup>
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize" style={{ fontWeight: "bold" }}>Organizational Structure</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Organizational Structure</Label>
<Input <Input
@ -1241,7 +1276,7 @@ const DialogFormProyek = ({
</Row> </Row>
); );
}); });
} else if (checklist.length < 1) { } else if (checklist?.length == 0) {
return ( return (
<div <div
style={{ style={{
@ -1546,7 +1581,7 @@ const DialogFormProyek = ({
return ( return (
<> <>
<Modal size="lg" isOpen={openDialog} toggle={toggleDialog}> <Modal scrollable={true} size="lg" isOpen={openDialog} toggle={toggleDialog}>
<ModalHeader className="capitalize" toggle={closeDialog}> <ModalHeader className="capitalize" toggle={closeDialog}>
{step === 1 {step === 1
? idTask ? idTask

166
src/views/SimproV2/CreatedProyek/index.js

@ -70,11 +70,11 @@ import DialogInitDocument from "./DialogInitDocument";
import DialogGantt from "./DialogGantt"; import DialogGantt from "./DialogGantt";
import DialogHierarchy from "./DialogHierarchy"; import DialogHierarchy from "./DialogHierarchy";
import { import {
formatNumber, formatNumber,
formatRupiah, formatRupiah,
formatThousand, formatThousand,
renderFormatRupiah, renderFormatRupiah,
checkActMenup, checkActMenup,
} from "../../../const/CustomFunc"; } from "../../../const/CustomFunc";
// import DialogAsignHr from './AsignHrProject'; // import DialogAsignHr from './AsignHrProject';
import AssignHrProject from "./AsignHrProject"; import AssignHrProject from "./AsignHrProject";
@ -91,7 +91,7 @@ const url = "";
const format = "DD-MM-YYYY"; const format = "DD-MM-YYYY";
const CreatedProyek = ({ params, ...props }) => { const CreatedProyek = ({ params, ...props }) => {
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '', configApp={}; let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '', configApp = {};
if (props && props.role_id && props.user_id) { if (props && props.role_id && props.user_id) {
role_id = props.role_id; role_id = props.role_id;
user_id = props.user_id; user_id = props.user_id;
@ -208,10 +208,10 @@ const CreatedProyek = ({ params, ...props }) => {
}, [openDialogProyek]); }, [openDialogProyek]);
useEffect(() => { useEffect(() => {
if(role_name === 'Super Admin') { if (role_name === 'Super Admin') {
getDataProyekCompany(); getDataProyekCompany();
} }
},[]) }, [])
useEffect(() => { useEffect(() => {
if (parseInt(role_id) === 44) { if (parseInt(role_id) === 44) {
@ -245,7 +245,7 @@ const CreatedProyek = ({ params, ...props }) => {
"joins": [], "joins": [],
"orders": { "columns": ["id"], "ascending": false } "orders": { "columns": ["id"], "ascending": false }
} }
if(role_name !== 'Super Admin') { if (role_name !== 'Super Admin') {
payload.columns.push( payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } { "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }
) )
@ -266,7 +266,7 @@ const CreatedProyek = ({ params, ...props }) => {
"joins": [], "joins": [],
"orders": { "columns": ["id"], "ascending": false } "orders": { "columns": ["id"], "ascending": false }
} }
if(role_name !== 'Super Admin') { if (role_name !== 'Super Admin') {
payload.columns.push( payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } { "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }
) )
@ -287,7 +287,7 @@ const CreatedProyek = ({ params, ...props }) => {
"joins": [], "joins": [],
"orders": { "columns": ["id"], "ascending": false } "orders": { "columns": ["id"], "ascending": false }
} }
if(role_name !== 'Super Admin') { if (role_name !== 'Super Admin') {
payload.columns.push( payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } { "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }
) )
@ -310,7 +310,7 @@ const CreatedProyek = ({ params, ...props }) => {
"joins": [], "joins": [],
"orders": { "columns": ["id"], "ascending": false } "orders": { "columns": ["id"], "ascending": false }
} }
if(role_name !== 'Super Admin') { if (role_name !== 'Super Admin') {
payload.columns.push( payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } { "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }
) )
@ -414,9 +414,10 @@ const CreatedProyek = ({ params, ...props }) => {
"currency_symbol", "currency_symbol",
"mulai_proyek", "mulai_proyek",
"akhir_proyek", "akhir_proyek",
"value_proyek",
"income_year",
"company_id", "company_id",
"deleted_at", "deleted_at",
"value_proyek",
"deleted_by_id" "deleted_by_id"
], ],
joins: [ joins: [
@ -440,7 +441,7 @@ const CreatedProyek = ({ params, ...props }) => {
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } { name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" }
); );
} }
if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') {
payload.columns.push( payload.columns.push(
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } { name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" }
); );
@ -1429,7 +1430,7 @@ const CreatedProyek = ({ params, ...props }) => {
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } { name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" }
); );
} }
if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') {
payload.columns.push( payload.columns.push(
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } { name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" }
); );
@ -1489,7 +1490,7 @@ const CreatedProyek = ({ params, ...props }) => {
const handleExportPdf = async () => { const handleExportPdf = async () => {
const doc = new jsPDF(); const doc = new jsPDF();
let headers = [ let headers = [
[role_name === 'Super Admin' ? "Company" : null, "Project Name", "Budget", "Project Type", "PM", "Time Project"], [role_name === 'Super Admin' ? "Company" : null, "Project Name", "Nilai Kontrak", "Pendapatan Pertahun", "Anggaran Biaya", "Project Type", "PM", "Time Project"],
]; ];
const payload = { const payload = {
@ -1544,7 +1545,7 @@ const CreatedProyek = ({ params, ...props }) => {
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } { name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" }
); );
} }
if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') {
payload.columns.push( payload.columns.push(
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } { name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" }
); );
@ -1621,7 +1622,7 @@ const CreatedProyek = ({ params, ...props }) => {
<span className="menu-icon"> <span className="menu-icon">
<i className="fa fa-eye"></i> <i className="fa fa-eye"></i>
</span> </span>
<span className="menu-text">Project Charter</span> <span className="menu-text">Indentitas Proyek</span>
</div> </div>
<div className="menu-list" onClick={() => handleOpenDokumen(text)}> <div className="menu-list" onClick={() => handleOpenDokumen(text)}>
<span className="menu-icon"> <span className="menu-icon">
@ -1697,18 +1698,18 @@ const CreatedProyek = ({ params, ...props }) => {
<> <>
{dataVersionGantt.slice(0, 8).map((res) => ( {dataVersionGantt.slice(0, 8).map((res) => (
<Link to={{ <Link to={{
pathname : `/projects/${res.id}/${text.id}/gantt`, pathname: `/projects/${res.id}/${text.id}/gantt`,
state: { state: {
isLogin, isLogin,
token, token,
role_id, role_id,
user_id, user_id,
role_name, role_name,
company_id: text.company_id, company_id: text.company_id,
dataViewStartDate, dataViewStartDate,
companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name) companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name)
} }
}}> }}>
<div className="menu-list"> <div className="menu-list">
<span className="menu-icon"> <span className="menu-icon">
<i className="fa fa-file"></i> <i className="fa fa-file"></i>
@ -1762,6 +1763,7 @@ const CreatedProyek = ({ params, ...props }) => {
title: "Action", title: "Action",
dataIndex: "", dataIndex: "",
key: "x", key: "x",
width: 70,
render: (text, record) => render: (text, record) =>
parseInt(role_id) == 44 ? ( parseInt(role_id) == 44 ? (
<> <>
@ -1785,40 +1787,40 @@ const CreatedProyek = ({ params, ...props }) => {
trigger="click" trigger="click"
> >
{ {
checkActMenup(location.pathname, 'read') ? checkActMenup(location.pathname, 'read') ?
<Button size="small" type="link" style={{ color: "green" }}> <Button size="small" type="link" style={{ color: "green" }}>
<i className="fa fa-ellipsis-v"></i> <i className="fa fa-ellipsis-v"></i>
</Button> </Button>
: :
null null
} }
</Popover> </Popover>
{ {
checkActMenup(location.pathname, 'update') ? checkActMenup(location.pathname, 'update') ?
<Popover <Popover
placement="rightTop" placement="rightTop"
title={text.nama} title={text.nama}
content={popupMenuGantt(text, record)} content={popupMenuGantt(text, record)}
trigger="click" trigger="click"
>
{text.join_second_is_multiLocation == true ? (
<Button size="small" type="link" style={{ color: "green" }}>
<i className="fa fa-bars"></i>
</Button>
) : (
<Button
onClick={() => getdataGantt(text.id)}
size="small"
type="link"
style={{ color: "green" }}
> >
<i className="fa fa-bars"></i> {text.join_second_is_multiLocation == true ? (
</Button> <Button size="small" type="link" style={{ color: "green" }}>
)} <i className="fa fa-bars"></i>
</Popover> </Button>
: ) : (
null <Button
} onClick={() => getdataGantt(text.id)}
size="small"
type="link"
style={{ color: "green" }}
>
<i className="fa fa-bars"></i>
</Button>
)}
</Popover>
:
null
}
</> </>
), ),
}, },
@ -1831,13 +1833,25 @@ const CreatedProyek = ({ params, ...props }) => {
<span>{record.join_third_company_name}</span> <span>{record.join_third_company_name}</span>
) )
}] : []), }] : []),
{ title: "Project Name", dataIndex: "nama", key: "nama" }, { title: "Project Name", dataIndex: "nama", key: "nama", width: 200 },
{
title: "Pendapatan Pertahun", dataIndex: "income_year",
key: "income_year",
render: (text, record) => {
const incomeYear = text ?? '-';
return record.currency_symbol
? `${record.currency_symbol} ${formatThousand(incomeYear)}`
: `${formatThousand(incomeYear)}`;
},
},
{ {
title: "Nilai Kontrak", title: "Nilai Kontrak", dataIndex: "value_proyek",
dataIndex: "value_proyek",
key: "value_proyek", key: "value_proyek",
render: (text, record) => { render: (text, record) => {
return "Rp " + (record.value_proyek == null ? 0 : record.value_proyek); const valueProyek = text ?? '-';
return record.currency_symbol
? `${record.currency_symbol} ${formatThousand(valueProyek)}`
: `${formatThousand(valueProyek)}`;
}, },
}, },
{ {
@ -2200,18 +2214,18 @@ const CreatedProyek = ({ params, ...props }) => {
<Col> <Col>
{parseInt(role_id) == 44 ? null : ( // role kustomer {parseInt(role_id) == 44 ? null : ( // role kustomer
<Tooltip title="Add Project"> <Tooltip title="Add Project">
{ {
checkActMenup(location.pathname, 'create') ? checkActMenup(location.pathname, 'create') ?
<Button <Button
style={{ background: "#4caf50", color: "#fff" }} style={{ background: "#4caf50", color: "#fff" }}
onClick={() => handleOpenDialogProyek(0)} onClick={() => handleOpenDialogProyek(0)}
> >
<i className="fa fa-plus"></i> <i className="fa fa-plus"></i>
</Button> </Button>
: :
null null
} }
</Tooltip> </Tooltip>
)} )}
<Tooltip title="Export"> <Tooltip title="Export">

Loading…
Cancel
Save