Compare commits

...

1 Commits

Author SHA1 Message Date
sonali d63ed80855 " mew changes in ui " 2024-12-25 18:28:03 +05:30
36 changed files with 1528 additions and 1426 deletions

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="" /> <meta name="description" content="" />
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;600&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
@ -29,14 +29,14 @@
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> --> <!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> -->
<style> <style>
body { body {
background-color: #E9ECFF; background-color: #f9fff6;
background-image: url('../src/assets/Image/Pattern.png'); background-image: url('../src/assets/Image/Pattern.png');
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-blend-mode: overlay; background-blend-mode: overlay;
font-family: Manrope; font-family: 'Comfortaa', sans-serif;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

View File

@ -144,7 +144,7 @@ body {
align-items: center; align-items: center;
} }
.nav-link { .nav-link {
font-family: "Manrope"; font-family: 'Comfortaa', sans-serif;
font-size: 16px !important; font-size: 16px !important;
color: #002300; color: #002300;
@ -306,7 +306,25 @@ body {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
margin-left: 80%;
position: absolute;
/* margin-left: 140px; */
top: 100%; /* Positions dropdown below the parent */
left: 0;
background-color: #FFFFFF;
border: 1px solid #F6F6F6;
z-index: 1000;
border-radius: 10px;
min-width: 120px; /* Optional minimum width */
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
}
.nav-menu-drop {
list-style-type: none;
padding: 0;
margin: 0;
position: absolute; position: absolute;
/* margin-left: 140px; */ /* margin-left: 140px; */
top: 100%; /* Positions dropdown below the parent */ top: 100%; /* Positions dropdown below the parent */
@ -501,6 +519,7 @@ body {
height: 50px; height: 50px;
background: #f4f4f4; background: #f4f4f4;
border-radius: 50px; border-radius: 50px;
border: none; border: none;
padding-left: 40px; padding-left: 40px;
font-size: 16px; font-size: 16px;
@ -514,8 +533,8 @@ body {
} }
.search-container-icon { .search-container-icon {
position: absolute; position: absolute;
left: 10px; left: 12px;
top: 50%; top: 47%;
transform: translateY(-50%); transform: translateY(-50%);
pointer-events: none; pointer-events: none;
} }
@ -725,6 +744,7 @@ h3 {
box-shadow: none; box-shadow: none;
outline: none; outline: none;
width: auto; width: auto;
height: 42px; height: 42px;
padding: 8px 12px; padding: 8px 12px;
font-size: 16px; font-size: 16px;

View File

@ -318,7 +318,7 @@ const ATMDepositTable = (props) => {
style={{ style={{
backgroundColor: "#fff8e6", backgroundColor: "#fff8e6",
border: "1px solid #ffd700", border: "1px solid #ffd700",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -341,7 +341,7 @@ const ATMDepositTable = (props) => {
style={{ style={{
backgroundColor: "#e6ffee", backgroundColor: "#e6ffee",
border: "1px solid #00b300", border: "1px solid #00b300",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -364,7 +364,7 @@ const ATMDepositTable = (props) => {
style={{ style={{
backgroundColor: "#ffe6e6", backgroundColor: "#ffe6e6",
border: "1px solid #ff4d4d", border: "1px solid #ff4d4d",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",

View File

@ -737,18 +737,20 @@ function AddInvoice() {
> >
Pay Invoice Pay Invoice
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/bankDeposit')}
>
Bank Deposit
</button>
<button <button
className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`} className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/atmDeposit')} onClick={() => handleLinkClick('/atmDeposit')}
> >
ATM Deposit ATM Deposit
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/bankDeposit')}
>
Bank Deposit
</button>
</div> </div>
</div> </div>
<div className="formcontainer"> <div className="formcontainer">

View File

@ -148,7 +148,7 @@ function AtmDeposit() {
<div className="dashboard-container"> <div className="dashboard-container">
<ToastContainer /> <ToastContainer />
<div className="d-flex justify-content-between mb-4"> <div className="d-flex justify-content-between mb-4">
<div className="button-groups"> <div className="button-groups">
<button <button
className={`btn ${activeButton === '/' ? 'active' : ''}`} className={`btn ${activeButton === '/' ? 'active' : ''}`}
onClick={() => handleLinkClick('/')} onClick={() => handleLinkClick('/')}
@ -161,18 +161,20 @@ function AtmDeposit() {
> >
Pay Invoice Pay Invoice
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/bankDeposit')}
>
Bank Deposit
</button>
<button <button
className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`} className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/atmDeposit')} onClick={() => handleLinkClick('/atmDeposit')}
> >
ATM Deposit ATM Deposit
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/bankDeposit')}
>
Bank Deposit
</button>
</div> </div>
</div> </div>
<div className="formcontainer"> <div className="formcontainer">

View File

@ -156,33 +156,35 @@ function BankDeposit() {
<div className="dashboard-container"> <div className="dashboard-container">
<ToastContainer /> <ToastContainer />
<div className="d-flex justify-content-between mb-4"> <div className="d-flex justify-content-between mb-4">
<div className="button-groups"> <div className="button-groups">
<button <button
className={`btn ${activeButton === '/' ? 'active' : ''}`} className={`btn ${activeButton === '/' ? 'active' : ''}`}
onClick={() => handleLinkClick('/')} onClick={() => handleLinkClick('/')}
> >
Add Invoice Add Invoice
</button> </button>
<button <button
className={`btn ${activeButton === '/payInvoice' ? 'active' : ''}`} className={`btn ${activeButton === '/payInvoice' ? 'active' : ''}`}
onClick={() => handleLinkClick('/payInvoice')} onClick={() => handleLinkClick('/payInvoice')}
> >
Pay Invoice Pay Invoice
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`} <button
onClick={() => handleLinkClick('/bankDeposit')} className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`}
> onClick={() => handleLinkClick('/atmDeposit')}
Bank Deposit >
</button> ATM Deposit
<button </button>
className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/atmDeposit')} <button
> className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
ATM Deposit onClick={() => handleLinkClick('/bankDeposit')}
</button> >
</div> Bank Deposit
</div> </button>
</div>
</div>
<div className="formcontainer"> <div className="formcontainer">
<div <div
className="container" className="container"

View File

@ -323,7 +323,7 @@ const BankDepositTable = (props) => {
style={{ style={{
backgroundColor: "#fff8e6", backgroundColor: "#fff8e6",
border: "1px solid #ffd700", border: "1px solid #ffd700",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -346,7 +346,7 @@ const BankDepositTable = (props) => {
style={{ style={{
backgroundColor: "#e6ffee", backgroundColor: "#e6ffee",
border: "1px solid #00b300", border: "1px solid #00b300",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -369,7 +369,7 @@ const BankDepositTable = (props) => {
style={{ style={{
backgroundColor: "#ffe6e6", backgroundColor: "#ffe6e6",
border: "1px solid #ff4d4d", border: "1px solid #ff4d4d",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",

View File

@ -23,12 +23,9 @@
background-color: #ffffff; background-color: #ffffff;
width: auto; width: auto;
border-radius: 44px; border-radius: 44px;
padding: 10px 50px; padding: 10px 20px; /* Equal padding on left and right sides */
} }
/* Active button styles */ /* Active button styles */
.btn.active { .btn.active {
background-color: #ffaf32; /* Yellow background */ background-color: #ffaf32; /* Yellow background */
@ -131,6 +128,7 @@
background-color: #ffffff; background-color: #ffffff;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 10px;
} }
.pgbtn { .pgbtn {
@ -139,7 +137,7 @@
border: #ced4da; border: #ced4da;
width: 30px; width: 30px;
height: 30px; height: 30px;
border-radius: 30px; border-radius: 50%;
} }
.active-pgbtn { .active-pgbtn {
@ -147,7 +145,7 @@
border: 1px solid #00230007; border: 1px solid #00230007;
width: 30px; width: 30px;
height: 30px; height: 30px;
border-radius: 30px; border-radius: 50%;
} }
.filterbutton { .filterbutton {

View File

@ -298,7 +298,7 @@ const InvoiceTable = ({ reloadData }) => {
style={{ style={{
backgroundColor: "#fff8e6", backgroundColor: "#fff8e6",
border: "1px solid #ffd700", border: "1px solid #ffd700",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -321,7 +321,7 @@ const InvoiceTable = ({ reloadData }) => {
style={{ style={{
backgroundColor: "#e6ffee", backgroundColor: "#e6ffee",
border: "1px solid #00b300", border: "1px solid #00b300",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -344,7 +344,7 @@ const InvoiceTable = ({ reloadData }) => {
style={{ style={{
backgroundColor: "#ffe6e6", backgroundColor: "#ffe6e6",
border: "1px solid #ff4d4d", border: "1px solid #ff4d4d",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",

View File

@ -301,7 +301,7 @@ function PayInvoice() {
return ( return (
<div className="dashboard-container"> <div className="dashboard-container">
<div className="d-flex justify-content-between mb-4"> <div className="d-flex justify-content-between mb-4">
<div className="button-groups"> <div className="button-groups">
<button <button
className={`btn ${activeButton === '/' ? 'active' : ''}`} className={`btn ${activeButton === '/' ? 'active' : ''}`}
onClick={() => handleLinkClick('/')} onClick={() => handleLinkClick('/')}
@ -314,18 +314,20 @@ function PayInvoice() {
> >
Pay Invoice Pay Invoice
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/bankDeposit')}
>
Bank Deposit
</button>
<button <button
className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`} className={`btn ${activeButton === '/atmDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/atmDeposit')} onClick={() => handleLinkClick('/atmDeposit')}
> >
ATM Deposit ATM Deposit
</button> </button>
<button
className={`btn ${activeButton === '/bankDeposit' ? 'active' : ''}`}
onClick={() => handleLinkClick('/bankDeposit')}
>
Bank Deposit
</button>
</div> </div>
</div> </div>
<div className="formcontainer"> <div className="formcontainer">

View File

@ -326,7 +326,7 @@ const PayInvoiceTable = ({ onEdit, reloadData }) => {
style={{ style={{
backgroundColor: "#fff8e6", backgroundColor: "#fff8e6",
border: "1px solid #ffd700", border: "1px solid #ffd700",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -349,7 +349,7 @@ const PayInvoiceTable = ({ onEdit, reloadData }) => {
style={{ style={{
backgroundColor: "#e6ffee", backgroundColor: "#e6ffee",
border: "1px solid #00b300", border: "1px solid #00b300",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
@ -372,7 +372,7 @@ const PayInvoiceTable = ({ onEdit, reloadData }) => {
style={{ style={{
backgroundColor: "#ffe6e6", backgroundColor: "#ffe6e6",
border: "1px solid #ff4d4d", border: "1px solid #ff4d4d",
borderRadius: "8px", borderRadius: "20px",
padding: "16px 24px", padding: "16px 24px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",

View File

@ -626,143 +626,89 @@ export default function Expense() {
return ( return (
<div className="main-container"> <div className="main-container">
<div className="d-flex p-2"> <div className="d-flex p-2 ">
<div className="expensecontainer d-flex flex-column pd-2"> <div className="expensecontainer d-flex flex-column pd-2 ">
<div className="d-flex align-items-center mb-3" style={{ gap: "10px" }}> <div
<button className="btn cus d-flex align-items-center" onClick={toggleModal}> className="d-flex align-items-center mb-3"
style={{
justifyContent: "space-between",
gap: "10px",
marginBottom: "10px",
}}
>
{/* Title on the left */}
<h3 className="mb-1" style={{ margin: "0" }}>Expense</h3>
+ Add Invoice {/* Buttons on the right */}
<img <div className="d-flex align-items-center" style={{ gap: "10px" }}>
src={invoiceIcon}
alt="Invoice Icon"
style={{ width: "20px", height: "20px", marginLeft: "8px" }} <button
/> style={{
</button> backgroundColor: "#4A5546",
boxShadow: "none",
outline: "none",
<button style={{ width: "auto",
backgroundColor: "#4A5546", height: "42px",
boxShadow: "none", padding: "8px 12px",
outline: "none", fontSize: "14px",
width: "auto", border: "none",
height: "42px", borderRadius: "10px",
padding: "8px 12px", color: "#F4FFEE",
fontSize: "16px", cursor: "pointer",
border: "none", }}
borderRadius: "10px", >
color: "#F4FFEE", Add Expense Type
cursor: "pointer", <img
}}> src={expensetype}
alt="Expense Type Icon"
+ Add New Vendor style={{ width: "20px", height: "20px", marginLeft: "8px" }}
<img />
src={vendor} </button>
alt="Invoice Icon" <button
style={{ width: "20px", height: "20px", marginLeft: "8px" }} style={{
/> backgroundColor: "#4A5546",
</button> boxShadow: "none",
<button style={{ outline: "none",
backgroundColor: "#4A5546", width: "auto",
boxShadow: "none", height: "42px",
outline: "none", padding: "8px 12px",
width: "auto", fontSize: "14px",
height: "42px", border: "none",
padding: "8px 12px", borderRadius: "10px",
fontSize: "16px", color: "#F4FFEE",
border: "none", cursor: "pointer",
borderRadius: "10px", }}
color: "#F4FFEE", >
cursor: "pointer", Add New Vendor
}} <img
> src={vendor}
+ Add Expense Type alt="Vendor Icon"
<img style={{ width: "20px", height: "20px", marginLeft: "8px" }}
src={expensetype} />
alt="Invoice Icon" </button>
style={{ width: "20px", height: "20px", marginLeft: "8px" }} <button
/> className="btn cus d-flex align-items-center" onClick={toggleModal}
</button> style={{
<div width: "180px",
style={{ height: "42px",
display: "flex",
gap: "16px", justifyContent:"center",
justifyContent: "center", textAlign:'center',
alignItems: "center",
margin: "20px", }}
}} >
> Add Invoice
{/* Invoice due this month */} <img
<div src={invoiceIcon}
style={{ alt="Invoice Icon"
backgroundColor: "#fff8e6", style={{ width: "20px", height: "20px", marginLeft: "8px" }}
border: "1px solid #ffd700", />
borderRadius: "8px", </button>
padding: "16px 24px", </div>
display: "flex", </div>
flexDirection: "column",
justifyContent: "center",
alignItems: "flex-start",
width: "300px",
textAlign: "left",
}}
>
<p style={{ fontSize: "24px", fontWeight: "bold", margin: "0" }}>
$500
</p>
<p style={{ fontSize: "14px", color: "#555", margin: "4px 0" }}>
Invoice due this month
</p>
</div>
{/* Last 7 days sale */}
<div
style={{
backgroundColor: "#e6ffee",
border: "1px solid #00b300",
borderRadius: "8px",
padding: "16px 24px",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "flex-start",
width: "300px",
textAlign: "left",
}}
>
<p style={{ fontSize: "24px", fontWeight: "bold", margin: "0" }}>
$1900
</p>
<p style={{ fontSize: "14px", color: "#555", margin: "4px 0" }}>
Last 7 days sale
</p>
</div>
{/* Expense this month */}
<div
style={{
backgroundColor: "#ffe6e6",
border: "1px solid #ff4d4d",
borderRadius: "8px",
padding: "16px 24px",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "flex-start",
width: "300px",
textAlign: "left",
}}
>
<p style={{ fontSize: "24px", fontWeight: "bold", margin: "0" }}>
$0.00
</p>
<p style={{ fontSize: "14px", color: "#555", margin: "4px 0" }}>
Expense this month
</p>
</div>
</div>
</div>
@ -796,11 +742,11 @@ export default function Expense() {
className="modal-container" className="modal-container"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
style={{ style={{
width: "1200px", width: "1800px",
backgroundColor: "white", backgroundColor: "white",
margin: "100px auto", margin: "100px auto",
padding: "20px", // padding: "2px",
borderRadius: "8px", borderRadius: "30px",
position: "relative", position: "relative",
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)", boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
}} }}
@ -830,8 +776,8 @@ export default function Expense() {
</div> </div>
<div className="modal-body"> <div className="modal-body">
<form> <form>
<div className="form-row form-group col-md-12 position-relative d-flex"> <div className="form-row form-group col-md-12 position-relative d-flex gap-3">
<div className="col-md-3" style={{ paddingRight: "10px" }}> <div className="col-md-3 " style={{ paddingRight: "10px" }}>
<input <input
style={{ style={{
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
@ -872,7 +818,7 @@ export default function Expense() {
/> />
</div> </div>
<div className="col-md-6" style={{ paddingRight: "10px" }}> <div className="col-md-5" style={{ paddingRight: "10px" }}>
<select <select
style={{ style={{
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
@ -910,7 +856,7 @@ export default function Expense() {
</div> </div>
</div> </div>
<div className="d-flex col-md-12"> <div className="d-flex align-items-center justify-content-center col-md-12 gap-3">
<div className="col-md-3" style={{ paddingRight: "10px" }}> <div className="col-md-3" style={{ paddingRight: "10px" }}>
<select <select
@ -939,7 +885,7 @@ export default function Expense() {
</div> </div>
<div <div
className="form-row d-flex col-md-3 " className="form-row d-flex col-md-3"
style={{ style={{
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
border: "none", // Remove all borders border: "none", // Remove all borders
@ -997,7 +943,7 @@ export default function Expense() {
padding: '10px 10px', padding: '10px 10px',
width: 'fit-content', width: 'fit-content',
borderRadius: '40px', borderRadius: '40px',
// marginTop:'20px', marginTop:'10px',
display: 'flex', // Use flexbox display: 'flex', // Use flexbox
gap: '10px', // Add spacing between the options gap: '10px', // Add spacing between the options
}} }}
@ -1018,7 +964,7 @@ export default function Expense() {
style={{ style={{
backgroundColor: formData.pay_method_status === 'pay_later' ? '#4a5546' : 'transparent', backgroundColor: formData.pay_method_status === 'pay_later' ? '#4a5546' : 'transparent',
color: formData.pay_method_status === 'pay_later' ? '#fff' : '#000', color: formData.pay_method_status === 'pay_later' ? '#fff' : '#000',
padding: '5px 10px', padding: '5px 5px',
borderRadius: '20px', borderRadius: '20px',
}} }}
@ -1042,7 +988,7 @@ export default function Expense() {
style={{ style={{
backgroundColor: formData.pay_method_status === 'pay_now' ? '#4a5546' : 'transparent', backgroundColor: formData.pay_method_status === 'pay_now' ? '#4a5546' : 'transparent',
color: formData.pay_method_status === 'pay_now' ? '#fff' : '#000', color: formData.pay_method_status === 'pay_now' ? '#fff' : '#000',
padding: '5px 10px', padding: '5px 5px',
borderRadius: '20px', borderRadius: '20px',
}} }}
@ -1066,7 +1012,7 @@ export default function Expense() {
style={{ style={{
backgroundColor: formData.pay_method_status === 'credit_invoice' ? '#4a5546' : 'transparent', backgroundColor: formData.pay_method_status === 'credit_invoice' ? '#4a5546' : 'transparent',
color: formData.pay_method_status === 'credit_invoice' ? '#fff' : '#000', color: formData.pay_method_status === 'credit_invoice' ? '#fff' : '#000',
padding: '5px 10px', padding: '5px 5px',
borderRadius: '20px', borderRadius: '20px',
}} }}
@ -1084,7 +1030,7 @@ export default function Expense() {
className="d-flex col-md-6 mb-3" className="d-flex col-md-6 mb-3"
style={{ style={{
border: '2px solid #ACB4AA', border: '2px solid #ACB4AA',
padding: '10px 10px', padding: '5px 5px',
width: 'fit-content', width: 'fit-content',
borderRadius: '40px', borderRadius: '40px',
display: 'flex', // Use flexbox for inner items display: 'flex', // Use flexbox for inner items
@ -1104,7 +1050,7 @@ export default function Expense() {
backgroundColor: formData.pay_method === method.value ? "#4a5546" : "transparent", backgroundColor: formData.pay_method === method.value ? "#4a5546" : "transparent",
color: formData.pay_method === method.value ? "white" : "black", color: formData.pay_method === method.value ? "white" : "black",
padding: '5px 10px', // Add padding for better appearance padding: '5px 5px', // Add padding for better appearance
borderRadius: '20px', // Optional: Round the corners of the label borderRadius: '20px', // Optional: Round the corners of the label
cursor: "pointer", cursor: "pointer",
}} }}
@ -1134,7 +1080,7 @@ export default function Expense() {
onChange={handleChange} onChange={handleChange}
style={{ style={{
backgroundColor: "#fff", backgroundColor: "#fff",
border: "none", // Remove all borders border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius borderRadius: "0px", // Remove border radius

View File

@ -13,4 +13,6 @@
font-size: 22px; font-size: 22px;
font-weight: 600; font-weight: 600;
color: #000; color: #000;
text-align: center; /* Center the text */
width: 100%; /* Ensure it spans the full width */
} }

View File

@ -6,6 +6,9 @@ import useApi from "../../../../utils/api-manager/Helper/useApi";
import AuthContext from "../../.././../utils/secure-route/AuthContext"; import AuthContext from "../../.././../utils/secure-route/AuthContext";
import SettingTable from "../ManageSettings/SettingTable"; import SettingTable from "../ManageSettings/SettingTable";
import Swal from "sweetalert2"; import Swal from "sweetalert2";
import atmdeposite from "../../../../assets/Image/Atm Deposite.png"
export default function GeneralLedgerATM() { export default function GeneralLedgerATM() {
const { user } = useContext(AuthContext); const { user } = useContext(AuthContext);
@ -249,9 +252,21 @@ export default function GeneralLedgerATM() {
<ToastContainer /> <ToastContainer />
<div className="due-days"> <div className="due-days">
<div className="header-row mb-4"> <div className="header-row mb-4">
<div className="setting-title">ATM Deposit</div> <div className="setting-title" style={{marginLeft:"8px"}}>ATM Deposit</div>
<button className="gas-invoice-add-button" onClick={toggleModal}> <button className="btn cus d-flex align-items-center" style={{
+ Add ATM Deposit width: "250px",
height: "48px",
justifyContent:"center"
// justifyContent:"center",
// textAlign:'center',
}} onClick={toggleModal}>
Add ATM Deposit
<img
src={atmdeposite}
alt="Atm Deposite Icon"
style={{ width: "30px", height: "30px", marginLeft: "18px" }}
/>
</button> </button>
</div> </div>
@ -275,7 +290,7 @@ export default function GeneralLedgerATM() {
backgroundColor: "white", backgroundColor: "white",
margin: "100px auto", margin: "100px auto",
// padding: "20px", // padding: "20px",
borderRadius: "8px", borderRadius: "40px",
position: "relative", position: "relative",
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)", boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
}} }}
@ -306,28 +321,80 @@ export default function GeneralLedgerATM() {
</div> </div>
<div className="modal-body"> <div className="modal-body">
<form onSubmit={handleAtmDeposit}> <form onSubmit={handleAtmDeposit}>
<div className="form-row form-group col-md-5 position-relative"> <div className="form-row">
<input {/* Date Input Field */}
style={{
backgroundColor: "#0023000C",
borderRadius: "10px",
height: "52px", {/* Amount Input Field */}
}} <div className="form-group col-12">
type="date" <div
className="form-control" className="d-flex gap-3 align-items-center"
name="date" style={{ display: "flex", justifyContent: "space-between" }}
value={formData.date} >
onChange={handleDateChange} {/* Date Input */}
required <input
/> style={{
</div> backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
height: "52px",
flex: 1, // Flex-grow to manage space
}}
type="date"
className="form-control"
name="date"
value={formData.date}
onChange={handleDateChange}
required
/>
{/* Amount Input */}
<div
className="input-group"
style={{
backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
height: "52px",
flex: 1, // Flex-grow to manage space
}}
>
<input
type="text"
name="amount"
className="form-control sampletext"
value={formData.amount}
onChange={handleChange}
placeholder="Amount"
aria-label="Amount"
aria-describedby="addon-wrapping"
onInput={(e) => {
// Allow only numbers and a decimal point with two digits after it
e.target.value = e.target.value
.replace(/[^0-9.]/g, "") // Remove non-numeric characters except the decimal point
.replace(/^(\d*\.?\d{0,2}).*/g, "$1") // Allow only two decimal places
.slice(0, 12); // Limit input length (10 digits + 1 decimal + 2 decimal places)
}}
/>
</div>
</div>
</div>
<div className="d-flex col-md-12"> <div className="d-flex col-md-12">
<div className="form-row d-flex col-md-6"> <div className="form-row d-flex col-md-6">
<select <select
style={{ style={{
backgroundColor: "#0023000C", backgroundColor: "#ffffff",
borderRadius: "10px", backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
height: "52px", height: "52px",
}} }}
className="form-control" className="form-control"
@ -337,7 +404,7 @@ export default function GeneralLedgerATM() {
onChange={handleChange} onChange={handleChange}
required required
> >
<option value="">Type</option> <option value="">Cash Type</option>
<option value="Business cash">Business Cash</option> <option value="Business cash">Business Cash</option>
<option value="Gas cash">Gas Cash</option> <option value="Gas cash">Gas Cash</option>
<option value="Lottery cash">Lottery Cash</option> <option value="Lottery cash">Lottery Cash</option>
@ -499,6 +566,7 @@ export default function GeneralLedgerATM() {
)} )}
</div> </div>
</div> </div>
)} )}
<div className="form-row d-flex col-md-12"> <div className="form-row d-flex col-md-12">
<textarea <textarea
@ -513,56 +581,7 @@ export default function GeneralLedgerATM() {
></textarea> ></textarea>
</div> </div>
<div className="form-row d-flex col-md-6 ">
<div class="containercolor">
<div
class="input-group col-md-6 p-2 mt-2"
style={{
backgroundColor: "#0023000C",
borderRadius: "10px",
height: "52px",
border: "1px lightgray solid",
}}
>
<div
class="input-group-prepend"
style={{
background: "#F5F5F5",
height: "100%",
borderRadius: "10px 0 0 10px",
display: "flex",
alignItems: "center",
}}
>
<span
class="input-group-text prefixtext"
style={{
border: "none",
fontSize: "14px",
}}
>
USD
</span>
</div>
<input
type="text"
name="amount"
className="form-control sampletext"
value={formData.amount}
onChange={handleChange}
placeholder="Amount"
aria-label="Username"
aria-describedby="addon-wrapping"
onInput={(e) => {
// Allow only numbers and a decimal point with two digits after it
e.target.value = e.target.value
.replace(/[^0-9.]/g, '') // Remove non-numeric characters except the decimal point
.replace(/^(\d*\.?\d{0,2}).*/g, '$1') // Allow only two decimal places
.slice(0, 12); // Limit input length (10 digits + 1 decimal + 2 decimal places)
}}
/>
</div>
</div>
</div> </div>
<div className="modal-footer" style={{ border: "none" }}> <div className="modal-footer" style={{ border: "none" }}>
<button <button

View File

@ -7,6 +7,8 @@ import AuthContext from "../../.././../utils/secure-route/AuthContext";
import SettingTable from "../ManageSettings/SettingTable"; import SettingTable from "../ManageSettings/SettingTable";
import "./GeneralLedger.css"; import "./GeneralLedger.css";
import Swal from "sweetalert2"; import Swal from "sweetalert2";
import bankdeposite from '../../../../assets/Image/Bank Deposite .png'
export default function GeneralLedgerBank() { export default function GeneralLedgerBank() {
const { user } = useContext(AuthContext); const { user } = useContext(AuthContext);
@ -275,11 +277,19 @@ export default function GeneralLedgerBank() {
<div className="header-row mb-4"> <div className="header-row mb-4">
<div className="setting-title">Bank Deposit</div> <div className="setting-title">Bank Deposit</div>
<button <button
className="gas-invoice-add-button-bank-deposit" className="btn cus d-flex align-items-center"
onClick={openAddModal} onClick={openAddModal}
style={{ Width: "200px" }} style={{ width: "250px",
height: "48px",
justifyContent:"center" }}
> >
+ Add Bank Deposit Add Bank Deposit
<img
src={bankdeposite}
alt="Bank Deposite Icon"
style={{ width: "30px", height: "30px", marginLeft: "18px" }}
/>
</button> </button>
</div> </div>

View File

@ -8,7 +8,7 @@ import AuthContext from "../../.././../utils/secure-route/AuthContext";
import SettingTable from "../ManageSettings/SettingTable"; import SettingTable from "../ManageSettings/SettingTable";
import "./GeneralLedger.css"; import "./GeneralLedger.css";
import Swal from "sweetalert2"; import Swal from "sweetalert2";
import otherincome from '../../../../assets/Image/other income.png'
export default function GeneralLedgerOtherIncome() { export default function GeneralLedgerOtherIncome() {
const { user } = useContext(AuthContext); const { user } = useContext(AuthContext);
@ -300,11 +300,18 @@ export default function GeneralLedgerOtherIncome() {
<div className="header-row mb-4"> <div className="header-row mb-4">
<div className="setting-title">Other Income</div> <div className="setting-title">Other Income</div>
<button <button
className="gas-invoice-add-button-bank-deposit" className="btn cus d-flex align-items-center"
onClick={handleAddOtherIncome} onClick={handleAddOtherIncome}
style={{ Width: "200px" }} style={{ width: "250px",
height: "48px",
justifyContent:"center" }}
> >
+ Add Other Income Add Other Income
<img
src={otherincome}
alt="Bank Deposite Icon"
style={{ width: "30px", height: "30px", marginLeft: "18px" }}
/>
</button> </button>
</div> </div>

View File

@ -4,6 +4,10 @@ import SettingTable from "../ManageSettings/SettingTable";
import useApi from "../../../../utils/api-manager/Helper/useApi"; import useApi from "../../../../utils/api-manager/Helper/useApi";
import AuthContext from "../../.././../utils/secure-route/AuthContext"; import AuthContext from "../../.././../utils/secure-route/AuthContext";
import { toast,ToastContainer } from "react-toastify"; import { toast,ToastContainer } from "react-toastify";
import prepaid from '../../../../assets/Image/prepaid.png'
export default function GeneralLedgerSalesTax() { export default function GeneralLedgerSalesTax() {
// const [billDate, setBillDate] = useState("2024-09-20"); // Example default date // const [billDate, setBillDate] = useState("2024-09-20"); // Example default date
// const dateInputRef = useRef(null); // const dateInputRef = useRef(null);
@ -126,9 +130,18 @@ export default function GeneralLedgerSalesTax() {
<div className="expensecontainer d-flex flex-column pd-2"> <div className="expensecontainer d-flex flex-column pd-2">
<div className="d-flex justify-content-between align-items-center mb-3"> <div className="d-flex justify-content-between align-items-center mb-3">
<h3 className="mb-1">Sales Tax</h3> <h3 className="mb-1">Sales Tax</h3>
<button className="btn btn-primary cus" onClick={toggleModal}> <button className="btn cus d-flex align-items-center"
style={{ width: "250px",
height: "48px",
justifyContent:"center" }}
onClick={toggleModal}>
{" "} {" "}
+ Add Prepaid Tax Add Prepaid Tax
<img
src={prepaid}
alt="Bank Deposite Icon"
style={{ width: "30px", height: "30px", marginLeft: "18px" }}
/>
</button> </button>
</div> </div>

View File

@ -206,7 +206,7 @@ const PayrollTable = ({
<div className="data-table-container"> <div className="data-table-container">
<div className="d-flex mb-3"> <div className="d-flex mb-3">
<div className="expense-searchcontainerstart d-flex"> <div className="expense-searchcontainerstart d-flex">
<div className="search-container" <div className="search-container"
> >
<input <input
type="text" type="text"
@ -241,88 +241,67 @@ const PayrollTable = ({
</button> </button>
{/* <button className="btn custbtn2" type="submit">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
style={{ marginRight: "3px" }}
>
<g opacity="0.8">
<path
d="M19 3H5C3.586 3 2.879 3 2.44 3.412C2.001 3.824 2 4.488 2 5.815V6.505C2 7.542 2 8.061 2.26 8.491C2.52 8.921 2.993 9.189 3.942 9.723L6.855 11.363C7.491 11.721 7.81 11.9 8.038 12.098C8.512 12.509 8.804 12.993 8.936 13.588C9 13.872 9 14.206 9 14.873V17.543C9 18.452 9 18.907 9.252 19.261C9.504 19.616 9.952 19.791 10.846 20.141C12.725 20.875 13.664 21.242 14.332 20.824C15 20.406 15 19.452 15 17.542V14.872C15 14.206 15 13.872 15.064 13.587C15.1896 13.0042 15.5059 12.4798 15.963 12.097C16.19 11.9 16.509 11.721 17.145 11.362L20.058 9.722C21.006 9.189 21.481 8.922 21.74 8.492C22 8.062 22 7.542 22 6.504V5.814C22 4.488 22 3.824 21.56 3.412C21.122 3 20.415 3 19 3Z"
stroke="white"
strokeWidth="1.5"
/>
</g>
</svg>
Filter
</button> */}
</div> </div>
<div style={{ marginRight: "58%" }}> <div style={{ marginRight: "1%" }}>
<div <div
className="expense-search d-flex align-items-center" className="expense-search align-items-center"
style={{
style={{ display: "flex",
display: "flex", alignItems: "center",
alignItems: "center", backgroundColor: "#FFFFFF",
backgroundColor: "#FFFFFF", border: "1px solid #DBDBDB",
border: "1px solid #DBDBDB", borderRadius: "10px",
borderRadius: "10px", cursor: "pointer",
// boxSizing: "border-box", width: "200px",
cursor: "pointer",
}}
width: "170px", >
gap: "10px", <span
}} style={{
> fontFamily: "'Comfortaa'",
<span fontStyle: "normal",
style={{ fontWeight: "400",
fontFamily: "'Comfortaa'", fontSize: "14px", // Compact text
fontStyle: "normal", color: "#000000",
fontWeight: "400", marginLeft:"10px"
fontSize: "16px", }}
padding: "5px", >
color: "#000000", Show Rows:
}} </span>
> <select
Show Rows: name="option"
</span> id="pageSelect"
<select className="selectoptions"
name="option" style={{
id="pageSelect" backgroundColor: "#282E26", // Match background color
className="selectoptions" color: "#FFFFFF", // White text color
style={{ fontFamily: "'Comfortaa'",
backgroundColor: "#282E26", fontStyle: "normal",
borderRadius: "0px 10px 10px 0px", fontWeight: "700",
color: "#F4FFEE", fontSize: "14px",
fontFamily: "'Comfortaa'", lineHeight: "16px",
fontStyle: "normal", padding: "4px 10px", // Adjust padding for the dropdown
fontWeight: "700", border: "none", // No border
fontSize: "16px", borderRadius: "0 10px 10px 0", // Rounded on the right side only
lineHeight: "18px", cursor: "pointer",
padding: "5px 8px", marginLeft: "auto", // Push to the right
border: "none", }}
cursor: "pointer", value={rowsPerPage}
}} onChange={(e) => {
value={rowsPerPage} setRowsPerPage(Number(e.target.value));
onChange={(e) => { setCurrentPage(1); // Reset to the first page on change
setRowsPerPage(Number(e.target.value)); }}
setCurrentPage(1); // Reset to the first page on change >
}} <option value={5}>5</option>
> <option value={10}>10</option>
<option value={5}>5</option> <option value={15}>15</option>
<option value={10}>10</option> <option value={20}>20</option>
<option value={15}>15</option> </select>
<option value={20}>20</option> </div>
</select>
</div>
</div>
</div>
</div> </div>
<table className="data-table custom-table "> <table className="data-table custom-table ">

View File

@ -132,7 +132,9 @@ function ManageDepartments() {
}} }}
required required
/> />
<button className="btn cus d-flex align-items-center" onClick={handleSaveDepartment}> <button className="btn d-flex align-items-center"
style={{width:"208px" , height:"33px" , backgroundColor: "#FFAF32" , borderRadius:"10px" , justifyContent:"center"}}
onClick={handleSaveDepartment}>
{editDepartmentId ? "Update Department" : " + Add Department"} {editDepartmentId ? "Update Department" : " + Add Department"}
</button> </button>
</div> </div>

View File

@ -1,6 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import React, { useState, useEffect, useContext } from "react"; import React, { useState, useEffect, useContext } from "react";
import ReusableModal from "./ReusableModal";
import useApi from "../../../../utils/api-manager/Helper/useApi"; import useApi from "../../../../utils/api-manager/Helper/useApi";
import AuthContext from "../../../../utils/secure-route/AuthContext"; import AuthContext from "../../../../utils/secure-route/AuthContext";
import "./Settings.css"; import "./Settings.css";
@ -8,17 +7,14 @@ import SettingTable from "./SettingTable";
import Swal from "sweetalert2"; import Swal from "sweetalert2";
import { toast, ToastContainer } from "react-toastify"; import { toast, ToastContainer } from "react-toastify";
function ManageExpenseType() { function ManageExpenseType() {
let { user } = useContext(AuthContext); let { user } = useContext(AuthContext);
const storeId = user.store; const storeId = user.store;
const [showModal, setShowModal] = useState(false);
const [isEditMode, setIsEditMode] = useState(false);
const [selectedExpenseType, setSelectedExpenseType] = useState(null);
const [expenseType, setExpenseType] = useState(""); const [expenseType, setExpenseType] = useState("");
const [expenseTypes, setExpenseTypes] = useState([]); const [expenseTypes, setExpenseTypes] = useState([]);
const [selectedExpenseTypeId, setSelectedExpenseTypeId] = useState(null); // Store the ID of the currently selected expense type
const { Get, Post, Put, Delete } = useApi(); const { Get, Post, Put, Delete } = useApi();
useEffect(() => { useEffect(() => {
const fetchExpenseTypes = async () => { const fetchExpenseTypes = async () => {
try { try {
@ -30,73 +26,56 @@ function ManageExpenseType() {
}; };
fetchExpenseTypes(); fetchExpenseTypes();
}, []); }, []);
const handleShow = () => {
setShowModal(true); const handleAddNew = () => {
setIsEditMode(false);
setSelectedExpenseType(null);
setExpenseType(""); setExpenseType("");
setSelectedExpenseTypeId(null); // Reset the selected ID
}; };
const handleEdit = (expenseType) => { const handleEdit = (expenseType) => {
setShowModal(true);
setIsEditMode(true);
setSelectedExpenseType(expenseType);
setExpenseType(expenseType.title); setExpenseType(expenseType.title);
setSelectedExpenseTypeId(expenseType.id); // Store the ID of the selected expense type
}; };
const handleClose = () => {
setShowModal(false);
setIsEditMode(false);
setSelectedExpenseType(null);
setExpenseType("");
};
const handleSave = async () => { const handleSave = async () => {
if (expenseType) { if (expenseType) {
try { try {
if (isEditMode && selectedExpenseType) { if (selectedExpenseTypeId) {
// Update existing expense type // Update existing expense type
const response = await Put( const response = await Put("vendorDepartmentServiceData", selectedExpenseTypeId, {
"vendorDepartmentServiceData", title: expenseType,
selectedExpenseType.id,
{ title: expenseType, store: storeId, type: "expense type" } // Send the data with store and type
);
if (response.status === 200) {
setExpenseTypes(
expenseTypes.map((et) =>
et.id === selectedExpenseType.id
? { ...et, title: expenseType }
: et
)
);
toast.success("Expense type updated successfully!");
} else {
console.error("Error updating expense type:", response.data);
toast.error("Error updating expense type: " + response.data);
}
} else {
// Add new expense type
const response = await Post("vendorDepartmentServiceData", {
store: storeId, store: storeId,
type: "expense type", type: "expense type",
title: expenseType,
}); });
if (response.status === 201) { if (response.status === 200) {
setExpenseTypes([...expenseTypes, response.data]); // Update the state with the edited expense type
setExpenseTypes(expenseTypes.map((et) =>
et.id === selectedExpenseTypeId ? { ...et, title: expenseType } : et
));
toast.success("Expense type updated successfully!");
}
} else {
// Add a new expense type
const response = await Post("vendorDepartmentServiceData", {
title: expenseType,
store: storeId,
type: "expense type",
});
if (response.status === 201) { // Assuming a 201 status code for successful creation
setExpenseTypes([...expenseTypes, response.data]); // Assuming response.data returns the new expense type
toast.success("Expense type added successfully!"); toast.success("Expense type added successfully!");
} else {
console.error("Error saving expense type:", response.data);
toast.error("Error saving expense type: " + response.data);
} }
} }
handleClose(); handleAddNew(); // Reset after saving (adding or updating)
} catch (error) { } catch (error) {
toast.error( toast.error("Error saving expense type: " + (error.response ? error.response.data : error.message));
isEditMode ? "Error updating expense type: " (error.response ? error.response.data : error.message) :
"Error saving expense type: " + (error.response ? error.response.data : error.message)
);
} }
} else { } else {
toast.warn("Expense type is required"); toast.warn("Expense type is required");
} }
}; };
const handleDelete = async (id) => { const handleDelete = async (id) => {
const result = await Swal.fire({ const result = await Swal.fire({
title: "Are you sure?", title: "Are you sure?",
@ -106,10 +85,9 @@ function ManageExpenseType() {
confirmButtonColor: "#d33", confirmButtonColor: "#d33",
cancelButtonColor: "#3085d6", cancelButtonColor: "#3085d6",
confirmButtonText: "Yes, delete it!", confirmButtonText: "Yes, delete it!",
}); });
// Check if the user clicked the confirm button if (!result.isConfirmed) return; // Exit if the user cancels
if (!result.isConfirmed) return; // Exit if the user cancels
try { try {
await Delete("vendorDepartmentServiceData", id); await Delete("vendorDepartmentServiceData", id);
setExpenseTypes(expenseTypes.filter((et) => et.id !== id)); setExpenseTypes(expenseTypes.filter((et) => et.id !== id));
@ -118,41 +96,16 @@ function ManageExpenseType() {
toast.error("Error deleting expense type: " + (error.response ? error.response.data : error.message)); toast.error("Error deleting expense type: " + (error.response ? error.response.data : error.message));
} }
}; };
const data = expenseTypes.filter((et) => et.type === "expense type"); const data = expenseTypes.filter((et) => et.type === "expense type");
const columns = [{ header: "Department / Expense Type", field: "title" }]; const columns = [{ header: "Department / Expense Type", field: "title" }];
return ( return (
<> <>
<div className="due-days"> <div className="" style={{ marginTop: "5%" }}>
<div className="header-row"> <div className="department-container">
<div className="setting-title">Manage Expense Type</div> <div className="input-container">
<div className="btn-position"> <div className="input-row">
<button className="vendor-add-button" onClick={handleShow}>
+ Add Expense Type
</button>
</div>
</div>
<SettingTable
data={data}
showFooter={true}
columns={columns}
showAction={true}
onEdit={handleEdit}
onDelete={handleDelete}
/>
<ReusableModal
show={showModal}
handleClose={handleClose}
title={isEditMode ? "Edit Expense Type" : "Add Expense Type"}
width="697px"
height="171px"
>
<form
onSubmit={(e) => {
e.preventDefault();
handleSave();
}}
>
<div className="form-group d-flex align-items-center ">
<input <input
type="text" type="text"
id="expenseTypeName" id="expenseTypeName"
@ -160,33 +113,40 @@ function ManageExpenseType() {
placeholder="Expense Type" placeholder="Expense Type"
value={expenseType} value={expenseType}
onChange={(e) => setExpenseType(e.target.value)} onChange={(e) => setExpenseType(e.target.value)}
style={{ width: "483px", marginRight: "10px" }} style={{ width: "483px", marginRight: "10px" ,
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
}}
/> />
<button <button
type="submit" type="button" // Prevent form submission
style={{ className="btn d-flex align-items-center"
padding: "6px 8px", style={{width:"208px" , height:"33px" , backgroundColor: "#FFAF32" , borderRadius:"10px" , justifyContent:"center"}}
backgroundColor: "#4545db",
color: "white", onClick={handleSave} // Call handleSave on button click
border: "none",
borderRadius: "40px",
cursor: "pointer",
width: "103px",
height: "42px",
fontSize: "18px",
marginLeft:"20px",
isEditMode
}}
> >
{isEditMode ? "Update" : "Submit"} {selectedExpenseTypeId ? "Update Expense" : "Add Expense Type"}
</button> </button>
</div> </div>
</form> </div>
</ReusableModal> </div>
<ToastContainer/> </div>
<div className="due-days">
<SettingTable
data={data}
showFooter={true}
columns={columns}
showAction={true}
onEdit={handleEdit} // Pass handleEdit to SettingTable
onDelete={handleDelete}
/>
<ToastContainer />
</div> </div>
</> </>
); );
} }
export default ManageExpenseType; export default ManageExpenseType;

View File

@ -280,10 +280,10 @@ const ManageSettings = () => {
confirmButtonColor: "#d33", confirmButtonColor: "#d33",
cancelButtonColor: "#3085d6", cancelButtonColor: "#3085d6",
confirmButtonText: "Yes, delete it!", confirmButtonText: "Yes, delete it!",
}); });
// Check if the user clicked the confirm button // Check if the user clicked the confirm button
if (!result.isConfirmed) return; // Exit if the user cancels if (!result.isConfirmed) return; // Exit if the user cancels
try { try {
await Delete("bank", bankId); await Delete("bank", bankId);
@ -345,10 +345,10 @@ const ManageSettings = () => {
confirmButtonColor: "#d33", confirmButtonColor: "#d33",
cancelButtonColor: "#3085d6", cancelButtonColor: "#3085d6",
confirmButtonText: "Yes, delete it!", confirmButtonText: "Yes, delete it!",
}); });
// Check if the user clicked the confirm button // Check if the user clicked the confirm button
if (!result.isConfirmed) return; // Exit if the user cancels if (!result.isConfirmed) return; // Exit if the user cancels
try { try {
await Delete("dueDaysData", dayId); await Delete("dueDaysData", dayId);
setDueDaysList((prevList) => prevList.filter((day) => day.id !== dayId)); setDueDaysList((prevList) => prevList.filter((day) => day.id !== dayId));
@ -413,23 +413,13 @@ const ManageSettings = () => {
<div className="card"> <div className="card">
<div className="card-body"> <div className="card-body">
<p className="question-text">{setting.question}</p> <p className="question-text">{setting.question}</p>
<CustomSwitch
setting={setting}
isActive={
setting.id === 13 ||
setting.id === 14 ||
checkedStates[setting.id]
}
handleSwitchChange={handleSwitchChange}
disabled={setting.id === 13 || setting.id === 14} // Disable for IDs 13 and 14
/>
</div> </div>
</div> </div>
</div> </div>
))} ))}
<div className="row setting-manage"> <div className="row setting-manage">
{/* First Dropdown */}
<div className="col-md-6"> <div className="col-md-6">
{isDropdownVisible && ( {isDropdownVisible && (
<select <select
@ -442,7 +432,9 @@ const ManageSettings = () => {
</select> </select>
)} )}
</div> </div>
<div className="col-md-6 mb-3">
{/* Second Dropdown */}
<div className="col-md-6">
{isDropdownVisible && ( {isDropdownVisible && (
<select <select
className="form-select mt-3" className="form-select mt-3"
@ -450,34 +442,32 @@ const ManageSettings = () => {
value={selectedLotteryRegister} value={selectedLotteryRegister}
onChange={handleLotteryRegisterChange} onChange={handleLotteryRegisterChange}
> >
{renderOptions( {renderOptions(selectedLotteryRegister, numberOfLotteryRegisters)}
selectedLotteryRegister,
numberOfLotteryRegisters
)}
</select> </select>
)} )}
</div> </div>
<div className="col-md-12">
<div className="col-md-6 mb-3"> {/* Sales Tax Percentage Input */}
<label htmlFor="sales_tax_percentage"> <div className="col-md-12 d-flex align-items-center mt-3" style={{
Sales Tax Percentage:
</label> }}>
</div> <label htmlFor="sales_tax_percentage" className="me-2">
<div className="col-md-6"> Sales Tax Percentage:
<input </label>
type="number" <input
id="sales_tax_percentage" type="number"
value={salesTax} id="sales_tax_percentage"
onBlur={handleIncrementSalesTax} // Trigger the function when input loses focus value={salesTax}
onChange={(e) => setSalesTax(e.target.value)} // Allow editing the value while typing onBlur={handleIncrementSalesTax} // Trigger the function when input loses focus
placeholder="Enter percentage" onChange={(e) => setSalesTax(e.target.value)} // Allow editing the value while typing
className="form-control" placeholder="Enter percentage"
/> className="form-control w-25" // Adjust width as needed
</div> />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div className="bank-container"> <div className="bank-container">
<div className="header-row"> <div className="header-row">
<div className="setting-title">Manage Bank</div> <div className="setting-title">Manage Bank</div>
@ -535,7 +525,7 @@ const ManageSettings = () => {
show={showModal && formType === "bank"} show={showModal && formType === "bank"}
handleClose={handleClose} handleClose={handleClose}
title="Add Bank" title="Add Bank"
width="1054px" width="600px"
height="auto" height="auto"
> >
<form> <form>
@ -546,7 +536,11 @@ const ManageSettings = () => {
onChange={(e) => setBankName(e.target.value)} onChange={(e) => setBankName(e.target.value)}
className="input-field" className="input-field"
placeholder="Bank Name" placeholder="Bank Name"
style={{ width: "483px", marginRight: "10px" }} style={{
width: "483px", marginRight: "10px", backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
}}
/> />
<input <input
type="text" type="text"
@ -554,7 +548,11 @@ const ManageSettings = () => {
onChange={(e) => setBankBranch(e.target.value)} onChange={(e) => setBankBranch(e.target.value)}
className="input-field" className="input-field"
placeholder="Bank Short Name" placeholder="Bank Short Name"
style={{ width: "483px", marginRight: "10px" }} style={{
width: "483px", marginRight: "10px", backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
}}
/> />
</div> </div>
<div className="form-group d-flex align-items-center mt-1"> <div className="form-group d-flex align-items-center mt-1">
@ -564,7 +562,11 @@ const ManageSettings = () => {
onChange={(e) => setAccountNumber(e.target.value)} onChange={(e) => setAccountNumber(e.target.value)}
className="input-field" className="input-field"
placeholder="Account Number" placeholder="Account Number"
style={{ width: "483px", marginRight: "10px" }} style={{
width: "270px", marginRight: "10px", backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
}}
/> />
</div> </div>
<div style={{ display: "flex", justifyContent: "flex-end" }}> <div style={{ display: "flex", justifyContent: "flex-end" }}>
@ -574,13 +576,13 @@ const ManageSettings = () => {
style={{ style={{
marginRight: "40px", marginRight: "40px",
padding: "4px 8px", padding: "4px 8px",
backgroundColor: "#4545db", backgroundColor: " #282E26",
color: "white", color: "white",
border: "none", border: "none",
borderRadius: "40px", borderRadius: "40px",
cursor: "pointer", cursor: "pointer",
width: "124px", width: "181px",
height: "42px", height: "45px",
fontSize: "18px", fontSize: "18px",
}} }}
> >
@ -642,7 +644,11 @@ const ManageSettings = () => {
className="input-day" className="input-day"
value={day.days} value={day.days}
readOnly readOnly
style={{ paddingLeft: "10px" }} style={{
paddingLeft: "10px", backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
}}
/> />
</div> </div>
{/* <button className="card-button day">Mark as Default</button> */} {/* <button className="card-button day">Mark as Default</button> */}
@ -654,39 +660,50 @@ const ManageSettings = () => {
handleClose={handleClose} handleClose={handleClose}
title="Add Due Days" title="Add Due Days"
width="683px" width="683px"
height="172px" height="230px"
> >
<form> <form>
<div className="form-group d-flex align-items-center"> <div className="form-group mx-5" style={{ display: "flex", flexDirection: "column" }}>
<input <input
type="number" type="number"
value={dueDays} value={dueDays}
onChange={(e) => setDueDays(e.target.value)} onChange={(e) => setDueDays(e.target.value)}
className="input-field" className="input-field"
placeholder="Due Days" placeholder="Enter Due Days"
style={{ width: "483px", marginRight: "10px" }}
/>
<button
onClick={handleSaveDueDays}
type="button"
style={{ style={{
marginRight: "40px", width: "100%",
padding: "4px 8px", marginBottom: "10px",
backgroundColor: "#4545db",
color: "white",
border: "none", border: "none",
borderRadius: "40px", borderBottom: "2px solid #ccc", // Only bottom border
cursor: "pointer", padding: "8px 0",
width: "124px", fontSize: "16px",
height: "42px", outline: "none",
fontSize: "18px",
}} }}
> />
{editingDueDayId ? "Update" : "Save"} <div style={{ display: "flex", justifyContent: "flex-end" }}>
</button> <button
onClick={handleSaveDueDays}
type="button"
style={{
padding: "10px 16px",
backgroundColor: "#282E26",
color: "white",
border: "none",
borderRadius: "20px",
cursor: "pointer",
width: "150px",
fontSize: "16px",
}}
>
{editingDueDayId ? "Update" : "Save"}
</button>
</div>
</div> </div>
</form> </form>
</ReusableModal> </ReusableModal>
</div> </div>
</> </>
); );

View File

@ -278,66 +278,64 @@ const ManageUserTable = ({
)} )}
</div> </div>
<div style={{ marginRight: "69%" }}> <div
<div className="expense-search d-flex align-items-center"
className="expense-search d-flex align-items-center" style={{
display: "flex",
style={{ alignItems: "center",
display: "flex", backgroundColor: "#FFFFFF",
alignItems: "center", border: "1px solid #DBDBDB",
backgroundColor: "#FFFFFF", borderRadius: "10px",
border: "1px solid #DBDBDB", cursor: "pointer",
borderRadius: "10px", width: "200px",
// boxSizing: "border-box",
cursor: "pointer", }}
>
width: "170px", <span
gap: "10px", style={{
}} fontFamily: "'Comfortaa'",
> fontStyle: "normal",
<span fontWeight: "400",
style={{ fontSize: "14px", // Compact text
fontFamily: "'Comfortaa'", color: "#000000",
fontStyle: "normal", marginLeft:"10px"
fontWeight: "400", }}
fontSize: "16px", >
padding: "5px", Show Rows:
color: "#000000", </span>
}} <select
> name="option"
Show Rows: id="pageSelect"
</span> className="selectoptions"
<select style={{
name="option" backgroundColor: "#282E26", // Match background color
id="pageSelect" color: "#FFFFFF", // White text color
className="selectoptions" fontFamily: "'Comfortaa'",
style={{ fontStyle: "normal",
backgroundColor: "#282E26", fontWeight: "700",
borderRadius: "0px 10px 10px 0px", fontSize: "14px",
color: "#F4FFEE", lineHeight: "16px",
fontFamily: "'Comfortaa'", padding: "4px 10px", // Adjust padding for the dropdown
fontStyle: "normal", border: "none", // No border
fontWeight: "700", borderRadius: "0 10px 10px 0", // Rounded on the right side only
fontSize: "16px", cursor: "pointer",
lineHeight: "18px", marginLeft: "auto", // Push to the right
padding: "5px 8px", }}
border: "none", value={rowsPerPage}
cursor: "pointer", onChange={(e) => {
}} setRowsPerPage(Number(e.target.value));
value={rowsPerPage} setCurrentPage(1); // Reset to the first page on change
onChange={(e) => { }}
setRowsPerPage(Number(e.target.value)); >
setCurrentPage(1); // Reset to the first page on change <option value={5}>5</option>
}} <option value={10}>10</option>
> <option value={15}>15</option>
<option value={5}>5</option> <option value={20}>20</option>
<option value={10}>10</option> </select>
<option value={15}>15</option> </div>
<option value={20}>20</option>
</select>
</div>
</div>
</div> </div>

View File

@ -394,14 +394,28 @@ function ManageUsers() {
<div className="header-row"> <div className="header-row">
<div className="setting-title">Manage Users</div> <div className="setting-title">Manage Users</div>
<div className="btn-position" style={{ display: "flex", gap: "10px" }}> {/* Set up flex with gap */} <div className="btn-position" style={{ display: "flex", gap: "10px" }}> {/* Set up flex with gap */}
<button <button
className="btn cus d-flex align-items-center" style={{
onClick={() => handleShowUserModal()} // Open modal for adding a user backgroundColor: "#4A5546",
boxShadow: "none",
outline: "none",
width: "auto",
height: "42px",
padding: "8px 12px",
fontSize: "16px",
border: "none",
borderRadius: "10px",
color: "#F4FFEE",
cursor: "pointer",
}}
onClick={() => setAssignOwnerModal(true)} // Open modal for assigning an owner
> >
+ Add New User Assign Existing User As Owner
<img <img
src={userIcon} src={ownerIcon}
alt="user Icon" alt="owner Icon"
style={{ width: "20px", height: "20px", marginLeft: "8px" }} style={{ width: "20px", height: "20px", marginLeft: "8px" }}
/> />
</button> </button>
@ -421,7 +435,7 @@ function ManageUsers() {
}} }}
onClick={() => handleShowStoreModal()} // Open modal for adding a user onClick={() => handleShowStoreModal()} // Open modal for adding a user
> >
+ Add New Store Add New Store
<img <img
src={storeIcon} src={storeIcon}
alt="store Icon" alt="store Icon"
@ -429,25 +443,13 @@ function ManageUsers() {
/> />
</button> </button>
<button <button
style={{ className="btn cus d-flex align-items-center"
backgroundColor: "#4A5546", onClick={() => handleShowUserModal()} // Open modal for adding a user
boxShadow: "none",
outline: "none",
width: "auto",
height: "42px",
padding: "8px 12px",
fontSize: "16px",
border: "none",
borderRadius: "10px",
color: "#F4FFEE",
cursor: "pointer",
}}
onClick={() => setAssignOwnerModal(true)} // Open modal for assigning an owner
> >
+ Assign Existing User As Owner Add New User
<img <img
src={ownerIcon} src={userIcon}
alt="owner Icon" alt="user Icon"
style={{ width: "20px", height: "20px", marginLeft: "8px" }} style={{ width: "20px", height: "20px", marginLeft: "8px" }}
/> />
</button> </button>
@ -472,7 +474,7 @@ function ManageUsers() {
width="700px" width="700px"
> >
<form> <form>
<div className="form-group d-flex flex-column p-5"> <div className="form-group d-flex flex-column px-5">
<div className="d-flex align-items-center mb-3 "> <div className="d-flex align-items-center mb-3 ">
<input <input
type="text" type="text"
@ -592,7 +594,7 @@ function ManageUsers() {
width="700px" width="700px"
> >
<form> <form>
<div className="form-group p-5"> <div className="form-group px-5">
{/* Wrapper for Flexbox */} {/* Wrapper for Flexbox */}
<div className="d-flex flex-wrap"> <div className="d-flex flex-wrap">
{/* Left Side */} {/* Left Side */}
@ -745,7 +747,7 @@ function ManageUsers() {
width="600px" width="600px"
> >
<form onSubmit={handleAssignOwnerSubmit}> <form onSubmit={handleAssignOwnerSubmit}>
<div className="form-group d-flex flex-column mt-1 p-3 "> <div className="form-group d-flex flex-column mt-1 px-5 ">
<input <input
type="email" type="email"
className="input-field" className="input-field"

View File

@ -190,8 +190,8 @@ function ManageVendor() {
<div className="header-row"> <div className="header-row">
<div className="setting-title">Manage Vendor</div> <div className="setting-title">Manage Vendor</div>
<div className="btn-position"> <div className="btn-position">
<button className="vendor-add-button" onClick={handleShow}> <button className="btn cus d-flex align-items-center" style={{marginBottom:"10px"}} onClick={handleShow}>
+ Add Vendor Add Vendor
</button> </button>
</div> </div>
</div> </div>
@ -224,7 +224,7 @@ function ManageVendor() {
handleSave(); handleSave();
}} }}
> >
<div className="form-group d-flex align-items-center mt-0"> <div className="form-group d-flex align-items-center mt-0 mx-5">
<input <input
type="text" type="text"
id="vendorName" id="vendorName"
@ -232,7 +232,11 @@ function ManageVendor() {
placeholder="Vendor Name" placeholder="Vendor Name"
value={vendorName} value={vendorName}
onChange={(e) => setVendorName(e.target.value)} onChange={(e) => setVendorName(e.target.value)}
style={{ width: "400px", marginRight: "10px", height: "44px" }} style={{ width: "400px", marginRight: "10px", height: "44px" , backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
}}
/> />
<select <select
id="vendorType" id="vendorType"
@ -243,7 +247,11 @@ function ManageVendor() {
setVendorDepartments([]); // Reset departments when type changes setVendorDepartments([]); // Reset departments when type changes
setOpeningBalance(""); setOpeningBalance("");
}} }}
style={{ width: "400px", marginRight: "10px", height: "44px" }} style={{ width: "400px", marginRight: "10px", height: "44px" , backgroundColor: "#ffffff",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
}}
> >
<option value="">Vendor Type</option> <option value="">Vendor Type</option>
<option value="purchase">Purchase</option> <option value="purchase">Purchase</option>
@ -273,12 +281,17 @@ function ManageVendor() {
</div> </div>
<select <select
id="vendorDepartment" id="vendorDepartment"
className="input-field" className="input-field "
onChange={handleDepartmentChange} onChange={handleDepartmentChange}
style={{ style={{
width: "400px", width: "400px",
marginRight: "10px", marginRight: "10px",
height: "44px", height: "44px",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
marginLeft:"45px"
}} }}
> >
<option value=""> <option value="">
@ -314,6 +327,9 @@ function ManageVendor() {
width: "400px", width: "400px",
marginRight: "10px", marginRight: "10px",
height: "44px", height: "44px",
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
}} }}
/> />
)} )}
@ -325,13 +341,14 @@ function ManageVendor() {
style={{ style={{
marginLeft: "690px", marginLeft: "690px",
padding: "4px 8px", padding: "4px 8px",
backgroundColor: "#4545db", background: "#282E26",
color: "white", color: "white",
border: "none", border: "none",
borderRadius: "40px", borderRadius: "40px",
cursor: "pointer", cursor: "pointer",
width: "124px", width: "181px",
height: "42px", height: "45px",
fontSize: "18px", fontSize: "18px",
}} }}
> >

View File

@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import React, { useState, useEffect,useContext } from "react"; import React, { useState, useEffect, useContext } from "react";
import ReusableModal from "./ReusableModal"; import ReusableModal from "./ReusableModal";
import useApi from "../../../../utils/api-manager/Helper/useApi"; import useApi from "../../../../utils/api-manager/Helper/useApi";
import AuthContext from "../../../../utils/secure-route/AuthContext"; import AuthContext from "../../../../utils/secure-route/AuthContext";
@ -7,15 +7,15 @@ import { toast, ToastContainer } from "react-toastify";
import Swal from "sweetalert2"; import Swal from "sweetalert2";
import "./Settings.css"; import "./Settings.css";
function OtherIncomeType() { function OtherIncomeType() {
let { user } = useContext(AuthContext); let { user } = useContext(AuthContext);
const storeId = user.store; const storeId = user.store;
const [showModal, setShowModal] = useState(false);
const [name, setName] = useState(""); const [name, setName] = useState("");
const [incomes, setIncomes] = useState([]); const [incomes, setIncomes] = useState([]);
const [editIncome, setEditIncome] = useState(null); const [editIncome, setEditIncome] = useState(null);
const { Get, Post, Put, Delete } = useApi(); const { Get, Post, Put, Delete } = useApi();
useEffect(() => { useEffect(() => {
// Fetch existing income types from the API // Fetch existing income types from the API
const fetchIncomes = async () => { const fetchIncomes = async () => {
@ -29,6 +29,7 @@ function OtherIncomeType() {
}; };
fetchIncomes(); fetchIncomes();
}, []); }, []);
const handleShow = (income = null) => { const handleShow = (income = null) => {
if (income) { if (income) {
setEditIncome(income); setEditIncome(income);
@ -37,20 +38,23 @@ function OtherIncomeType() {
setEditIncome(null); setEditIncome(null);
setName(""); // Reset name when adding a new income type setName(""); // Reset name when adding a new income type
} }
setShowModal(true);
}; };
const handleClose = () => { const handleClose = () => {
setShowModal(false);
setName(""); // Reset name when closing setName(""); // Reset name when closing
setEditIncome(null); // Reset editIncome when closing setEditIncome(null); // Reset editIncome when closing
}; };
const handleSave = async () => { const handleSave = async () => {
if (name) { if (name) {
try { try {
if (editIncome) { if (editIncome) {
// Update existing income type // Update existing income type
const response = await Put("otherIncomeData", editIncome.id, { const response = await Put("otherIncomeData", editIncome.id, {
title: name,store: storeId, title: name,
store: storeId,
}); });
const updatedIncome = response.data; const updatedIncome = response.data;
setIncomes((prevIncomes) => setIncomes((prevIncomes) =>
@ -62,7 +66,8 @@ function OtherIncomeType() {
} else { } else {
// Add new income type // Add new income type
const response = await Post("otherIncomeData", { const response = await Post("otherIncomeData", {
title: name,store: storeId, title: name,
store: storeId,
}); });
const newIncome = response.data; const newIncome = response.data;
setIncomes([...incomes, newIncome]); setIncomes([...incomes, newIncome]);
@ -77,6 +82,7 @@ function OtherIncomeType() {
toast.warn("Income type name cannot be empty."); toast.warn("Income type name cannot be empty.");
} }
}; };
const handleDelete = async (id) => { const handleDelete = async (id) => {
const result = await Swal.fire({ const result = await Swal.fire({
title: "Are you sure?", title: "Are you sure?",
@ -86,10 +92,10 @@ function OtherIncomeType() {
confirmButtonColor: "#d33", confirmButtonColor: "#d33",
cancelButtonColor: "#3085d6", cancelButtonColor: "#3085d6",
confirmButtonText: "Yes, delete it!", confirmButtonText: "Yes, delete it!",
}); });
// Check if the user clicked the confirm button // Check if the user clicked the confirm button
if (!result.isConfirmed) return; // Exit if the user cancels if (!result.isConfirmed) return; // Exit if the user cancels
try { try {
await Delete("otherIncomeData", id); await Delete("otherIncomeData", id);
setIncomes((prevIncomes) => setIncomes((prevIncomes) =>
@ -104,109 +110,89 @@ function OtherIncomeType() {
toast.error("Failed to delete income type."); toast.error("Failed to delete income type.");
} }
}; };
return ( return (
<> <>
<div className="due-days"> <div className="" style={{ marginTop: "5%" }}>
<div className="header-row"> <ToastContainer />
<div className="setting-title">Other Income Type</div> {/* <p className="setting-title">Manage Departments</p> */}
<div className="btn-position"> <div className="department-container">
<button className="vendor-add-button" onClick={() => handleShow()}> <div className="input-container">
+ Add New <div className="input-row">
</button> <input
type="text"
id="incomeTypeName"
className="input-field"
placeholder="Enter income type name"
value={name}
onChange={(e) => setName(e.target.value)}
style={{
border: "none", // Remove all borders
borderBottom: "2px solid #ccc", // Set bottom border
borderRadius: "0px", // Remove border radius
}}
/>
<button
onClick={handleSave}
className="btn d-flex align-items-center"
type="button"
style={{width:"208px" , height:"33px" , backgroundColor: "#FFAF32" , borderRadius:"10px" , justifyContent:"center"}}
>
{editIncome ? "Update " : "Add Other Income"}
</button>
</div>
</div> </div>
</div> </div>
<div className="dept-cards-row"> <div className="store-container">
{incomes.length === 0 ? (
<p <div className="show-department-section">
style={{ <div className="dept-cards-row">
textAlign: "center", {incomes.map((income) => (
fontFamily: "Manrope", <div className="dept-card" key={income.id}>
fontWeight: "600", <input className="dept-info" value={income.title} readOnly />
fontSize: "40px", <svg
background: "linear-gradient(180deg, rgba(255, 255, 255, 0.1) -92.86%, #4545DB 71.43%)", className="dept-icon"
WebkitBackgroundClip: "text", onClick={() => handleShow(income)}
WebkitTextFillColor: "transparent", width="16"
}} height="16"
> viewBox="0 0 16 16"
No data found fill="none"
</p> xmlns="http://www.w3.org/2000/svg"
) : ( >
incomes.map((income) => ( <path
<div className="dept-card" key={income.id}> d="M13.5854 4.695C13.8304 4.435 13.8304 4.00167 13.5854 3.755L12.1154 2.195C11.8829 1.935 11.4746 1.935 11.2296 2.195L10.0736 3.415L12.4295 5.915M2.45947 11.5017V14.0017H4.81534L11.7636 6.62167L9.4077 4.12167L2.45947 11.5017Z"
<input className="dept-info" value={income.title} readOnly /> fill="#002300"
<svg />
className="dept-icon" </svg>
onClick={() => handleShow(income)} <svg
width="16" className="dept-icon"
height="16" onClick={() => handleDelete(income.id)}
viewBox="0 0 16 16" width="16"
fill="none" height="16"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"
> fill="none"
<path xmlns="http://www.w3.org/2000/svg"
d="M13.5854 4.695C13.8304 4.435 13.8304 4.00167 13.5854 3.755L12.1154 2.195C11.8829 1.935 11.4746 1.935 11.2296 2.195L10.0736 3.415L12.4295 5.915M2.45947 11.5017V14.0017H4.81534L11.7636 6.62167L9.4077 4.12167L2.45947 11.5017Z" >
fill="#002300" <path
/> d="M3.84503 12.6667C3.84503 13.4 4.41044 14 5.10149 14H10.1273C10.8184 14 11.3838 13.4 11.3838 12.6667V6C11.3838 5.26667 10.8184 4.66667 10.1273 4.66667H5.10149C4.41044 4.66667 3.84503 5.26667 3.84503 6V12.6667ZM11.3838 2.66667H9.81322L9.36718 2.19333C9.25409 2.07333 9.09075 2 8.92741 2H6.30141C6.13807 2 5.97473 2.07333 5.86165 2.19333L5.4156 2.66667H3.84503C3.4995 2.66667 3.2168 2.96667 3.2168 3.33333C3.2168 3.7 3.4995 4 3.84503 4H11.3838C11.7293 4 12.012 3.7 12.012 3.33333C12.012 2.96667 11.7293 2.66667 11.3838 2.66667Z"
</svg> fill="#002300"
<svg />
className="dept-icon" </svg>
onClick={() => handleDelete(income.id)} // Show modal for editing </div>
width="16" ))
height="16" }
viewBox="0 0 16 16" </div>
fill="none" </div>
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M3.84503 12.6667C3.84503 13.4 4.41044 14 5.10149 14H10.1273C10.8184 14 11.3838 13.4 11.3838 12.6667V6C11.3838 5.26667 10.8184 4.66667 10.1273 4.66667H5.10149C4.41044 4.66667 3.84503 5.26667 3.84503 6V12.6667ZM11.3838 2.66667H9.81322L9.36718 2.19333C9.25409 2.07333 9.09075 2 8.92741 2H6.30141C6.13807 2 5.97473 2.07333 5.86165 2.19333L5.4156 2.66667H3.84503C3.4995 2.66667 3.2168 2.96667 3.2168 3.33333C3.2168 3.7 3.4995 4 3.84503 4H11.3838C11.7293 4 12.012 3.7 12.012 3.33333C12.012 2.96667 11.7293 2.66667 11.3838 2.66667Z"
fill="#002300"
/>
</svg>
</div>
))
)}
</div> </div>
</div> </div>
<ReusableModal
show={showModal}
handleClose={handleClose}
title={editIncome ? "Edit Other Income Type" : "Add Other Income Type"}
width="697px"
height="200px"
>
<form>
<div className="form-group d-flex align-items-center mt-1">
<input
type="text"
id="incomeTypeName"
className="input-field"
placeholder="Enter income type name"
value={name}
onChange={(e) => setName(e.target.value)}
style={{ width: "483px", marginRight: "10px" }}
/>
<button
onClick={handleSave}
type="button"
style={{
padding: "6px 8px",
backgroundColor: "#4545db", // Bootstrap primary color
color: "white",
border: "none",
borderRadius: "40px",
cursor: "pointer",
width: "103px",
height: "42px",
fontSize: "18px",
}}
>
{editIncome ? "Update" : "Save"}
</button>
</div>
</form>
</ReusableModal>
<ToastContainer/>
</> </>
); );
} }
export default OtherIncomeType; export default OtherIncomeType;

View File

@ -47,7 +47,7 @@ const ReusableModal = ({
}; };
const modalContentStyle = { const modalContentStyle = {
borderRadius: "30px", borderRadius: "40px",
overflow: "hidden", overflow: "hidden",
width: width, // use the width prop width: width, // use the width prop
height: height, // use the height prop height: height, // use the height prop

View File

@ -82,7 +82,7 @@ const SettingTable = ({
pages.push( pages.push(
<li <li
key={i} key={i}
className={`page-item ${currentPage === i ? "active" : ""}`} className={`page-item ${currentPage === i ? "active" : "pgbtn"}`}
> >
<a <a
className="page-link" className="page-link"
@ -200,6 +200,7 @@ const SettingTable = ({
value={searchTerm} value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)} onChange={(e) => setSearchTerm(e.target.value)}
placeholder="Search" placeholder="Search"
style={{ height: "50px", backgroundColor: "#fff", border: '1px solid #DBDBDB', boxShadow: "0px 0px 10px rgba(187, 187, 187, 0.25)" }}
/> />
<svg <svg
className="search-container-icon" className="search-container-icon"
@ -293,25 +294,67 @@ const SettingTable = ({
</div> </div>
)} )}
</div> </div>
<div className="expense-searchcontainerend d-flex align-items-center"> <div style={{ marginRight: "1%" }}>
<h3 className="me-2">Show</h3> <div
<select className="expense-search d-flex align-items-center"
name="option" style={{
id="pageSelect" display: "flex",
className="selectoptions" alignItems: "center",
value={rowsPerPage} backgroundColor: "#FFFFFF",
onChange={(e) => { border: "1px solid #DBDBDB",
setRowsPerPage(Number(e.target.value)); borderRadius: "10px",
setCurrentPage(1); // Reset to first page on change cursor: "pointer",
}} width: "200px",
>
<option value={5}>5</option>
<option value={10}>10</option> }}
<option value={15}>15</option> >
<option value={20}>20</option> <span
</select> style={{
</div> fontFamily: "'Comfortaa'",
fontStyle: "normal",
fontWeight: "400",
fontSize: "14px", // Compact text
color: "#000000",
marginLeft:"10px"
}}
>
Show Rows:
</span>
<select
name="option"
id="pageSelect"
className="selectoptions"
style={{
backgroundColor: "#282E26", // Match background color
color: "#FFFFFF", // White text color
fontFamily: "'Comfortaa'",
fontStyle: "normal",
fontWeight: "700",
fontSize: "14px",
lineHeight: "16px",
padding: "2px 10px", // Adjust padding for the dropdown
border: "none", // No border
borderRadius: "0 10px 10px 0", // Rounded on the right side only
cursor: "pointer",
marginLeft: "auto", // Push to the right
}}
value={rowsPerPage}
onChange={(e) => {
setRowsPerPage(Number(e.target.value));
setCurrentPage(1); // Reset to the first page on change
}}
>
<option value={5}>5</option>
<option value={10}>10</option>
<option value={15}>15</option>
<option value={20}>20</option>
</select>
</div>
</div>
</div> </div>
<table className="data-table custom-table" style={{borderRadius:"none"}} > <table className="data-table custom-table" style={{borderRadius:"none"}} >
<thead className="table-header"> <thead className="table-header">
<tr> <tr>
@ -435,7 +478,7 @@ const SettingTable = ({
{showFooter && ( {showFooter && (
<nav> <nav>
<ul className="pagination"> <ul className="pagination">
<li className={`prev-next ${currentPage === 1 ? "disabled" : ""}`}> {/* <li className={`prev-next ${currentPage === 1 ? "disabled" : ""}`}>
<span <span
style={{ style={{
fontSize: "24px", fontSize: "24px",
@ -454,9 +497,9 @@ const SettingTable = ({
&lt; &lt;
</span> </span>
&nbsp; &nbsp;
</li> </li> */}
{renderPagination()} {renderPagination()}
<li {/* <li
className={`prev-next ${ className={`prev-next ${
currentPage === totalPages ? "disabled" : "" currentPage === totalPages ? "disabled" : ""
}`} }`}
@ -479,7 +522,7 @@ const SettingTable = ({
> >
&gt;{" "} &gt;{" "}
</span> </span>
</li> </li> */}
</ul> </ul>
</nav> </nav>
)} )}

View File

@ -1,4 +1,8 @@
/*================================================Setting page===================================================================================*/ /*================================================Setting page===================================================================================*/
/* Dropdown container styles */
.setting-container { .setting-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -8,9 +12,10 @@
padding: 20px; padding: 20px;
margin: 20px auto; margin: 20px auto;
background-color: #ffffff; background-color: #ffffff;
width: 1600px; width: 1600px;
max-width: 100%; max-width: 100%;
} }
.setting-title { .setting-title {
margin-bottom: 20px; margin-bottom: 20px;
font-weight: bold; font-weight: bold;
@ -18,14 +23,17 @@
color: #002300; color: #002300;
align-self: flex-start; align-self: flex-start;
} }
.row.setting-manage { .row.setting-manage {
width: 1600px; width: 1600px;
max-width: 100%; max-width: 100%;
} }
.card { .card {
margin-bottom: 20px; margin-bottom: 20px;
max-width: 100%; max-width: 100%;
} }
.card-body { .card-body {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -35,104 +43,134 @@
max-height: 100%; max-height: 100%;
height: 56px; height: 56px;
} }
.question-text { .question-text {
margin-top: 15px; margin-top: 15px;
font-size: 16px; font-size: 16px;
color: #002300; color: #002300;
align-items: center; align-items: center;
} }
.form-check { .form-check {
margin: 0; margin: 0;
} }
.card { .card {
width: 100%; width: 100%;
border-radius: 10px; border-radius: 10px;
border: 1px solid #e0e0e0; border: 1px solid #e0e0e0;
background-color: #ffffff; background-color: #ffffff;
} }
.form-check-input { .form-check-input {
cursor: pointer; cursor: pointer;
} }
/*===========================================================================Bank container=================================================================*/ /*===========================================================================Bank container=================================================================*/
.bank-container { .bank-container {
padding: 20px; /* Adjust as needed */ padding: 20px;
/* Adjust as needed */
margin: 30px auto; margin: 30px auto;
background-color: #ffffff;
border-radius: 10px; background: #FFFFFF;
border: 1px solid #EBEAF2;
box-shadow: 0px 2px 8px rgba(6, 12, 34, 0.0392157);
border-radius: 40px;
width: 1600px; width: 1600px;
height: 467px;
max-width: 100%; max-width: 100%;
} }
.header-row { .header-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 1540px; width: 1540px;
max-width: 100%; max-width: 100%;
} }
.setting-title { .setting-title {
font-size: 24px; /* Adjust font size as needed */ font-size: 24px;
margin: 0; /* Remove default margin */ /* Adjust font size as needed */
margin: 0;
/* Remove default margin */
} }
.bank-add-button { .bank-add-button {
padding: 8px 16px; padding: 8px 16px;
background-color: #4545db; /* Bootstrap primary color */ background-color: #ffaf32;
color: white; /* Bootstrap primary color */
color: #000000;
border: none; border: none;
border-radius: 40px; border-radius: 14px;
cursor: pointer; cursor: pointer;
width: 155px; width: 177px;
height: 42px; height: 48px;
font-size: 18px; font-size: 18px;
} }
.second-container { .second-container {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
} }
.bank-cards { .bank-cards {
display: flex; display: flex;
flex-wrap: wrap; /* Allow wrapping */ flex-wrap: wrap;
/* Allow wrapping */
} }
.bank-card { .bank-card {
width: 426px; background: #FFFFFF;
height: 206px; border: 1px solid #EBEAF2;
background-color: #ffffff; box-shadow: 0px 2px 8px rgba(6, 12, 34, 0.0392157);
border: 1px solid rgba(0, 35, 0, 0.1); border-radius: 20px;
border-radius: 10px; width: 348px;
height: 303px;
display: flex; display: flex;
flex-direction: column; /* Stack content vertically */ flex-direction: column;
/* Stack content vertically */
padding: 16px; padding: 16px;
margin: 10px 0; /* Vertical margin only */ margin: 10px 0;
/* Vertical margin only */
padding: 16px; padding: 16px;
position: relative; position: relative;
margin-right: 10px; margin-right: 10px;
margin-left: 10px; margin-left: 10px;
} }
.bank-header { .bank-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
position: relative; position: relative;
} }
.bank-details { .bank-details {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.bank-name-group { .bank-name-group {
margin-bottom: 16px; /* Space between the groups of names */ margin-bottom: 16px;
/* Space between the groups of names */
} }
.bank-name { .bank-name {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
color: #002300; color: #002300;
margin-bottom: 2px; margin-bottom: 2px;
} }
.bank-short-name { .bank-short-name {
font-size: 16px; font-size: 16px;
color: #002300; color: #002300;
margin: 0; margin: 0;
} }
.del-icon { .del-icon {
color: #002300; color: #002300;
position: absolute; position: absolute;
@ -140,6 +178,7 @@
right: 16px; right: 16px;
cursor: pointer; cursor: pointer;
} }
.card-button { .card-button {
text-align: left; text-align: left;
border: 1px solid #4545db; border: 1px solid #4545db;
@ -151,45 +190,60 @@
font-size: 18px; font-size: 18px;
color: #4545db; color: #4545db;
} }
.card-button.default { .card-button.default {
width: 212px; width: 212px;
} }
.card-button.atm { .card-button.atm {
width: 252px; width: 252px;
} }
.card-button.ltry { .card-button.ltry {
width: 277px; width: 277px;
} }
.card-button.credit { .card-button.credit {
width: 313px; width: 313px;
} }
/*======================================================Due Days css Start==========================================================================*/ /*======================================================Due Days css Start==========================================================================*/
.due-days { .due-days {
padding: 20px; /* Adjust as needed */ padding: 20px;
/* Adjust as needed */
margin: 20px auto; margin: 20px auto;
background-color: #ffffff;
border: 1px solid #EBEAF2; border: 1px solid #EBEAF2;
box-shadow: "0px 2px 8px rgba(6, 12, 34, 0.0392157)"; box-shadow: 0px 2px 8px rgba(6, 12, 34, 0.0392157);
border-radius: 40px; border-radius: 40px;
width: 1600px; width: 1600px;
max-width: 100%; max-width: 100%;
background-color: #ffffff; background-color: #ffffff;
} }
.due-card { .due-card {
position: relative; position: relative;
width: 360px; /* Fixed width for each card */ width: 348px;
height: 185px; /* Fixed height for each card */ height: 196px;
background-color: #ffffff;
border: 1px solid rgba(0, 35, 0, 0.1); background: #FFFFFF;
border-radius: 10px; border: 1px solid #EBEAF2;
box-shadow: 0px 2px 8px rgba(6, 12, 34, 0.0392157);
border-radius: 20px;
display: flex; display: flex;
flex-direction: column; /* Column layout inside the card */ flex-direction: column;
/* Column layout inside the card */
padding: 16px; padding: 16px;
margin: 10px; /* Margin for spacing */ margin: 10px;
/* Margin for spacing */
} }
.due-details { .due-details {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.due-icon { .due-icon {
display: flex; display: flex;
align-items: center; align-items: center;
@ -199,28 +253,41 @@
right: 16px; right: 16px;
cursor: pointer; cursor: pointer;
} }
.input-day { .input-day {
width: 260px; width: 260px;
height: 44px; height: 44px;
background-color: #f6f6f6; background-color: #ffffff;
border: 1px solid rgba(0, 35, 0, 0.1); border: none;
/* Remove all borders */
border-bottom: 2px solid #ccc;
/* Only apply the bottom border */
border-radius: 4px; border-radius: 4px;
/* Optional: apply a border-radius if needed */
outline: none;
/* Optional: removes the default focus outline */
} }
.card-button.day { .card-button.day {
margin-top: 20px; margin-top: 20px;
width: 191px; width: 191px;
} }
.btn-position { .btn-position {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.vendor-add { .vendor-add {
flex-direction: column; flex-direction: column;
margin-bottom: 10px; /* Space between rows */ margin-bottom: 10px;
/* Space between rows */
} }
.vendor-add-button { .vendor-add-button {
padding: 8px 26px; padding: 8px 26px;
background-color: #4545db; /* Bootstrap primary color */ background-color: #4545db;
/* Bootstrap primary color */
color: white; color: white;
border: none; border: none;
border-radius: 40px; border-radius: 40px;
@ -228,48 +295,64 @@
height: 42px; height: 42px;
font-size: 18px; font-size: 18px;
margin-left: 10px; margin-left: 10px;
margin-bottom: 10px; /* Space between buttons */ margin-bottom: 10px;
/* Space between buttons */
} }
/* Remove the margin from the last button */ /* Remove the margin from the last button */
.vendor-add-button:last-child { .vendor-add-button:last-child {
margin-bottom: 0; /* No margin for the last button */ margin-bottom: 0;
/* No margin for the last button */
} }
/* Mobile responsiveness */ /* Mobile responsiveness */
@media (max-width: 600px) { @media (max-width: 600px) {
.vendor-add-button { .vendor-add-button {
width: 100%; /* Full width buttons */ width: 100%;
margin-bottom: 10px; /* Maintain spacing for mobile */ /* Full width buttons */
margin-bottom: 10px;
/* Maintain spacing for mobile */
} }
} }
/* styles.css */ /* styles.css */
.rounded-table { .rounded-table {
border-radius: 20px; border-radius: 20px;
overflow: hidden; overflow: hidden;
border: 1px solid #ccc; border: 1px solid #ccc;
} }
.table-head { .table-head {
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.table-head th { .table-head th {
padding: 10px; padding: 10px;
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
} }
.table-body td { .table-body td {
font-size: 16px; font-size: 16px;
} }
/*===============================================================Store Css Start===============================================================*/ /*===============================================================Store Css Start===============================================================*/
.store-container { .store-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: flex-start; /* Align items to the start (left) */ align-items: flex-start;
border-radius: 40px; /* Align items to the start (left) */
padding: 30px; padding: 30px;
margin: 20px auto; margin: 20px auto;
background-color: #ffffff;
width: 1600px; width: 1600px;
max-width: 100%; max-width: 100%;
background: #FFFFFF;
border: 1px solid #EBEAF2;
box-shadow: "0px 2px 8px rgba(6, 12, 34, 0.0392157)";
border-radius: 14px;
} }
@ -277,33 +360,44 @@
.department-container { .department-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; /* Align items to the start (top) */ justify-content: flex-start;
align-items: flex-start; /* Align items to the start (left) */ box-shadow: 0px 2px 8px rgba(6, 12, 34, 0.0392157);
align-items: flex-start;
border: 1px solid #EBEAF2;
border-radius: 20px; border-radius: 20px;
padding: 30px; padding: 30px;
margin: 10px 0;
border: none; /* Ensure no border */
border-bottom: 2px solid #ccc; /* Set a bottom border */
margin: 20px 0; /* Center vertically with top and bottom margins */
background-color: #ffffff; background-color: #ffffff;
width: 850px; /* Set a fixed width */ width: 850px;
max-width: 100%; /* Ensure it doesn't exceed the screen width */
margin-left: 160px; /* Align to the left with 9% margin */ max-width: 100%;
margin-left: 160px;
} }
.setting-title { .setting-title {
margin-bottom: 10px; /* Space between title and inputs */ margin-bottom: 10px;
font-size: 24px; /* Adjust as needed */ /* Space between title and inputs */
font-size: 24px;
/* Adjust as needed */
} }
.input-container { .input-container {
width: 100%; /* Ensure it takes the full width */ width: 100%;
/* Ensure it takes the full width */
} }
.input-row { .input-row {
display: flex; /* Use flexbox to align input fields */ display: flex;
gap: 10px; /* Space between input fields */ /* Use flexbox to align input fields */
gap: 10px;
/* Space between input fields */
} }
.input-field { .input-field {
padding: 10px; padding: 10px;
width: 600px; width: 600px;
@ -312,19 +406,24 @@
border: 1px solid #f6f6f6; border: 1px solid #f6f6f6;
border-radius: 5px; border-radius: 5px;
} }
.card-container { .card-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 30px; gap: 30px;
} }
.plan-title { .plan-title {
align-items: center; /* This centers the items vertically */ align-items: center;
/* This centers the items vertically */
gap: 10px; gap: 10px;
width: 308px; width: 308px;
height: 46px; height: 46px;
font-size: 20px; font-size: 20px;
justify-content: center; /* Center items horizontally */ justify-content: center;
/* Center items horizontally */
} }
.current-plan { .current-plan {
font-weight: 600; font-weight: 600;
font-size: 20px; font-size: 20px;
@ -336,23 +435,30 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.card-store { .card-store {
width: 377px; /* Set card width */ width: 377px;
height: 400px; /* Set card height */ /* Set card width */
height: 400px;
/* Set card height */
border: 1px solid rgba(69, 69, 219, 0.3); border: 1px solid rgba(69, 69, 219, 0.3);
box-shadow: 12px 4px 4px rgba(0, 0, 0, 0.18); box-shadow: 12px 4px 4px rgba(0, 0, 0, 0.18);
border-radius: 20px; border-radius: 20px;
position: relative; position: relative;
} }
.card-store.basic { .card-store.basic {
background-color: #f4f6ff; background-color: #f4f6ff;
} }
.card-store.premium { .card-store.premium {
background-color: #ececfb; background-color: #ececfb;
} }
.card-store.enterprise { .card-store.enterprise {
background-color: #f4f6ff; background-color: #f4f6ff;
} }
.card-store-title { .card-store-title {
width: 313px; width: 313px;
font-size: 32px; font-size: 32px;
@ -360,11 +466,13 @@
margin-left: 20px; margin-left: 20px;
font-weight: 600px; font-weight: 600px;
} }
.card-store-description { .card-store-description {
width: 325px; width: 325px;
font-size: 20px; font-size: 20px;
margin-left: 20px; margin-left: 20px;
} }
.card-store-sub-amount { .card-store-sub-amount {
display: flex; display: flex;
align-items: center; align-items: center;
@ -373,35 +481,42 @@
margin-left: 20px; margin-left: 20px;
font-weight: 600px; font-weight: 600px;
} }
.dollar-sign { .dollar-sign {
font-size: 40px; font-size: 40px;
margin-right: 8px; margin-right: 8px;
} }
.card-store-button { .card-store-button {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: auto; /* Center horizontally */ margin: auto;
/* Center horizontally */
border: 1px solid #4545db; border: 1px solid #4545db;
border-radius: 40px; border-radius: 40px;
margin-top: 10px; margin-top: 10px;
background-color: #ffffff; background-color: #ffffff;
height: 52px; height: 52px;
width: 300px; /* Adjust width */ width: 300px;
/* Adjust width */
padding: 0 25px; padding: 0 25px;
font-size: 18px; font-size: 18px;
color: #4545db; color: #4545db;
cursor: pointer; cursor: pointer;
} }
.card-store-button.premium { .card-store-button.premium {
background-color: #4545db; background-color: #4545db;
color: #ffffff; color: #ffffff;
} }
.sub-icon { .sub-icon {
position: absolute; position: absolute;
top: 16px; top: 16px;
right: 16px; right: 16px;
} }
/*-----------------------------------------------------upcoming invoice-------------------------------------*/ /*-----------------------------------------------------upcoming invoice-------------------------------------*/
.saved-card { .saved-card {
width: 260px; width: 260px;
@ -415,45 +530,63 @@
position: relative; position: relative;
margin: 0 10px; margin: 0 10px;
} }
.card-head { .card-head {
display: flex; display: flex;
justify-content: space-between; /* Align label and bank name */ justify-content: space-between;
align-items: center; /* Center vertically */ /* Align label and bank name */
margin-bottom: 10px; /* Space below header */ align-items: center;
/* Center vertically */
margin-bottom: 10px;
/* Space below header */
} }
.credit-card-label { .credit-card-label {
font-size: 16px; font-size: 16px;
margin: 0; margin: 0;
} }
.bank-name-card { .bank-name-card {
font-size: 16px; font-size: 16px;
text-align: right; /* Align bank name to the right */ text-align: right;
margin: 0; /* Remove default margin */ /* Align bank name to the right */
margin: 0;
/* Remove default margin */
} }
.card-number { .card-number {
text-align: center; text-align: center;
font-size: 20px; /* Adjust size as needed */ font-size: 20px;
/* Adjust size as needed */
margin-top: 20px; margin-top: 20px;
font-weight: 500; font-weight: 500;
} }
.card-bottom { .card-bottom {
display: flex; display: flex;
justify-content: space-between; /* Space between card holder and validity */ justify-content: space-between;
margin-top: auto; /* Push footer to the bottom */ /* Space between card holder and validity */
margin-top: auto;
/* Push footer to the bottom */
} }
.card-holder { .card-holder {
font-size: 16px; font-size: 16px;
text-align: left; text-align: left;
margin: 0; /* Remove default margin */ margin: 0;
/* Remove default margin */
} }
.valid-through { .valid-through {
font-size: 12px; font-size: 12px;
text-align: right; text-align: right;
margin: 0; margin: 0;
} }
.dept-button { .dept-button {
padding: 6px 8px; padding: 6px 8px;
background-color: #4545db; /* Bootstrap primary color */ background-color: #4545db;
/* Bootstrap primary color */
color: white; color: white;
border: none; border: none;
border-radius: 40px; border-radius: 40px;
@ -462,59 +595,81 @@
height: 42px; height: 42px;
font-size: 18px; font-size: 18px;
} }
.dept-cards-row { .dept-cards-row {
margin-top: 30px; margin-top: 30px;
display: flex; display: flex;
flex-wrap: wrap; /* Allow wrapping to the next row */ flex-wrap: wrap;
gap: 10px; /* Space between cards */ /* space above cards */ /* Allow wrapping to the next row */
gap: 10px;
/* Space between cards */
/* space above cards */
} }
.dept-card { .dept-card {
width: 474px; /* Fixed width */ width: 474px;
height: 70px; /* Fixed height */ /* Fixed width */
height: 70px;
/* Fixed height */
padding: 10px; padding: 10px;
border: 1px solid #EBEAF2; /* Add border color */ border: 1px solid #EBEAF2;
border-radius: 20px; /* Rounded corners */ /* Add border color */
display: flex; /* Flexbox layout */ border-radius: 20px;
align-items: center; /* Center items vertically */ /* Rounded corners */
justify-content: space-between; /* Space items evenly */ display: flex;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add box shadow */ /* Flexbox layout */
align-items: center;
/* Center items vertically */
justify-content: space-between;
/* Space items evenly */
/* Add box shadow */
} }
.dept-info { .dept-info {
width: 386px; width: 386px;
height: 50px; height: 50px;
padding: 10px; padding: 10px;
background-color: #ffffff; background-color: #ffffff;
border: none; /* Remove the redundant border */
border-radius: 10px; /* Rounded corners */ border: none;
/* Remove the redundant border */
border-radius: 10px;
/* Rounded corners */
} }
.create-department-section { .create-department-section {
width: 100%; width: 100%;
} }
.dept-icon { .dept-icon {
cursor: pointer; cursor: pointer;
} }
/* ===========================================================Expense Screen CSS Start =============================================================*/ /* ===========================================================Expense Screen CSS Start =============================================================*/
input[type="date"]::-webkit-calendar-picker-indicator { input[type="date"]::-webkit-calendar-picker-indicator {
color: rgba(0, 0, 0, 0); color: rgba(0, 0, 0, 0);
opacity: 1; opacity: 1;
display: block; display: block;
background: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 2V5" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 2V5" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 9.08984H20.5" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 8.5V17C21 20 19.5 22 16 22H8C4.5 22 3 20 3 17V8.5C3 5.5 4.5 3.5 8 3.5H16C19.5 3.5 21 5.5 21 8.5Z" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.6947 13.6992H15.7037" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.6947 16.6992H15.7037" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.9955 13.6992H12.0045" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.9955 16.6992H12.0045" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.29431 13.6992H8.30329" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.29431 16.6992H8.30329" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') background: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 2V5" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 2V5" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 9.08984H20.5" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 8.5V17C21 20 19.5 22 16 22H8C4.5 22 3 20 3 17V8.5C3 5.5 4.5 3.5 8 3.5H16C19.5 3.5 21 5.5 21 8.5Z" stroke="%23002300" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.6947 13.6992H15.7037" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.6947 16.6992H15.7037" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.9955 13.6992H12.0045" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.9955 16.6992H12.0045" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.29431 13.6992H8.30329" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.29431 16.6992H8.30329" stroke="%23002300" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat;
no-repeat;
width: 20px; width: 20px;
height: 20px; height: 20px;
border-width: thin; border-width: thin;
} }
input[type="date"] { input[type="date"] {
cursor: default; cursor: default;
} }
/*==================================================================vendor multiselect==========================================================*/ /*==================================================================vendor multiselect==========================================================*/
.chips-container { .chips-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 5px; /* Space between chips and dropdown */ margin-bottom: 5px;
max-width: 483px; /* Match the dropdown width */ /* Space between chips and dropdown */
max-width: 483px;
/* Match the dropdown width */
} }
.chip { .chip {
@ -531,6 +686,7 @@ input[type="date"] {
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
} }
/* Custom styles for the select element and option hover */ /* Custom styles for the select element and option hover */
@ -539,6 +695,7 @@ input[type="date"] {
max-width: 100%; max-width: 100%;
width: 100%; width: 100%;
} }
.data-table { .data-table {
width: 100%; width: 100%;
border: 2px solid #F4F4F4; border: 2px solid #F4F4F4;
@ -546,38 +703,48 @@ input[type="date"] {
/* border-radius: 20px 20px 0 0; */ /* border-radius: 20px 20px 0 0; */
overflow: hidden; overflow: hidden;
} }
.table-header th, .table-body td {
.table-header th,
.table-body td {
/* border: 1px solid #F4F4F4; */ /* border: 1px solid #F4F4F4; */
padding: 12px; padding: 12px;
text-align: left; text-align: center;
padding-left: 20px; padding-left: 20px;
} }
.table-header th { .table-header th {
background-color: #282e26; background-color: #282e26;
color: white; color: white;
cursor: pointer; /* Added cursor for sortable columns */ cursor: pointer;
/* Added cursor for sortable columns */
} }
.table-body td { .table-body td {
padding-left: 20px; padding-left: 20px;
color: #002300; color: #002300;
background-color: #ffffff; background-color: #ffffff;
border-bottom: 1px solid #EBEAF2; border-bottom: 1px solid #EBEAF2;
} }
.table-body tr:last-child td { .table-body tr:last-child td {
border-bottom: 1px solid #ffffff; border-bottom: 1px solid #ffffff;
} }
.table-body { .table-body {
border-bottom: 2px solid #EBEAF2; border-bottom: 2px solid #EBEAF2;
} }
.no-column { .no-column {
width: 100px; width: 100px;
} }
.action-column { .action-column {
color: #002300; color: #002300;
width: auto; width: auto;
text-align: right; text-align: right;
} }
.action-button { .action-button {
background: none; background: none;
border: none; border: none;
@ -585,56 +752,86 @@ input[type="date"] {
padding: 0; padding: 0;
margin: 0 5px; margin: 0 5px;
} }
.action-button svg { .action-button svg {
width: 16px; width: 16px;
height: 16px; height: 16px;
fill: #002300; fill: #002300;
transition: fill 0.3s; transition: fill 0.3s;
} }
.action-button:hover svg { .action-button:hover svg {
fill: #005600; fill: #005600;
} }
.pagination {
display: flex; .p.pagination {
justify-content: end; border-end-start-radius: 24px;
padding: 10px 0; border-end-end-radius: 24px;
border-radius: 50%;
/* Overall border radius for the pagination container */
border-bottom: 2px solid #EBEAF2;
background-color: #ffffff; background-color: #ffffff;
display: flex;
/* Ensure it behaves as a flex container */
justify-content: center;
align-items: center;
} }
.pagination .page-item { .pagination .page-item {
margin: 0 5px;
width: 30px;
/* Fixed width */
height: 30px;
/* Fixed height */
border-radius: 50%;
/* Make sure all page items are circular */
display: flex;
/* Center the content */
align-items: center;
/* Center the content vertically */
justify-content: center;
/* Center the content horizontally */
} }
.pagination .page-link { .pagination .page-link {
padding: 10px;
border: 1px solid #F4F4F4; border: 1px solid #F4F4F4;
/* background-color: #ffffff; */
background-color: #b6d7a8; background-color: #b6d7a8;
border-radius: 30px; border-radius: 50%;
/* Make sure links are circular */
color: #002300; color: #002300;
text-decoration: none; text-decoration: none;
display: flex; display: flex;
/* Center the content */
align-items: center; align-items: center;
/* Center the content vertically */
justify-content: center; justify-content: center;
/* Center the content horizontally */
width: 30px; width: 30px;
/* Fixed width */
height: 30px; height: 30px;
/* Fixed height */
transition: background-color 0.3s, color 0.3s; transition: background-color 0.3s, color 0.3s;
} }
.pagination .page-link:hover { .pagination .page-link:hover {
background-color: red; background-color: #b6d7a8;
/* Same background color on hover */
border-radius: 50%;
} }
.pagination .page-item.active .page-link { .pagination .page-item.active .page-link {
width: 30px; background-color: #ffaf32;
height: 30px; /* Yellow background for active item */
border-radius: 30px;
background-color: #ffaf32; /* Yellow background */
color: #002300; color: #002300;
border-color:#fbfbfbfb; border-radius: 50%;
border: 1px solid #d3d3d3fb; border-color: #d3d3d3;
} /* Border color for active item */
.pagination .page-item.disabled .page-link {
opacity: 0.5;
pointer-events: none;
} }
.pagination .page-item.pgbtn .page-link {
border-radius: 50%;
}

View File

@ -418,7 +418,7 @@ export default function Payroll() {
<div <div
className="modal-container" className="modal-container"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
style={{ width: modalType === 'payment' ? '650px' : '700px', borderRadius: '40px' }} style={{ width: modalType === 'payment' ? '800px' : '700px', borderRadius: '40px' }}
> >
<div <div
className="modal-header" className="modal-header"
@ -678,7 +678,7 @@ export default function Payroll() {
backgroundColor: paymentData.payment_method === "cash" ? "#4a5546" : "transparent", backgroundColor: paymentData.payment_method === "cash" ? "#4a5546" : "transparent",
color: paymentData.payment_method === "cash" ? "#ffffff" : "#000000", color: paymentData.payment_method === "cash" ? "#ffffff" : "#000000",
border: 'none', border: 'none',
padding: '5px 5px', padding: '5px 0px',
borderRadius: '20px', borderRadius: '20px',
cursor: 'pointer', cursor: 'pointer',
}} }}

View File

@ -264,50 +264,63 @@ const PayrollTableWithButton = ({
)} )}
</div> </div>
<div > <div >
<div <div
className="expense-search d-flex align-items-center" className="expense-search d-flex align-items-center"
style={{ style={{
backgroundColor: "#4A5546", display: "flex",
boxShadow: "none", alignItems: "center",
outline: "none", backgroundColor: "#FFFFFF",
width: "auto", border: "1px solid #DBDBDB",
height: "42px", borderRadius: "10px",
cursor: "pointer",
width: "200px",
}}
>
<span
style={{
fontFamily: "'Comfortaa'",
fontStyle: "normal",
fontWeight: "400",
fontSize: "14px", // Compact text
color: "#000000",
marginLeft:"10px"
}}
>
Show Rows:
</span>
<select
name="option"
id="pageSelect"
className="selectoptions"
style={{
backgroundColor: "#282E26", // Match background color
color: "#FFFFFF", // White text color
fontFamily: "'Comfortaa'",
fontStyle: "normal",
fontWeight: "700",
fontSize: "14px",
lineHeight: "16px",
padding: "4px 10px", // Adjust padding for the dropdown
border: "none", // No border
borderRadius: "0 10px 10px 0", // Rounded on the right side only
cursor: "pointer",
marginLeft: "auto", // Push to the right
}}
value={rowsPerPage}
onChange={(e) => {
setRowsPerPage(Number(e.target.value));
setCurrentPage(1); // Reset to the first page on change
}}
>
<option value={5}>5</option>
<option value={10}>10</option>
<option value={15}>15</option>
<option value={20}>20</option>
</select>
</div>
padding: "8px 12px", </div>
fontSize: "16px",
border: "none",
borderRadius: "10px",
color: "#F4FFEE",
cursor: "pointer",
}}
>
<h6 className="" style={{ margin: '10px' }}>Show</h6>
<select
name="option"
id="pageSelect"
className="selectoptions"
style={{
height: "30px",
padding: "2px 6px",
border: "1px solid #ccc",
backgroundColor: "#282E26",
color: "#fff",
fontSize: "14px",
}}
value={rowsPerPage}
onChange={(e) => {
setRowsPerPage(Number(e.target.value));
setCurrentPage(1); // Reset to first page on change
}}
>
<option value={5}>5</option>
<option value={10}>10</option>
<option value={15}>15</option>
<option value={20}>20</option>
</select>
</div>
</div>
</div> </div>
<table className="data-table custom-table "> <table className="data-table custom-table ">

View File

@ -623,38 +623,16 @@ export default function Purchase() {
<div className="main-container"> <div className="main-container">
<div className="d-flex p-2"> <div className="d-flex p-2">
<div className="expensecontainer d-flex flex-column pd-2"> <div className="expensecontainer d-flex flex-column pd-2">
<div className="d-flex align-items-center mb-3" style={{ gap: "10px" }}> <div className="d-flex align-items-center mb-3" style={{
<button className="btn cus d-flex align-items-center" onClick={toggleModal}> justifyContent: "space-between",
{" "} gap: "10px",
+ Add Invoice marginBottom: "10px",
<img }}>
src={invoiceIcon} <h3 className="mb-1" style={{ margin: "0" }}>Purchase</h3>
alt="Invoice Icon" <div className="d-flex align-items-center" style={{ gap: "10px" }}>
style={{ width: "20px", height: "20px", marginLeft: "8px" }}
/>
</button>
<button style={{
backgroundColor: "#4A5546",
boxShadow: "none",
outline: "none",
width: "auto",
height: "42px",
padding: "8px 12px",
fontSize: "16px",
border: "none",
borderRadius: "10px",
color: "#F4FFEE",
cursor: "pointer",
}}>
+ Add New Vendor
<img
src={vendor}
alt="Invoice Icon"
style={{ width: "20px", height: "20px", marginLeft: "8px" }}
/>
</button>
<button style={{ <button style={{
backgroundColor: "#4A5546", backgroundColor: "#4A5546",
boxShadow: "none", boxShadow: "none",
@ -669,95 +647,57 @@ export default function Purchase() {
cursor: "pointer", cursor: "pointer",
}} }}
> >
+ Add Department Add Department
<img <img
src={department} src={department}
alt="Invoice Icon" alt="Invoice Icon"
style={{ width: "20px", height: "20px", marginLeft: "8px" }} style={{ width: "20px", height: "20px", marginLeft: "8px" }}
/> />
</button> </button>
<button style={{
backgroundColor: "#4A5546",
boxShadow: "none",
outline: "none",
width: "auto",
height: "42px",
padding: "8px 12px",
fontSize: "16px",
border: "none",
borderRadius: "10px",
color: "#F4FFEE",
cursor: "pointer",
}}>
Add New Vendor
<img
src={vendor}
alt="Invoice Icon"
style={{ width: "20px", height: "20px", marginLeft: "8px" }}
/>
</button>
<div <button className="btn cus d-flex align-items-center"
style={{ style={{
display: "flex",
gap: "16px",
justifyContent: "center", width: "180px",
alignItems: "center", height: "42px",
margin: "20px",
}} justifyContent:"center",
> textAlign:'center',
{/* Invoice due this month */}
<div }}
style={{ onClick={toggleModal}>
backgroundColor: "#fff8e6", {" "}
border: "1px solid #ffd700", Add Invoice
borderRadius: "8px", <img
padding: "16px 24px", src={invoiceIcon}
display: "flex", alt="Invoice Icon"
flexDirection: "column", style={{ width: "20px", height: "20px", marginLeft: "8px" }}
justifyContent: "center", />
alignItems: "flex-start", </button>
width: "300px",
textAlign: "left",
}}
>
<p style={{ fontSize: "24px", fontWeight: "bold", margin: "0" }}>
$500
</p>
<p style={{ fontSize: "14px", color: "#555", margin: "4px 0" }}>
Invoice due this month
</p>
</div>
{/* Last 7 days sale */}
<div
style={{
backgroundColor: "#e6ffee",
border: "1px solid #00b300",
borderRadius: "8px",
padding: "16px 24px",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "flex-start",
width: "300px",
textAlign: "left",
}}
>
<p style={{ fontSize: "24px", fontWeight: "bold", margin: "0" }}>
$1900
</p>
<p style={{ fontSize: "14px", color: "#555", margin: "4px 0" }}>
Last 7 days sale
</p>
</div>
{/* Expense this month */}
<div
style={{
backgroundColor: "#ffe6e6",
border: "1px solid #ff4d4d",
borderRadius: "8px",
padding: "16px 24px",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "flex-start",
width: "300px",
textAlign: "left",
}}
>
<p style={{ fontSize: "24px", fontWeight: "bold", margin: "0" }}>
$0.00
</p>
<p style={{ fontSize: "14px", color: "#555", margin: "4px 0" }}>
Expense this month
</p>
</div>
</div> </div>
</div> </div>
{/* Table Start */} {/* Table Start */}
@ -787,10 +727,10 @@ export default function Purchase() {
className="modal-container" className="modal-container"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
style={{ style={{
width: "700px", width: "800px",
backgroundColor: "white", backgroundColor: "white",
margin: "100px auto", margin: "100px auto",
padding: "20px", // padding: "10px",
borderRadius: "8px", borderRadius: "8px",
position: "relative", position: "relative",
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)", boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
@ -867,7 +807,7 @@ export default function Purchase() {
</div> </div>
</div> </div>
<div className="d-flex col-md-12"> <div className="d-flex col-md-12">
<div className="col-md-6" style={{ paddingRight: "10px" }}> <div className="col-md-5" style={{ paddingRight: "10px" }}>
<select <select
style={{ style={{
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
@ -946,9 +886,9 @@ export default function Purchase() {
</div> </div>
</div> </div>
<div className="d-flex col-md-12 mt-2"> <div className="d-flex col-md-12 mt-2 gap-4">
<div <div
className="form-row d-flex col-md-5 p-2 mt-2" className="form-row d-flex col-md-5 p-2 mt-2 "
style={{ style={{
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
border: "none", // Remove all borders border: "none", // Remove all borders

View File

@ -34,14 +34,9 @@ const Header = () => {
const settingsRef = useRef(null); const settingsRef = useRef(null);
const lotteryRef = useRef(null); const lotteryRef = useRef(null);
const gasRef = useRef(null); const gasRef = useRef(null);
// const [selectedNav, setSelectedNav] = useState("/"); const [selectedNav, setSelectedNav] = useState("/");
const { Get, getAPI, Post } = useApi(); const { Get, getAPI, Post } = useApi();
const [parentLabel, setParentLabel] = useState("Expense"); // Parent label
const [selectedChild, setSelectedChild] = useState(""); // Selected child label
const [selectedNav, setSelectedNav] = useState("Expense");
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
const toggleMobileMenu = () => { const toggleMobileMenu = () => {
setIsMobileMenuOpen(!isMobileMenuOpen); setIsMobileMenuOpen(!isMobileMenuOpen);
@ -64,18 +59,6 @@ const Header = () => {
logOutUser(); logOutUser();
}; };
const handleChildSelection = (childLabel) => {
setSelectedChild(childLabel); // Update the selected child label
setExpenseDropdownOpen(false); // Close the dropdown
};
const toggleDropdown = () => {
setExpenseDropdownOpen(!expenseDropdownOpen);
if (expenseDropdownOpen) {
setSelectedChild(""); // Clear selected child if closing
}
};
const handleStoreManageClick = async () => { const handleStoreManageClick = async () => {
setDropdownVisible(!isDropdownVisible); setDropdownVisible(!isDropdownVisible);
@ -158,8 +141,6 @@ const Header = () => {
setLotteryDropdownOpen(false); setLotteryDropdownOpen(false);
setGasDropdownOpen(false); setGasDropdownOpen(false);
setDropdownVisible(false); setDropdownVisible(false);
setSelectedChild("");
}; };
useEffect(() => { useEffect(() => {
@ -170,42 +151,43 @@ const Header = () => {
}, []); }, []);
return ( return (
<header className="header-container"> <header className="header-container">
<div className="navbar-left"> <div className="navbar-left">
<img src={paisavalaLogo} alt="Logo" /> <img src={paisavalaLogo} alt="Logo" />
</div> </div>
<nav className="navbar navbar-expand-lg"> <nav className="navbar navbar-expand-lg">
<div className="container-fluid"> <div className="container-fluid">
{/* <Link to="/"> {/* <Link to="/">
<img src={logo} alt="Logo" className="logo" /> <img src={logo} alt="Logo" className="logo" />
</Link> */} </Link> */}
<button <button
className="navbar-toggler" className="navbar-toggler"
type="button" type="button"
onClick={toggleMobileMenu} onClick={toggleMobileMenu}
>
<i className="fas fa-bars"></i>
</button>
<div
className={`collapse navbar-collapse ${isMobileMenuOpen ? 'show' : ''}`}
id="navbarNav"
> <ul className="navbar-nav me-auto">
{userRole === "store owner" && (
<li
className={`nav-item ${
selectedNav === "/owner-dashboard" ? "active" : ""
}`}
> >
<i className="fas fa-bars"></i> <Link
</button> className="nav-link"
<div to="/owner-dashboard"
className={`collapse navbar-collapse ${isMobileMenuOpen ? 'show' : ''}`} onClick={() => {
id="navbarNav" setSelectedNav("/owner-dashboard");
> <ul className="navbar-nav me-auto"> closeDropdowns();
{userRole === "store owner" && ( }}
<li >
className={`nav-item ${selectedNav === "/owner-dashboard" ? "active" : "" Owner Dashboard
}`} </Link>
> </li>
<Link )}
className="nav-link"
to="/owner-dashboard"
onClick={() => {
setSelectedNav("/owner-dashboard");
closeDropdowns();
}}
>
Owner Dashboard
</Link>
</li>
)}
<li className={`nav-item ${selectedNav === "/" ? "active" : ""}`}> <li className={`nav-item ${selectedNav === "/" ? "active" : ""}`}>
<Link <Link
@ -219,80 +201,28 @@ const Header = () => {
Dashboard Dashboard
</Link> </Link>
</li> </li>
<li <li
className={`nav-item ${expenseDropdownOpen ? "active" : ""}`} className={`nav-item ${selectedNav === "#" ? "active" : ""}`}
ref={expenseRef} ref={expenseRef}
onClick={() => { onClick={() => {
closeDropdowns();
setExpenseDropdownOpen(!expenseDropdownOpen); setExpenseDropdownOpen(!expenseDropdownOpen);
}} }}
style={{
display: "flex",
flexDirection: "column", // Ensures child label is displayed below
alignItems: "flex-start", // Align labels to the left
position: "relative",
marginTop: "12px",
}}
> >
{/* Parent Label */}
<a <a
className="nav-link" className="nav-link"
href="#" href="#"
onClick={(e) => e.preventDefault()} onClick={(e) => e.preventDefault()}
> >
{parentLabel} Expense
</a> </a>
{/* Selected Child Label Below Parent Label */}
{selectedChild && (
<span
style={{
fontSize: "14px",
color: "white",
// borderBottom:'1px solid blue',
backgroundColor: "#282e26",
padding: "0px 20px",
borderRadius: '20px',
fontStyle: "normal",
}}
>
{selectedChild}
</span>
)}
{/* Dropdown Menu */}
{expenseDropdownOpen && ( {expenseDropdownOpen && (
<ul <ul className="nav-menu-drop">
className="nav-menu-drop"
style={{
listStyle: "none",
padding: "10px",
margin: "0px",
border: "1px solid #ccc",
borderRadius: "4px",
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
backgroundColor: "#fff",
position: "absolute",
top: "100%", // Ensures dropdown appears below labels
left: "0",
zIndex: 10,
transform: "translateY(20px)", // Moves dropdown below header area
}}
>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/expense" to="/expense"
onClick={() => handleChildSelection("Expense")} onClick={closeDropdowns}
style={{
display: "block",
padding: "8px 12px",
color: "#000",
textDecoration: "none",
}}
> >
Expense Expense
</Link> </Link>
@ -301,13 +231,7 @@ const Header = () => {
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/purchase" to="/purchase"
onClick={() => handleChildSelection("Purchase")} onClick={closeDropdowns}
style={{
display: "block",
padding: "8px 12px",
color: "#000",
textDecoration: "none",
}}
> >
Purchase Purchase
</Link> </Link>
@ -315,10 +239,10 @@ const Header = () => {
</ul> </ul>
)} )}
</li> </li>
<li <li
className={`nav-item ${selectedNav === "/payroll" ? "active" : "" className={`nav-item ${
}`} selectedNav === "/payroll" ? "active" : ""
}`}
> >
<Link <Link
className="nav-link" className="nav-link"
@ -333,8 +257,9 @@ const Header = () => {
</li> </li>
<li <li
className={`nav-item ${selectedNav === "/reportDateSelection" ? "active" : "" className={`nav-item ${
}`} selectedNav === "/reportDateSelection" ? "active" : ""
}`}
> >
<Link <Link
className="nav-link" className="nav-link"
@ -347,92 +272,92 @@ const Header = () => {
Reports Reports
</Link> </Link>
</li> </li>
{(userRole === "store owner" || userRole === "store manager") && ( {(userRole === "store owner" || userRole === "store manager") &&(
<li <li
className={`nav-item ${selectedNav === "#" ? "active" : ""}`} className={`nav-item ${selectedNav === "#" ? "active" : ""}`}
ref={generalRef} ref={generalRef}
onClick={() => { onClick={() => {
closeDropdowns(); closeDropdowns();
setGeneralDropdownOpen(!generalDropdownOpen); setGeneralDropdownOpen(!generalDropdownOpen);
}} }}
>
<a
className="nav-link"
href="#"
onClick={(e) => e.preventDefault()}
> >
<a General
className="nav-link" </a>
href="#" {generalDropdownOpen && (
onClick={(e) => e.preventDefault()} <ul className="nav-menu-drop">
> <li>
General <Link
</a> className="nav-menu-drop-item"
{generalDropdownOpen && ( to="/ATM"
<ul className="nav-menu-drop"> onClick={closeDropdowns}
<li> >
<Link ATM
className="nav-menu-drop-item" </Link>
to="/ATM" </li>
onClick={closeDropdowns} <li>
> <Link
ATM className="nav-menu-drop-item"
</Link> to="/Bank"
</li> onClick={closeDropdowns}
<li> >
<Link Bank
className="nav-menu-drop-item" </Link>
to="/Bank" </li>
onClick={closeDropdowns} <li>
> <Link
Bank className="nav-menu-drop-item"
</Link> to="/OtherIncome"
</li> onClick={closeDropdowns}
<li> >
<Link Other Income
className="nav-menu-drop-item" </Link>
to="/OtherIncome" </li>
onClick={closeDropdowns} <li>
> <Link
Other Income className="nav-menu-drop-item"
</Link> to="/SalesTax"
</li> onClick={closeDropdowns}
<li> >
<Link Sales Tax
className="nav-menu-drop-item" </Link>
to="/SalesTax" </li>
onClick={closeDropdowns} <li>
> <Link
Sales Tax className="nav-menu-drop-item"
</Link> to="/bankLedger"
</li> onClick={closeDropdowns}
<li> >
<Link Bank Ledger
className="nav-menu-drop-item" </Link>
to="/bankLedger" </li>
onClick={closeDropdowns}
>
Bank Ledger
</Link>
</li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/cashLedger" to="/cashLedger"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Cash Ledger Cash Ledger
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/OwnerDist" to="/OwnerDist"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Owner Distribution Owner Distribution
</Link> </Link>
</li> </li>
</ul> </ul>
)} )}
</li> </li>
)} )}
<li <li
className={`nav-item ${selectedNav === "#" ? "active" : ""}`} className={`nav-item ${selectedNav === "#" ? "active" : ""}`}
@ -547,191 +472,191 @@ const Header = () => {
</ul> </ul>
)} )}
</li> </li>
{userRole === "store owner" && ( {userRole === "store owner" &&(
<li <li
className={`nav-item ${selectedNav === "#" ? "active" : ""}`} className={`nav-item ${selectedNav === "#" ? "active" : ""}`}
ref={settingsRef} ref={settingsRef}
onClick={() => { onClick={() => {
closeDropdowns(); closeDropdowns();
setSettingsDropdownOpen(!settingsDropdownOpen); setSettingsDropdownOpen(!settingsDropdownOpen);
}} }}
> >
<a <a
className="nav-link" className="nav-link"
href="#" href="#"
onClick={(e) => e.preventDefault()} onClick={(e) => e.preventDefault()}
> >
Settings Settings
</a> </a>
{settingsDropdownOpen && ( {settingsDropdownOpen && (
<ul className="nav-menu-drop"> <ul className="nav-menu-drop">
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/store-information" to="/store-information"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Store Information Store Information
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/manage-users" to="/manage-users"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Manage Users Manage Users
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/manage-departments" to="/manage-departments"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Manage Departments Manage Departments
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/manage-expense-type" to="/manage-expense-type"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Manage Expense Type Manage Expense Type
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/other-income-type" to="/other-income-type"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Other Income Type Other Income Type
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/manage-vendor" to="/manage-vendor"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Manage Vendor Manage Vendor
</Link> </Link>
</li> </li>
<li> <li>
<Link <Link
className="nav-menu-drop-item" className="nav-menu-drop-item"
to="/manage-settings" to="/manage-settings"
onClick={closeDropdowns} onClick={closeDropdowns}
> >
Manage Settings Manage Settings
</Link> </Link>
</li> </li>
</ul> </ul>
)} )}
</li> </li>
)} )}
</ul> </ul>
<div className="d-flex align-items-center" > <div className="d-flex align-items-center" >
{/* <div className={`trail me-3 ${getColorClass()}`}> {/* <div className={`trail me-3 ${getColorClass()}`}>
<p>Remaining days: {remainingDays}</p> <p>Remaining days: {remainingDays}</p>
</div> */} </div> */}
</div> </div>
</div> </div>
</div> </div>
</nav> </nav>
<div className="navbar-left"> <div className="navbar-left">
<div className="avatar-container" ref={avatarRef}> <div className="avatar-container" ref={avatarRef}>
<img <img
src={shopeKeeper} src={shopeKeeper}
className="avatar" className="avatar"
alt="User Avatar" alt="User Avatar"
/>
{/* Display role_name here */}
<div className="user-role">
{userRole && <span>{userRole}</span>}
</div>
{/* Settings Icon Button */}
<button
className="settings-button"
onClick={(e) => {
e.stopPropagation(); // Prevent the click from triggering the avatar's click
closeDropdowns();
setsettingsDropOpen(!settingsDropOpen); // Toggle dropdown
}}
>
{/* Optional: Add an icon here */}
</button>
/> {settingsDropOpen && (
{/* Display role_name here */} <ul className="nav-menu-drop">
<div className="user-role"> <li>
{userRole && <span>{userRole}</span>} <Link className="nav-menu-drop-item" to="#" onClick={closeDropdowns}>
Profile
</Link>
</li>
{(userRole === "store owner" || userRole === "store manager") && (
<li>
<a
className="nav-menu-drop-item"
href="#"
onClick={(e) => {
e.preventDefault();
handleStoreManageClick();
}}
>
Switch Store
</a>
</li>
)}
{isDropdownVisible && (
<div className="dropdown-container">
<ul className="dropdown-list">
{loading ? (
<li>Loading...</li>
) : (
stores.map((store) => (
<li key={store.id} className="dropdown-item">
<a
href="#"
className="dropdown-link"
onClick={(e) => {
handleStoreClick(store.id);
window.location.reload();
}}
>
{store.name}
</a>
</li>
))
)}
</ul>
</div> </div>
{/* Settings Icon Button */} )}
<button <li>
className="settings-button" <a
onClick={(e) => { className="nav-menu-drop-item"
e.stopPropagation(); // Prevent the click from triggering the avatar's click href="#"
onClick={() => {
handleLogout();
closeDropdowns(); closeDropdowns();
setsettingsDropOpen(!settingsDropOpen); // Toggle dropdown
}} }}
> >
{/* Optional: Add an icon here */} Logout
</button> </a>
</li>
{settingsDropOpen && ( </ul>
<ul className="nav-menu-drop"> )}
<li> </div>
<Link className="nav-menu-drop-item" to="#" onClick={closeDropdowns}> </div>
Profile
</Link>
</li>
{(userRole === "store owner" || userRole === "store manager") && (
<li>
<a
className="nav-menu-drop-item"
href="#"
onClick={(e) => {
e.preventDefault();
handleStoreManageClick();
}}
>
Switch Store
</a>
</li>
)}
{isDropdownVisible && (
<div className="dropdown-container">
<ul className="dropdown-list">
{loading ? (
<li>Loading...</li>
) : (
stores.map((store) => (
<li key={store.id} className="dropdown-item">
<a
href="#"
className="dropdown-link"
onClick={(e) => {
handleStoreClick(store.id);
window.location.reload();
}}
>
{store.name}
</a>
</li>
))
)}
</ul>
</div>
)}
<li>
<a
className="nav-menu-drop-item"
href="#"
onClick={() => {
handleLogout();
closeDropdowns();
}}
>
Logout
</a>
</li>
</ul>
)}
</div>
</div>