Skip to content

Commit

Permalink
Billing and Invoice Hi Fi Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Harin329 committed Jun 27, 2023
1 parent 7799a4e commit 5ea7ecf
Show file tree
Hide file tree
Showing 17 changed files with 364 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function InvoiceDetails({ billingData }) {
{index + 1}. {invoiceItem.name}
</td>
<td>{invoiceItem.quantity}</td>
<td>${invoiceItem.cost / invoiceItem.quantity}</td>
<td>${(invoiceItem.cost / invoiceItem.quantity).toFixed(2)}</td>
<td>${invoiceItem.cost}</td>
</tr>
);
Expand All @@ -176,11 +176,11 @@ function InvoiceDetails({ billingData }) {
</tr>
<tr className="item">
<td>Total Tax:</td>
<td>${0.12 * subtotal}</td>
<td>${(0.12 * subtotal).toFixed(2)}</td>
</tr>
<tr className="item">
<td>Total Due:</td>
<td className="last">${subtotal + 0.12 * subtotal}</td>
<td className="last">${(subtotal + 0.12 * subtotal).toFixed(2)}</td>
</tr>
<tr className="item total">
<td>Amount Paid:</td>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/GenerateInvoice/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NavLink } from "react-router-dom";
function GenerateInvoice() {
return (
<NavLink to="/pdf">
<div className="GeneratePdfButton">Generate Invoice</div>
<div className="GenerateInvoice">Generate Invoice</div>
</NavLink>
);
}
Expand Down
26 changes: 25 additions & 1 deletion frontend/src/components/GeneratePdf/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,29 @@
margin-top: 30px;
border-radius: 10px;
cursor: pointer;
width:100%;
width: 180px;
align-self: center;
}

.GenerateInvoice {
display: flex;
justify-content: center;
font-size: 18px;
font-weight: 600;
background-color: #8A9DF8;
color: #ffffff;
padding: 10px;
padding-left: 20px;
padding-right: 20px;
margin-bottom: 20px;
margin-top: 30px;
border-radius: 10px;
cursor: pointer;
width: 100%;
}

.GeneratePDFView {
display: flex;
justify-content: center;
align-items: center;
}
6 changes: 4 additions & 2 deletions frontend/src/components/GeneratePdf/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ const GeneratePdf = ({ htmlElementRef }) => {
});
};
return (
<div className="GeneratePdfButton" onClick={generatePdfHandler}>
Generate PDF
<div className="GeneratePDFView">
<div className="GeneratePdfButton" onClick={generatePdfHandler}>
Generate PDF
</div>
</div>
);
};
Expand Down
17 changes: 16 additions & 1 deletion frontend/src/components/InvoiceTable/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,31 @@

.invoiceTable {
margin-top: 30px;
margin-bottom: 80px;
}

.invoiceTable .editable-row-dark {
background-color: #F6F6F6;
}

.invoiceTable .ant-table-tbody > tr.ant-table-row-selected td {
background-color: #CAD3FF !important;
}

.invoiceTable .ant-table-selection-column {
padding-left: 20px;
padding-right: 20px;
}

.invoiceTable .ant-table-container {
border: none;
}

.subtaskInvoiceLabel {
font-size: 12px;
color: #627BF6;
}

.addService {
display: flex;
align-items: center;
Expand Down Expand Up @@ -97,5 +112,5 @@ So try and beat it with CSS specificity */
}

.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th{
border-right: none;
border-right: none;
}
9 changes: 6 additions & 3 deletions frontend/src/components/InvoiceTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const InvoiceTable = () => {
editable: false,
render: (_, record) =>
dataSource.length >= 1 ? (
<div>SOW-{record.task_id ?? record.fk_task_id ?? record.task_uuid}</div>
<div>
<div>SOW-{record.task_id ?? record.fk_task_id ?? record.task_uuid}</div>
{record.subtask_id ? <span className="subtaskInvoiceLabel">Subtask-{record.subtask_id}</span> : null}
</div>
) : null,
sorter: (a, b) => (a.task_id ?? a.fk_task_id ?? 0) - (b.task_id ?? b.fk_task_id ?? 0)
},
Expand All @@ -31,8 +34,8 @@ const InvoiceTable = () => {
},
{
title: "Project",
dataIndex: "billable_id",
key: "billable_id",
dataIndex: "fk_project_id",
key: "fk_project_id",
editable: false,
},
{
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/InvoiceTotal/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
align-items: center;
background-color: #f5f5f5;
border-radius: 10px;
height: 73px;
height: 70px;
width: 100%;
padding: 0 1rem;
}

.invoice-total-container {
display: flex;
margin: 0 1rem;
align-items: center;
margin: 0 2rem;
justify-content: space-between;
align-items: center;
width: 100%;
Expand All @@ -25,4 +26,11 @@
font-size: 1.8em;
font-weight: 700;
font-style: bold;
margin-right: 5px;
}

.TotalStat {
display: flex;
justify-content: center;
align-items: center;
}
65 changes: 34 additions & 31 deletions frontend/src/components/InvoiceTotal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,43 @@ const InvoiceTotal = () => {
return (
<div className="InvoiceTotal">
<div className="invoice-total-container">
<div className="TotalServices"
onClick={() => {
dispatch({ type: SET_ACTIVE_ANALYTICS });
dispatch({
type: UPDATE_CLICKS,
payload: {
component_name: "services_chart"
},
});
}}>
<span className="total-number" >{totalServices}</span> Total Services
<div className="TotalStat"
onClick={() => {
dispatch({ type: SET_ACTIVE_ANALYTICS });
dispatch({
type: UPDATE_CLICKS,
payload: {
component_name: "services_chart"
},
});
}}>
<span className="total-number">
{totalServices}
</span>
Total Services
</div>
<div className="TotalSows"
onClick={() => {
dispatch({ type: SET_ACTIVE_SOW_ANALYTICS });
dispatch({
type: UPDATE_CLICKS,
payload: {
component_name: "sow_chart"
},
});
}}>
<div className="TotalStat"
onClick={() => {
dispatch({ type: SET_ACTIVE_SOW_ANALYTICS });
dispatch({
type: UPDATE_CLICKS,
payload: {
component_name: "sow_chart"
},
});
}}>
<span className="total-number">{Object.keys(sowMap).length}</span> Total SOWs
</div>
<div className="TotalProjects"
onClick={() => {
dispatch({ type: SET_ACTIVE_PROJECT_ANALYTICS });
dispatch({
type: UPDATE_CLICKS,
payload: {
component_name: "projects_chart"
},
});
}}>
<div className="TotalStat"
onClick={() => {
dispatch({ type: SET_ACTIVE_PROJECT_ANALYTICS });
dispatch({
type: UPDATE_CLICKS,
payload: {
component_name: "projects_chart"
},
});
}}>
<span className="total-number">{Object.keys(projectMap).length}</span> Total Projects
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/ProjectTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ProjectTable = () => {
render: (_, record) =>
dataSource.length >= 1 ? (
<Select
mode="multiple"
mode={null}
allowClear
style={{ width: "100%" }}
placeholder="Please select"
Expand All @@ -48,7 +48,8 @@ const ProjectTable = () => {
value: costcenter.cost_center_id,
};
})}
onChange={(newList) => {
onChange={(selection) => {
const newList = [selection];
dispatch({
type: UPDATE_PROJECT_ASSIGNMENT,
payload: {
Expand Down
Loading

0 comments on commit 5ea7ecf

Please sign in to comment.