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

(-)a/acqui/basket.pl (-19 / +6 lines)
Lines 324-351 if ( $op eq 'delete_confirm' ) { Link Here
324
        push @books_loop, \%line;
324
        push @books_loop, \%line;
325
    }
325
    }
326
326
327
my $total_est_gste;
327
    my $total_est_gste;
328
    my $total_est_gsti;
328
    my $total_est_gsti;
329
    my $gist_est;
329
    my $gist_est;
330
    if ($gist){                                                    # if we have GST
331
       if ( $bookseller->{'listincgst'} ) {                        # if prices already includes GST
332
           $total_rrp_gsti = $total_rrp;                           # we know $total_rrp_gsti
333
           $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 );      # and can reverse compute other values
334
           $gist_rrp       = $total_rrp_gsti - $total_rrp_gste;    #
335
           $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
336
           $total_est_gsti = $total_rrp_est;
337
        } else {                                                    # if prices does not include GST
338
           $total_rrp_gste = $total_rrp;                           # then we use the common way to compute other values
339
           $gist_rrp       = $total_rrp_gste * $gist;              #
340
           $total_rrp_gsti = $total_rrp_gste + $gist_rrp;          #
341
           $total_est_gste = $total_rrp_est;
342
           $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
343
       }
344
       $gist_est = $gist_rrp - ( $gist_rrp * $discount );
345
    } else {
346
    $total_rrp_gsti = $total_rrp;
330
    $total_rrp_gsti = $total_rrp;
347
    $total_est_gsti = $total_rrp_est;
331
    $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 );
348
}
332
    $gist_rrp       = $total_rrp_gsti - $total_rrp_gste;
333
    $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
334
    $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
335
    $gist_est = $total_est_gsti / (1+$gist) * ($gist); # could also be ($total_est_gsti - $total_est_gste )
349
336
350
    my $contract = &GetContract($basket->{contractnumber});
337
    my $contract = &GetContract($basket->{contractnumber});
351
    my @orders = GetOrders($basketno);
338
    my @orders = GetOrders($basketno);
(-)a/acqui/parcel.pl (-6 / +10 lines)
Lines 77-83 my $bookseller=GetBookSellerFromId($booksellerid); Link Here
77
my $invoice=$input->param('invoice') || '';
77
my $invoice=$input->param('invoice') || '';
78
my $freight=$input->param('freight');
78
my $freight=$input->param('freight');
79
my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
79
my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
80
my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
80
my $gstrate= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
81
my $datereceived =  ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) 
81
my $datereceived =  ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) 
82
					:  C4::Dates->new($input->param('datereceived'), 'iso')   ;
82
					:  C4::Dates->new($input->param('datereceived'), 'iso')   ;
