Modify Marque.pm.in so --since "works" with --items and --lib. user/dyrcona/marque-export
authorJason Stephenson <jstephenson@mvlc.org>
Tue, 4 Feb 2014 17:56:41 +0000 (12:56 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Tue, 4 Feb 2014 17:56:41 +0000 (12:56 -0500)
When the --since option is specified with --items and/or --lib,
don't include the deleted = 'f' restrictions on acp and acn.
This is because we want to build an update file of MARC records
since the given date, so we want to include deleted MARC records
with 'd' in the leader's 05.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/support-scripts/Marque.pm.in

index 8e5ab93..13147c9 100644 (file)
@@ -372,19 +372,19 @@ sub build_query {
         $from .= <<ACN_JOIN;
 
 join $acnTable on $acnTable.record = $breTable.id
-and $acnTable.deleted = 'f'
 and $acnTable.owning_lib in (
 ACN_JOIN
         $from .= join(',', @{$self->{libs}}) . ")";
+        $from .= "\nand $acnTable.deleted = 'f'" unless ($Marque::config->option_value('since'));
     }
 
     if ($Marque::config->option_value('items')) {
         unless ($acn_joined) {
             $from .= "\njoin $acnTable on $acnTable.record = $breTable.id";
-            $from .= "\nand $acnTable.deleted = 'f'";
+            $from .= "\nand $acnTable.deleted = 'f'" unless ($Marque::config->option_value('since'));
         }
         $from .= "\njoin $acpTable on $acpTable.call_number = $acnTable.id";
-        $from .= "\nand $acpTable.deleted = 'f'";
+        $from .= "\nand $acpTable.deleted = 'f'" unless ($Marque::config->option_value('since'));
     }
 
     # The where really depends on a few options: