No subject


Mon Jul 28 14:19:07 CEST 2008


with this patch without breaking the expected
behavior on our side.  Let me know if I was not sufficiently clear,
misinterpreted your needs, or if you cannot accept the
extra button click to verify that it's okay to modify the acq record without
adding the holdings record(s).

Ryan



On Thu, Jul 31, 2008 at 8:19 AM, <paul.poulain at biblibre.com> wrote:

> From: Paul POULAIN <paul.poulain at biblibre.com>
>
> It has to be reintroduced, as some (most in France) libraries don't create
> items on recieve, but after "equipment" step.
> ---
>  acqui/finishreceive.pl |   58
> ++++++++++++++++++++++++-----------------------
>  1 files changed, 30 insertions(+), 28 deletions(-)
>
> diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl
> index 8cf8d4f..8cb5bf2 100755
> --- a/acqui/finishreceive.pl
> +++ b/acqui/finishreceive.pl
> @@ -59,34 +59,36 @@ my $error_url_str;
>
>  if ($quantityrec > $origquantityrec ) {
>        foreach my $bc (@barcode) {
> -               my $item_hash = {
> -                    "items.replacementprice" => $replacement,
> -                    "items.price"            => $cost,
> -                    "items.booksellerid"     => $supplierid,
> -                    "items.homebranch"       => $branch[$cnt],
> -                    "items.holdingbranch"    => $branch[$cnt],
> -                    "items.barcode"          => $barcode[$cnt],
> -                    "items.ccode"          => $ccode[$cnt],
> -                    "items.itype"          => $itemtype[$cnt],
> -                    "items.location"          => $location[$cnt],
> -                    "items.enumchron"          => $enumchron[$cnt], #
> FIXME : No integration here with serials module.
> -                    "items.loan"             => 0,
> -                                       };
> -               $item_hash->{'items.cn_source'} =
> C4::Context->preference('DefaultClassificationSource')
> if(C4::Context->preference('DefaultClassificationSource') );
> -               # FIXME : cn_sort is populated by
> Items::_set_derived_columns_for_add , which is never called with
> AddItemFromMarc .  Bug 2403
> -        my $itemRecord = TransformKohaToMarc($item_hash);
> -               $cnt++;
> -               $item_hash =
> TransformMarcToKoha(undef,$itemRecord,'','items');
> -               # FIXME: possible race condition.  duplicate barcode check
> should happen in AddItem, but for now we have to do it here.
> -               my %err = CheckItemPreSave($item_hash);
> -               if(%err) {
> -                       for my $err_cnd (keys %err) {
> -                               $error_url_str .= "&error=" . $err_cnd .
> "&error_param=" . $err{$err_cnd};
> -                       }
> -                       $quantityrec--;
> -               } else {
> -                       AddItemFromMarc($itemRecord,$biblionumber);
> -               }
> +        if ($bc) {
> +            my $item_hash = {
> +                        "items.replacementprice" => $replacement,
> +                        "items.price"            => $cost,
> +                        "items.booksellerid"     => $supplierid,
> +                        "items.homebranch"       => $branch[$cnt],
> +                        "items.holdingbranch"    => $branch[$cnt],
> +                        "items.barcode"          => $barcode[$cnt],
> +                        "items.ccode"          => $ccode[$cnt],
> +                        "items.itype"          => $itemtype[$cnt],
> +                        "items.location"          => $location[$cnt],
> +                        "items.enumchron"          => $enumchron[$cnt], #
> FIXME : No integration here with serials module.
> +                        "items.loan"             => 0,
> +                        };
> +            $item_hash->{'items.cn_source'} =
> C4::Context->preference('DefaultClassificationSource')
> if(C4::Context->preference('DefaultClassificationSource') );
> +            # FIXME : cn_sort is populated by
> Items::_set_derived_columns_for_add , which is never called with
> AddItemFromMarc .  Bug 2403
> +            my $itemRecord = TransformKohaToMarc($item_hash);
> +            $cnt++;
> +            $item_hash =
> TransformMarcToKoha(undef,$itemRecord,'','items');
> +            # FIXME: possible race condition.  duplicate barcode check
> should happen in AddItem, but for now we have to do it here.
> +            my %err = CheckItemPreSave($item_hash);
> +            if(%err) {
> +                for my $err_cnd (keys %err) {
> +                    $error_url_str .= "&error=" . $err_cnd .
> "&error_param=" . $err{$err_cnd};
> +                }
> +                $quantityrec--;
> +            } else {
> +                AddItemFromMarc($itemRecord,$biblionumber);
> +            }
> +        }
>        }
>
>     # save the quantity received.
> --
> 1.5.3.2
>
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha.org
> http://lists.koha.org/mailman/listinfo/koha-patches
>



-- 
Ryan Higgins

LibLime * Open-Source Solutions for Libraries
Featuring KohaZOOM ILS
888-564-2457 x704

------=_Part_7628_16749796.1217640505724
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr"><br>Hi Paul.<br><br>I think I understand your intent here:&nbsp; to allow a separation of item creation from receiving (billing/acq).<br><br>A recent patch I submitted for this page and its successor in normal workflow ( parcel.pl )<br>
reports errors on any item records that were not created in the receiving step.<br><br>Your patch removes the capacity to receive multiple items, which is definitely not desired.<br>All you should have to do&nbsp; alter the &quot; if( $quantityrec &gt; 0 ) &quot; conditional.<br>
<br>The question that needs to be answered is &#39;what is the appropriate behavior if item records are not <br>created?&#39; :<br><br>I think the answer is this: <br>1: (required)&nbsp; allow the user to manually edit &#39;quantity received&#39;&nbsp; (currently read-only field).<br>
2: (optional)&nbsp; add an onchange for &#39;quantity received&#39; to show enough item record divs to add the holdings data if we have it.<br>3: (required)&nbsp; add an onsubmit form checker that tests the number of unique barcodes against the number in &#39;quantity received&#39;,<br>
&nbsp;&nbsp;&nbsp; and tells the user that if they say ok, item records will _not_ be created, but the acq module will register that the items<br>&nbsp;&nbsp;&nbsp; were received.&nbsp; Most of this js code is already in place.<br><br>From my understanding, I think this will meet the needs that you express with this patch without breaking the expected<br>
behavior on our side.&nbsp; Let me know if I was not sufficiently clear, misinterpreted your needs, or if you cannot accept the <br>extra button click to verify that it&#39;s okay to modify the acq record without adding the holdings record(s).<br>
<br>Ryan<br><br><br><br><div class="gmail_quote">On Thu, Jul 31, 2008 at 8:19 AM,  <span dir="ltr">&lt;<a href="mailto:paul.poulain at biblibre.com">paul.poulain at biblibre.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
From: Paul POULAIN &lt;<a href="mailto:paul.poulain at biblibre.com">paul.poulain at biblibre.com</a>&gt;<br>
<br>
It has to be reintroduced, as some (most in France) libraries don&#39;t create<br>
items on recieve, but after &quot;equipment&quot; step.<br>
---<br>
&nbsp;acqui/finishreceive.pl | &nbsp; 58 ++++++++++++++++++++++++-----------------------<br>
&nbsp;1 files changed, 30 insertions(+), 28 deletions(-)<br>
<br>
diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl<br>
index 8cf8d4f..8cb5bf2 100755<br>
--- a/acqui/finishreceive.pl<br>
+++ b/acqui/finishreceive.pl<br>
@@ -59,34 +59,36 @@ my $error_url_str;<br>
<br>
&nbsp;if ($quantityrec &gt; $origquantityrec ) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;foreach my $bc (@barcode) {<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $item_hash = {<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.replacementprice&quot; =&gt; $replacement,<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.price&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $cost,<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.booksellerid&quot; &nbsp; &nbsp; =&gt; $supplierid,<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.homebranch&quot; &nbsp; &nbsp; &nbsp; =&gt; $branch[$cnt],<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.holdingbranch&quot; &nbsp; &nbsp;=&gt; $branch[$cnt],<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.barcode&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $barcode[$cnt],<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.ccode&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $ccode[$cnt],<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.itype&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $itemtype[$cnt],<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.location&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $location[$cnt],<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.enumchron&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $enumchron[$cnt], # FIXME : No integration here with serials module.<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.loan&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 0,<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item_hash-&gt;{&#39;items.cn_source&#39;} = C4::Context-&gt;preference(&#39;DefaultClassificationSource&#39;) if(C4::Context-&gt;preference(&#39;DefaultClassificationSource&#39;) );<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # FIXME : cn_sort is populated by Items::_set_derived_columns_for_add , which is never called with AddItemFromMarc . &nbsp;Bug 2403<br>
- &nbsp; &nbsp; &nbsp; &nbsp;my $itemRecord = TransformKohaToMarc($item_hash);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cnt++;<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item_hash = TransformMarcToKoha(undef,$itemRecord,&#39;&#39;,&#39;items&#39;);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # FIXME: possible race condition. &nbsp;duplicate barcode check should happen in AddItem, but for now we have to do it here.<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my %err = CheckItemPreSave($item_hash);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(%err) {<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for my $err_cnd (keys %err) {<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $error_url_str .= &quot;&amp;error=&quot; . $err_cnd . &quot;&amp;error_param=&quot; . $err{$err_cnd};<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $quantityrec--;<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddItemFromMarc($itemRecord,$biblionumber);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;if ($bc) {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;my $item_hash = {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.replacementprice&quot; =&gt; $replacement,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.price&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $cost,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.booksellerid&quot; &nbsp; &nbsp; =&gt; $supplierid,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.homebranch&quot; &nbsp; &nbsp; &nbsp; =&gt; $branch[$cnt],<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.holdingbranch&quot; &nbsp; &nbsp;=&gt; $branch[$cnt],<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.barcode&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $barcode[$cnt],<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.ccode&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $ccode[$cnt],<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.itype&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $itemtype[$cnt],<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.location&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $location[$cnt],<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.enumchron&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; $enumchron[$cnt], # FIXME : No integration here with serials module.<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;items.loan&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 0,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$item_hash-&gt;{&#39;items.cn_source&#39;} = C4::Context-&gt;preference(&#39;DefaultClassificationSource&#39;) if(C4::Context-&gt;preference(&#39;DefaultClassificationSource&#39;) );<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# FIXME : cn_sort is populated by Items::_set_derived_columns_for_add , which is never called with AddItemFromMarc . &nbsp;Bug 2403<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;my $itemRecord = TransformKohaToMarc($item_hash);<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$cnt++;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$item_hash = TransformMarcToKoha(undef,$itemRecord,&#39;&#39;,&#39;items&#39;);<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# FIXME: possible race condition. &nbsp;duplicate barcode check should happen in AddItem, but for now we have to do it here.<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;my %err = CheckItemPreSave($item_hash);<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(%err) {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for my $err_cnd (keys %err) {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$error_url_str .= &quot;&amp;error=&quot; . $err_cnd . &quot;&amp;error_param=&quot; . $err{$err_cnd};<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$quantityrec--;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AddItemFromMarc($itemRecord,$biblionumber);<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp; # save the quantity received.<br>
<font color="#888888">--<br>
<a href="http://1.5.3.2" target="_blank">1.5.3.2</a><br>
<br>
_______________________________________________<br>
Koha-patches mailing list<br>
<a href="mailto:Koha-patches at lists.koha.org">Koha-patches at lists.koha.org</a><br>
<a href="http://lists.koha.org/mailman/listinfo/koha-patches" target="_blank">http://lists.koha.org/mailman/listinfo/koha-patches</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Ryan Higgins<br><br>LibLime * Open-Source Solutions for Libraries<br>Featuring KohaZOOM ILS<br>888-564-2457 x704<br>
</div>

------=_Part_7628_16749796.1217640505724--


More information about the Koha-patches mailing list