Revision eebe8e90
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
bin/mozilla/invoice_io.pl | ||
---|---|---|
88 | 88 |
use SL::AM; |
89 | 89 |
use Data::Dumper; |
90 | 90 |
|
91 |
sub set_pricegroup { |
|
92 |
$main::lxdebug->enter_sub(); |
|
93 |
|
|
94 |
my $form = $main::form; |
|
95 |
my %myconfig = %main::myconfig; |
|
96 |
my $locale = $main::locale; |
|
97 |
|
|
98 |
my $rowcount = shift; |
|
99 |
for my $j (1 .. $rowcount) { |
|
100 |
my $pricegroup_old = $form->{"pricegroup_old_$j"}; |
|
101 |
if ($form->{PRICES}{$j}) { |
|
102 |
my $len = 0; |
|
103 |
my $prices = '<option value="--">' . $locale->text("none (pricegroup)") . '</option>'; |
|
104 |
my $price = 0; |
|
105 |
foreach my $item (@{ $form->{PRICES}{$j} }) { |
|
106 |
|
|
107 |
#$price = $form->round_amount($myconfig, $item->{price}, 5); |
|
108 |
#$price = $form->format_amount($myconfig, $item->{price}, 2); |
|
109 |
my $price = $item->{price}; |
|
110 |
my $pricegroup_id = $item->{pricegroup_id}; |
|
111 |
my $pricegroup = $item->{pricegroup}; |
|
112 |
|
|
113 |
# build drop down list for pricegroups |
|
114 |
$prices .= |
|
115 |
qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|; |
|
116 |
|
|
117 |
$len += 1; |
|
118 |
|
|
119 |
# map { |
|
120 |
# $form->{"${_}_$j"} = |
|
121 |
# $form->format_amount(\%myconfig, $form->{"${_}_$j"}) |
|
122 |
# } qw(sellprice price_new price_old); |
|
123 |
|
|
124 |
# set new selectedpricegroup_id and prices for "Preis" |
|
125 |
if ($item->{selected} && ($pricegroup_id != 0)) { |
|
126 |
$form->{"pricegroup_old_$j"} = $pricegroup_id; |
|
127 |
$form->{"price_new_$j"} = $price; |
|
128 |
# edit: don't change the sellprice here |
|
129 |
# $form->{"sellprice_$j"} = $price; # this must only be updated for existing articles, not new ones |
|
130 |
} |
|
131 |
if ($pricegroup_id == 0) { |
|
132 |
$form->{"price_new_$j"} = $form->{"sellprice_$j"}; |
|
133 |
} |
|
134 |
} |
|
135 |
$form->{"prices_$j"} = $prices; |
|
136 |
} |
|
137 |
} |
|
138 |
$main::lxdebug->leave_sub(); |
|
139 |
} |
|
140 |
|
|
141 | 91 |
sub display_form { |
142 | 92 |
$main::lxdebug->enter_sub(); |
143 | 93 |
|
... | ... | |
188 | 138 |
# $form->{rowcount}--; |
189 | 139 |
# my $rowcount = $form->{rowcount}; |
190 | 140 |
# |
191 |
# # get pricegroups for parts |
|
192 |
# IS->get_pricegroups_for_parts(\%myconfig, \%$form); |
|
193 |
# |
|
194 |
# # build up html code for prices_$i |
|
195 |
# set_pricegroup($rowcount); |
|
196 |
# |
|
197 | 141 |
# $form->{resubmit} = 1; |
198 | 142 |
# |
199 | 143 |
# } |
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