Revision eebe8e90
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
594 | 594 |
|
595 | 595 |
check_oe_access(); |
596 | 596 |
|
597 |
my $order = _make_record(); |
|
598 |
|
|
597 | 599 |
set_headings($form->{"id"} ? "edit" : "add"); |
598 | 600 |
|
599 | 601 |
$form->{update} = 1; |
... | ... | |
692 | 694 |
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); |
693 | 695 |
$form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces); |
694 | 696 |
$form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); |
695 |
|
|
696 |
# get pricegroups for parts |
|
697 |
IS->get_pricegroups_for_parts(\%myconfig, \%$form); |
|
698 |
|
|
699 |
# build up html code for prices_$i |
|
700 |
&set_pricegroup($i); |
|
701 | 697 |
} |
702 | 698 |
|
703 | 699 |
display_form(); |
... | ... | |
1510 | 1506 |
$form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); |
1511 | 1507 |
} |
1512 | 1508 |
|
1513 |
# show pricegroup in newly loaded invoice when creating invoice from quotation/order |
|
1514 |
IS->get_pricegroups_for_parts(\%myconfig, \%$form); |
|
1515 |
set_pricegroup($_) for 1 .. $form->{rowcount}; |
|
1516 |
|
|
1517 | 1509 |
&display_form; |
1518 | 1510 |
|
1519 | 1511 |
$main::lxdebug->leave_sub(); |
... | ... | |
2118 | 2110 |
|
2119 | 2111 |
$::form->error($::locale->text('No action defined.')); |
2120 | 2112 |
} |
2113 |
|
|
2114 |
sub _make_record { |
|
2115 |
my $obj = SL::DB::Order->new; |
|
2116 |
|
|
2117 |
for my $method (keys %$::form) { |
|
2118 |
next unless $obj->can($method); |
|
2119 |
next unless $obj->meta->column($method); |
|
2120 |
|
|
2121 |
if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) { |
|
2122 |
$obj->${\"$method\_as_date"}($::form->{$method}); |
|
2123 |
} elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Integer|Numeric|Float|DoublePrecsion)$/) { |
|
2124 |
$obj->$method($::form->{$method}); |
|
2125 |
} |
|
2126 |
} |
|
2127 |
|
|
2128 |
my @items; |
|
2129 |
for my $i (1 .. $::form->{rowcount}) { |
|
2130 |
next unless $::form->{"id_$i"}; |
|
2131 |
push @items, _make_record_item($i) |
|
2132 |
} |
|
2133 |
|
|
2134 |
$obj->orderitems(@items); |
|
2135 |
|
|
2136 |
return $obj; |
|
2137 |
} |
|
2138 |
|
Auch abrufbar als: Unified diff
PriceSource: Erste Version
- Preisgruppen und Stammdaten sind implementiert
- Persistenz in allen Belegen funktioniert
- Rudimentäre Visualisierung funktioniert
- Klassen sind alle da
- Doku fehlt
- Verkauf/Einkaufweiche fehlt
- best_price ungetestet
- Preisgruppen hängen noch nicht von Verkäufer ab
- dependancy system fehlt
- verhalten bei fehlerhaften sources
- pricegroup -> active_source migration