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

(-)a/C4/Acquisition.pm (+1 lines)
Lines 1264-1269 sub GetParcel { Link Here
1264
                aqorders.listprice,
1264
                aqorders.listprice,
1265
                aqorders.rrp,
1265
                aqorders.rrp,
1266
                aqorders.ecost,
1266
                aqorders.ecost,
1267
                aqorders.freight,
1267
                biblio.title
1268
                biblio.title
1268
        FROM aqorders
1269
        FROM aqorders
1269
        LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
1270
        LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
(-)a/acqui/addorder.pl (+3 lines)
Lines 103-108 budget_id used to pay this order. Link Here
103
103
104
=item C<cost>
104
=item C<cost>
105
105
106
=item C<freight>
107
106
=item C<sub>
108
=item C<sub>
107
109
108
=item C<invoice>
110
=item C<invoice>
Lines 174-179 $orderinfo->{'uncertainprice'} ||= 0; Link Here
174
#my $gst           = $input->param('GST');
176
#my $gst           = $input->param('GST');
175
#my $budget        = $input->param('budget');
177
#my $budget        = $input->param('budget');
176
#my $cost          = $input->param('cost');
178
#my $cost          = $input->param('cost');
179
#my $freight       = $input->param('freight');
177
#my $sub           = $input->param('sub');
180
#my $sub           = $input->param('sub');
178
#my $purchaseorder = $input->param('purchaseordernumber');
181
#my $purchaseorder = $input->param('purchaseordernumber');
179
#my $invoice       = $input->param('invoice');
182
#my $invoice       = $input->param('invoice');
(-)a/acqui/neworderempty.pl (+1 lines)
Lines 380-385 $template->param( Link Here
380
    quantityrec      => $data->{'quantity'},
380
    quantityrec      => $data->{'quantity'},
381
    rrp              => $data->{'rrp'},
381
    rrp              => $data->{'rrp'},
382
    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
382
    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
383
    freight          => sprintf("%.2f", $data->{'freight'}||0),
383
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
384
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
384
    ecost            => $data->{'ecost'},
385
    ecost            => $data->{'ecost'},
385
    notes            => $data->{'notes'},
386
    notes            => $data->{'notes'},
(-)a/acqui/parcel.pl (-11 / +5 lines)
Lines 216-234 for (my $i = 0 ; $i < $countlines ; $i++) { Link Here
216
    $totalprice += $parcelitems[$i]->{'unitprice'};
216
    $totalprice += $parcelitems[$i]->{'unitprice'};
217
    $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'});
217
    $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'});
218
218
219
    #double FIXME - totalfreight is redefined later.
219
    $totalfreight  += $parcelitems[$i]->{'freight'};
220
221
# FIXME - each order in a  parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget..
222
    if ($i > 0 && $totalfreight != $parcelitems[$i]->{'freight'}) {
223
        warn "FREIGHT CHARGE MISMATCH!!";
224
    }
225
    $totalfreight = $parcelitems[$i]->{'freight'};
226
    $totalquantity += $parcelitems[$i]->{'quantityreceived'};
220
    $totalquantity += $parcelitems[$i]->{'quantityreceived'};
227
    $tototal       += $total;
221
    $tototal       += $total;
228
}
222
}
229
223
230
my $pendingorders = GetPendingOrders($supplierid);
224
my $pendingorders = GetPendingOrders($supplierid);
231
my $countpendings = scalar @$pendingorders;
225
my $countpendings = scalar @$pendingorders;
226
my $freight_per_order = $freight && $countpendings ? $freight/$countpendings : 0;
232
227
233
# pending orders totals
228
# pending orders totals
234
my ($totalPunitprice, $totalPquantity, $totalPecost, $totalPqtyrcvd);
229
my ($totalPunitprice, $totalPquantity, $totalPecost, $totalPqtyrcvd);
Lines 247-252 for (my $i = 0 ; $i < $countpendings ; $i++) { Link Here
247
    $line{ecost} = sprintf("%.2f",$line{ecost});
242
    $line{ecost} = sprintf("%.2f",$line{ecost});
248
    $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
243
    $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
249
    $line{unitprice} = sprintf("%.2f",$line{unitprice});
244
    $line{unitprice} = sprintf("%.2f",$line{unitprice});
245
    $line{freight} = sprintf("%.2f",$freight_per_order);
250
    $line{invoice} = $invoice;
246
    $line{invoice} = $invoice;
251
    $line{gst} = $gst;
247
    $line{gst} = $gst;
252
    $line{total} = $total;
248
    $line{total} = $total;
Lines 254-260 for (my $i = 0 ; $i < $countpendings ; $i++) { Link Here
254
    $ordergrandtotal += $line{ecost} * $line{quantity};
250
    $ordergrandtotal += $line{ecost} * $line{quantity};
255
    push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
251
    push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
256
}
252
}
257
$freight = $totalfreight unless $freight;
258
253
259
my $count = $countpendings;
254
my $count = $countpendings;
260
255
Lines 289-296 if ($count>$resultsperpage){ Link Here
289
                    );
284
                    );
