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 99-117 Searches for suppliers with late orders. Link Here
99
=cut
99
=cut
100
100
101
sub GetBooksellersWithLateOrders {
101
sub GetBooksellersWithLateOrders {
102
    my $delay = shift;
102
    my ( $delay, $branch, $estimateddeliverydatefrom, $estimateddeliverydateto ) = @_;    # FIXME: Branch argument unused.
103
    my $dbh   = C4::Context->dbh;
103
    my $dbh = C4::Context->dbh;
104
104
105
    # TODO delay should be verified
105
    # FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
106
    my $query_string =
106
    # should be tested with other DBMs
107
      "SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
107
108
    FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
108
    my $strsth;
109
    LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
109
    my @query_params = ();
110
    WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY)
110
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
111
    AND (datereceived = '' OR datereceived IS NULL))";
111
    $strsth = "
112
112
        SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
113
    my $sth = $dbh->prepare($query_string);
113
        FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
114
    $sth->execute;
114
        LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
115
        WHERE 
116
            ( datereceived = ''
117
            OR datereceived IS NULL
118
            OR aqorders.quantityreceived < aqorders.quantity
119
            )
120
            AND aqorders.rrp <> 0
121
            AND aqorders.ecost <> 0
122
            AND aqorders.quantity - IFNULL(aqorders.quantityreceived,0) <> 0
123
            AND aqbasket.closedate IS NOT NULL
124
    ";
125
    if ( defined $delay ) {
126
        $strsth .= " AND (closedate <= DATE_SUB(CURDATE( ),INTERVAL ? DAY)) ";
127
        push @query_params, $delay;
128
    }
129
    if ( defined $estimateddeliverydatefrom ) {
130
        $strsth .= '
131
            AND aqbooksellers.deliverytime IS NOT NULL
132
            AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
133
        push @query_params, $estimateddeliverydatefrom;
134
    }
135
    if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
136
        $strsth .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
137
        push @query_params, $estimateddeliverydateto;
138
    } elsif ( defined $estimateddeliverydatefrom ) {
139
        $strsth .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CURDATE()';
140
    }
141
142
    my $sth = $dbh->prepare($strsth);
143
    $sth->execute( @query_params );
115
    my %supplierlist;
144
    my %supplierlist;
116
    while ( my ( $id, $name ) = $sth->fetchrow ) {
145
    while ( my ( $id, $name ) = $sth->fetchrow ) {
117
        $supplierlist{$id} = $name;
146
        $supplierlist{$id} = $name;
Lines 198-204 sub ModBookseller { Link Here
198
            contphone=?,contfax=?,contaltphone=?,contemail=?,
227
            contphone=?,contfax=?,contaltphone=?,contemail=?,
199
            contnotes=?,active=?,listprice=?, invoiceprice=?,
228
            contnotes=?,active=?,listprice=?, invoiceprice=?,
200
            gstreg=?,listincgst=?,invoiceincgst=?,
229
            gstreg=?,listincgst=?,invoiceincgst=?,
201
            discount=?,notes=?,gstrate=?
230
            discount=?,notes=?,gstrate=?,deliverytime=?
202
        WHERE id=?';
231
        WHERE id=?';
203
    my $sth = $dbh->prepare($query);
232
    my $sth = $dbh->prepare($query);
204
    $sth->execute(
233
    $sth->execute(
Lines 215-221 sub ModBookseller { Link Here
215
        $data->{'invoiceprice'}, $data->{'gstreg'},
244
        $data->{'invoiceprice'}, $data->{'gstreg'},
216
        $data->{'listincgst'},   $data->{'invoiceincgst'},
245
        $data->{'listincgst'},   $data->{'invoiceincgst'},
217
        $data->{'discount'},     $data->{'notes'},
246
        $data->{'discount'},     $data->{'notes'},
218
        $data->{'gstrate'},      $data->{'id'}
247
        $data->{'gstrate'},
248
        $data->{deliverytime},
249
        $data->{'id'}
219
    );
250
    );
220
    return;
251
    return;
221
}
252
}
(-)a/acqui/basket.pl (+12 lines)
Lines 34-39 use C4::Debug; Link Here
34
use C4::Biblio;
34
use C4::Biblio;
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 Date::Calc qw/Add_Delta_Days/;
38
37
=head1 NAME
39
=head1 NAME
38
40
39
basket.pl
41
basket.pl
Lines 212-217 if ( $op eq 'delete_confirm' ) { Link Here
212
        }
214
        }
213
        unshift( @$basketgroups, \%emptygroup );
215
        unshift( @$basketgroups, \%emptygroup );
214
    }
216
    }
217
218
    # if the basket is closed, calculate estimated delivery date
