Remove billedTo filtering to show all bills to landlord
The billedTo field indicates payment responsibility (tenant vs landlord), not viewing permissions. Landlords should see and manage ALL bills. Changes: - LocationCard: Display all bills regardless of billedTo value - LocationCard: Calculate monthlyExpense from all paid bills - HomePage: Include all paid bills in monthlyExpense aggregation - printActions: Print all bills with barcodes regardless of billedTo - locationActions: Add billedTo property to fetchAllLocations result 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use server';
|
||||
|
||||
import { getDbClient } from '../dbClient';
|
||||
import { BilledTo, BillingLocation, Bill } from '../db-types';
|
||||
import { BillingLocation } from '../db-types';
|
||||
import { AuthenticatedUser } from '../types/next-auth';
|
||||
import { withUser } from '../auth';
|
||||
import { unstable_noStore as noStore } from 'next/cache';
|
||||
@@ -41,8 +41,8 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser,
|
||||
|
||||
for (const location of locations) {
|
||||
for (const bill of location.bills) {
|
||||
// Only include bills that are billed to tenant and have barcode images
|
||||
if (bill.barcodeImage && bill.barcodeImage.trim() !== "" && (bill.billedTo ?? BilledTo.Tenant) === BilledTo.Tenant) {
|
||||
// Only include bills that have barcode images
|
||||
if (bill.barcodeImage && bill.barcodeImage.trim() !== "") {
|
||||
printData.push({
|
||||
locationName: location.name,
|
||||
billName: bill.name,
|
||||
|
||||
Reference in New Issue
Block a user