fix: store rent amount as whole currency units instead of cents
Changed rent amount handling to use whole currency units throughout the application instead of storing in cents. This simplifies data entry and aligns with Zod validation requiring integer values. Changes: - Set rent input step to "1" (whole numbers only) - Remove cents-to-currency conversion (/ 100) when formatting for email 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,7 +150,7 @@ export async function sendRentDueNotifications(db: Db, budget: number): Promise<
|
||||
const rentDueDate = `${location.yearMonth.month}/${location.rentDueDay}/${location.yearMonth.year}`;
|
||||
|
||||
// Format rent amount (convert from cents to display format)
|
||||
const rentAmount = location.rentAmount ? (location.rentAmount / 100).toFixed(2) : '0.00';
|
||||
const rentAmount = location.rentAmount ? (location.rentAmount).toFixed(2) : '0.00';
|
||||
const currency = userSettings?.currency || 'EUR';
|
||||
|
||||
const html = loadAndRender('rent-due', {
|
||||
|
||||
@@ -336,7 +336,7 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
name="rentAmount"
|
||||
type="number"
|
||||
min="1"
|
||||
step="0.01"
|
||||
step="1"
|
||||
placeholder={t("rent-amount-placeholder")}
|
||||
className="input input-bordered w-full placeholder:text-gray-600 text-right"
|
||||
defaultValue={formValues.rentAmount}
|
||||
|
||||
Reference in New Issue
Block a user