Skip to content

Commit

Permalink
Drop queue_payments configuration setting
Browse files Browse the repository at this point in the history
Removes non-functioning queue_payments setting from the `defaults`
table and the LedgerSMB::DBObjext::Payment::post_bulk()
method. This was the only place the setting was referenced and the
sql code to support it did not exist.
  • Loading branch information
nick-prater committed Feb 29, 2020
1 parent 0979098 commit e0409aa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
1 change: 1 addition & 0 deletions Changelog
Expand Up @@ -56,6 +56,7 @@ Code cleanup
* Making old/bin/old-handler.pl a PSGI app (LedgerSMB::oldHandler)
* Stripping LedgerSMB::Form from anything handled by middleware
* Separating 'setup.pl authentication' into its own middleware
* Remove unused 'queue_payments' setting

Dependency updates
* Dojo Toolkit updated to 1.16.0
Expand Down
29 changes: 5 additions & 24 deletions old/lib/LedgerSMB/DBObject/Payment.pm
Expand Up @@ -706,22 +706,7 @@ partial payment (C<paid == 'some'>).

sub post_bulk {
my ($self, $data) = @_;
my $total_count = 0;
my ($ref) = $self->call_procedure(
funcname => 'setting_get',
args => ['queue_payments'],
);
my $queue_payments = $ref->{setting_get};
if ($queue_payments){
my ($job_ref) = $self->call_dbmethod(
funcname => 'job__create'
);
$self->{job_id} = $job_ref->{job__create};

($self->{job}) = $self->call_dbmethod(
funcname => 'job__status'
);
}
#$self->{payment_date} = $self->{datepaid};
for my $contact (grep { $_->{id} } @{$data->{contacts}}) {
my $invoice_array = "{}"; # Pg Array
Expand Down Expand Up @@ -750,16 +735,12 @@ sub post_bulk {
}
$self->{transactions} = $invoice_array;
$self->{source} = $contact->{source};
if ($queue_payments){
$self->{batch_class} = BC_PAYMENT;
$self->call_dbmethod(
funcname => 'payment_bulk_queue'
);
} else {
$self->call_dbmethod(funcname => 'payment_bulk_post');
}


$self->call_dbmethod(funcname => 'payment_bulk_post');
}
return $self->{queue_payments} = $queue_payments;

return;
}

=item post_payment
Expand Down
1 change: 0 additions & 1 deletion sql/Pg-database.sql
Expand Up @@ -1362,7 +1362,6 @@ customernumber|1
vendornumber|1
glnumber|1
projectnumber|1
queue_payments|0
poll_frequency|1
rcptnumber|1
paynumber|1
Expand Down
1 change: 1 addition & 0 deletions sql/changes/1.8/drop_queue_payments_setting.sql
@@ -0,0 +1 @@
DELETE FROM defaults WHERE setting_key = 'queue_payments';
1 change: 1 addition & 0 deletions sql/changes/LOADORDER
Expand Up @@ -127,3 +127,4 @@ mc/delete-migration-validation-data.sql
1.8/explicit-reconciliation.sql
1.8/constrain-default-exchange-rates.sql
1.8/constrain-exchangerate-type.sql
1.8/drop_queue_payments_setting.sql

0 comments on commit e0409aa

Please sign in to comment.