Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui
Jonathan Druart 2f2d7b9368 Bug 7180: Order from staged file improvements
This patch adds:
- 1 syspref MarcFieldsToOrder
- 1 Ajax script acqui/ajax-getauthvaluedropbox.pl
- 1 routine C4::Budgets::GetBudgetByCode

Before this patch you were not able to order 1 or all the records from
your staged file. You were allowed to specify some information ("Import
All" and "Accounting details" areas) for the order.

With this patch, the previous behaviour still exists.
But now you can *select* which records you want to ordered.
For these ones you can specify independently quantity,
price, budget, sort1 and sort2.

The cherry on the cake is that you can pre-fill these fields  with
values from the MARC record.

Test plan:
1. Fill the new syspref MarcFieldsToOrder with something like:
==BEGIN==
price: 947$c
quantity: 969$h
budget_code: 922$a
rrp: 010$d
discount: 969$d
sort1: 923$a
sort2: 924$a

==END==
The empty line at the end is mandatory!
The budget (corresponding to your budget_code) can be filled with
authorized value categories (statistic 1 and 2).
The sort1 and sort2 values can be filled with the an authorized value
(of the category previously selected)

2. Choose randomly one or more biblio(s) and fill fields with what is
   relevant.

3. Export the biblio and import it (with the "Stage MARC records for
   import" tool).

4. Go on a basket and add an order from a staged file. Select your
   staged file.

5. Well. Now you can see your biblio (or biblios if your had exported
   more than one). For each one, fields should be pre-filled with the
   biblio values. The budget should be selected on the budget
   corresponding to the budget_code (in the field 922$a) and the
   "planning values" too (with fields 923$a and 924$a).
   You can modify these values (or not) and choose a default value for
   budget and planning values (in the "Accounting details" area).

6. Save and check the prices values. Modify the order and check that
   budget and sort* are good

Prices are calculated following some parameters:
if there is no price => listprice = 0
else =>
  - the gstrate value for your order is the gstrate value of the bookseller
  - discount = if filled : the discount value / 100
               else: the discount value of the bookseller
  - if the bookseller includes tax( List item price includes tax: Yes )
        if a discount exists:
            ecost = price
            rrp   = ecost / ( 1 - discount )
        else: # a discount does not exist
            ecost = price * ( 1 - discount )
            rrp   = price
    else # the bookseller does not include tax
        if a discount exists:
            ecost = price / ( 1 + gstrate )
            rrp   = ecost / ( 1 - discount )
        else: # a discount does not exist
            rrp   = price / ( 1 + gstrate )
            ecost = rrp * ( 1 - discount )
  - in all cases:
        listprice = rrp / currency rate
        unitprice = ecost
        total = ecost * quantity

7. Retry with different parameters

8. Check the 'Import all' action still works

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 19:41:30 +00:00
..
csv Bug 7298: (follow-up) fix translation for CSV strings 2013-10-31 15:51:45 +00:00
acqui-home.tt Bug 11608: Delete unused commented lines in template 2014-01-26 15:23:19 +00:00
addorder.tt Bug 9822: Alert on adding an order to a basket if budget s exceeded 2013-10-30 15:10:11 +00:00
addorderiso2709.tt Bug 7180: Order from staged file improvements 2014-05-04 19:41:30 +00:00
ajax.tt Bug 5917 : Swapping templates over 2011-04-10 20:38:30 +12:00
aqbasketuser_search.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
basket.tt Bug 9416: add new order vendor note field 2014-04-19 15:55:36 +00:00
basketgroup.tt Bug 12094: fix default tab selection broken by jQueryUI upgrade 2014-04-22 14:51:18 +00:00
basketheader.tt Bug 11805 - Use validation plugin when creating new basket in Acquisitions 2014-02-27 15:44:48 +00:00
booksellers.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
histsearch.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
invoice.tt Bug 10613: calculate the GST rate correctly on the invoice page. 2014-05-04 19:22:30 +00:00
invoices.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
lateorders.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
modordernotes.tt Bug 12111: (follow-up) fix breadcrumbs wording for vendor note 2014-04-28 15:31:46 +00:00
neworderbiblio.tt Bug 10649 - Upgrade DataTables and move scripts out of theme directory 2013-09-05 15:43:36 +00:00
neworderempty.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
neworderempty_duplicate.tt Bug 7760: Add unique ids and a module class to all acquisitions pages 2012-03-22 18:11:54 +01:00
newordersubscription.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
newordersuggestion.tt Bug 10649 - Upgrade DataTables and move scripts out of theme directory 2013-09-05 15:43:36 +00:00
ordered.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
orderreceive.tt Bug 12111: (follow-up) ensure that vendor note is not editable during order receiving 2014-04-28 15:37:43 +00:00
parcel.tt Bug 12111: Improving templates regarding order notes 2014-04-28 15:30:02 +00:00
parcels.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
spent.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
supplier.tt Bug 12089: Remove use of dt_add_type_uk_date() - Acquisitions 2014-04-28 18:41:28 +00:00
transferorder.tt Bug 5349: (follow-up) tweak order transfer form 2013-09-16 15:21:07 +00:00
uncertainprice.tt Bug 10649 - Upgrade DataTables and move scripts out of theme directory 2013-09-05 15:43:36 +00:00
z3950_search.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00