We've tried fixing this a few times but never fully achieved it. We need to get these consistent across the board to ensure the feature is working correctly out of the box everywhere. collected => tendered change_given => change
Created attachment 183787 [details] [review] Bug 40305: Fix 'tendered' vs 'collected' variable name inconsistency "One Ring to rule them all, one Ring to find them, One Ring to bring them all and in the darkness bind them" We've been battling against this for years, with a mixed use of terminology and thus confusion in templates vs controllers and notice templates. I've decided to just try and make sure all the terminology matches throughout, and use the more popular 'tendered' term over the 'collected' term. This patch standardizes the terminology used throughout the payment system to consistently use 'tendered' instead of the mixed usage of 'collected' and 'tendered' that has caused confusion over the years. Changes include: - Update all payment form templates to use 'tendered' input names - Update JavaScript validation and change calculation logic - Update controller parameter handling in pos/pay.pl, pos/printreceipt.pl, and members/paycollect.pl - Update sample notice templates (RECEIPT) to use 'tendered' variable - Add null check for $total_tendered to prevent perl warnings Test plan: 1. Test Point of Sale payments with tendered amounts and change calculation 2. Test member account payments with tendered amounts 3. Test receipt generation (both print and email) 4. Verify JavaScript validation works correctly 5. Confirm no perl warnings when tendered amount is undefined
Created attachment 183788 [details] [review] Bug 40305: Add database update to fix existing notice templates This database update fixes existing RECEIPT and ACCOUNT_CREDIT notice templates that may still use the old 'collected' variable instead of 'tendered'. It handles various formatting patterns and provides verification that the conversion was successful.