@@ -173,14 +173,21 @@ def make_pos_gl_entries(self, gl_entries):
173173
174174 def validate_pos_paid_amount (self ):
175175 """
176- Allow pure customer-credit POS sales to submit without a payment row.
176+ Allow POS sales to submit without a payment row in two cases:
177177
178- POSNext redeems customer credit after submit through Journal Entries /
179- Payment Entry allocation, so there is no real Mode of Payment row to send.
180- Only bypass the core POS payment-row check when submit_invoice has explicitly
181- marked the document for customer-credit redemption.
178+ 1. Pure customer-credit redemption — POSNext redeems existing customer
179+ credit after submit through Journal Entries / Payment Entry allocation,
180+ so there is no real Mode of Payment row to send.
181+ 2. "Pay on Account" credit sales — the cashier intentionally puts the full
182+ amount on the customer's account, leaving the invoice outstanding.
183+
184+ Both are only honoured when submit_invoice has explicitly marked the
185+ document via the corresponding flag (set after verifying the POS Settings
186+ permit the operation), so a tampered client can't bypass the check.
182187 """
183- if getattr (self .flags , "pos_next_redeemed_customer_credit" , 0 ):
188+ if getattr (self .flags , "pos_next_redeemed_customer_credit" , 0 ) or getattr (
189+ self .flags , "pos_next_credit_sale" , 0
190+ ):
184191 if len (self .payments ) == 0 and cint (self .is_pos ) and flt (self .grand_total ) > 0 :
185192 return
186193
0 commit comments