82 |
82 |
sub display_row {
|
83 |
83 |
$lxdebug->enter_sub();
|
84 |
84 |
my $numrows = shift;
|
85 |
|
print STDERR "io.pl-display_row\n";
|
86 |
85 |
if ($lizenzen && $form->{vc} eq "customer") {
|
87 |
86 |
if ($form->{type} =~ /sales_order/) {
|
88 |
87 |
@column_index = (runningnumber, partnumber, description, ship, qty);
|
... | ... | |
263 |
262 |
|
264 |
263 |
|
265 |
264 |
|
266 |
|
#print (STDERR "io.pl---111-i-$i", Dumper($form->{PRICES}));
|
267 |
265 |
# build in dragdrop for pricesgroups
|
268 |
266 |
if ($form->{"prices_$i"}) {
|
269 |
|
print STDERR " YES prices\n";
|
270 |
267 |
$price_tmp = $form->format_amount(\%myconfig, $form->{"price_new_$i"}, 2);
|
271 |
268 |
|
272 |
269 |
$column_data{sellprice_drag} =
|
... | ... | |
274 |
271 |
$column_data{sellprice} =
|
275 |
272 |
qq|<td><input name="sellprice_$i" size=5 value=$price_tmp></td>|;
|
276 |
273 |
} else {
|
277 |
|
print STDERR " NO prices\n";
|
278 |
274 |
# for last row and report
|
279 |
275 |
# set pricegroup dragdrop from report menu
|
280 |
276 |
if ($form->{"sellprice_$i"} != 0) {
|
281 |
|
print STDERR " HIER NOCH F?R RECHNUNGSAUFRUFE\n";
|
282 |
|
print (STDERR "sellprice_$i ", Dumper($form->{"sellprice_$i"}), " pricegroup_id_$i ", Dumper($form->{"pricegroup_id_$i"}));
|
283 |
277 |
$prices =
|
284 |
278 |
qq|<option value="$form->{"sellprice_$i"}--$form->{"pricegroup_id_$i"}" selected>$form->{"pricegroup_$i"}</option>\n|;
|
285 |
279 |
|
... | ... | |
303 |
297 |
$decimalplaces)
|
304 |
298 |
. qq|></td>|;
|
305 |
299 |
}
|
306 |
|
#print (STDERR "io.pl---555-i-$i", Dumper($form->{"price_old_$i"}));
|
307 |
300 |
$column_data{discount} =
|
308 |
301 |
qq|<td align=right><input name="discount_$i" size=3 value=|
|
309 |
302 |
. $form->format_amount(\%myconfig, $form->{"discount_$i"})
|
... | ... | |
426 |
419 |
$prices = '';
|
427 |
420 |
$price = 0;
|
428 |
421 |
foreach $item (@{ $form->{PRICES}{ $j } }) {
|
429 |
|
# print STDERR "-VOR PREIS--$item->{price}--PREISGRUOP-$item->{pricegroup_id}\n";
|
430 |
422 |
$price = $form->round_amount($myconfig, $item->{price},5);
|
431 |
423 |
$price = $form->format_amount($myconfig, $item->{price},2);
|
432 |
424 |
$price = $item->{price};
|
433 |
|
# print STDERR "-NACH PREIS--$price--PREISGRUOP-$item->{pricegroup_id}\n";
|
434 |
425 |
$pricegroup_id = $item->{pricegroup_id};
|
435 |
426 |
$pricegroup = $item->{pricegroup};
|
436 |
427 |
# build dragdrop for pricegroups
|
... | ... | |
438 |
429 |
qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|;
|
439 |
430 |
|
440 |
431 |
$len += 1;
|
441 |
|
# print STDERR "prices---$prices\n";
|
442 |
432 |
# set new selectedpricegroup_id and prices for "Preis"
|
443 |
433 |
if ($item->{selected}) {
|
444 |
434 |
$form->{"pricegroup_old_$j"} = $pricegroup_id;
|
... | ... | |
456 |
446 |
|
457 |
447 |
sub select_item {
|
458 |
448 |
$lxdebug->enter_sub();
|
459 |
|
print STDERR "io.pl-select_item\n";
|
460 |
449 |
@column_index = qw(ndx partnumber description onhand sellprice);
|
461 |
450 |
|
462 |
451 |
$column_data{ndx} = qq|<th> </th>|;
|
... | ... | |
509 |
498 |
|
510 |
499 |
map { $ref->{$_} =~ s/\"/"/g } qw(partnumber description unit);
|
511 |
500 |
#sk tradediscount
|
512 |
|
print STDERR "TRADEDISCOUNT $ref->{sellprice}\n";
|
513 |
501 |
$ref->{sellprice} =
|
514 |
502 |
$form->round_amount($ref->{sellprice} * (1 - $form->{tradediscount}), 2);
|
515 |
|
print STDERR "TRADEDISCOUNT $ref->{sellprice}\n";
|
516 |
503 |
$column_data{ndx} =
|
517 |
504 |
qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
|
518 |
505 |
$column_data{partnumber} =
|
... | ... | |
594 |
581 |
|
595 |
582 |
sub item_selected {
|
596 |
583 |
$lxdebug->enter_sub();
|
597 |
|
print STDERR "io.pl-item_selected\n";
|
598 |
584 |
# replace the last row with the checked row
|
599 |
585 |
$i = $form->{rowcount};
|
600 |
586 |
$i = $form->{assembly_rows} if ($form->{item} eq 'assembly');
|
... | ... | |
833 |
819 |
|
834 |
820 |
sub check_form {
|
835 |
821 |
$lxdebug->enter_sub();
|
836 |
|
print STDERR "io.pl-check_form\n";
|
837 |
822 |
my @a = ();
|
838 |
823 |
my $count = 0;
|
839 |
824 |
my @flds = (
|
... | ... | |
994 |
979 |
|
995 |
980 |
sub validate_items {
|
996 |
981 |
$lxdebug->enter_sub();
|
997 |
|
print STDERR "io.pl-validate_items\n";
|
998 |
982 |
# check if items are valid
|
999 |
983 |
if ($form->{rowcount} == 1) {
|
1000 |
984 |
&update;
|
... | ... | |
1017 |
1001 |
$form->{ordnumber} = $form->{invnumber};
|
1018 |
1002 |
|
1019 |
1003 |
map { delete $form->{$_} } qw(id printed emailed queued);
|
1020 |
|
|
1021 |
1004 |
if ($form->{script} eq 'ir.pl' || $form->{type} eq 'request_quotation') {
|
1022 |
1005 |
$form->{title} = $locale->text('Add Purchase Order');
|
1023 |
1006 |
$form->{vc} = 'vendor';
|
... | ... | |
1235 |
1218 |
|
1236 |
1219 |
sub print_options {
|
1237 |
1220 |
$lxdebug->enter_sub();
|
1238 |
|
print STDERR "io.pl-print_options\n";
|
1239 |
1221 |
$form->{sendmode} = "attachment";
|
1240 |
1222 |
$form->{copies} = 3 unless $form->{copies};
|
1241 |
1223 |
|
... | ... | |
1711 |
1693 |
|
1712 |
1694 |
sub customer_details {
|
1713 |
1695 |
$lxdebug->enter_sub();
|
1714 |
|
print STDERR "io.pl-customer_details\n";
|
1715 |
1696 |
IS->customer_details(\%myconfig, \%$form);
|
1716 |
1697 |
$lxdebug->leave_sub();
|
1717 |
1698 |
}
|
Merge von 620,621 aus unstable: Bugfix
-Fehler beim Speichern von Auftraegen behoben, wenn Angebot in Auftrag umgewandelt wird
-Fehler bei der Umwandlung von Angeboten in Auftraege, Preise mit nur einer Nachkommastelle wurden falsch formatiert