Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin
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
..
preferences Bug 7180: Order from staged file improvements 2014-05-04 19:41:30 +00:00
searchengine/solr
admin-home.tt Bug 7372: Move road types from the roadtype table to the ROADTYPE AV 2014-02-21 16:00:53 +00:00
aqbudget_user_search.tt
aqbudgetperiods.tt Bug 12089: Remove use of dt_add_type_uk_date() - Budgets 2014-04-28 18:38:50 +00:00
aqbudgets.tt Bug 11763: (follow-up) do not display anything in actions column if user cannot manage a budget 2014-05-04 18:41:33 +00:00
aqcontract.tt
aqplan.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
auth_subfields_structure.tt Bug 11508: fix untranslatable pull-down in auth_subfields_structure.pl 2014-04-19 14:40:41 +00:00
auth_tag_structure.tt Bug 11605: fallback to default DataTables settings where possible 2014-03-10 19:05:51 +00:00
authorised_values.tt Bug 12094: fix default tab selection broken by jQueryUI upgrade 2014-04-22 14:51:18 +00:00
authtypes.tt Bug 11766 - Use validation plugin when creating new authority type 2014-02-19 15:47:57 +00:00
biblio_framework.tt Bug 11769: (follow-up) style required fields 2014-04-27 21:38:28 +00:00
branch_transfer_limits.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
branches.tt Bug 11605: fallback to default DataTables settings where possible 2014-03-10 19:05:51 +00:00
categorie.tt Bug 11605: fallback to default DataTables settings where possible 2014-03-10 19:05:51 +00:00
checkmarc.tt
cities.tt Bug 11605: fallback to default DataTables settings where possible 2014-03-10 19:05:51 +00:00
classsources.tt
clone-rules.tt
currency.tt Bug 11792 - Use validation plugin when creating new currency 2014-02-20 16:58:49 +00:00
didyoumean.tt
fieldmapping.tt
item_circulation_alerts.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
itemtypes.tt Bug 11351 - Add support for SIP2 media types 2014-04-28 17:54:42 +00:00
koha2marclinks.tt
marc_subfields_structure.tt Bug 11497: remove TT construct for picking a default string that i18n toolchain fails to pick up 2014-04-27 21:23:01 +00:00
marctagstructure.tt Bug 7125: make MARC framework tag form not suggest that one can change the form 2014-04-28 17:42:00 +00:00
matching-rules.tt
oai_set_mappings.tt Bug 11877 - Eliminate use of deprecated jQuery .live() method 2014-03-26 19:15:01 +00:00
oai_sets.tt Bug 11806 - Use validation plugin when creating new OAI set 2014-03-26 19:21:14 +00:00
patron-attr-types.tt
preferences.tt Bug 12116 - Move fixFloat jQuery plugin outside of language-specific directory 2014-04-25 15:21:11 +00:00
printers.tt Bug 11765 - Remove unused function isDate from templates 2014-02-18 20:51:38 +00:00
smart-rules.tt Bug 7413: Add "No renewal before" to the circulation and fine rules 2014-04-07 18:28:57 +00:00
stopwords.tt Bug 11764 - Move repeatedly redefined function toUC() into staff-global.js 2014-02-18 20:49:30 +00:00
systempreferences.tt Bug 11765 - Remove unused function isDate from templates 2014-02-18 20:51:38 +00:00
transport-cost-matrix.tt
z3950servers.tt Bug 1047: Punctuation in site names no longer breaks Edit/Delete z39.50 server administration 2014-03-12 14:29:22 +00:00