diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-07-22 23:27:50 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-07-22 23:27:50 +0000 |
commit | ecf56eca694d9606ffe56d3cab13a6614efc6aa4 (patch) | |
tree | 84fc7c9a763a97ef1c633a885b80456fc93559a0 /LedgerSMB | |
parent | 12a0239ccda7e2bd68cae034e916c6a664c3c430 (diff) |
Added format option to LedgerSMB::format_amount
Added batch information options for check template
Added batch default_date field
Corrected issues with payment batches not preserving post dates when adding vouchers to existing batch.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2219 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/AA.pm | 4 | ||||
-rw-r--r-- | LedgerSMB/Batch.pm | 6 | ||||
-rw-r--r-- | LedgerSMB/DBObject/Payment.pm | 4 | ||||
-rwxr-xr-x | LedgerSMB/Template/LaTeX.pm | 5 |
4 files changed, 16 insertions, 3 deletions
diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm index d5d8a1fe..8245fa33 100644 --- a/LedgerSMB/AA.pm +++ b/LedgerSMB/AA.pm @@ -373,9 +373,9 @@ sub post_transaction { $form->dberror($query); if (!$form->{approved} && $form->{batch_id}){ if ($form->{arap} eq 'ar'){ - $batch_class = 'receivable'; + $batch_class = 'ar'; } else { - $batch_class = 'payable'; + $batch_class = 'ap'; } $query = qq| INSERT INTO voucher (batch_id, trans_id, batch_class) diff --git a/LedgerSMB/Batch.pm b/LedgerSMB/Batch.pm index 34d0185c..a4c4ecaf 100644 --- a/LedgerSMB/Batch.pm +++ b/LedgerSMB/Batch.pm @@ -71,4 +71,10 @@ sub list_vouchers { return @{$self->{vouchers}}; } +sub get { + my ($self) = @_; + my ($ref) = $self->exec_method(funcname => 'voucher_get_batch'); + $self->merge($ref); +} + 1; diff --git a/LedgerSMB/DBObject/Payment.pm b/LedgerSMB/DBObject/Payment.pm index 50e7829f..11e5ebfd 100644 --- a/LedgerSMB/DBObject/Payment.pm +++ b/LedgerSMB/DBObject/Payment.pm @@ -89,6 +89,10 @@ sub get_metadata { for my $ref(@{$self->{cash_accounts}}){ $ref->{text} = "$ref->{accno}--$ref->{description}"; } + if ($self->{batch_id} && !defined $self->{batch_date}){ + my ($ref) = $self->exec_method(funcname => 'voucher_get_batch'); + $self->{batch_date} = $ref->{default_date}; + } } sub search { diff --git a/LedgerSMB/Template/LaTeX.pm b/LedgerSMB/Template/LaTeX.pm index 00f283fa..593a0a74 100755 --- a/LedgerSMB/Template/LaTeX.pm +++ b/LedgerSMB/Template/LaTeX.pm @@ -70,7 +70,9 @@ sub preprocess { for (@{$rawvars}) { push @{$vars}, preprocess($_); } - } elsif (!$type or $type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { + } elsif (!$type or $type eq 'SCALAR' or $type eq 'Math::BigInt::GMP' + or $type eq 'CODE' + ) { if ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { $vars = $$rawvars; } else { @@ -82,6 +84,7 @@ sub preprocess { $vars =~ s/"(.*)"/``$1''/gs; } } else { + print STDERR "Type: $type\n"; for ( keys %{$rawvars} ) { $vars->{$_} = preprocess($rawvars->{$_}); } |