Acq batch updater misc corrections
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 25 Feb 2013 19:15:20 +0000 (14:15 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 11 Mar 2013 18:00:49 +0000 (14:00 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem/BatchUpdate.pm
Open-ILS/src/sql/Pg/200.schema.acq.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.acq.distribution_formula.expansion.sql
Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2
Open-ILS/web/js/ui/default/conify/global/acq/distribution_formula.js

index c9cfa92..14061aa 100644 (file)
@@ -8491,7 +8491,7 @@ SELECT  usr,
                        <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
                        <field reporter:label="Location" name="location" reporter:datatype="link"/>
                        <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
-                       <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
+                       <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
                        <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
                </fields>
                <links>
@@ -8499,7 +8499,7 @@ SELECT  usr,
                        <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
                        <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
-                       <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
+                       <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
                        <actions>
index 2c63139..620ae06 100644 (file)
@@ -245,11 +245,13 @@ sub lineitem_batch_update_impl {
     my $lineitems;
 
     if ($target->{lineitems}) {
-        $lineitems = $e->search_acq_lineitem([
-            {id => $target->{lineitems}},
-            {flesh => 1,
-                flesh_fields => {"jub" => ["lineitem_details"]}, %order_by}
-        ]) or return $e->die_event;
+        $lineitems = $e->search_acq_lineitem(
+            [
+                {id => $target->{lineitems}},
+                {flesh => 1,
+                    flesh_fields => {"jub" => ["lineitem_details"]}, %order_by}
+            ], {substream => 1}
+        ) or return $e->die_event;
     } else {
         my $where;
 
@@ -259,15 +261,15 @@ sub lineitem_batch_update_impl {
             $where = {picklist => $target->{picklist}};
         }
 
-        $lineitems = $e->search_acq_lineitem([
-            $where,
-            {flesh => 1,
-                flesh_fields => {"jub" => ["lineitem_details"]}, %order_by}
-        ]) or return $e->die_event;
+        $lineitems = $e->search_acq_lineitem(
+            [
+                $where,
+                {flesh => 1,
+                    flesh_fields => {"jub" => ["lineitem_details"]}, %order_by}
+            ], {substream => 1}
+        ) or return $e->die_event;
     }
 
-    # XXX Is this the best way to tell the client not to get bored at this
-    # point? Or substream on previous search_*()?  Ask berick.
     $conn->status(new OpenSRF::DomainObject::oilsContinueStatus);
     $logger->info(
         "lineitem_batch_update_impl() working with " .
@@ -280,7 +282,7 @@ sub lineitem_batch_update_impl {
     # Now, going through all our lineitem details, make the updates
     # called for in $changes, other than the 'item_count' field (handled above).
 
-    my @fields = qw/owning_lib fund location collection_code circ_modifer/;
+    my @fields = qw/owning_lib fund location collection_code circ_modifier/;
     foreach my $jub (@$lineitems) {
         # We use the counting style of loop below because we need to know our
         # position for dist_formula application.
@@ -408,7 +410,7 @@ sub lineitem_batch_update_api {
         # It's important that we NOT flesh use_count here, if that [ever]
         # does anything.  We're going to abuse that field internally.
 
-        $dist_formula = $e->acq->retrieve_acq_dist_formula([
+        $dist_formula = $e->acq->retrieve_acq_distribution_formula([
             int($dist_formula), {flesh=>1, flesh_fields=>["entries","fund"]}
         ]) or return $e->die_event;
 
index ec7ffdb..14813eb 100644 (file)
@@ -631,7 +631,7 @@ CREATE TABLE acq.distribution_formula_entry (
                                DEFERRABLE INITIALLY DEFERRED,
        location        INTEGER REFERENCES asset.copy_location(id),
        fund            INTEGER REFERENCES acq.fund (id),
-       circ_mod        TEXT REFERENCES config.circ_modifier (code),
+       circ_modifier   TEXT REFERENCES config.circ_modifier (code),
        collection_code TEXT,
        CONSTRAINT acqdfe_lib_once_per_formula UNIQUE( formula, position ),
        CONSTRAINT acqdfe_must_be_somewhere
index 0d92162..391bcf8 100644 (file)
@@ -4,7 +4,7 @@ BEGIN;
 
 ALTER TABLE acq.distribution_formula_entry
     ADD COLUMN fund INT REFERENCES acq.fund (id),
-    ADD COLUMN circ_mod TEXT REFERENCES config.circ_modifier (code),
+    ADD COLUMN circ_modifier TEXT REFERENCES config.circ_modifier (code),
     ADD COLUMN collection_code TEXT ;
 
 COMMIT;
index e3dfd1a..45d29ef 100644 (file)
@@ -50,6 +50,9 @@
                 <th></th>
                 <th>[% l('Owning Library') %]</th>
                 <th>[% l('Shelving Location') %]</th>
+                <th>[% l('Fund') %]</th>
+                <th>[% l('Circ Modifier') %]</th>
+                <th>[% l('Collection Code') %]</th>
                 <th>[% l('Item Count') %]</th>
                 <th></th>
             </tr>
         <tbody id='formula-entry-tbody'>
             <tr id='formula-entry-tempate'>
                 <td><div name='delete' dojoType='dijit.form.Button' style='color:red;' scrollOnFocus='false'>X</div></td>
-                <td><div name='owning_lib'></td>
-                <td><div name='location'></td>
-                <td><div name='item_count'></td>
+                <td><div name='owning_lib'></div></td>
+                <td><div name='location'></div></td>
+                <td><div name='fund'></div></td>
+                <td><div name='circ_modifer'></div></td>
+                <td><div name='collection_code'></div></td>
+                <td><div name='item_count'></div></td>
                 <td>
                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
                     <img src='[% ctx.media_prefix %]/images/dimple.png'/>
index 69e3932..dee35e0 100644 (file)
@@ -145,7 +145,7 @@ function addEntry(entry) {
     };
 
     dojo.forEach(
-        ['owning_lib', 'location', 'item_count'],
+        ['owning_lib', 'location', 'fund', 'circ_modifier', 'collection_code', 'item_count'],
         function(field) {
             new openils.widget.AutoFieldWidget({
                 forceSync : true,