290
}
285
}
291
286
292
#$totalfreight=$freight;
287
$tototal = $tototal + $totalfreight;
293
$tototal = $tototal + $freight;
294
288
295
$template->param(
289
$template->param(
296
    invoice               => $invoice,
290
    invoice               => $invoice,
Lines 307-313 $template->param( Link Here
307
    countpending          => $countpendings,
301
    countpending          => $countpendings,
308
    loop_orders           => \@loop_orders,
302
    loop_orders           => \@loop_orders,
309
    totalprice            => sprintf($cfstr, $totalprice),
303
    totalprice            => sprintf($cfstr, $totalprice),
310
    totalfreight          => $totalfreight,
304
    totalfreight          => sprintf($cfstr, $totalfreight),
311
    totalquantity         => $totalquantity,
305
    totalquantity         => $totalquantity,
312
    tototal               => sprintf($cfstr, $tototal),
306
    tototal               => sprintf($cfstr, $tototal),
313
    ordergrandtotal       => sprintf($cfstr, $ordergrandtotal),
307
    ordergrandtotal       => sprintf($cfstr, $ordergrandtotal),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (+6 lines)
Lines 422-427 $(document).ready(function() Link Here
422
                <input type="text" id="cost" size="20" name="cost" value="[% ecost %]" />
422
                <input type="text" id="cost" size="20" name="cost" value="[% ecost %]" />
423
                [% END %]
423
                [% END %]
424
            </li>
424
            </li>
425
            [% IF ( quantityrec ) %]
426
            <li>
427
                <label for="freight">Freight: </label>
428
                <input type="text" id="freight" size="20" name="freight" value="[% freight %]" [% IF close %] readonly="readonly" [% END %]/>
429
            </li>
430
            [% END %]
425
            <li>
431
            <li>
426
                <label for="notes">Notes: </label>
432
                <label for="notes">Notes: </label>
427
                <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea>
433
                <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-1 / +1 lines)
Lines 82-88 Link Here
82
    <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
82
    <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
83
    <input type="hidden" name="supplierid" value="[% supplierid %]" />
83
    <input type="hidden" name="supplierid" value="[% supplierid %]" />
84
    <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
84
    <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
85
    <input type="hidden" name="freight" value="[% freight %]" />
86
    <input type="hidden" name="gst" value="[% gst %]" />
85
    <input type="hidden" name="gst" value="[% gst %]" />
87
	</div>
86
	</div>
88
	<div class="yui-u">
87
	<div class="yui-u">
Lines 127-132 Link Here
127
        [% ELSE %]
126
        [% ELSE %]
128
            <input type="text" size="20" name="cost" id="cost" value="[% ecost %]" />
127
            <input type="text" size="20" name="cost" id="cost" value="[% ecost %]" />
129
        [% END %]</li></ol>
128
        [% END %]</li></ol>
129
        <li><label for="freight">Freight: </label><input type="text" size="20" name="freight" id="freight" value="[% freight %]" /></li>
130
        <label for="note">Notes: </label><textarea name="note" width="40" rows="8" >[% notes %]</textarea>
130
        <label for="note">Notes: </label><textarea name="note" width="40" rows="8" >[% notes %]</textarea>
131
        <input type="hidden" name="invoice" value="[% invoice %]" />
131
        <input type="hidden" name="invoice" value="[% invoice %]" />
132
    </fieldset>
132
    </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-3 / +1 lines)
Lines 96-106 Link Here
96
            <input type="text" size="20" id="gst" name="gst" />
96
            <input type="text" size="20" id="gst" name="gst" />
97
        </li>
97
        </li>
98
		[% END %]
98
		[% END %]
99
      <!--  // Removing freight input until shipping can be proplerly handled .
100
	  <li>
99
	  <li>
101
            <label for="freight">Shipping:</label>
100
            <label for="freight">Shipping:</label>
102
            <input type="text" size="20" id="freight" name="freight" />
101
            <input type="text" size="20" id="freight" name="freight" />
103
        </li> -->
102
        </li>
104
         <li><label for="datereceived">Shipment date: </label>
103
         <li><label for="datereceived">Shipment date: </label>
105
            <input type="text" id="datereceived" name="datereceived"  maxlength="10" size="10"  value="[% datereceived_today %]" />
104
            <input type="text" id="datereceived" name="datereceived"  maxlength="10" size="10"  value="[% datereceived_today %]" />
106
            <img src="[% themelang %]/lib/calendar/cal.gif" id="datereceived_button" alt="Show Calendar" />
105
            <img src="[% themelang %]/lib/calendar/cal.gif" id="datereceived_button" alt="Show Calendar" />
107
- 

Return to bug 6504