219
    my $estimateddeliverydate;
220
    if( $basket->{closedate} ) {
221
        my ($year, $month, $day) = ($basket->{closedate} =~ /(\d+)-(\d+)-(\d+)/);
222
        ($year, $month, $day) = Add_Delta_Days($year, $month, $day, $bookseller->{deliverytime});
223
        $estimateddeliverydate = "$year-$month-$day";
224
    }
225
215
    # if new basket, pre-fill infos
226
    # if new basket, pre-fill infos
216
    $basket->{creationdate} = ""            unless ( $basket->{creationdate} );
227
    $basket->{creationdate} = ""            unless ( $basket->{creationdate} );
217
    $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} );
228
    $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} );
Lines 359-364 my $total_est_gste; Link Here
359
        authorisedby         => $basket->{authorisedby},
370
        authorisedby         => $basket->{authorisedby},
360
        authorisedbyname     => $basket->{authorisedbyname},
371
        authorisedbyname     => $basket->{authorisedbyname},
361
        closedate            => C4::Dates->new($basket->{closedate},'iso')->output,
372
        closedate            => C4::Dates->new($basket->{closedate},'iso')->output,
373
        estimateddeliverydate => C4::Dates->new( $estimateddeliverydate, 'iso' )->output,
362
        active               => $bookseller->{'active'},
374
        active               => $bookseller->{'active'},
363
        booksellerid         => $bookseller->{'id'},
375
        booksellerid         => $bookseller->{'id'},
364
        name                 => $bookseller->{'name'},
376
        name                 => $bookseller->{'name'},
(-)a/acqui/lateorders.pl (-6 / +15 lines)
Lines 66-79 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
66
66
67
my $supplierid = $input->param('supplierid') || undef; # we don't want "" or 0
67
my $supplierid = $input->param('supplierid') || 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, (($supplierid and $supplierid eq $_ )            ? 
104
	push @sloopy, (($supplierid and $supplierid eq $_ )            ? 
Lines 103-109 $template->param(SUPPLIER_LOOP => \@sloopy); Link Here
103
$template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid);
109
$template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid);
104
$template->param(SupplierId=>$supplierid) if ($supplierid);
110
$template->param(SupplierId=>$supplierid) if ($supplierid);
105
111
106
my @lateorders = GetLateOrders($delay,$supplierid,$branch);
112
my @lateorders = GetLateOrders( $delay, $supplierid, $branch, $estimateddeliverydatefrom, $estimateddeliverydateto );
107
113
108
my $total;
114
my $total;
109
foreach (@lateorders){
115
foreach (@lateorders){
Lines 121-127 $template->param(ERROR_LOOP => \@errors) if (@errors); Link Here
121
$template->param(
127
$template->param(
122
	lateorders => \@lateorders,
128
	lateorders => \@lateorders,
123
	delay => $delay,
129
	delay => $delay,
130
    estimateddeliverydatefrom => $estimateddeliverydatefrom,
131
    estimateddeliverydateto   => $estimateddeliverydateto,
124
	total => $total,
132
	total => $total,
125
	intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
133
	intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
134
    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
126
);
135
);
127
output_html_with_http_headers $input, $cookie, $template->output;
136
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 171-176 if ( $op eq 'display' ) { Link Here
171
        invoiceincgst => $supplier->{'invoiceincgst'},
172
        invoiceincgst => $supplier->{'invoiceincgst'},
172
        gstrate       => $gstrate,
173
        gstrate       => $gstrate,
173
        discount      => $supplier->{'discount'},
174
        discount      => $supplier->{'discount'},
175
        deliverytime  => $supplier->{deliverytime},
174
        loop_currency => $loop_currency,
176
        loop_currency => $loop_currency,
175
        GST           => $tax_rate,
177
        GST           => $tax_rate,
176
        enter         => 1,
178
        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 2495-2500 CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis Link Here
2495
  `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged
2495
  `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged
2496
  `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor
2496
  `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor
2497
  `fax` varchar(50) default NULL, -- vendor fax number
2497
  `fax` varchar(50) default NULL, -- vendor fax number
2498
  `deliverytime` int(11) default NULL, -- vendor delivery time
2498
  PRIMARY KEY  (`id`),
2499
  PRIMARY KEY  (`id`),
2499
  KEY `listprice` (`listprice`),
2500
  KEY `listprice` (`listprice`),
2500
  KEY `invoiceprice` (`invoiceprice`),
2501
  KEY `invoiceprice` (`invoiceprice`),
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4663-4668 ENDOFRENEWAL Link Here
4663
    print "Upgrade to $DBversion done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
4663
    print "Upgrade to $DBversion done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
4664
    SetVersion($DBversion);
4664
    SetVersion($DBversion);
4665
}
4665
}
4666
4667
$DBversion = "3.07.00.XXX";
4668
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4669
    $dbh->do("ALTER TABLE aqbooksellers ADD deliverytime INT DEFAULT NULL");
4670
    print "Upgrade to $DBversion done (Add deliverytime field in aqbooksellers table)";
4671
    SetVersion($DBversion);
4672
}
4673
4666
=head1 FUNCTIONS
4674
=head1 FUNCTIONS
4667
4675
4668
=head2 DropAllForeignKeys($table)
4676
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+1 lines)
Lines 180-185 Link Here
180
                [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
180
                [% 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 %]
181
                [% 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 %]
182
                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate %]</li>[% END %]
