[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug/Patch - Receipt voucher source start id irrelevant



When you're receiving checks, you're highly unlikely to have any
sequence of check ids, so picking a "source start" on the interim step
of voucher receipt is highly annoying.

Attached patch removes this requirement for Cash -> Vouchers -> Receipts.

Note: Most of the patches I'm sending were done December - January --
might be some missing parts to the patch. If it doesn't fully work, ping
me to see what else I might've changed... (stored functions, most likely..)

Cheers,
John Locke
http://www.freelock.com
diff --git LedgerSMB/DBObject/Payment.pm LedgerSMB/DBObject/Payment.pm
index dba0e9c..230a8f8 100644
--- LedgerSMB/DBObject/Payment.pm
+++ LedgerSMB/DBObject/Payment.pm
@@ -534,7 +534,7 @@ This method sets appropriate project, department, etc. fields.
 sub get_payment_detail_data {
     my ($self) = @_;
     $self->get_metadata();
-    if ( !defined $self->{source_start} ){
+    if ( $self->{account_class} != 2 && !defined $self->{source_start} ){
         $self->error('No source start defined!');
         exit;
     }
@@ -567,8 +567,10 @@ sub get_payment_detail_data {
             }
     		$source =~ s/$source_src(\D*)$/$source_inc$1/;
     		++ $source_inc;
-    		$inv->{source} = $source;
-		$self->{"source_$inv->{contact_id}"} = $source;
+		if ($self->{account_class} == 1) { # skip for AR Receipts 
+		  $inv->{source} = $source;
+		  $self->{"source_$inv->{contact_id}"} = $source;
+		}
     	} else {
 		# Clear source numbers every time.
 		$inv->{source} = "";