Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions models/IntercompanyTransaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const mongoose = require('mongoose');

const intercompanyTransactionSchema = new mongoose.Schema({
userId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
index: true
},
sourceEntityId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Workspace',
required: true,
index: true
},
targetEntityId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Workspace',
required: true,
index: true
},
transactionDate: {
type: Date,
default: Date.now,
required: true
},
amount: {
type: Number,
required: true
},
currency: {
type: String,
default: 'INR'
},
description: String,
referenceNumber: {
type: String,
unique: true
},
type: {
type: String,
enum: ['Transfer', 'Service Charge', 'Loan', 'Expense Reimbursement'],
default: 'Transfer'
},
status: {
type: String,
enum: ['Pending', 'Matched', 'Disputed', 'Settled'],
default: 'Pending',
index: true
},
matchId: {
type: String, // ID to link the corresponding transaction in the other entity
index: true
},
auditTrail: [{
action: String,
timestamp: { type: Date, default: Date.now },
performedBy: String
}]
}, {
timestamps: true
});

module.exports = mongoose.model('IntercompanyTransaction', intercompanyTransactionSchema);
60 changes: 60 additions & 0 deletions models/ReconciliationReport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const mongoose = require('mongoose');

const reconciliationReportSchema = new mongoose.Schema({
userId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
index: true
},
reportId: {
type: String,
unique: true,
required: true
},
period: {
month: Number,
year: Number,
startDate: Date,
endDate: Date
},
entityAParty: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Workspace',
required: true
},
entityBParty: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Workspace',
required: true
},
summary: {
totalTxns: Number,
matchedTxns: Number,
unmatchedTxns: Number,
discrepancyAmount: { type: Number, default: 0 }
},
details: [{
txnId: mongoose.Schema.Types.ObjectId,
status: String,
amountA: Number,
amountB: Number,
difference: Number,
reason: String
}],
settlementStatus: {
type: String,
enum: ['None Required', 'Pending', 'Partially Settled', 'Fully Settled'],
default: 'Pending'
},
approvedBy: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
}
}, {
timestamps: true
});

reconciliationReportSchema.index({ userId: 1, 'period.year': 1, 'period.month': 1 });

module.exports = mongoose.model('ReconciliationReport', reconciliationReportSchema);
111 changes: 60 additions & 51 deletions public/expensetracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -10210,72 +10210,81 @@ input:checked + .toggle-slider::before {
.summary-row span.loss {
color: #ff6b6b;
}
/* Project Costing & ROI Dashboard Styles */
.project-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
/* Intercompany Reconciliation Hub Styles */
.entity-balance-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 15px;
margin-top: 15px;
}

.stat-card.highlight {
background: linear-gradient(135deg, rgba(72, 219, 251, 0.2), rgba(100, 255, 218, 0.2));
border: 1px solid rgba(72, 219, 251, 0.3);
.balance-card {
padding: 15px;
display: flex;
flex-direction: column;
gap: 10px;
border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-wrapper {
overflow-x: auto;
.pair-names {
font-size: 0.9rem;
color: #8892b0;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
padding-bottom: 8px;
}

.progress-bar-container {
width: 100%;
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
height: 8px;
position: relative;
margin-top: 5px;
.net-value {
font-size: 1.4rem;
font-weight: 700;
}

.progress-bar {
height: 100%;
background: #48dbfb;
border-radius: 10px;
transition: width 0.5s ease;
.net-value span {
display: block;
font-size: 0.75rem;
font-weight: 400;
margin-top: 4px;
color: #8892b0;
}

.badge {
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 600;
}
.net-value.pos { color: #64ffda; }
.net-value.neg { color: #ff6b6b; }

.badge.active { background: rgba(100, 255, 218, 0.2); color: #64ffda; }
.badge.completed { background: rgba(72, 219, 251, 0.2); color: #48dbfb; }
.badge.on_hold { background: rgba(255, 159, 67, 0.2); color: #ff9f43; }
.badge.planning { background: rgba(136, 146, 176, 0.2); color: #8892b0; }
.advice-box {
text-align: center;
padding: 10px;
}

.text-red { color: #ff6b6b; }
.text-green { color: #64ffda; }
.advice-summary {
margin-bottom: 15px;
}

.btn-icon {
background: none;
border: none;
.advice-summary label {
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 1px;
color: #8892b0;
cursor: pointer;
font-size: 1.1rem;
padding: 5px;
transition: color 0.3s ease;
}

.btn-icon:hover { color: #48dbfb; }

.changes-pre {
background: rgba(0, 0, 0, 0.2);
padding: 10px;
border-radius: 5px;
.advice-details {
display: flex;
justify-content: space-around;
font-size: 0.85rem;
color: #ffd700;
max-height: 200px;
overflow-y: auto;
color: #8892b0;
margin-bottom: 20px;
}

.type-tag {
background: rgba(72, 219, 251, 0.1);
color: #48dbfb;
padding: 2px 6px;
border-radius: 4px;
font-size: 0.75rem;
}

.badge.pending { background: rgba(255, 159, 67, 0.2); color: #ff9f43; }
.badge.matched { background: rgba(100, 255, 218, 0.2); color: #64ffda; }
.badge.settled { background: rgba(136, 146, 176, 0.2); color: #8892b0; }
.badge.disputed { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
Loading