"Fossies" - the Fresh Open Source Software Archive

Member "koha-19.11.15/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt" (23 Feb 2021, 35168 Bytes) of package /linux/misc/koha-19.11.15.tar.gz:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 [% USE raw %]
    2 [% USE Asset %]
    3 [% USE Koha %]
    4 [% USE KohaDates %]
    5 [% USE Price %]
    6 [% USE ItemTypes %]
    7 [% SET footerjs = 1 %]
    8 [% INCLUDE 'doc-head-open.inc' %]
    9 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno | html %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber | html %])[% ELSE %]New order[% END %]</title>
   10 [% INCLUDE 'doc-head-close.inc' %]
   11 </head>
   12 
   13 <body id="acq_neworderempty" class="acq">
   14 
   15 [% INCLUDE 'header.inc' %]
   16 [% INCLUDE 'acquisitions-search.inc' %]
   17 
   18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Basket [% basketno | html %]</a> &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber | html %])[% ELSE %]New order[% END %]</div>
   19 
   20 [% INCLUDE 'blocking_errors.inc' %]
   21 
   22 <div class="main container-fluid">
   23     <div class="row">
   24         <div class="col-sm-10 col-sm-push-2">
   25             <main>
   26 
   27 <h2>
   28     [% IF ( ordernumber ) %]
   29         Modify order line
   30     [% ELSE %]
   31         New order
   32     [% END %]
   33 </h2>
   34 
   35 <div class="dialog alert order_error" style="display:none"></div>
   36 
   37 [% IF ( basketno ) %]
   38     <div id="acqui_basket_summary">
   39     <fieldset class="rows">
   40         <legend>Basket details</legend>
   41         <ol>
   42         [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote | html %]</li>[% END %]
   43         [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote | html %]</li>[% END %]
   44         [% IF ( basketcontractno ) %]
   45             <li><span class="label">Contract number: </span>[% basketcontractno | html %]</li>
   46             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno | uri %]">[% basketcontractname | html %]</a></li>
   47         [% END %]
   48         [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname | html %]</li>[% END %]
   49         [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
   50         [% IF ( closedate ) %]
   51         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
   52         <li><span class="label">Closed on:</span>  [% closedate | $KohaDates %]</li>
   53         [% IF ( basketgroups ) %]
   54             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
   55                 [% FOREACH basketgroup IN basketgroups %]
   56                     [% IF ( basketgroup.default ) %]
   57                     <option value="[% basketgroup.id | html %]" selected="selected">[% basketgroup.name | html %]</option>
   58                     [% ELSE %]
   59                     <option value="[% basketgroup.id | html %]">[% basketgroup.name | html %]</option>
   60                     [% END %]
   61                 [% END %]
   62                 </select>
   63                 <input type="hidden" id="basketno" value="[% basketno | html %]" name="basketno" />
   64                 <input type="hidden" value="mod_basket" name="op" />
   65                 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
   66             </li>
   67             <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
   68         [% END %]
   69         </form>
   70         [% END %]
   71         </ol>
   72     </fieldset>
   73     </div>
   74 [% END %]
   75 
   76 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" class="validated noEnterSubmit" id="Aform" onsubmit="return Check(this);" >
   77 
   78     <fieldset class="rows">
   79         <legend>Patrons</legend>
   80         <ol>
   81             <li>
   82                 <span class="label">To notify on receiving:</span>
   83                 <div style="float:left">
   84                     <ul id="users_names" style="padding-left:0">
   85                       [% FOREACH user IN users %]
   86                         <li id="user_[% user.borrowernumber | html %]">
   87                             [% user.firstname | html %] [% user.surname | html %]
   88                             [<a onclick="del_user([% user.borrowernumber | html %]);" style="cursor:pointer">Delete user</a>]
   89                         </li>
   90                       [% END %]
   91                     </ul>
   92                     <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids | html %]" />
   93                     <input type="hidden" id="op" name="op" value="mod_users" />
   94                     <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
   95                 </div>
   96             </li>
   97         </ol>
   98     </fieldset>
   99 
  100 <fieldset class="rows">
  101         <legend>
  102             Catalog details
  103             [% IF ( biblionumber ) %]
  104                 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]"> Edit record</a></span>
  105             [% END %]
  106         </legend>
  107         [% UNLESS ( existing ) %]
  108         <input type="hidden" name="existing" value="no" />
  109         [% END %]
  110         <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
  111         <input type="hidden" name="basketno" value="[% basketno | html %]" />
  112         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
  113         <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
  114         <input type="hidden" name="listinc" id="listinc" value="[% listincgst | html %]" />
  115         <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst | html %]" />
  116         <input type="hidden" name="suggestionid" value="[% suggestionid | html %]" />
  117         <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
  118 
  119         [% FOREACH c IN currencies %]
  120             <input type="hidden" id="currency_rate_[% c.currency | html %]"  name="[% c.currency | html %]" value="[% c.rate | html %]" />
  121         [% END %]
  122 
  123         [% IF NOT Koha.Preference('UseACQFrameworkForBiblioRecords') OR NoACQframework %]
  124             <ol><li>
  125                 [% IF ( biblionumber ) %]
  126                 <span class="label">Title</span>
  127                     <input type="hidden" name="title" value="[% title | html %]" /> <span class="title">[% title | html %]</span>
  128                 [% ELSE %]
  129                 <label for="entertitle">Title: </label>
  130                     <input type="text" id="entertitle" size="50" name="title" value="[% title | html %]" class="focus" required="required" />
  131                     <span class="required">Required</span>
  132                 [% END %]
  133             </li>
  134             <li>
  135                 [% IF ( biblionumber ) %]
  136                 <span class="label">Author: </span>
  137                     <input type="hidden" name="author" id="author" value="[% author | html %]" />[% author | html %]
  138                 [% ELSE %]
  139                 <label for="author">Author: </label>
  140                     <input type="text" size="50" name="author" id="author" value="[% author | html %]" />
  141                 [% END %]
  142             </li>
  143             <li>
  144                 [% IF ( biblionumber ) %]
  145                 <span class="label">Publisher: </span>
  146                     <input type="hidden" name="publishercode" id="publishercode" value="[% publishercode | html %]" />[% publishercode | html %]
  147                 [% ELSE %]
  148                 <label for="publishercode"> Publisher: </label>
  149                     <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode | html %]" />
  150                 [% END %]
  151             </li>
  152             <li>
  153                 [% IF ( biblionumber ) %]
  154                 <span class="label">Edition: </span>
  155                     <input type="hidden" name="editionstatement" id="editionstatement" value="[% editionstatement | html %]" />[% editionstatement | html %]
  156 
  157                 [% ELSE %]
  158                 <label for="editionstatement">Edition: </label>
  159                     <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement | html %]" />
  160                 [% END %]
  161             </li>
  162             <li>
  163                 [% IF ( biblionumber ) %]
  164                 <span class="label">Publication year: </span>
  165                     <input type="hidden" name="publicationyear" id="publicationyear" value="[% publicationyear | html %]" />[% publicationyear | html %]
  166                 [% ELSE %]
  167                 <label for="publicationyear">Publication year: </label>
  168                     <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear | html %]" />
  169                 [% END %]
  170             </li>
  171             <li>
  172                 [% IF ( biblionumber ) %]
  173                 <span class="label">ISBN: </span>
  174                     <input type="hidden" name="isbn" id="ISBN" value="[% isbn | html %]" />[% isbn | html %]
  175                 [% ELSE %]
  176                 <label for="ISBN">ISBN: </label>
  177                     <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn | html %]" />
  178                 [% END %]
  179             </li>
  180             [% IF (UNIMARC) %]
  181             <li>
  182                 [% IF ( biblionumber ) %]
  183                 <span class="label">EAN: </span>
  184                     <input type="hidden" name="ean" id="EAN" value="[% ean | html %]" />[% ean | html %]
  185                 [% ELSE %]
  186                 <label for="EAN">EAN: </label>
  187                     <input type="text" size="20" name="ean" id="EAN" value="[% ean | html %]" />
  188                 [% END %]
  189             </li>
  190             [% END %]
  191             <li>
  192                 [% IF ( biblionumber ) %]
  193                 <span class="label">Series: </span>
  194                     <input type="hidden" name="series" id="series" value="[% seriestitle | html %]" />[% seriestitle | html %]
  195                 [% ELSE %]
  196                 <label for="series">Series: </label>
  197                     <input type="text" size="50" name="series" id="series" value="[% seriestitle | html %]" />
  198                 [% END %]
  199             </li>
  200                 [% UNLESS ( biblionumber ) %]
  201                 [% IF ( itemtypeloop ) %]
  202                 <li>
  203                     <span class="label">Item type:</span>
  204                     <select name="itemtype" style="width:12em;">
  205                     [% FOREACH itemtype IN itemtypeloop %]
  206                         <option value="[% itemtype.itemtype | html %]">[% itemtype.description | html %]</option>
  207                     [% END %]
  208                     </select>
  209                 </li>
  210                 [% END %]
  211                 [% END %]
  212             </ol>
  213         [% ELSE %]
  214             <input type="hidden" name="use_ACQ_framework" value="1" />
  215             [% IF biblionumber %]
  216                 <ol>
  217                     [% FOREACH field IN catalog_details %]
  218                         <li>
  219                             <div class="subfield_line">
  220                                 <label>[% field.lib | html %] ([% field.tag | html %][% field.subfield | html %])</label>
  221                                 [% field.value | html %]
  222                             </div>
  223                         </li>
  224                     [% END %]
  225                 </ol>
  226             [% ELSE %]
  227                 <ol>
  228                     [% FOREACH field IN catalog_details %]
  229                         <li>
  230                             <div class="subfield_line">
  231                                 [% PROCESS display_subfield field=field %]
  232                             </div>
  233                         </li>
  234                     [% END %]
  235                 </ol>
  236             [% END %]
  237         [% END %]
  238     </fieldset>
  239 
  240     [% IF ( suggestionid ) %]
  241         <fieldset class="rows">
  242         <legend>Suggestion</legend>
  243         <ol>
  244           <li>
  245             <span class="label">Suggested by: </span>
  246             [% surnamesuggestedby | html %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid | uri %]&amp;op=show">suggestion #[% suggestionid | html %]</a>)
  247           </li>
  248         </ol>
  249         </fieldset>
  250     [% END %]
  251 
  252     [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
  253       [% IF (AcqCreateItemOrdering) %]
  254 
  255       <div id="items_list" style="display:none">
  256           <p><b>Items list</b></p>
  257           <div style="width:100%;overflow:auto;">
  258               <table>
  259                   <thead>
  260                       <tr>
  261                           <th>Actions</th>
  262                           <th>Barcode</th>
  263                           <th>Home library</th>
  264                           <th>Holding library</th>
  265                           <th>Not for loan</th>
  266                           <th>Restricted</th>
  267                           <th>Location</th>
  268                           <th>Call number</th>
  269                           <th>Copy number</th>
  270                           <th>Inventory number</th>
  271                           <th>Collection</th>
  272                           <th>Item type</th>
  273                           <th>Materials</th>
  274                           <th>Notes</th>
  275                       </tr>
  276                   </thead>
  277                   <tbody>
  278                   </tbody>
  279               </table>
  280           </div>
  281       </div>
  282 
  283       <fieldset class="rows" id="itemfieldset">
  284           <legend>Item</legend>
  285           [% IF ( NoACQframework ) %]
  286               <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
  287           [% END %]
  288 
  289           [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %]
  290               <div class="dialog message">The autoBarcode system preference is set to [% Koha.Preference('autoBarcode') | html %] and items with blank barcodes will have barcodes generated upon save to database</div>
  291           [% END %]
  292 
  293           <div id="outeritemblock"></div>
  294 
  295       </fieldset>
  296       [% END %][%# | html UNLESS subscriptionid %]
  297     [% END %][%# IF (AcqCreateItemOrdering) %]
  298     <fieldset class="rows">
  299         <legend>Accounting details</legend>
  300         <ol>
  301             <li>
  302                 <label class="required" for="quantity">Quantity: </label>
  303                 [% IF subscriptionid %]
  304                     <input type="text" size="20" id="quantity" name="quantity" value="1" onchange="updateCosts();" />
  305                 [% ELSIF AcqCreateItemOrdering %]
  306                     [% IF basket.is_standing %]
  307                         <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
  308                     [% ELSE %]
  309                         <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
  310                     [% END %]
  311                 [% ELSE %]
  312                     [% IF basket.is_standing %]
  313                         <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
  314                     [% ELSE %]
  315                         <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec | html %]" onchange="updateCosts();" />
  316                     [% END %]
  317                 [% END %]
  318                 <span class="required">Required</span>
  319                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, useful when receiveing an order -->
  320                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
  321 
  322                 [% IF subscription %]
  323                     <br/>
  324                     <div class="hint">
  325                         Frequency: [% subscription.frequency.description | html %] |
  326                         [% IF subscription.numberlength %]Number of issues: [% subscription.numberlength | html %][% END %]
  327                         [% IF subscription.weeklength   %]Number of weeks: [% subscription.weeklength | html %][% END %]
  328                         [% IF subscription.monthlength  %]Number of months: [% subscription.monthlength | html %][% END %]
  329                     </div>
  330                 [% END %]
  331             </li>
  332             <li>
  333                 <label class="required" for="budget_id">Fund: </label>
  334                 [% active_count = 0 %]
  335                 [% IF !ordernumber %]
  336                     [% FOREACH budget_loo IN budget_loop %]
  337                         [% active_count= active_count + budget_loo.b_active %]
  338                     [% END %]
  339                 [% END %]
  340                 <select id="budget_id" size="1" name="budget_id">
  341                     <option value="">Select a fund</option>
  342                 [% FOREACH budget_loo IN budget_loop %]
  343                     [% IF ( budget_loo.b_sel ) %]
  344                         [% active_count = 0 #select no other fund %]
  345                         <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"
  346                                 style="padding-left:[% budget_loo.b_level | html %]em;"
  347                         >
  348                     [% ELSIF active_count==1 && budget_loo.b_active %]
  349                         <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"
  350                                 style="padding-left:[% budget_loo.b_level | html %]em;"
  351                         >
  352                     [% ELSE %]
  353                         [% bdgclass=budget_loo.b_active? "": "b_inactive" | html %]
  354                         <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"
  355                                 style="padding-left:[% budget_loo.b_level | html %]em;"
  356                         >
  357                     [% END %]
  358                         [% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %]
  359                     </option>
  360                 [% END %]
  361                 </select>
  362                 <span class="required">Required</span>
  363                 <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
  364                 <input type="checkbox" id="showallbudgets" />
  365             </li>
  366 		<li>
  367 			<label for="currency">Currency:</label>
  368             <select name="currency" id="currency" onchange="updateCosts();">
  369                 [% FOREACH c IN currencies %]
  370                     [% IF ordernumber and c.currency == currency or not ordernumber and c.currency == vendor_currency %]
  371                         <option value="[% c.currency | html %]" selected="selected">[% c.currency | html %]</option>
  372                     [% ELSIF not c.archived %]
  373                         <option value="[% c.currency | html %]">[% c.currency | html %]</option>
  374                     [% END %]
  375                 [% END %]
  376             </select>
  377                 </li>
  378             <li>
  379                 <label for="listprice">Vendor price: </label>
  380                     <input type="text" size="20" name="listprice" id="listprice" value="[% listprice | html %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
  381             </li>
  382             <li>
  383                     <label for="uncertainprice">Uncertain price: </label>
  384                     [% IF ( uncertainprice ) %]
  385                     <input type="checkbox" name="uncertainprice"  id="uncertainprice" value="1" checked="checked" />
  386                     [% ELSE %]
  387                     <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
  388                 [% END %]
  389             </li>
  390             [% IF ( gst_values ) %]
  391                 <li>
  392                     <label for="tax_rate">Tax rate: </label>
  393                     <select name="tax_rate" id="tax_rate" onchange="updateCosts();">
  394                         [% SET gst_found = 0 %]
  395                         [% FOREACH gst IN gst_values %]
  396                           [% IF ( gst.option == tax_rate ) %]
  397                             <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
  398                             [% SET gst_found = 1 %]
  399                           [% ELSE %]
  400                             <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
  401                           [% END %]
  402                         [% END %]
  403 
  404                         [% IF !gst_found %]
  405                             <option value="[% tax_rate | html %]" selected="selected">[% tax_rate * 100 | html %]%</option>
  406                         [% END %]
  407                     </select>
  408 
  409                     [% IF !gst_found %]<span class="required">Tax rate not defined in system preference gist!</span>[% END %]
  410             [% ELSE %]
  411                     <input type="hidden" name="tax_rate" value="0" />
  412                 </li>
  413             [% END %]
  414             <li>
  415                 <label for="discount">Discount: </label>
  416                 [% IF ( orderdiscount ) %]
  417                     <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount | html %]" onchange="updateCosts();" />%
  418                 [% ELSE %]
  419                     <input type="text" size="6" name="discount" id="discount" value="[% discount | html %]" onchange="updateCosts();" />%
  420                 [% END %]
  421             </li>
  422             <li>
  423                 <label for="rrp">Retail price: </label>
  424                 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp | html %]" /> (adjusted for [% cur_active | html %], [% IF (listincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])
  425             </li>
  426             <li>
  427                 <label for="replacementprice">Replacement cost: </label>
  428                 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | html | $Price on_editing => 1 %]" />
  429             </li>
  430             <li>
  431                 <label for="ecost">Budgeted cost: </label>
  432                 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost | html %]" readonly="readonly"  /> [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]
  433             </li>
  434             <li>
  435                 <label for="total">Total: </label>
  436                 <input type="text" id="total" size="20" name="total" value="[% total | html %]" readonly="readonly" /> (budgeted cost * quantity)
  437             </li>
  438             <li class="ordering_unitprice">
  439                 <label for="unitprice">Actual cost: </label>
  440                 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice | html %]" />
  441                 [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
  442             </li>
  443             <li>
  444                 <label for="order_internalnote">Internal note: </label>
  445                 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote | html %][% END %]</textarea>
  446             </li>
  447             <li>
  448                 <label for="order_vendornote">Vendor note: </label>
  449                 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote | html %][% END %]</textarea>
  450             </li>
  451             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
  452                 <label for="sort1">Statistic 1: </label>
  453                 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 | html %]" />
  454             <li>
  455                 <label for="sort2">Statistic 2: </label>
  456                 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 | html %]" />
  457             </li>
  458         </ol>
  459     </fieldset>
  460     <fieldset class="action">
  461         <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
  462         <input type="submit" value="Save" />
  463         [% IF (suggestionid) %]
  464             <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]">Cancel</a>
  465         [% ELSE %]
  466             [% IF subscriptionid %]
  467                 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]">Cancel</a>
  468             [% ELSE %]
  469                 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Cancel</a>
  470             [% END %]
  471         [% END %]
  472     </fieldset>
  473 </form>
  474 
  475 <div id="procModal" data-backdrop="static" class="modal fade" aria-labelledby="procModal" aria-hidden="true">
  476     <div class="modal-dialog">
  477     <div class="modal-content">
  478     <div class="modal-body">
  479     <h3>Processing multiple items</h3>
  480     </div>
  481     </div>
  482     </div>
  483 </div>
  484 
  485 <div id="multiCountModal" class="modal fade" aria-labelledby="multiCountModal" aria-hidden="true">
  486     <div class="modal-dialog">
  487     <div class="modal-content">
  488     <h3>Invalid number of copies</h3>
  489     <p>Please enter a <b>number</b>, greater than or equal to 1</p>
  490     </div>
  491     </div>
  492 </div>
  493 
  494 </main>
  495 </div> <!-- /.col-sm-10.col-sm-push-2 -->
  496 
  497 <div class="col-sm-2 col-sm-pull-10">
  498     <aside>
  499         [% INCLUDE 'acquisitions-menu.inc' %]
  500     </aside>
  501 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
  502 </div> <!-- /.row -->
  503 
  504 [% MACRO jsinclude BLOCK %]
  505     [% Asset.js("js/acquisitions-menu.js") | $raw %]
  506     [% Asset.js("js/acq.js") | $raw %]
  507     [% INCLUDE 'additem.js.inc' %]
  508     [% Asset.js("js/additem.js") | $raw %]
  509     [% Asset.js("js/cataloging.js") | $raw %]
  510     [% INCLUDE 'calendar.inc' %]
  511     <script>
  512         actTotal = "";
  513 
  514         function Check(ff) {
  515             [% IF (AcqCreateItemOrdering) %]
  516                 // Remove last itemblock if it is not in items_list
  517                 var lastitemblock = $("#outeritemblock > div:last");
  518                 var tobedeleted = true;
  519                 var listitems = $("#items_list tr");
  520                 $(listitems).each(function(){
  521                     if($(this).attr('idblock') == $(lastitemblock).attr('id')){
  522                         tobedeleted = false;
  523                     }
  524                 });
  525                 if(tobedeleted){
  526                     $(lastitemblock).remove();
  527                 }
  528             [% END %]
  529 
  530             var ok=0;
  531             var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
  532 
  533             _alertString +="-------------------------------------------------------------------\n\n";
  534 
  535             if(isNull(ff.budget_id,1)){
  536                 ok=1;
  537                 _alertString += "\n- "+ _("You must select a fund");
  538             }
  539 
  540             if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
  541                 ok=1;
  542                             _alertString += "\n- " + _("Quantity must be greater than '0'");
  543             }
  544 
  545             if (!(isNum(ff.listprice,0))){
  546                 ok=1;
  547                             _alertString += "\n- " + _("Vendor price must be a number");
  548             }
  549 
  550             if (!(isNum(ff.total,0))){
  551                 ok=1;
  552                             _alertString += "\n- " + _("Total must be a number");
  553             }
  554 
  555             if (totalExceedsBudget(ff.budget_id.value, ff.total.value  )  ) {
  556                 ok=1;
  557                 _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
  558             }
  559 
  560             if ( ff.field_value ) {
  561                 var empty_item_mandatory = CheckMandatorySubfields(ff);
  562                 if (empty_item_mandatory > 0) {
  563                     ok = 1;
  564                     _alertString +=
  565                         "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
  566                 }
  567 
  568             }
  569 
  570             if (ok) {
  571                 alert(_alertString);
  572                 [% IF (AcqCreateItemOrdering) %]
  573                     if(tobedeleted) {
  574                         $(lastitemblock).appendTo('#outeritemblock');
  575                     }
  576                 [% END %]
  577                 return false;
  578             }
  579 
  580             [% IF (AcqCreateItemOrdering) %]
  581                 if(check_additem('[% UniqueItemFields | html %]') == false) {
  582                     alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
  583                     if(tobedeleted) {
  584                         $(lastitemblock).appendTo('#outeritemblock');
  585                     }
  586                     return false;
  587                 }
  588             [% END %]
  589         }
  590 
  591         $(document).ready(function(){
  592             [% IF AcqCreateItemOrdering and not basket.is_standing %]
  593                 cloneItemBlock(0, '[% UniqueItemFields | html %]');
  594             [% END %]
  595 
  596             [% IF ( suggestionid ) %]updateCosts();[% END %]
  597             $("#quantity").change(function() {
  598                 updateCosts();
  599             });
  600 
  601             //We apply the fonction only for modify option
  602             [% IF ( quantityrec and not subscriptionid ) %]
  603                 [% IF ( acqcreate ) %]
  604                     $('#quantity').blur(function(){
  605                         // if user decreases the quantity
  606                         if($(this).val() < [% quantityrec | html %]){
  607                             alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
  608                             return true;
  609                         } else {
  610                             // if user increases the quantity
  611                             alert(_("You can't add a new item, please create a new order line"));
  612                             // and we replace the original value
  613                             $(this).val([% quantityrec | html %])
  614                             updateCosts(); // blur is invoked after change which updated values
  615                             return false;
  616                         }
  617                     });
  618                 [% END %]
  619             [% END %]
  620 
  621             //keep a copy of all budgets before removing the inactives
  622             disabledBudgetsCopy = $('#budget_id').html();
  623             $('#budget_id .b_inactive').remove();
  624 
  625             $('#showallbudgets').click(function() {
  626                 if ($(this).is(":checked")) {
  627                     $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
  628                 }
  629                 else {
  630                     $('#budget_id .b_inactive').remove();
  631                 }
  632             });
  633 
  634             $("#budget_id").change(function(){
  635                 var destination_sort1 = $(this).parents('fieldset.rows').find('input[name="sort1"]');
  636                 var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
  637                 var sort1 = $(destination_sort1).val() || "";
  638                 if ( destination_sort1.length < 1 ) {
  639                     destination_sort1 = $(this).parents('fieldset.rows').find('select[name="sort1"]');
  640                 }
  641                 var destination_sort2 = $(this).parents('fieldset.rows').find('input[name="sort2"]');
  642                 var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
  643                 var sort2 = $(destination_sort2).val() || "";
  644                 if ( destination_sort2.length < 1 ) {
  645                     destination_sort2 = $(this).parents('fieldset.rows').find('select[name="sort2"]');
  646                 }
  647                 getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
  648                 getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
  649             });
  650             $("#budget_id").change();
  651         });
  652 
  653         function UserSearchPopup(f) {
  654             window.open(
  655                 "/cgi-bin/koha/acqui/add_user_search.pl",
  656                 'UserSearchPopup',
  657                 'width=740, height=450, scrollbars=yes, toolbar=no,'
  658              );
  659         }
  660 
  661         function add_user(borrowernumber, borrowername) {
  662             var ids = $("#users_ids").val();
  663             if(ids.length > 0) {
  664                 ids = ids.split(':');
  665             } else {
  666                 ids = new Array;
  667             }
  668         if (ids.indexOf(borrowernumber.toString()) < 0) {
  669                 ids.push(borrowernumber);
  670                 $("#users_ids").val(ids.join(':'));
  671                 var li = '<li id="user_'+borrowernumber+'">'+borrowername
  672                     + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
  673                     + _("Delete user") + '</a>]</li>';
  674                 $("#users_names").append(li);
  675                 return 0;
  676             }
  677             return -1;
  678         }
  679 
  680         function del_user(borrowernumber) {
  681             $("#user_"+borrowernumber).remove();
  682             var ids = $("#users_ids").val().split(':');
  683             ids.splice(ids.indexOf(borrowernumber.toString()), 1);
  684             $("#users_ids").val(ids.join(':'));
  685         }
  686     </script>
  687 [% END %]
  688 
  689 [% INCLUDE 'intranet-bottom.inc' %]
  690 
  691 [% BLOCK display_subfield %]
  692     <label>[% field.lib | html %] ([% field.tag | html %][% field.subfield | html %])</label>
  693     [% IF field.authorised_value %]
  694         [% SWITCH field.authorised_value %]
  695         [% CASE 'branches' %]
  696             [% IF field.mandatory %]
  697             <select name="bib_field_value" required="required">
  698             [% ELSE %]
  699             <select name="bib_field_value">
  700             [% END %]
  701                 <option value=""></option>
  702                 [% PROCESS options_for_libraries libraries => Branches.all( selected => "FIXME" ) %]
  703             </select>
  704         [% CASE 'itemtypes' %]
  705             [% IF field.mandatory %]
  706             <select name="bib_field_value" required="required">
  707             [% ELSE %]
  708             <select name="bib_field_value">
  709             [% END %]
  710                 <option value=""></option>
  711                 [% PROCESS options_for_item_types itemtypes => ItemTypes.Get(), selected_itemtype => "FIXME" %]
  712             </select>
  713         [% CASE 'cn_source' %]
  714         [% CASE %]
  715             [% PROCESS 'av-build-dropbox.inc' name="bib_field_value", category=field.authorised_value, default="FIXME" %]
  716         [% END %]
  717     [% ELSE %]
  718         [% IF field.mandatory %]
  719         <input type="text" name="bib_field_value" value="[% field.value | html %]" required="required" size="50" />
  720         [% ELSE %]
  721         <input type="text" name="bib_field_value" value="[% field.value | html %]" size="50" />
  722         [% END %]
  723 
  724     [% END %]
  725     <input type="hidden" name="bib_kohafield" value="[% field.kohafield | html %]" />
  726     <input type="hidden" name="bib_tag" value="[% field.tag | html %]" />
  727     <input type="hidden" name="bib_subfield" value="[% field.subfield | html %]" />
  728     [% IF field.mandatory %] <span class="required">Required</span>[% END %]
  729 [% END %]