summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/Batch.pm12
-rw-r--r--LedgerSMB/DBObject/Payment.pm7
2 files changed, 18 insertions, 1 deletions
diff --git a/LedgerSMB/Batch.pm b/LedgerSMB/Batch.pm
index 28be86f7..67bc0ad9 100644
--- a/LedgerSMB/Batch.pm
+++ b/LedgerSMB/Batch.pm
@@ -28,4 +28,16 @@ sub get_search_results {
return @{$self->{search_results}};
}
+sub post {
+ my ($self) = @_;
+ ($self->{post_return_ref}) = $self->exec_method(funcname => 'batch_post');
+ return $self->{post_return_ref};
+}
+
+sub delete {
+ my ($self) = @_;
+ ($self->{delete_ref}) = $self->exec_method(funcname => 'batch_delete');
+ return $self->{delete_ref};
+}
+
1;
diff --git a/LedgerSMB/DBObject/Payment.pm b/LedgerSMB/DBObject/Payment.pm
index f4382a28..b35bb2d8 100644
--- a/LedgerSMB/DBObject/Payment.pm
+++ b/LedgerSMB/DBObject/Payment.pm
@@ -366,14 +366,19 @@ sub get_payment_detail_data {
if ($source_src) {
$source_inc = $source_src;
} else {
- $source_inc = $0;
+ $source_inc = 0;
}
}
+ my $source_length = length($source_inc);
+
@{$self->{contact_invoices}} = $self->exec_method(
funcname => 'payment_get_all_contact_invoices');
for my $inv (@{$self->{contact_invoices}}){
if (defined $self->{source_start}){
my $source = $self->{source_start};
+ if (length($source_inc) < $source_length){
+ $source_inc = sprintf('%0*s', $source_length, $source_inc);
+ }
$source =~ s/$source_src(\D*)$/$source_inc$1/;
++ $source_inc;
$inv->{source} = $source;