summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorivan <ivan>2001-09-02 05:38:13 +0000
committerivan <ivan>2001-09-02 05:38:13 +0000
commit4f8a0bb6d0c789c7e156a446dc61dbe27938a372 (patch)
tree8d793aafaff9d0258d501e94caa9ad5e3bc74d4e /bin
parent9b81123e5ff5825d2c3c000432e4dd18b5fd764f (diff)
migration. ugh.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fs-migrate-payref30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/fs-migrate-payref b/bin/fs-migrate-payref
new file mode 100755
index 000000000..f1513112b
--- /dev/null
+++ b/bin/fs-migrate-payref
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_pay;
+use FS::cust_refund;
+
+my $user = shift or die &usage;
+my $dbh = adminsuidsetup $user;
+
+#local $FS::UID::AutoCommit = 0; #quelle hack, in this case
+# $FS::UID::AutoCommit = 0; #quelle hack, in this case
+
+# apply payments to invoices
+
+foreach my $cust_pay ( qsearch('cust_pay', {} ) ) {
+ my $error = $cust_pay->upgrade_replace;
+ warn $error if $error;
+}
+
+# apply refunds to credits
+
+foreach my $cust_refund ( qsearch('cust_refund') ) {
+ my $error = $cust_refund->upgrade_replace;
+ warn $error if $error;
+}
+
+# ? apply credits to invoices
+