exit();
sub apply_cust_credits {
- my @credits = shift;
+ my @credits = @_;
my $csv_fn = "$csv_dir/cust_credit.csv";
die $error;
}
- say $log->info(
- sprintf 'Issued credit to custnum:%s for invnum:%s for amount %s',
+ my $msg = sprintf 'Issued credit to custnum:%s for invnum:%s for amount %s',
$credit->{custnum},
$credit->{invnum},
- $credit->{amount},
- );
+ $credit->{amount};
+ say $msg;
+ $log->info( $msg );
say $csv_fh join ',' => (
map { $_ =~ /\D/ ? qq["$_"] : $_ } (
error_and_help( '--csv_dir is required' )
unless $csv_dir;
- error_and_help( '--start_date is required' )
+ error_and_help( '--start-date is required' )
unless $start_date;
error_and_help( '--end-date is required' )
unless $end_date;
error_and_help( '--taxnums is required' )
unless @taxnums;
- error_and_help( '--credit-reasonnum is required with --apply-credits' )
+ error_and_help( '--credit-reasonnum is required with --insert-credits' )
if $insert_credits && !$credit_reasonnum;
- error_and_help( '--credit-addlinfo is required with --apply-credits' )
+ error_and_help( '--credit-addlinfo is required with --insert-credits' )
if $insert_credits && !$credit_addlinfo;
- error_and_help( "csv dir ($csv_dir) is not a writable directoryu" )
+ error_and_help( "csv dir ($csv_dir) is not a writable directory" )
unless -d $csv_dir && -r $csv_dir;
error_and_help( "start_date($start_date) is not a valid date string")
=item B<--credit-reasonnum> [22]
-The credit num to be attached to issued credits
+The credit reasonnum to be attached to issued credits
=item B<--credit-addlinfo> "[Credits happen for this reason]"
-Comment field attached to issued creits. Enclose text within quotes.
+Comment field attached to issued credits. Enclose text within quotes.
=item B<--insert-credits>
When directed, utility will issue a credit to the account of each of those
customers, and generate a CSV report describing those credits for reporting
-=cut
\ No newline at end of file
+=cut