83
$datereceived = C4::Dates->new() unless $datereceived;
83
$datereceived = C4::Dates->new() unless $datereceived;
Lines 167-178 my @loop_received = (); Link Here
167
for (my $i = 0 ; $i < $countlines ; $i++) {
167
for (my $i = 0 ; $i < $countlines ; $i++) {
168
168
169
    #$total=($parcelitems[$i]->{'unitprice'} + $parcelitems[$i]->{'freight'}) * $parcelitems[$i]->{'quantityreceived'};   #weird, are the freight fees counted by book? (pierre)
169
    #$total=($parcelitems[$i]->{'unitprice'} + $parcelitems[$i]->{'freight'}) * $parcelitems[$i]->{'quantityreceived'};   #weird, are the freight fees counted by book? (pierre)
170
    $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'};    #weird, are the freight fees counted by book? (pierre)
170
    $total = ($parcelitems[$i]->{'ecost'}) * $parcelitems[$i]->{'quantityreceived'};    #weird, are the freight fees counted by book? (pierre)
171
    $parcelitems[$i]->{'unitprice'} += 0;
171
    $parcelitems[$i]->{'unitprice'} += 0;
172
    my %line;
172
    my %line;
173
    %line          = %{ $parcelitems[$i] };
173
    %line          = %{ $parcelitems[$i] };
174
    $line{invoice} = $invoice;
174
    $line{invoice} = $invoice;
175
    $line{gst}     = $gst;
175
    $line{gstrate}     = $gstrate;
176
    $line{total} = sprintf($cfstr, $total);
176
    $line{total} = sprintf($cfstr, $total);
177
    $line{booksellerid} = $booksellerid;
177
    $line{booksellerid} = $booksellerid;
178
    push @loop_received, \%line;
178
    push @loop_received, \%line;
Lines 217-223 for (my $i = 0 ; $i < $countpendings ; $i++) { Link Here
217
    $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
217
    $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
218
    $line{unitprice} = sprintf("%.2f",$line{unitprice});
218
    $line{unitprice} = sprintf("%.2f",$line{unitprice});
219
    $line{invoice} = $invoice;
219
    $line{invoice} = $invoice;
220
    $line{gst} = $gst;
220
    $line{gstrate}     = $gstrate;
221
    $line{gst} = $parcelitems[$i]->{'gst'} * $gstrate;
222
    $line{total} = sprintf($cfstr, $total);
221
    $line{total} = $total;
223
    $line{total} = $total;
222
    $line{booksellerid} = $booksellerid;
224
    $line{booksellerid} = $booksellerid;
223
    $ordergrandtotal += $line{ecost} * $line{quantity};
225
    $ordergrandtotal += $line{ecost} * $line{quantity};
Lines 304-309 $template->param( Link Here
304
    name                  => $bookseller->{'name'},
306
    name                  => $bookseller->{'name'},
305
    booksellerid            => $booksellerid,
307
    booksellerid            => $booksellerid,
306
    gst                   => $gst,
308
    gst                   => $gst,
309
    supplierid            => $supplierid,
310
    gstrate                   => $gstrate,
307
    freight               => $freight,
311
    freight               => $freight,
308
    invoice               => $invoice,
312
    invoice               => $invoice,
309
    countreceived         => $countlines,
313
    countreceived         => $countlines,
Lines 315-322 $template->param( Link Here
315
    totalquantity         => $totalquantity,
319
    totalquantity         => $totalquantity,
316
    tototal               => sprintf($cfstr, $tototal),
320
    tototal               => sprintf($cfstr, $tototal),
317
    ordergrandtotal       => sprintf($cfstr, $ordergrandtotal),
321
    ordergrandtotal       => sprintf($cfstr, $ordergrandtotal),
318
    gst                   => $gst,
322
    gst                   => sprintf($cfstr, $tototal*$gstrate),
319
    grandtot              => sprintf($cfstr, $tototal + $gst),
323
    grandtot              => sprintf($cfstr, $tototal*(1+$gstrate)), # FIXME assumes budgeted cost is gst exclusive (currently correct), will need to be fixed once a pref exists for gst incl/excl gst
320
    totalPunitprice       => sprintf("%.2f", $totalPunitprice),
324
    totalPunitprice       => sprintf("%.2f", $totalPunitprice),
321
    totalPquantity        => $totalPquantity,
325
    totalPquantity        => $totalPquantity,
322
    totalPqtyrcvd         => $totalPqtyrcvd,
326
    totalPqtyrcvd         => $totalPqtyrcvd,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-1 / +4 lines)
Lines 31-40 function Check(ff) { Link Here
31
31
32
    _alertString +="-------------------------------------------------------------------\n\n";
32
    _alertString +="-------------------------------------------------------------------\n\n";
33
33
34
    if ( isNull(ff.title,1)  &&  isNull(ff.entertitle,1)   ){
34
[% UNLESS( biblionumber ) %]
35
// this caused errors so I enclosed it within an UNLESS, if biblionumber then ff.entertitle doesnt exist so checking it will cause a type error
36
    if(  isNull(ff.entertitle,1)   ){
35
        ok=1;
37
        ok=1;
36
                    _alertString += "\n- " + _("Title cannot be empty");
38
                    _alertString += "\n- " + _("Title cannot be empty");
37
    }
39
    }
40
[% END %]
38
    
41
    
39
    if(isNull(ff.budget_id,1)){
42
    if(isNull(ff.budget_id,1)){
40
		ok=1;
43
		ok=1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-3 / +2 lines)
Lines 348-355 Link Here
348
		    The total at the bottom of the page should be within a few cents of the total for the invoice.
348
		    The total at the bottom of the page should be within a few cents of the total for the invoice.
349
		</p>
349
		</p>
350
		</td>
350
		</td>
351
			    <td><b>Tax rate</b></td>
351
			    <td><b>Tax</b></td>
352
		<td>[% gst %]</td>
352
		        <td>[% gst %]</td>
353
	    	</tr> 
353
	    	</tr> 
354
	    [% END %]
354
	    [% END %]
355
	    <tr>
355
	    <tr>
356
- 

Return to bug 2865