183
                [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate %]</li>[% END %]
183
184
184
                </ol>
185
                </ol>
185
                </div>
186
                </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt (-2 / +38 lines)
Lines 2-7 Link Here
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
4
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
5
[% INCLUDE 'calendar.inc' %]
5
<script type="text/javascript">
6
<script type="text/javascript">
6
//<![CDATA[
7
//<![CDATA[
7
$(document).ready(function() {
8
$(document).ready(function() {
Lines 60-65 $(document).ready(function() { Link Here
60
    <table id="late_orders">
61
    <table id="late_orders">
61
        <tr>
62
        <tr>
62
            <th>Order Date</th>
63
            <th>Order Date</th>
64
            <th>Estimated delivery date</th>
63
            <th>Vendor</th>
65
            <th>Vendor</th>
64
            <th>Information</th>
66
            <th>Information</th>
65
            <th>Total cost</th>
67
            <th>Total cost</th>
Lines 81-86 $(document).ready(function() { Link Here
81
                ([% lateorder.latesince %] days)
83
                ([% lateorder.latesince %] days)
82
            </td>
84
            </td>
83
            <td>
85
            <td>
86
                [% lateorder.estimateddeliverydate %]
87
            </td>
88
            <td>
84
                [% lateorder.supplier %]
89
                [% lateorder.supplier %]
85
            </td>
90
            </td>
86
            <td>
91
            <td>
Lines 117-123 $(document).ready(function() { Link Here
117
        [% END %]
122
        [% END %]
118
        <tr> 
123
        <tr> 
119
            <th>Total</th>
124
            <th>Total</th>
120
            <th colspan="2">&nbsp;</th>
125
            <th colspan="3">&nbsp;</th>
121
            <th>[% total %]</th>
126
            <th>[% total %]</th>
122
            <th>&nbsp;</th>
127
            <th>&nbsp;</th>
123
            <th>&nbsp;</th>
128
            <th>&nbsp;</th>
Lines 140-146 $(document).ready(function() { Link Here
140
[% FOREACH ERROR_LOO IN ERROR_LOOP %]
145
[% 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 %]
146
[% 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 %]
147
[% 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>
148
<ol>
149
    <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
150
    <li><label for="delay">Estimated Delivery date from: </label>
151
        <input type="text" size="10" id="estimateddeliverydatefrom" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" />
152
        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarFrom" style="cursor: pointer;" alt="Show Calendar" />
153
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
154
    </li>
155
    <li><label for="delay">To: </label>
156
        <input type="text" size="10" id="estimateddeliverydateto" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" />
157
        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="Show Calendar" />
158
        <script type="text/javascript">
159
            // return true if the date is blocked.
160
            function disable_from(date) {var limit = get_Calendar_limit(date,'estimateddeliverydatefrom'); return (limit && limit < date);}
161
            function disable_to(date) {var limit = get_Calendar_limit(date,'estimateddeliverydateto'); return (limit && limit < date);}
162
            Calendar.setup({
163
                inputField : "estimateddeliverydatefrom",
164
                ifFormat : "[% DHTMLcalendar_dateformat %]",
165
                button : "openCalendarFrom",
166
                disableFunc : disable_from,
167
                dateStatusFunc : disable_from
168
            });
169
            Calendar.setup({
170
                inputField : "estimateddeliverydateto",
171
                ifFormat : "[% DHTMLcalendar_dateformat %]",
172
                button : "openCalendarTo",
173
                disableFunc : disable_to,
174
                dateStatusFunc : disable_to
175
             });
176
        </script>
177
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
178
    </li>
179
144
	<li><label for="supplierid">Vendor:</label>
180
	<li><label for="supplierid">Vendor:</label>
145
		<select id="supplierid" size="1" tabindex="" name="supplierid">
181
		<select id="supplierid" size="1" tabindex="" name="supplierid">
146
			<option value=""/>
182
			<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