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

(-)a/C4/Acquisition.pm (-3 / +25 lines)
Lines 1438-1450 sub GetLateOrders { Link Here
1438
    my $delay      = shift;
1438
    my $delay      = shift;
1439
    my $supplierid = shift;
1439
    my $supplierid = shift;
1440
    my $branch     = shift;
1440
    my $branch     = shift;
1441
    my $estimateddeliverydatefrom = shift;
1442
    my $estimateddeliverydateto = shift;
1441
1443
1442
    my $dbh = C4::Context->dbh;
1444
    my $dbh = C4::Context->dbh;
1443
1445
1444
    #BEWARE, order of parenthesis and LEFT JOIN is important for speed
1446
    #BEWARE, order of parenthesis and LEFT JOIN is important for speed
1445
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
1447
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
1446
1448
1447
    my @query_params = ($delay);	# delay is the first argument regardless
1449
    my @query_params = ();
1448
    my $select = "
1450
    my $select = "
1449
    SELECT aqbasket.basketno,
1451
    SELECT aqbasket.basketno,
1450
        aqorders.ordernumber,
1452
        aqorders.ordernumber,
Lines 1460-1465 sub GetLateOrders { Link Here
1460
        biblio.author, biblio.title,
1462
        biblio.author, biblio.title,
1461
        biblioitems.publishercode AS publisher,
1463
        biblioitems.publishercode AS publisher,
1462
        biblioitems.publicationyear,
1464
        biblioitems.publicationyear,
1465
        ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,
1463
    ";
1466
    ";
1464
    my $from = "
1467
    my $from = "
1465
    FROM
1468
    FROM
Lines 1473-1478 sub GetLateOrders { Link Here
1473
            OR datereceived IS NULL
1476
            OR datereceived IS NULL
1474
            OR aqorders.quantityreceived < aqorders.quantity
1477
            OR aqorders.quantityreceived < aqorders.quantity
1475
        )
1478
        )
1479
        AND aqbasket.closedate IS NOT NULL
1476
        AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
1480
        AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
1477
    ";
1481
    ";
1478
    my $having = "";
1482
    my $having = "";
Lines 1482-1488 sub GetLateOrders { Link Here
1482
        (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1486
        (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1483
        DATEDIFF(CURDATE( ),closedate) AS latesince
1487
        DATEDIFF(CURDATE( ),closedate) AS latesince
1484
        ";
1488
        ";
1485
        $from .= " AND (closedate <= DATE_SUB(CURDATE( ),INTERVAL ? DAY)) ";
1489
        if ( defined $delay ) {
1490
            $from .= " AND (closedate <= DATE_SUB(CURDATE( ),INTERVAL ? DAY)) " ;
1491
            push @query_params, $delay;
1492
        }
1486
        $having = "
1493
        $having = "
1487
        HAVING quantity          <> 0
1494
        HAVING quantity          <> 0
1488
            AND unitpricesupplier <> 0
1495
            AND unitpricesupplier <> 0
Lines 1495-1501 sub GetLateOrders { Link Here
1495
                aqorders.quantity * aqorders.rrp AS subtotal,
1502
                aqorders.quantity * aqorders.rrp AS subtotal,
1496
                (CURDATE - closedate)            AS latesince
1503
                (CURDATE - closedate)            AS latesince
1497
        ";
1504
        ";
1498
        $from .= " AND (closedate <= (CURDATE -(INTERVAL ? DAY)) ";
1505
        if ( defined $delay ) {
1506
            $from .= " AND (closedate <= (CURDATE -(INTERVAL ? DAY)) ";
1507
            push @query_params, $delay;
1508
        }
1499
    }
1509
    }
1500
    if (defined $supplierid) {
1510
    if (defined $supplierid) {
1501
        $from .= ' AND aqbasket.booksellerid = ? ';
1511
        $from .= ' AND aqbasket.booksellerid = ? ';
Lines 1505-1510 sub GetLateOrders { Link Here
1505
        $from .= ' AND borrowers.branchcode LIKE ? ';
1515
        $from .= ' AND borrowers.branchcode LIKE ? ';
1506
        push @query_params, $branch;
1516
        push @query_params, $branch;
1507
    }
1517
    }
1518
    if ( defined $estimateddeliverydatefrom ) {
1519
        $from .= '
1520
            AND aqbooksellers.deliverytime IS NOT NULL
1521
            AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
1522
        push @query_params, $estimateddeliverydatefrom;
1523
    }
1524
    if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
1525
        $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
1526
        push @query_params, $estimateddeliverydateto;
1527
    } elsif ( defined $estimateddeliverydatefrom ) {
1528
        $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CURDATE()';
1529
    }
1508
    if (C4::Context->preference("IndependantBranches")
1530
    if (C4::Context->preference("IndependantBranches")
1509
            && C4::Context->userenv
1531
            && C4::Context->userenv
1510
            && C4::Context->userenv->{flags} != 1 ) {
1532
            && C4::Context->userenv->{flags} != 1 ) {
(-)a/C4/Bookseller.pm (-15 / +46 lines)
Lines 102-120 Searches for suppliers with late orders. Link Here
102
=cut
102
=cut
103
103
104
sub GetBooksellersWithLateOrders {
104
sub GetBooksellersWithLateOrders {
105
    my $delay = shift;
105
    my ( $delay, $branch, $estimateddeliverydatefrom, $estimateddeliverydateto ) = @_;    # FIXME: Branch argument unused.
106
    my $dbh   = C4::Context->dbh;
106
    my $dbh = C4::Context->dbh;
107
107
108
    # TODO delay should be verified
108
    # FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
109
    my $query_string =
109
    # should be tested with other DBMs
110
      "SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
110
111
    FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
111
    my $strsth;
112
    LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
112
    my @query_params = ();
113
    WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY)
113
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
114
    AND (datereceived = '' OR datereceived IS NULL))";
114
    $strsth = "
115
115
        SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
116
    my $sth = $dbh->prepare($query_string);
116
        FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
117
    $sth->execute;
117
        LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
118
        WHERE 
119
            ( datereceived = ''
120
            OR datereceived IS NULL
121
            OR aqorders.quantityreceived < aqorders.quantity
122
            )
123
            AND aqorders.rrp <> 0
124
            AND aqorders.ecost <> 0
125
            AND aqorders.quantity - IFNULL(aqorders.quantityreceived,0) <> 0
126
            AND aqbasket.closedate IS NOT NULL
127
    ";
128
    if ( defined $delay ) {
129
        $strsth .= " AND (closedate <= DATE_SUB(CURDATE( ),INTERVAL ? DAY)) ";
130
        push @query_params, $delay;
131
    }
132
    if ( defined $estimateddeliverydatefrom ) {
133
        $strsth .= '
134
            AND aqbooksellers.deliverytime IS NOT NULL
135
            AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
136
        push @query_params, $estimateddeliverydatefrom;
137
    }
138
    if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
139
        $strsth .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
140
        push @query_params, $estimateddeliverydateto;
141
    } elsif ( defined $estimateddeliverydatefrom ) {
142
        $strsth .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CURDATE()';
143
    }
144
145
    my $sth = $dbh->prepare($strsth);
146
    $sth->execute( @query_params );
118
    my %supplierlist;
147
    my %supplierlist;
119
    while ( my ( $id, $name ) = $sth->fetchrow ) {
148
    while ( my ( $id, $name ) = $sth->fetchrow ) {
120
        $supplierlist{$id} = $name;
149
        $supplierlist{$id} = $name;
Lines 201-207 sub ModBookseller { Link Here
201
            contphone=?,contfax=?,contaltphone=?,contemail=?,
230
            contphone=?,contfax=?,contaltphone=?,contemail=?,
202
            contnotes=?,active=?,listprice=?, invoiceprice=?,
231
            contnotes=?,active=?,listprice=?, invoiceprice=?,
203
            gstreg=?,listincgst=?,invoiceincgst=?,
232
            gstreg=?,listincgst=?,invoiceincgst=?,
204
            discount=?,notes=?,gstrate=?
233
            discount=?,notes=?,gstrate=?,deliverytime=?
205
        WHERE id=?';
234
        WHERE id=?';
206
    my $sth = $dbh->prepare($query);
235
    my $sth = $dbh->prepare($query);
207
    $sth->execute(
236
    $sth->execute(
Lines 218-224 sub ModBookseller { Link Here
218
        $data->{'invoiceprice'}, $data->{'gstreg'},
247
        $data->{'invoiceprice'}, $data->{'gstreg'},
219
        $data->{'listincgst'},   $data->{'invoiceincgst'},
248
        $data->{'listincgst'},   $data->{'invoiceincgst'},
220
        $data->{'discount'},     $data->{'notes'},
249
        $data->{'discount'},     $data->{'notes'},
221
        $data->{'gstrate'},      $data->{'id'}
250
        $data->{'gstrate'},
251
        $data->{deliverytime},
252
        $data->{'id'}
222
    );
253
    );
223
    return;
254
    return;
224
}
255
}
(-)a/acqui/basket.pl (+11 lines)
Lines 35-40 use C4::Biblio; Link Here
35
use C4::Members qw/GetMember/;  #needed for permissions checking for changing basketgroup of a basket
35
use C4::Members qw/GetMember/;  #needed for permissions checking for changing basketgroup of a basket
36
use C4::Items;
36
use C4::Items;
37
use C4::Suggestions;
37
use C4::Suggestions;
38
use Date::Calc qw/Add_Delta_Days/;
38
39
39
=head1 NAME
40
=head1 NAME
40
41
Lines 214-219 if ( $op eq 'delete_confirm' ) { Link Here
214
        }
215
        }
215
        unshift( @$basketgroups, \%emptygroup );
216
        unshift( @$basketgroups, \%emptygroup );
216
    }
217
    }
218
219
    # if the basket is closed, calculate estimated delivery date
220
    my $estimateddeliverydate;
221
    if( $basket->{closedate} ) {
222
        my ($year, $month, $day) = ($basket->{closedate} =~ /(\d+)-(\d+)-(\d+)/);
223
        ($year, $month, $day) = Add_Delta_Days($year, $month, $day, $bookseller->{deliverytime});
224
        $estimateddeliverydate = "$year-$month-$day";
225
    }
226
217
    # if new basket, pre-fill infos
227
    # if new basket, pre-fill infos
218
    $basket->{creationdate} = ""            unless ( $basket->{creationdate} );
228
    $basket->{creationdate} = ""            unless ( $basket->{creationdate} );
219
    $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} );
229
    $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} );
