summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_pkg.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-05-21 14:51:13 -0700
committerMark Wells <mark@freeside.biz>2014-05-21 14:51:13 -0700
commit3992c4726337c3b257489a2898cf898efc8a6554 (patch)
treec44b723c8eb104ac128b83393ad13a61f0b4c7a1 /FS/FS/cust_bill_pkg.pm
parent58f8f045141e56c38dd47bf7b9f33094236c0d0a (diff)
cursorize cust_bill_pkg_tax_location upgrade, #940
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r--FS/FS/cust_bill_pkg.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 212c4b6..1955452 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -26,6 +26,8 @@ use FS::cust_bill_pkg_tax_location_void;
use FS::cust_bill_pkg_tax_rate_location_void;
use FS::cust_tax_exempt_pkg_void;
+use FS::Cursor;
+
$DEBUG = 0;
$me = '[FS::cust_bill_pkg]';
@@ -1158,8 +1160,7 @@ sub upgrade_tax_location {
' WHERE cust_bill_pkg.invnum = cust_bill.invnum'.
' AND exempt_monthly IS NULL';
- my @invnums = map { $_->invnum } qsearch({
- select => 'cust_bill.invnum',
+ my $search = FS::Cursor->new({
table => 'cust_bill',
hashref => {},
extra_sql => "WHERE NOT EXISTS($sub_has_tax_link) ".
@@ -1167,11 +1168,12 @@ sub upgrade_tax_location {
$date_where,
});
- print "Processing ".scalar(@invnums)." invoices...\n";
+#print "Processing ".scalar(@invnums)." invoices...\n";
my $committed;
INVOICE:
- foreach my $invnum (@invnums) {
+ while (my $cust_bill = $search->fetch) {
+ my $invnum = $cust_bill->invnum;
$committed = 0;
print STDERR "Invoice #$invnum\n";
my $pre = '';