Improve payment output prep.

This commit is contained in:
Bradley M. Kuhn 2018-09-22 17:30:44 -07:00
parent 9145aec8c5
commit b301b2a86e

View file

@ -311,10 +311,21 @@ while (my $file = readdir $dh) {
$leftA = '$-2,750.00'; $rightA = '$2,750.00'; $leftA = '$-2,750.00'; $rightA = '$2,750.00';
} }
my(@tags) = AllFormattedLedgerTagFromTicket($ticket); my(@tags) = AllFormattedLedgerTagFromTicket($ticket);
my $contractName = 'FIXME';
$contractName = $paymentVals{'CONTRACTED NAME'} if defined $paymentVals{'CONTRACTED NAME'};
$contractName =~ s/^\s*//; $contractName =~ s/\s*$//;
open(my $paymentValsFH, ">", File::Spec->catfile($PAYMENT_DIR, "payment-values.txt"));
foreach my $key (keys %paymentVals) {
print $paymentValsFH "$key:$paymentVals{$key}\n";
}
close $paymentValsFH;
open(my $ledgerEntryFH, ">>", File::Spec->catfile($PAYMENT_DIR, "entry.ledger")); open(my $ledgerEntryFH, ">>", File::Spec->catfile($PAYMENT_DIR, "entry.ledger"));
print $ledgerEntryFH <<LEDGER_ENTRY print $ledgerEntryFH <<LEDGER_ENTRY
$LEDGER_ENTRY_DATE FIXME - Outreachy Internship - Round 2018-05 - Payment $PAYMENT_NUMBER $LEDGER_ENTRY_DATE $contractName - Outreachy Internship - Round 2018-05 - Payment $PAYMENT_NUMBER
@tags ;Invoice: $INVOICE_LINE @tags ;Invoice: $INVOICE_LINE
$approvalTag $approvalTag
Accrued:Accounts Payable:Outreachy $leftA Accrued:Accounts Payable:Outreachy $leftA