Lines 368-373 my $total_est_gste; Link Here
368
        authorisedby         => $basket->{authorisedby},
378
        authorisedby         => $basket->{authorisedby},
369
        authorisedbyname     => $basket->{authorisedbyname},
379
        authorisedbyname     => $basket->{authorisedbyname},
370
        closedate            => C4::Dates->new($basket->{closedate},'iso')->output,
380
        closedate            => C4::Dates->new($basket->{closedate},'iso')->output,
381
        estimateddeliverydate => C4::Dates->new( $estimateddeliverydate, 'iso' )->output,
371
        active               => $bookseller->{'active'},
382
        active               => $bookseller->{'active'},
372
        booksellerid         => $bookseller->{'id'},
383
        booksellerid         => $bookseller->{'id'},
373
        name                 => $bookseller->{'name'},
384
        name                 => $bookseller->{'name'},
(-)a/acqui/lateorders.pl (-6 / +21 lines)
Lines 66-79 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
66
66
67
my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
67
my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
68
my $delay      = $input->param('delay');
68
my $delay      = $input->param('delay');
69
my $estimateddeliverydatefrom = $input->param('estimateddeliverydatefrom');
70
my $estimateddeliverydateto   = $input->param('estimateddeliverydateto');
69
my $branch     = $input->param('branch');
71
my $branch     = $input->param('branch');
70
my $op         = $input->param('op');
72
my $op         = $input->param('op');
71
73
72
my @errors = ();
74
my @errors = ();
73
$delay = 30 unless defined $delay;
75
if ( defined $delay and not $delay =~ /^\d{1,3}$/ ) {
74
unless ($delay =~ /^\d{1,3}$/) {
76
    push @errors, {delay_digits => 1, bad_delay => $delay};
75
	push @errors, {delay_digits => 1, bad_delay => $delay};
76
	$delay = 30;	#default value for delay
77
}
77
}
78
78
79
if ($op and $op eq "send_alert"){
79
if ($op and $op eq "send_alert"){
Lines 92-98 if ($op and $op eq "send_alert"){ Link Here
92
    }
92
    }
93
}
93
}
94
94
95
my %supplierlist = GetBooksellersWithLateOrders($delay);
95
my %supplierlist = GetBooksellersWithLateOrders(
96
    $delay,
97
    $branch,
98
    C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
99
    C4::Dates->new($estimateddeliverydateto)->output("iso")
100
);
101
96
my (@sloopy);	# supplier loop
102
my (@sloopy);	# supplier loop
97
foreach (keys %supplierlist){
103
foreach (keys %supplierlist){
98
	push @sloopy, (($booksellerid and $booksellerid eq $_ )            ?
104
	push @sloopy, (($booksellerid and $booksellerid eq $_ )            ?
Lines 104-110 $template->param(SUPPLIER_LOOP => \@sloopy); Link Here
104
$template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid);
110
$template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid);
105
$template->param(booksellerid=>$booksellerid) if ($booksellerid);
111
$template->param(booksellerid=>$booksellerid) if ($booksellerid);
106
112
107
my @lateorders = GetLateOrders($delay,$booksellerid,$branch);
113
my @lateorders = GetLateOrders(
114
    $delay,
115
    $booksellerid,
116
    $branch,
117
    C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
118
    C4::Dates->new($estimateddeliverydateto)->output("iso")
119
);
108
120
109
my $total;
121
my $total;
110
foreach (@lateorders){
122
foreach (@lateorders){
Lines 122-128 $template->param(ERROR_LOOP => \@errors) if (@errors); Link Here
122
$template->param(
134
$template->param(
123
	lateorders => \@lateorders,
135
	lateorders => \@lateorders,
124
	delay => $delay,
136
	delay => $delay,
137
    estimateddeliverydatefrom => $estimateddeliverydatefrom,
138
    estimateddeliverydateto   => $estimateddeliverydateto,
125
	total => $total,
139
	total => $total,
126
	intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
140
	intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
141
    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
127
);
142
);
128
output_html_with_http_headers $input, $cookie, $template->output;
143
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/acqui/supplier.pl (+2 lines)
Lines 109-114 if ( $op eq 'display' ) { Link Here
109
        listincgst    => $supplier->{'listincgst'},
109
        listincgst    => $supplier->{'listincgst'},
110
        invoiceincgst => $supplier->{'invoiceincgst'},
110
        invoiceincgst => $supplier->{'invoiceincgst'},
111
        discount      => $supplier->{'discount'},
111
        discount      => $supplier->{'discount'},
112
        deliverytime  => $supplier->{deliverytime},
112
        invoiceprice  => $supplier->{'invoiceprice'},
113
        invoiceprice  => $supplier->{'invoiceprice'},
113
        listprice     => $supplier->{'listprice'},
114
        listprice     => $supplier->{'listprice'},
114
        GST           => $tax_rate,
115
        GST           => $tax_rate,
Lines 176-181 if ( $op eq 'display' ) { Link Here
176
        invoiceincgst => $supplier->{'invoiceincgst'},
177
        invoiceincgst => $supplier->{'invoiceincgst'},
177
        gstrate       => $gstrate,
178
        gstrate       => $gstrate,
178
        discount      => $supplier->{'discount'},
179
        discount      => $supplier->{'discount'},
180
        deliverytime  => $supplier->{deliverytime},
179
        loop_currency => $loop_currency,
181
        loop_currency => $loop_currency,
180
        GST           => $tax_rate,
182
        GST           => $tax_rate,
181
        enter         => 1,
183
        enter         => 1,
(-)a/acqui/updatesupplier.pl (+1 lines)
Lines 107-112 if ($gstrate eq '') { Link Here
107
    $data{'gstrate'} = $input->param('gstrate')/100;
107
    $data{'gstrate'} = $input->param('gstrate')/100;
108
}
108
}
109
$data{'discount'}=$input->param('discount');
109
$data{'discount'}=$input->param('discount');
110
$data{deliverytime} = $input->param('deliverytime');
110
$data{'active'}=$input->param('status');
111
$data{'active'}=$input->param('status');
111
if($data{'name'}) {
112
if($data{'name'}) {
112
	if ($data{'id'}){
113
	if ($data{'id'}){
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2519-2524 CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis Link Here
2519
  `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged
2519
  `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged
2520
  `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor
2520
  `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor
2521
  `fax` varchar(50) default NULL, -- vendor fax number
2521
  `fax` varchar(50) default NULL, -- vendor fax number
2522
  `deliverytime` int(11) default NULL, -- vendor delivery time
2522
  PRIMARY KEY  (`id`),
2523
  PRIMARY KEY  (`id`),
2523
  KEY `listprice` (`listprice`),
2524
  KEY `listprice` (`listprice`),
2524
  KEY `invoiceprice` (`invoiceprice`),
2525
  KEY `invoiceprice` (`invoiceprice`),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4924-4929 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4924
}
4924
}
4925
4925
4926
4926
4927
$DBversion = "3.07.00.XXX";
4928
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4929
    $dbh->do("ALTER TABLE aqbooksellers ADD deliverytime INT DEFAULT NULL");
4930
    print "Upgrade to $DBversion done (Add deliverytime field in aqbooksellers table)";
4931
    SetVersion($DBversion);
4932
}
4933
4927
=head1 FUNCTIONS
4934
=head1 FUNCTIONS
4928
4935
4929
=head2 DropAllForeignKeys($table)
4936
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+2 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
3
<title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 180-185 Link Here
180
                [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
181
                [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
181
                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate %]</li>[% END %]
182
                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate %]</li>[% END %]
182
                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate %]</li>[% END %]
183
                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate %]</li>[% END %]
184
                [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
183
185
184
                </ol>
186
                </ol>
185
                </div>
187
                </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt (-2 / +39 lines)
Lines 1-7 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6
[% INCLUDE 'calendar.inc' %]
5
<script type="text/javascript">
7
<script type="text/javascript">
6
//<![CDATA[
8
//<![CDATA[
7
$(document).ready(function() {
9
$(document).ready(function() {
Lines 60-65 $(document).ready(function() { Link Here
60
    <table id="late_orders">
62
    <table id="late_orders">
61
        <tr>
63
        <tr>
62
            <th>Order Date</th>
64
            <th>Order Date</th>
65
            <th>Estimated delivery date</th>
63
            <th>Vendor</th>
66
            <th>Vendor</th>
64
            <th>Information</th>
67
            <th>Information</th>
65
            <th>Total cost</th>
68
            <th>Total cost</th>
Lines 81-86 $(document).ready(function() { Link Here
81
                ([% lateorder.latesince %] days)
84
                ([% lateorder.latesince %] days)
82
            </td>
85
            </td>
83
            <td>
86
            <td>
87
                [% lateorder.estimateddeliverydate | $KohaDates  %]
88
            </td>
89
            <td>
84
                [% lateorder.supplier %]
90
                [% lateorder.supplier %]
85
            </td>
91
            </td>
86
            <td>
92
            <td>
Lines 117-123 $(document).ready(function() { Link Here
117
        [% END %]
123
        [% END %]
118
        <tr> 
124
        <tr> 
119
            <th>Total</th>
125
            <th>Total</th>
120
            <th colspan="2">&nbsp;</th>
126
            <th colspan="3">&nbsp;</th>
121
            <th>[% total %]</th>
127
            <th>[% total %]</th>
122
            <th>&nbsp;</th>
128
            <th>&nbsp;</th>
123
            <th>&nbsp;</th>
129
            <th>&nbsp;</th>
Lines 140-146 $(document).ready(function() { Link Here
140
[% FOREACH ERROR_LOO IN ERROR_LOOP %]
146
[% FOREACH ERROR_LOO IN ERROR_LOOP %]
141
[% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
147
[% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
142
[% END %]
148
[% END %]
143
<ol><li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
149
<ol>
150
    <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
151
    <li><label for="delay">Estimated Delivery date from: </label>
152
        <input type="text" size="10" id="estimateddeliverydatefrom" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" />
153
        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarFrom" style="cursor: pointer;" alt="Show Calendar" />
154
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
155
    </li>
156
    <li><label for="delay">To: </label>
157
        <input type="text" size="10" id="estimateddeliverydateto" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" />
158
        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="Show Calendar" />
159
        <script type="text/javascript">
160
            // return true if the date is blocked.
161
            function disable_from(date) {var limit = get_Calendar_limit(date,'estimateddeliverydatefrom'); return (limit && limit < date);}
162
            function disable_to(date) {var limit = get_Calendar_limit(date,'estimateddeliverydateto'); return (limit && limit < date);}
163
            Calendar.setup({
164
                inputField : "estimateddeliverydatefrom",
165
                ifFormat : "[% DHTMLcalendar_dateformat %]",
166
                button : "openCalendarFrom",
167
                disableFunc : disable_from,
168
                dateStatusFunc : disable_from
169
            });
170
            Calendar.setup({
171
                inputField : "estimateddeliverydateto",
172
                ifFormat : "[% DHTMLcalendar_dateformat %]",
173
                button : "openCalendarTo",
174
                disableFunc : disable_to,
175
                dateStatusFunc : disable_to
176
             });
177
        </script>
178
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
179
    </li>
180
144
	<li><label for="booksellerid">Vendor:</label>
181
	<li><label for="booksellerid">Vendor:</label>
145
		<select id="booksellerid" size="1" tabindex="" name="booksellerid">
182
		<select id="booksellerid" size="1" tabindex="" name="booksellerid">
146
			<option value=""/>
183
			<option value=""/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (-1 / +8 lines)
Lines 137-142 if (f.company.value == "") { Link Here
137
            <li><label for="discount">Discount</label>
137
            <li><label for="discount">Discount</label>
138
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
138
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
139
            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
139
            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
140
            <li>
141
                <label for="deliverytime">Delivery time</label>
142
                <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
143
            </li>
140
            <li><label for="notes">Notes</label>
144
            <li><label for="notes">Notes</label>
141
                <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
145
                <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
142
        </fieldset>
146
        </fieldset>
Lines 197-202 if (f.company.value == "") { Link Here
197
                [% discount %] %</p>
201
                [% discount %] %</p>
198
            <p><strong>Tax rate: </strong>
202
            <p><strong>Tax rate: </strong>
199
                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
203
                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
204
            [% IF deliverytime.defined %]
205
                <p><strong>Delivery time: </strong>
206
                    [% deliverytime %] days</p>
207
            [% END %]
200
            [% IF ( notes ) %]<p><strong>Notes: </strong>
208
            [% IF ( notes ) %]<p><strong>Notes: </strong>
201
                [% notes %]</p>[% END %]
209
                [% notes %]</p>[% END %]
202
        </div>
210
        </div>
203
- 

Return to bug 7291