#===================================================================== # LedgerSMB # Small Medium Business Accounting software # # See COPYRIGHT file for copyright information #====================================================================== # # This file has NOT undergone whitespace cleanup. # #====================================================================== # # Payment module # #====================================================================== use LedgerSMB::CP; use LedgerSMB::OP; use LedgerSMB::IS; use LedgerSMB::IR; require "$form->{path}/arap.pl"; 1; # end of main sub payment { if ($form->{type} eq 'receipt') { $form->{ARAP} = "AR"; $form->{arap} = "ar"; $form->{vc} = "customer"; $form->{formname} = "receipt"; } if ($form->{type} eq 'check') { $form->{ARAP} = "AP"; $form->{arap} = "ap"; $form->{vc} = "vendor"; $form->{formname} = "check"; } $form->{payment} = "payment"; $form->{callback} = "$form->{script}?action=payment&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&all_vc=$form->{all_vc}&type=$form->{type}"; # setup customer/vendor selection for open invoices if ($form->{all_vc}) { $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP}, undef, $form->{datepaid}); } else { CP->get_openvc(\%myconfig, \%$form); if ($myconfig{vclimit} > 0) { $form->{"all_$form->{vc}"} = $form->{name_list}; } } $form->{"select$form->{vc}"} = ""; if (@{ $form->{"all_$form->{vc}"} }) { $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id}; for (@{ $form->{"all_$form->{vc}"} }) { $form->{"select$form->{vc}"} .= qq|