From 1db887cf38238f8e22a36d72b92f8212c11a5618 Mon Sep 17 00:00:00 2001 From: abijah Date: Mon, 1 Jun 2009 05:44:44 +0000 Subject: [PATCH] Removed the debug comments that were helping me with the sitelink migration, and added in the actual comments that were entered in sitelink. git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@54 97e9348a-65ac-dc4b-aefc-98561f571b83 --- scripts/sitelink2pmgr.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/sitelink2pmgr.pl b/scripts/sitelink2pmgr.pl index ea0db31..f52a1d3 100644 --- a/scripts/sitelink2pmgr.pl +++ b/scripts/sitelink2pmgr.pl @@ -651,7 +651,7 @@ foreach $row (@$result) { datefmt($row->{'ChargeDate'}), datefmt($row->{'EndDate'}), $row->{'ChargeAmount'}, $row->{'TaxAmount'}, $row->{'ChargeAmount'} + $row->{'TaxAmount'}, - "SiteLink Charges.ChargeID #".$row->{'ChargeID'}) + undef) )) . ")"; query($db_handle, $query) || die("Unable to insert"); @@ -679,8 +679,7 @@ foreach $row (@$result) { (`id`, `stamp`, `comment`) VALUES (" . join(", ", map({defined $_ ? "'$_'" : "NULL"} - ($rid, datefmt($row->{'ReceiptDate'}), - "SiteLink Receipts.ReceiptNum #".$row->{'ReceiptNum'}) + ($rid, datefmt($row->{'ReceiptDate'}), undef) )) . ")"; query($db_handle, $query) || die("Unable to insert"); } @@ -720,8 +719,7 @@ foreach $row (@$result) { join(", ", map({defined $_ ? "'$_'" : "NULL"} ($pid, $rid, $row->{'PaymentDate'} =~ m%3/25/2009% ? 8 : $row->{'PaymentType'}, - $row->{'PaymentAmount'}, - "PaymentID #".$row->{'PaymentID'} . ($row->{'Memo'} ? "; ".$row->{'Memo'} : "")) + $row->{'PaymentAmount'}, undef) )) . ")"; query($db_handle, $query) || die("Unable to insert"); @@ -732,6 +730,13 @@ foreach $row (@$result) { ($chid, $rid, $row->{'PaymentAmount'}) )) . ")"; query($db_handle, $query) || die("Unable to insert"); + + if ($row->{'Memo'}) { + $query = + "UPDATE pmgr_receipts SET `comment` = '$row->{'Memo'}'" . + " WHERE `id` = $rid"; + query($db_handle, $query) || die("Unable to update"); + } } __END__