View | Details | Raw Unified | Return to bug 7301
Collapse All | Expand All

(-)a/acqui/histsearch.pl (-10 / +12 lines)
Lines 61-74 use C4::Debug; Link Here
61
my $input = new CGI;
61
my $input = new CGI;
62
my $title                   = $input->param( 'title');
62
my $title                   = $input->param( 'title');
63
my $author                  = $input->param('author');
63
my $author                  = $input->param('author');
64
my $isbn          	    = $input->param('isbn');
64
my $isbn                    = $input->param('isbn');
65
my $name                    = $input->param( 'name' );
65
my $name                    = $input->param( 'name' );
66
my $basket                  = $input->param( 'basket' );
66
my $basket                  = $input->param( 'basket' );
67
my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' );
67
my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' );
68
my $from_placed_on          = $input->param('from');
68
my $do_search               = $input->param('do_search') || 0;
69
$from_placed_on             = C4::Dates->new($from_placed_on) if $from_placed_on;
69
my $from_placed_on          = C4::Dates->new($input->param('from'));
70
my $to_placed_on            = $input->param('to');
70
my $to_placed_on            = C4::Dates->new($input->param('to'));
71
$to_placed_on               = C4::Dates->new($to_placed_on) if $to_placed_on;
71
if ( not $input->param('from') ) {
72
    # FIXME Dirty but we can't sent a Date::Calc to C4::Dates ?
73
    # We would use a function like Add_Delta_YM(-1, 0, 0);
74
    $$from_placed_on{dmy_arrayref}[5] -= 1;
75
}
72
76
73
my $dbh = C4::Context->dbh;
77
my $dbh = C4::Context->dbh;
74
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
78
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 92-104 if ( $d = $input->param('iso') ) { Link Here
92
96
93
my ( $order_loop, $total_qty, $total_price, $total_qtyreceived );
97
my ( $order_loop, $total_qty, $total_price, $total_qtyreceived );
94
# If we're supplied any value then we do a search. Otherwise we don't.
98
# If we're supplied any value then we do a search. Otherwise we don't.
95
my $do_search = $title || $author || $isbn || $name || $basket || $booksellerinvoicenumber ||
96
    $from_placed_on || $to_placed_on;
97
if ($do_search) {
99
if ($do_search) {
98
    ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = GetHistory(
100
    ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = GetHistory(
99
        title => $title,
101
        title => $title,
100
        author => $author,
102
        author => $author,
101
	isbn   => $isbn,
103
        isbn   => $isbn,
102
        name => $name,
104
        name => $name,
103
        from_placed_on => $from_iso,
105
        from_placed_on => $from_iso,
104
        to_placed_on => $to_iso,
106
        to_placed_on => $to_iso,
Lines 118-131 $template->param( Link Here
118
    numresults              => $order_loop ? scalar(@$order_loop) : undef,
120
    numresults              => $order_loop ? scalar(@$order_loop) : undef,
119
    title                   => $title,
121
    title                   => $title,
120
    author                  => $author,
122
    author                  => $author,
121
    isbn		    => $isbn,
123
    isbn                    => $isbn,
122
    name                    => $name,
124
    name                    => $name,
123
    basket                  => $basket,
125
    basket                  => $basket,
124
    booksellerinvoicenumber => $booksellerinvoicenumber,
126
    booksellerinvoicenumber => $booksellerinvoicenumber,
125
    from_placed_on          => $from_date,
127
    from_placed_on          => $from_date,
126
    to_placed_on            => $to_date,
128
    to_placed_on            => $to_date,
127
    DHTMLcalendar_dateformat=> C4::Dates->DHTMLcalendar(),
129
    DHTMLcalendar_dateformat=> C4::Dates->DHTMLcalendar(),
128
	dateformat              => C4::Dates->new()->format(),
130
    dateformat              => C4::Dates->new()->format(),
129
    debug                   => $debug || $input->param('debug') || 0,
131
    debug                   => $debug || $input->param('debug') || 0,
130
);
132
);
131
133
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt (-1 / +1 lines)
Lines 57-62 Link Here
57
		</li>
57
		</li>
58
		</ol>
58
		</ol>
59
	</fieldset>
59
	</fieldset>
60
    <input type="hidden" name="do_search" value="1" />
60
	<fieldset class="action"><input type="submit" value="Search" /></fieldset>
61
	<fieldset class="action"><input type="submit" value="Search" /></fieldset>
61
	</form>[% END %]
62
	</form>[% END %]
62
	[% IF ( suggestions_loop ) %]<h1>Search Results</h1>
63
	[% IF ( suggestions_loop ) %]<h1>Search Results</h1>
63
- 

Return to bug 7301