@@ -, +, @@ --- installer/data/mysql/kohastructure.sql | 4 ++++ installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 18 ++++++++++++++++++ .../prog/en/modules/suggestion/suggestion.tmpl | 19 +++++++++++++++++-- kohaversion.pl | 2 +- suggestion/suggestion.pl | 20 ++++++++++++++++++++ 6 files changed, 72 insertions(+), 3 deletions(-) --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1835,6 +1835,10 @@ CREATE TABLE `suggestions` ( branchcode VARCHAR(10) default NULL, collectiontitle text default NULL, itemtype VARCHAR(30) default NULL, + quantity SMALLINT(6) default NULL, + currency VARCHAR(3) default NULL, + price DECIMAL(28,6) default NULL, + total DECIMAL(28,6) default NULL, PRIMARY KEY (`suggestionid`), KEY `suggestedby` (`suggestedby`), KEY `managedby` (`managedby`) --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -3876,6 +3876,18 @@ VALUES SetVersion ($DBversion); }; +$DBversion = '3.03.00.005'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER table suggestions ADD quantity SMALLINT(6) default NULL, + ADD currency VARCHAR(3) default NULL, + ADD price DECIMAL(28,6) default NULL, + ADD total DECIMAL(28,6) default NULL; + "); + print "Upgrade to $DBversion done (Added acq related columns to suggestions)\n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js @@ -679,6 +679,24 @@ function calcNeworderTotal(){ return true; } +// Calculates total amount in a suggestion + +function calcNewsuggTotal(){ + //collect values + var quantity = new Number(document.getElementById('quantity').value); +// var currency = f.currency.value; + var currcode = new String(document.getElementById('currency').value); + var price = new Number(document.getElementById('price').value); + var exchangerate = new Number(document.getElementById(currcode).value); + + var total = new Number(quantity*price*exchangerate); + + document.getElementById('total').value = total.toFixed(2); + document.getElementById('price').value = listprice.toFixed(2); + return true; +} + + // ---------------------------------------- //USED BY NEWORDEREMPTY.PL /* --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl @@ -81,8 +81,9 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di .overlay { top: 180px; left: 50%; position: absolute; margin-left: -100px; width: 200px; text-align: center; display: none; margin-top: -10px; background: #eeffd4; padding: .5em; color: #000; } + -
+ @@ -160,7 +161,21 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di - +