# -------------------------------------------------------------------
sub GetBudgetHierarchy {
- my ($budget_period_id, $branchcode, $owner) = @_;
- my @bind_params;
- my $dbh = C4::Context->dbh;
- my $query = qq|
- SELECT aqbudgets.*
+ my ( $budget_period_id, $branchcode, $owner ) = @_;
+ my @bind_params;
+ my $dbh = C4::Context->dbh;
+ my $query = qq|
+ SELECT aqbudgets.*, aqbudgetperiods.budget_period_active
FROM aqbudgets
- LEFT JOIN aqbudgetperiods
- ON aqbudgetperiods.budget_period_id=aqbudgets.budget_period_id |;
+ JOIN aqbudgetperiods USING (budget_period_id)|;
+
my @where_strings;
- # Pick out the active ones
- push @where_strings, 'aqbudgetperiods.budget_period_active=1';
# show only period X if requested
if ($budget_period_id) {
push @where_strings," aqbudgets.budget_period_id = ?";
# show only budgets owned by me, my branch or everyone
if ($owner) {
if ($branchcode) {
- push @where_strings,qq{ (budget_owner_id = ? OR budget_branchcode = ? OR (budget_branchcode IS NULL or budget_branchcode="" AND (budget_owner_id IS NULL OR budget_owner_id="")))};
- push @bind_params, ($owner, $branchcode);
+ push @where_strings,
+ qq{ (budget_owner_id = ? OR budget_branchcode = ? OR ((budget_branchcode IS NULL or budget_branchcode="") AND (budget_owner_id IS NULL OR budget_owner_id="")))};
+ push @bind_params, ( $owner, $branchcode );
} else {
push @where_strings, ' (budget_owner_id = ? OR budget_owner_id IS NULL or budget_owner_id ="") ';
push @bind_params, $owner;
use C4::Context;
use C4::Output;
-use C4::Dates qw(format_date);
+use C4::Dates qw(format_date format_date_in_iso);
use C4::SQLHelper qw(:all);
use C4::Debug;
use C4::Letters;
if ($userenv) {
if (($userenv->{flags} % 2) != 1 && !$suggestion->{branchcode}){
push @sql_params,$$userenv{branch};
- push @query,q{ and (branchcode = ? or branchcode ='')};
+ push @query,q{ and (suggestions.branchcode = ? or suggestions.branchcode ='')};
}
}
}
}
}
+ my $today = C4::Dates->today('iso');
+
+ foreach ( qw( suggesteddate manageddate accepteddate ) ) {
+ my $from = $_ . "_from";
+ my $to = $_ . "_to";
+ if ($$suggestion{$from} || $$suggestion{$to}) {
+ push @query, " AND suggestions.suggesteddate BETWEEN '"
+ . (format_date_in_iso($$suggestion{$from}) || 0000-00-00) . "' AND '" . (format_date_in_iso($$suggestion{$to}) || $today) . "'";
+ }
+ }
+
$debug && warn "@query";
my $sth=$dbh->prepare("@query");
$sth->execute(@sql_params);
push @{$budget_loop}, {
b_id => $r->{budget_id},
b_txt => $r->{budget_name},
+ b_active => $r->{budget_period_active},
b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
};
}
resultsperpage => $resultsperpage,
);
output_html_with_http_headers $input, $cookie, $template->output;
+
my $budget_id = $$budget_hash{budget_id};
my $budget_permission = $input->param('budget_permission');
my $budget_period_dropbox = $input->param('budget_period_dropbox');
+my $filter_budgetbranch = $input->param('filter_budgetbranch');
#filtering non budget keys
delete $$budget_hash{$_} foreach grep {/filter|^op$|show/} keys %$budget_hash;
-my $filter_budgetbranch = $input->param('filter_budgetbranch');
my $filter_budgetname = $input->param('filter_budgetname');
$template->param(
notree => ($filter_budgetbranch or $show_mine)
#melm 035 Local-number,Identifier-standard
melm 037 Identifier-standard,Stock-number
melm 040 Code-institution,Record-source
-melm 041 ln
+melm 041$a ln
+melm 041$d ln
+melm 041$e ln
+melm 041$j ln
melm 043 Code-geographic
#melm 046 pubdate
melm 050$b LC-call-number:w,LC-call-number:p,LC-call-number:s
`stocknumber` varchar(32) default NULL,
PRIMARY KEY (`itemnumber`),
UNIQUE KEY `itembarcodeidx` (`barcode`),
- UNIQUE KEY `itemstocknumberidx` (`stocknumber`),
+ KEY `itemstocknumberidx` (`stocknumber`),
KEY `itembinoidx` (`biblioitemnumber`),
KEY `itembibnoidx` (`biblionumber`),
KEY `homebranch` (`homebranch`),
SetVersion ($DBversion);
}
+$DBversion = '3.03.00.042';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE `items` DROP INDEX `itemsstocknumberidx`;");
+ $dbh->do("ALTER TABLE items ADD INDEX itemstocknumberidx (stocknumber);");
+ print "Upgrade to $DBversion done (Change items.stocknumber to be not unique)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)
var total = new Number(quantity*price*exchangerate);
document.getElementById('total').value = total.toFixed(2);
- document.getElementById('price').value = listprice.toFixed(2);
+ document.getElementById('price').value = price.toFixed(2);
return true;
}
ok=1;
_alertString += "\n- " + _("Title cannot be empty");
}
+
+ if(isNull(ff.budget_id,1)){
+ ok=1;
+ _alertString += "\n- "+ _("You must select a budget");
+ }
if (!(isNum(ff.quantity,0))){
ok=1;
}
-
+$(document).ready(function()
+ {
+ //We apply the fonction only for modify option
+ <!--TMPL_IF NAME="quantityrec"-->
+ $('#quantity').blur(function()
+ {
+ // if user decreases the quantity
+ if($(this).val() < <!-- TMPL_VAR name="quantityrec" -->)
+ {
+ alert("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog");
+ return true;
+ }
+ else
+ {
+ // if user increases the quantity
+ alert("You can't add a new item, please create a new order line");
+ // and we replace the original value
+ $(this).val(<!-- TMPL_VAR name="quantityrec" -->)
+ return false;
+ }
+ });
+ <!-- /TMPL_IF -->
+
+ $('#showallbudgets').click(function() {
+ if ( $('#budget_id .b_inactive').is(":visible") )
+ {
+ $('#budget_id .b_inactive').hide();
+ }
+ else {
+ $('#budget_id .b_inactive').show();
+ }
+ });
+ });
//]]>
</script>
</head>
<h2>
<!-- TMPL_IF name="ordernumber" -->
- Modify order details (line #<!-- TMPL_VAR NAME="ordernumber" -->)
+ Modify order line
<!-- TMPL_ELSE -->
New order
<!-- /TMPL_IF -->
<form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform">
<fieldset class="rows">
- <legend>Catalog details</legend>
+ <legend>
+ Catalog details
+ <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=<!--TMPL_VAR NAME= "biblionumber"-->"> Edit record</a></span>
+ </legend>
<!-- TMPL_UNLESS name="existing" -->
<input type="hidden" name="existing" value="no" />
<!-- /TMPL_UNLESS -->
<!-- TMPL_IF NAME="b_sel" -->
<option value="<!-- TMPL_VAR NAME='b_id' -->" selected="selected"><!-- TMPL_VAR NAME="b_txt" --></option>
<!-- TMPL_ELSE -->
- <option value="<!-- TMPL_VAR NAME='b_id' -->"><!-- TMPL_VAR NAME="b_txt" --></option>
+ <!-- TMPL_IF NAME="b_active" --><option value="<!-- TMPL_VAR NAME='b_id' -->"><!-- TMPL_VAR NAME="b_txt" --></option>
+ <!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME='b_id' -->" class="b_inactive" style="display : none;"><!-- TMPL_VAR NAME="b_txt" --></option>
+ <!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select>
+ <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
+ <input type="checkbox" id="showallbudgets" />
<!--/TMPL_IF-->
</li>
<li>
</li>
<li>
<label for="notes">Notes: </label>
- <textarea id="notes" cols="30" rows="3" name="notes"><!-- TMPL_VAR NAME="notes" --></textarea>
+ <textarea id="notes" cols="30" rows="3" name="notes"></textarea>
</li>
<li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
- <label for="sort1">Planning value1: </label>
+ <label for="sort1">Statistic 1: </label>
<!-- TMPL_IF Name="CGIsort1" -->
<!-- TMPL_VAR Name="CGIsort1" -->
<!--/TMPL_IF -->
</li>
<li>
- <label for="sort2">Planning value2: </label>
+ <label for="sort2">Statistic 2: </label>
<!-- TMPL_IF Name="CGIsort2" -->
<!-- TMPL_VAR Name="CGIsort2" -->
<th>Order Line</th>
<th>Summary</th>
<th>View Record</th>
+ <th>Quantity</th>
<th>Est cost</th>
<th>Actual cost</th>
<th>TOTAL</th>
<tfoot>
<tr>
<td colspan="4" class="total">SUBTOTAL</td>
- <td> </td>
+ <td colspan="2"> </td>
<td><!-- TMPL_VAR NAME="totalprice" --></td>
<td><!-- TMPL_VAR NAME="tototal" --></td>
</tr>
+
<!-- TMPL_IF NAME="totalfreight" -->
<tr>
- <td colspan="5">
+ <td colspan="6">
</td>
<td>Shipping</td>
<td><!-- TMPL_VAR NAME="totalfreight" --></td>
- </tr> <!-- /TMPL_IF -->
+ </tr>
+ <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="gst" -->
<tr>
- <td colspan="5">
+ <td colspan="6">
<p class="message">
<b>HELP</b><br />
The total at the bottom of the page should be within a few cents of the total for the invoice.
</td>
<td><b>Tax rate</b></td>
<td><!-- TMPL_VAR NAME="gst" --></td>
- </tr> <!-- /TMPL_IF -->
+ </tr>
+ <!-- /TMPL_IF -->
<tr>
<td colspan="4" class="total">TOTAL</td>
+ <td><!-- TMPL_VAR NAME="totalquantity" --></td>
<td colspan="2"> </td>
<td><!-- TMPL_VAR NAME="grandtot" --></td>
</tr>
<!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
</td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
+ <td><!-- TMPL_VAR NAME="quantityreceived" --></td>
<td><!-- TMPL_VAR NAME="ecost" --></td>
<td><!-- TMPL_VAR NAME="unitprice" --></td>
<td><!-- TMPL_VAR NAME="total" --></td>
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
+
Serials:
+ -
+ - Show
+ - pref: opacSerialDefaultTab
+ choices:
+ holdings: Holdings tab
+ subscriptions: Subscriptions tab
+ serialcollection: Serial Collection tab
+ - as default tab for serials in OPAC. Please note that the Serial Collection tab is currently available only for UNIMARC.
-
- pref: RenewSerialAddsSuggestion
choices:
choices:
simplified: a summary
full: a full list
- - of the serial issues.
\ No newline at end of file
+ - of the serial issues.
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
<!--TMPL_IF Name="op_else"--> <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
-<script type="text/JavaScript">
+<script type="text/javascript">
// <![CDATA[
function yuiToolbar() {
<style type="text/css">
h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
.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; } .note { -moz-border-radius: 3px; border-radius:3px; background: transparent url("/intranet-tmpl/prog/img/famfamfam/silk/comment.png") top left no-repeat; padding : 1px 3px 1px 18px; font-size : 90%; }
-</style>
+</style><!-- TMPL_ELSE -->
+<script type="text/javascript">
+// <![CDATA[
+$(document).ready(function() { calcNewsuggTotal(); });
+// ]]>
+</script>
<!--/TMPL_IF-->
<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
</head>
-<body onload="calcNewsuggTotal();">
+<body>
<!-- TMPL_INCLUDE name="header.inc" -->
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <!-- TMPL_IF name="op_save" --> <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> › <!-- TMPL_IF name="suggestionid" -->Suggestion edit #<!-- TMPL_VAR name="suggestionid" --><!--TMPL_ELSE-->New purchase suggestion<!-- /TMPL_IF --><!--TMPL_ELSE-->Suggestions Management<!-- /TMPL_IF --> </div>
use strict;
sub kohaversion {
- our $VERSION = '3.03.00.041';
+ our $VERSION = '3.03.00.042';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
- if ($displayby =~/managedby/||$displayby =~/acceptedby/){
+ if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
return "" unless $borr;
return $$borr{firstname} . ", " . $$borr{surname};
$op ='save';
}
elsif ($op eq "change" ) {
+ # set accepted/rejected/managed informations if applicable
+ # ie= if the librarian has choosen some action on the suggestions
+ if ($$suggestion_ref{"STATUS"} eq "ACCEPTED"){
+ $$suggestion_ref{"accepteddate"}=C4::Dates->today;
+ $$suggestion_ref{"acceptedby"}=C4::Context->userenv->{number};
+ } elsif ($$suggestion_ref{"STATUS"} eq "REJECTED"){
+ $$suggestion_ref{"rejecteddate"}=C4::Dates->today;
+ $$suggestion_ref{"rejectedby"}=C4::Context->userenv->{number};
+ }
if ($$suggestion_ref{"STATUS"}){
- if (my $tmpstatus=lc($$suggestion_ref{"STATUS"}) =~/ACCEPTED|REJECTED/i){
- $$suggestion_ref{"$tmpstatus"."date"}=C4::Dates->today;
- $$suggestion_ref{"$tmpstatus"."by"}=C4::Context->userenv->{number};
- }
$$suggestion_ref{"manageddate"}=C4::Dates->today;
$$suggestion_ref{"managedby"}=C4::Context->userenv->{number};
}