Revision 195883fd
Von Stephan Köhler vor etwa 19 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
221 | 221 |
|
222 | 222 |
my ($self, $myconfig, $form) = @_; |
223 | 223 |
|
224 |
# set pricegroup to default |
|
225 |
if ($form->{klass}) { } |
|
226 |
else { $form->{klass} = 0; } |
|
227 |
|
|
224 | 228 |
# connect to database |
225 | 229 |
my $dbh = $form->dbconnect($myconfig); |
226 | 230 |
##LINET |
227 |
map({ $form->{"cp_${_}"} = $form->{"selected_cp_${_}"} |
|
228 |
if ($form->{"selected_cp_${_}"}); |
|
231 |
map({ |
|
232 |
$form->{"cp_${_}"} = $form->{"selected_cp_${_}"} |
|
233 |
if ($form->{"selected_cp_${_}"}); |
|
229 | 234 |
} qw(title greeting)); |
230 |
|
|
235 |
# |
|
231 | 236 |
# escape ' |
232 | 237 |
map { $form->{$_} =~ s/\'/\'\'/g } |
233 |
qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language); |
|
238 |
qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language pricegroup);
|
|
234 | 239 |
##/LINET |
235 | 240 |
# assign value discount, terms, creditlimit |
236 | 241 |
$form->{discount} = $form->parse_amount($myconfig, $form->{discount}); |
... | ... | |
314 | 319 |
username = '$form->{username}', |
315 | 320 |
salesman_id = '$form->{salesman_id}', |
316 | 321 |
user_password = '$form->{user_password}', |
317 |
c_vendor_id = '$form->{c_vendor_id}' |
|
322 |
c_vendor_id = '$form->{c_vendor_id}', |
|
323 |
klass = '$form->{klass}' |
|
318 | 324 |
WHERE id = $form->{id}|; |
319 | 325 |
$dbh->do($query) || $form->dberror($query); |
320 | 326 |
|
... | ... | |
362 | 368 |
# connect to database |
363 | 369 |
my $dbh = $form->dbconnect($myconfig); |
364 | 370 |
##LINET |
365 |
map({ $form->{"cp_${_}"} = $form->{"selected_cp_${_}"} |
|
366 |
if ($form->{"selected_cp_${_}"}); |
|
371 |
map({ |
|
372 |
$form->{"cp_${_}"} = $form->{"selected_cp_${_}"} |
|
373 |
if ($form->{"selected_cp_${_}"}); |
|
367 | 374 |
} qw(title greeting)); |
368 | 375 |
|
369 | 376 |
# escape ' |
SL/Form.pm | ||
---|---|---|
382 | 382 |
$jsscript = qq| |
383 | 383 |
<style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style> |
384 | 384 |
<script type="text/javascript" src="js/jscalendar/calendar.js"></script> |
385 |
? <script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
|
|
386 |
? <script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
|
|
385 |
<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
|
|
386 |
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
|
|
387 | 387 |
$self->{javascript} |
388 | 388 |
|; |
389 | 389 |
} |
... | ... | |
450 | 450 |
|
451 | 451 |
$trigger_1 = qq| |
452 | 452 |
Calendar.setup( |
453 |
? {
|
|
454 |
??? inputField ?: "$inputField_1",
|
|
455 |
??? ifFormat ???:"$ifFormat",
|
|
456 |
???align ???: "$align_1", ????
|
|
457 |
??? button ?????: "$button_1"
|
|
458 |
? }
|
|
459 |
? );
|
|
453 |
{ |
|
454 |
inputField : "$inputField_1",
|
|
455 |
ifFormat :"$ifFormat",
|
|
456 |
align : "$align_1",
|
|
457 |
button : "$button_1"
|
|
458 |
} |
|
459 |
); |
|
460 | 460 |
|; |
461 | 461 |
|
462 | 462 |
if ($qty == 2) { |
463 | 463 |
$trigger_2 = qq| |
464 | 464 |
Calendar.setup( |
465 | 465 |
{ |
466 |
??? inputField ?: "$inputField_2",
|
|
467 |
?? ? ifFormat ???:"$ifFormat",
|
|
468 |
??? align ???: "$align_2", ????
|
|
469 |
??? button ?????: "$button_2"
|
|
470 |
? }
|
|
471 |
? );
|
|
466 |
inputField : "$inputField_2",
|
|
467 |
ifFormat :"$ifFormat",
|
|
468 |
align : "$align_2",
|
|
469 |
button : "$button_2"
|
|
470 |
} |
|
471 |
); |
|
472 | 472 |
|; |
473 | 473 |
} |
474 | 474 |
$jsscript = qq| |
... | ... | |
2120 | 2120 |
} |
2121 | 2121 |
|
2122 | 2122 |
|
2123 |
sub get_pricegroup { |
|
2124 |
$main::lxdebug->enter_sub(); |
|
2125 |
|
|
2126 |
my ($self, $myconfig, $p) = @_; |
|
2127 |
|
|
2128 |
my $dbh = $self->dbconnect($myconfig); |
|
2129 |
|
|
2130 |
my $query = qq|SELECT p.id, p.pricegroup |
|
2131 |
FROM pricegroup p|; |
|
2132 |
|
|
2133 |
$query .= qq| |
|
2134 |
ORDER BY pricegroup|; |
|
2135 |
|
|
2136 |
if ($p->{all}) { |
|
2137 |
$query = qq|SELECT id, pricegroup FROM pricegroup |
|
2138 |
ORDER BY pricegroup|; |
|
2139 |
} |
|
2140 |
|
|
2141 |
my $sth = $dbh->prepare($query); |
|
2142 |
$sth->execute || $self->dberror($query); |
|
2143 |
|
|
2144 |
$self->{all_pricegroup} = (); |
|
2145 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
2146 |
push @{ $self->{all_pricegroup} }, $ref; |
|
2147 |
} |
|
2148 |
$sth->finish; |
|
2149 |
$dbh->disconnect; |
|
2150 |
|
|
2151 |
$main::lxdebug->leave_sub(); |
|
2152 |
} |
|
2153 |
|
|
2154 |
|
|
2123 | 2155 |
sub audittrail { |
2124 | 2156 |
my ($self, $dbh, $myconfig, $audittrail) = @_; |
2125 | 2157 |
|
SL/IC.pm | ||
---|---|---|
33 | 33 |
#====================================================================== |
34 | 34 |
|
35 | 35 |
package IC; |
36 |
|
|
36 |
use Data::Dumper; |
|
37 | 37 |
sub get_part { |
38 | 38 |
$main::lxdebug->enter_sub(); |
39 | 39 |
|
... | ... | |
101 | 101 |
$form->{amount}{IC_expense} = $form->{expense_accno}; |
102 | 102 |
$form->{amount}{IC_cogs} = $form->{expense_accno}; |
103 | 103 |
|
104 |
# get prices |
|
105 |
$query = |
|
106 |
qq|SELECT p.parts_id, p.pricegroup_id, p.price, (SELECT pg.pricegroup FROM pricegroup pg WHERE pg.id=p.pricegroup_id) AS pricegroup FROM prices p |
|
107 |
WHERE parts_id = $form->{id} |
|
108 |
ORDER by pricegroup|; |
|
109 |
|
|
110 |
$sth = $dbh->prepare($query); |
|
111 |
$sth->execute || $form->dberror($query); |
|
112 |
|
|
113 |
@pricegroups = (); |
|
114 |
@pricegroups_not_used = (); |
|
115 |
|
|
116 |
#for pricegroups |
|
117 |
my $i = 1; |
|
118 |
while ( |
|
119 |
($form->{"klass_$i"}, $form->{"pricegroup_id_$i"}, |
|
120 |
$form->{"price_$i"}, $form->{"pricegroup_$i"}) |
|
121 |
= $sth->fetchrow_array |
|
122 |
) { |
|
123 |
$form->{"price_$i"} = $form->round_amount($form->{"price_$i"}, 5); |
|
124 |
$form->{"price_$i"} = |
|
125 |
$form->format_amount($myconfig, $form->{"price_$i"}, 5); |
|
126 |
push @pricegroups, $form->{"pricegroup_id_$i"}; |
|
127 |
$i++; |
|
128 |
} |
|
129 |
|
|
130 |
$sth->finish; |
|
131 |
|
|
132 |
# get pricegroups |
|
133 |
$query = qq|SELECT p.id, p.pricegroup FROM pricegroup p|; |
|
134 |
|
|
135 |
$pkq = $dbh->prepare($query); |
|
136 |
$pkq->execute || $form->dberror($query); |
|
137 |
while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) { |
|
138 |
push @{ $form->{PRICEGROUPS} }, $pkr; |
|
139 |
} |
|
140 |
$pkq->finish; |
|
141 |
|
|
142 |
#find not used pricegroups |
|
143 |
while ($tmp = pop @{ $form->{PRICEGROUPS} }) { |
|
144 |
my $insert = 0; |
|
145 |
foreach $item (@pricegroups) { |
|
146 |
if ($item eq $tmp->{id}) { |
|
147 |
|
|
148 |
#drop |
|
149 |
$insert = 1; |
|
150 |
} |
|
151 |
} |
|
152 |
if ($insert == 0) { |
|
153 |
push @pricegroups_not_used, $tmp; |
|
154 |
} |
|
155 |
} |
|
156 |
|
|
157 |
# if not used pricegroups are avaible |
|
158 |
if (@pricegroups_not_used) { |
|
159 |
|
|
160 |
foreach $name (@pricegroups_not_used) { |
|
161 |
$form->{"klass_$i"} = "$name->{id}"; |
|
162 |
$form->{"price_$i"} = $form->round_amount($form->{sellprice}, 5); |
|
163 |
$form->{"price_$i"} = |
|
164 |
$form->format_amount($myconfig, $form->{"price_$i"}, 5); |
|
165 |
$form->{"pricegroup_id_$i"} = "$name->{id}"; |
|
166 |
$form->{"pricegroup_$i"} = "$name->{pricegroup}\n"; |
|
167 |
$i++; |
|
168 |
} |
|
169 |
} |
|
170 |
|
|
171 |
#correct rows |
|
172 |
$form->{price_rows} = $i - 1; |
|
173 |
|
|
104 | 174 |
unless ($form->{item} eq 'service') { |
105 | 175 |
|
106 | 176 |
# get makes |
... | ... | |
332 | 402 |
WHERE id = $form->{id}|; |
333 | 403 |
$dbh->do($query) || $form->dberror($query); |
334 | 404 |
|
405 |
# delete price records |
|
406 |
$query = qq|DELETE FROM prices |
|
407 |
WHERE parts_id = $form->{id}|; |
|
408 |
$dbh->do($query) || $form->dberror($query); |
|
409 |
|
|
410 |
# insert price records only if different to sellprice |
|
411 |
for my $i (1 .. $form->{price_rows}) { |
|
412 |
if (( $form->{"price_$i"} |
|
413 |
|| $form->{"klass_$i"} |
|
414 |
|| $form->{"pricegroup_id_$i"}) and $form->{"price_$i"} != $form->{sellprice}) { |
|
415 |
$klass = $form->parse_amount($myconfig, $form->{"klass_$i"}); |
|
416 |
$price = $form->parse_amount($myconfig, $form->{"price_$i"}); |
|
417 |
$pricegroup_id = |
|
418 |
$form->parse_amount($myconfig, $form->{"pricegroup_id_$i"}); |
|
419 |
$query = qq|INSERT INTO prices (parts_id, pricegroup_id, price) |
|
420 |
VALUES($form->{id},$pricegroup_id,$price)|; |
|
421 |
$dbh->do($query) || $form->dberror($query); |
|
422 |
} |
|
423 |
} |
|
424 |
|
|
335 | 425 |
# insert makemodel records |
336 | 426 |
unless ($form->{item} eq 'service') { |
337 | 427 |
for my $i (1 .. $form->{makemodel_rows}) { |
SL/IS.pm | ||
---|---|---|
34 | 34 |
|
35 | 35 |
package IS; |
36 | 36 |
|
37 |
use Data::Dumper; |
|
38 |
|
|
37 | 39 |
sub invoice_details { |
38 | 40 |
$main::lxdebug->enter_sub(); |
39 | 41 |
|
... | ... | |
365 | 367 |
|
366 | 368 |
sub post_invoice { |
367 | 369 |
$main::lxdebug->enter_sub(); |
368 |
|
|
370 |
print STDERR "IS.pm-post_invoice\n"; |
|
369 | 371 |
my ($self, $myconfig, $form) = @_; |
370 | 372 |
|
371 | 373 |
# connect to database, turn off autocommit |
... | ... | |
549 | 551 |
? qq|'$form->{"deliverydate_$i"}'| |
550 | 552 |
: "NULL"; |
551 | 553 |
|
554 |
|
|
555 |
# get pricegroup_id and save ist |
|
556 |
($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"}; |
|
557 |
|
|
552 | 558 |
# save detail record in invoice table |
553 | 559 |
$query = qq|INSERT INTO invoice (trans_id, parts_id, description, qty, |
554 | 560 |
sellprice, fxsellprice, discount, allocated, assemblyitem, |
555 |
unit, deliverydate, project_id, serialnumber) |
|
561 |
unit, deliverydate, project_id, serialnumber, pricegroup_id)
|
|
556 | 562 |
VALUES ($form->{id}, $form->{"id_$i"}, |
557 | 563 |
'$form->{"description_$i"}', $form->{"qty_$i"}, |
558 | 564 |
$form->{"sellprice_$i"}, $fxsellprice, |
559 | 565 |
$form->{"discount_$i"}, $allocated, 'f', |
560 | 566 |
'$form->{"unit_$i"}', $deliverydate, (SELECT id from project where projectnumber = '$project_id'), |
561 |
'$form->{"serialnumber_$i"}')|; |
|
567 |
'$form->{"serialnumber_$i"}', |
|
568 |
'$pricegroup_id')|; |
|
562 | 569 |
$dbh->do($query) || $form->dberror($query); |
563 | 570 |
|
564 | 571 |
if ($form->{lizenzen}) { |
... | ... | |
1105 | 1112 |
|
1106 | 1113 |
sub retrieve_invoice { |
1107 | 1114 |
$main::lxdebug->enter_sub(); |
1108 |
|
|
1115 |
print STDERR "IS.pm-retrieve_invoice\n"; |
|
1109 | 1116 |
my ($self, $myconfig, $form) = @_; |
1110 | 1117 |
|
1111 | 1118 |
# connect to database |
... | ... | |
1211 | 1218 |
i.discount, i.parts_id AS id, i.unit, i.deliverydate, |
1212 | 1219 |
i.project_id, pr.projectnumber, i.serialnumber, |
1213 | 1220 |
p.partnumber, p.assembly, p.bin, p.notes AS partnotes, i.id AS invoice_pos, |
1214 |
pg.partsgroup |
|
1221 |
pg.partsgroup, i.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=i.pricegroup_id) as pricegroup
|
|
1215 | 1222 |
FROM invoice i |
1216 | 1223 |
JOIN parts p ON (i.parts_id = p.id) |
1217 | 1224 |
LEFT JOIN project pr ON (i.project_id = pr.id) |
... | ... | |
1306 | 1313 |
c.email, c.cc, c.bcc, c.language, |
1307 | 1314 |
c.street, c.zipcode, c.city, c.country, |
1308 | 1315 |
$duedate + c.terms AS duedate, c.notes AS intnotes, |
1309 |
b.discount AS tradediscount, b.description AS business |
|
1316 |
b.discount AS tradediscount, b.description AS business, c.klass as customer_klass
|
|
1310 | 1317 |
FROM customer c |
1311 | 1318 |
LEFT JOIN business b ON (b.id = c.business_id) |
1312 | 1319 |
WHERE c.id = $form->{customer_id}|; |
... | ... | |
1513 | 1520 |
$stw->finish; |
1514 | 1521 |
} |
1515 | 1522 |
} |
1516 |
|
|
1517 | 1523 |
} |
1518 | 1524 |
$sth->finish; |
1519 | 1525 |
$dbh->disconnect; |
... | ... | |
1521 | 1527 |
$main::lxdebug->leave_sub(); |
1522 | 1528 |
} |
1523 | 1529 |
|
1530 |
########################## |
|
1531 |
# get pricegroups from database |
|
1532 |
# build up selected pricegroup |
|
1533 |
# if an exchange rate - change price |
|
1534 |
# for each part |
|
1535 |
# |
|
1536 |
sub get_pricegroups_for_parts { |
|
1537 |
print STDERR "IS.pm - get_pricegroups_for_parts\n"; |
|
1538 |
$main::lxdebug->enter_sub(); |
|
1539 |
|
|
1540 |
my ($self, $myconfig, $form) = @_; |
|
1541 |
|
|
1542 |
my $dbh = $form->dbconnect($myconfig); |
|
1543 |
|
|
1544 |
my $i = 1; |
|
1545 |
my $id = 0; |
|
1546 |
|
|
1547 |
while (($form->{"id_$i"}) or ($form->{"new_id_$i"})) { |
|
1548 |
|
|
1549 |
$id = $form->{"id_$i"}; |
|
1550 |
|
|
1551 |
if (!($form->{"id_$i"}) and $form->{"new_id_$i"}) { |
|
1552 |
|
|
1553 |
$id = $form->{"new_id_$i"}; |
|
1554 |
} |
|
1555 |
|
|
1556 |
($price, $selectedpricegroup_id) = split /--/, $form->{"sellprice_drag_$i"}; |
|
1557 |
# print (STDERR "sellprice_drag_$i", Dumper($form->{"sellprice_drag_$i"})); |
|
1558 |
|
|
1559 |
$pricegroup_old = $form->{"pricegroup_old_$i"}; |
|
1560 |
# print (STDERR "pricegroup_old_i-$i", Dumper($pricegroup_old)); |
|
1561 |
|
|
1562 |
$price_new = $form->{"price_new_$i"}; |
|
1563 |
|
|
1564 |
$price_old = $form->{"price_old_$i"}; |
|
1565 |
|
|
1566 |
|
|
1567 |
$query = qq|SELECT pricegroup_id, (SELECT p.sellprice from parts p where p.id = $id) as default_sellprice,(SELECT pg.pricegroup FROM pricegroup pg WHERE id=pricegroup_id) AS pricegroup, price, '' AS selected FROM prices WHERE parts_id = $id UNION SELECT 0 as pricegroup_id,(SELECT sellprice FROM parts WHERE id=$id) as default_sellprice,'' as pricegroup, (SELECT DISTINCT sellprice from parts where id=$id) as price, 'selected' AS selected from prices ORDER BY pricegroup|; |
|
1568 |
|
|
1569 |
$pkq = $dbh->prepare($query); |
|
1570 |
$pkq->execute || $form->dberror($query); |
|
1571 |
while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) { |
|
1572 |
# push @{ $form->{PRICES}{$id} }, $pkr; |
|
1573 |
push @{ $form->{PRICES}{$i} }, $pkr; |
|
1574 |
$pkr->{id} = $id; |
|
1575 |
$pkr->{selected} = ''; |
|
1576 |
|
|
1577 |
# if there is an exchange rate change price |
|
1578 |
if (($form->{exchangerate} * 1) != 0) { |
|
1579 |
# print STDERR "WECHSELKURS?-$form->{exchangerate}\n"; |
|
1580 |
$pkr->{price} /= $form->{exchangerate}; |
|
1581 |
} |
|
1582 |
$pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5); |
|
1583 |
|
|
1584 |
|
|
1585 |
if ($selectedpricegroup_id eq undef) { |
|
1586 |
if ($pkr->{pricegroup_id} eq $form->{customer_klass}) { |
|
1587 |
print STDERR " INIT ROW \n"; |
|
1588 |
#print (STDERR " PREIS", Dumper($pkr->{price})); |
|
1589 |
$pkr->{selected} = ' selected'; |
|
1590 |
$last->{selected} = ''; |
|
1591 |
# print (STDERR " SELLPRICE", Dumper($form->{"sellprice_$i"})); |
|
1592 |
|
|
1593 |
# no customer pricesgroup set |
|
1594 |
if ($pkr->{price} == $pkr->{default_sellprice}) { |
|
1595 |
print (STDERR " PREIS IST DEFAULT-SELLPRICE", Dumper($form->{"sellprice_$i"})); |
|
1596 |
$pkr->{price} = $form->{"sellprice_$i"}; |
|
1597 |
|
|
1598 |
# if ($form->{tradediscount}){ |
|
1599 |
# print (STDERR "TRADE--", Dumper($pkr->{price})); |
|
1600 |
# $pkr->{price} =$pkr->{price} * (1 - $form->{tradediscount}); |
|
1601 |
# $pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5); |
|
1602 |
# print (STDERR "TRADE--", Dumper($pkr->{price})); |
|
1603 |
# } |
|
1604 |
|
|
1605 |
} else { |
|
1606 |
print STDERR " PREIS IST NICHT NULL\n"; |
|
1607 |
$form->{"sellprice_$i"} = $pkr->{price}; |
|
1608 |
} |
|
1609 |
# print (STDERR " PRICE", Dumper($pkr->{price})); |
|
1610 |
|
|
1611 |
} else { |
|
1612 |
print STDERR " INIT ROW but what\n"; |
|
1613 |
print (STDERR " PREIS -", Dumper($pkr->{price}), "Default", Dumper($pkr->{default_sellprice})); |
|
1614 |
if ($pkr->{price} == $pkr->{default_sellprice}) { |
|
1615 |
print (STDERR " PREIS IST DEFAULT-", Dumper($form->{"sellprice_$i"})); |
|
1616 |
$pkr->{price} = $form->{"sellprice_$i"}; |
|
1617 |
$pkr->{selected} = ' selected'; |
|
1618 |
} |
|
1619 |
} |
|
1620 |
} |
|
1621 |
if ($selectedpricegroup_id or $selectedpricegroup_id == 0){ |
|
1622 |
if ($selectedpricegroup_id ne $pricegroup_old) { |
|
1623 |
if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) { |
|
1624 |
if ($price_new != $form->{"sellprice_$i"}) { |
|
1625 |
print STDERR " MANUELLEN PREIS W?HLEN\n"; |
|
1626 |
} else { |
|
1627 |
print STDERR " UPDATE CHANGE PRICEGROUP\n"; |
|
1628 |
$pkr->{selected} = ' selected'; |
|
1629 |
$last->{selected} = ''; |
|
1630 |
#$form->{"pricegroup_old_$i"} = $pkr->{$pricegroup_id}; |
|
1631 |
} |
|
1632 |
} |
|
1633 |
} else { |
|
1634 |
if (($price_new != $form->{"sellprice_$i"}) and ($price_new ne 0)) { |
|
1635 |
if ($pkr->{pricegroup_id} == 0) { |
|
1636 |
print STDERR " UPDATE CHANGE PRICEGROUP with price manuelly\n"; |
|
1637 |
print (STDERR " SELLPRICE??? ---", Dumper($form->{"sellprice_$i"})); |
|
1638 |
print (STDERR " NEWPRICE??? ---", Dumper($price_new)); |
|
1639 |
$pkr->{price} = $form->{"sellprice_$i"}; |
|
1640 |
$pkr->{selected} = ' selected'; |
|
1641 |
$last->{selected} = ''; |
|
1642 |
#$form->{"sellprice_$i"} = $form->format_amount($myconfig, $price_new, 2); |
|
1643 |
# print (STDERR "----5555---", Dumper($pkr)); |
|
1644 |
} |
|
1645 |
} else { |
|
1646 |
if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) { |
|
1647 |
print STDERR " UPDATE NO CHANGE\n"; |
|
1648 |
$pkr->{selected} = ' selected'; |
|
1649 |
$last->{selected} = ''; |
|
1650 |
print STDERR " DEFAULTPRICE??? ---$pkr->{default_sellprice}\n"; |
|
1651 |
print (STDERR " SELLPRICE??? ---", Dumper($form->{"sellprice_$i"})); |
|
1652 |
# print (STDERR " HIER DER SELLPRICE DEFAULT??? ---", Dumper($form)); |
|
1653 |
print STDERR " NEWPRICE??? ---$price_new_\n"; |
|
1654 |
if (($pkr->{pricegroup_id} == 0) and ($pkr->{price} == $form->{"sellprice_$i"})) { |
|
1655 |
print (STDERR " UPDATE NO CHANGE BUT PRICE MANUELLY SET", Dumper($pkr->{price})); |
|
1656 |
# $pkr->{price} = $form->{"sellprice_$i"}; |
|
1657 |
} else { |
|
1658 |
$pkr->{price} = $form->{"sellprice_$i"}; |
|
1659 |
} |
|
1660 |
#print (STDERR " FEHLER", Dumper($form->{"sellprice_$i"})); |
|
1661 |
} |
|
1662 |
} |
|
1663 |
} |
|
1664 |
} |
|
1665 |
} |
|
1666 |
$i++; |
|
1667 |
|
|
1668 |
$pkq->finish; |
|
1669 |
} |
|
1670 |
|
|
1671 |
$dbh->disconnect; |
|
1672 |
|
|
1673 |
# print (STDERR "TEST", Dumper($form->{PRICES})); |
|
1674 |
# print (STDERR "TEST id_$i", Dumper($form->{"id_$i"})); |
|
1675 |
$main::lxdebug->leave_sub(); |
|
1676 |
} |
|
1677 |
|
|
1524 | 1678 |
sub webdav_folder { |
1525 | 1679 |
$main::lxdebug->enter_sub(); |
1526 | 1680 |
|
SL/OE.pm | ||
---|---|---|
311 | 311 |
$reqdate = |
312 | 312 |
($form->{"reqdate_$i"}) ? qq|'$form->{"reqdate_$i"}'| : "NULL"; |
313 | 313 |
|
314 |
# get pricegroup_id and save ist |
|
315 |
($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"}; |
|
316 |
|
|
314 | 317 |
# save detail record in orderitems table |
315 | 318 |
$query = qq|INSERT INTO orderitems (|; |
316 | 319 |
$query .= "id, " if $form->{"orderitems_id_$i"}; |
317 | 320 |
$query .= qq|trans_id, parts_id, description, qty, sellprice, discount, |
318 |
unit, reqdate, project_id, serialnumber, ship) |
|
321 |
unit, reqdate, project_id, serialnumber, ship, pricegroup_id)
|
|
319 | 322 |
VALUES (|; |
320 | 323 |
$query .= qq|$form->{"orderitems_id_$i"},| |
321 | 324 |
if $form->{"orderitems_id_$i"}; |
... | ... | |
323 | 326 |
'$form->{"description_$i"}', $form->{"qty_$i"}, |
324 | 327 |
$fxsellprice, $form->{"discount_$i"}, |
325 | 328 |
'$form->{"unit_$i"}', $reqdate, (SELECT id from project where projectnumber = '$project_id'), |
326 |
'$form->{"serialnumber_$i"}', $form->{"ship_$i"})|; |
|
329 |
'$form->{"serialnumber_$i"}', $form->{"ship_$i"}, |
|
330 |
'$pricegroup_id')|; |
|
327 | 331 |
$dbh->do($query) || $form->dberror($query); |
328 | 332 |
|
329 | 333 |
$form->{"sellprice_$i"} = $fxsellprice; |
... | ... | |
631 | 635 |
o.sellprice, o.parts_id AS id, o.unit, o.discount, p.bin, p.notes AS partnotes, |
632 | 636 |
o.reqdate, o.project_id, o.serialnumber, o.ship, |
633 | 637 |
pr.projectnumber, |
634 |
pg.partsgroup |
|
638 |
pg.partsgroup, o.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=o.pricegroup_id) as pricegroup
|
|
635 | 639 |
FROM orderitems o |
636 | 640 |
JOIN parts p ON (o.parts_id = p.id) |
637 | 641 |
LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id) |
SL/PE.pm | ||
---|---|---|
35 | 35 |
|
36 | 36 |
package PE; |
37 | 37 |
|
38 |
use Data::Dumper; |
|
39 |
|
|
38 | 40 |
sub projects { |
39 | 41 |
$main::lxdebug->enter_sub(); |
40 | 42 |
|
... | ... | |
290 | 292 |
$main::lxdebug->leave_sub(); |
291 | 293 |
} |
292 | 294 |
|
295 |
########################## |
|
296 |
# get pricegroups from database |
|
297 |
# |
|
298 |
sub pricegroups { |
|
299 |
$main::lxdebug->enter_sub(); |
|
300 |
|
|
301 |
my ($self, $myconfig, $form) = @_; |
|
302 |
|
|
303 |
my $var; |
|
304 |
|
|
305 |
# connect to database |
|
306 |
my $dbh = $form->dbconnect($myconfig); |
|
307 |
|
|
308 |
my $sortorder = ($form->{sort}) ? $form->{sort} : "pricegroup"; |
|
309 |
|
|
310 |
my $query = qq|SELECT g.id, g.pricegroup |
|
311 |
FROM pricegroup g|; |
|
312 |
|
|
313 |
my $where = "1 = 1"; |
|
314 |
|
|
315 |
if ($form->{pricegroup}) { |
|
316 |
$var = $form->like(lc $form->{pricegroup}); |
|
317 |
$where .= " AND lower(g.pricegroup) LIKE '$var'"; |
|
318 |
} |
|
319 |
$query .= qq| |
|
320 |
WHERE $where |
|
321 |
ORDER BY $sortorder|; |
|
322 |
|
|
323 |
if ($form->{status} eq 'orphaned') { |
|
324 |
$query = qq|SELECT pg.* |
|
325 |
FROM pricegroup pg |
|
326 |
LEFT JOIN prices p ON (p.pricegroup_id = pg.id) |
|
327 |
WHERE $where |
|
328 |
EXCEPT |
|
329 |
SELECT pg.* |
|
330 |
FROM pricegroup pg |
|
331 |
JOIN prices p ON (p.pricegroup_id = pg.id) |
|
332 |
WHERE $where |
|
333 |
ORDER BY $sortorder|; |
|
334 |
} |
|
335 |
print STDERR "asdfasdf-$query\n"; |
|
336 |
|
|
337 |
$sth = $dbh->prepare($query); |
|
338 |
$sth->execute || $form->dberror($query); |
|
339 |
|
|
340 |
my $i = 0; |
|
341 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
342 |
push @{ $form->{item_list} }, $ref; |
|
343 |
$i++; |
|
344 |
} |
|
345 |
|
|
346 |
$sth->finish; |
|
347 |
$dbh->disconnect; |
|
348 |
|
|
349 |
$main::lxdebug->leave_sub(); |
|
350 |
|
|
351 |
return $i; |
|
352 |
} |
|
353 |
######################## |
|
354 |
# save pricegruop to database |
|
355 |
# |
|
356 |
sub save_pricegroup { |
|
357 |
$main::lxdebug->enter_sub(); |
|
358 |
|
|
359 |
my ($self, $myconfig, $form) = @_; |
|
360 |
|
|
361 |
# connect to database |
|
362 |
my $dbh = $form->dbconnect($myconfig); |
|
363 |
|
|
364 |
map { $form->{$_} =~ s/\'/\'\'/g } (pricegroup); |
|
365 |
|
|
366 |
$form->{discount} /= 100; |
|
367 |
|
|
368 |
if ($form->{id}) { |
|
369 |
$query = qq|UPDATE pricegroup SET |
|
370 |
pricegroup = '$form->{pricegroup}' |
|
371 |
WHERE id = $form->{id}|; |
|
372 |
} else { |
|
373 |
$query = qq|INSERT INTO pricegroup |
|
374 |
(pricegroup) |
|
375 |
VALUES ('$form->{pricegroup}')|; |
|
376 |
} |
|
377 |
$dbh->do($query) || $form->dberror($query); |
|
378 |
|
|
379 |
$dbh->disconnect; |
|
380 |
|
|
381 |
$main::lxdebug->leave_sub(); |
|
382 |
} |
|
383 |
############################ |
|
384 |
# get one pricegroup from database |
|
385 |
# |
|
386 |
sub get_pricegroup { |
|
387 |
$main::lxdebug->enter_sub(); |
|
388 |
print STDERR "PE.pm-get_pricegroup\n"; |
|
389 |
my ($self, $myconfig, $form) = @_; |
|
390 |
|
|
391 |
# connect to database |
|
392 |
my $dbh = $form->dbconnect($myconfig); |
|
393 |
|
|
394 |
my $query = qq|SELECT p.id, p.pricegroup |
|
395 |
FROM pricegroup p |
|
396 |
WHERE p.id = $form->{id}|; |
|
397 |
my $sth = $dbh->prepare($query); |
|
398 |
$sth->execute || $form->dberror($query); |
|
399 |
|
|
400 |
my $ref = $sth->fetchrow_hashref(NAME_lc); |
|
401 |
|
|
402 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
|
403 |
|
|
404 |
$sth->finish; |
|
405 |
|
|
406 |
# check if it is orphaned |
|
407 |
$query = qq|SELECT count(*) |
|
408 |
FROM prices p |
|
409 |
WHERE p.pricegroup_id = $form->{id}|; |
|
410 |
$sth = $dbh->prepare($query); |
|
411 |
$sth->execute || $form->dberror($query); |
|
412 |
|
|
413 |
($form->{orphaned}) = $sth->fetchrow_array; |
|
414 |
$form->{orphaned} = !$form->{orphaned}; |
|
415 |
|
|
416 |
$sth->finish; |
|
417 |
|
|
418 |
$dbh->disconnect; |
|
419 |
#print (STDERR " ", Dumper($form)); |
|
420 |
$main::lxdebug->leave_sub(); |
|
421 |
} |
|
422 |
|
|
293 | 423 |
1; |
294 | 424 |
|
bin/mozilla/ct.pl | ||
---|---|---|
69 | 69 |
if ($form->{db} eq 'vendor') { |
70 | 70 |
$gifi = qq| |
71 | 71 |
<td><input name="l_gifi_accno" type=checkbox class=checkbox value=Y> | |
72 |
. $locale->text('GIFI') |
|
73 |
. qq|</td> |
|
72 |
. $locale->text('GIFI') . qq|</td> |
|
74 | 73 |
|; |
75 | 74 |
} |
76 | 75 |
|
... | ... | |
112 | 111 |
<td><input name=status class=radio type=radio value=all checked> | |
113 | 112 |
. $locale->text('All') . qq| |
114 | 113 |
<input name=status class=radio type=radio value=orphaned> | |
115 |
. $locale->text('Orphaned') |
|
116 |
. qq|</td> |
|
114 |
. $locale->text('Orphaned') . qq|</td> |
|
117 | 115 |
</tr> |
118 | 116 |
<tr> |
119 | 117 |
<th align=right nowrap>| . $locale->text('Include in Report') . qq|</th> |
... | ... | |
121 | 119 |
<table> |
122 | 120 |
<tr> |
123 | 121 |
<td><input name="l_id" type=checkbox class=checkbox value=Y> | |
124 |
. $locale->text('ID') |
|
125 |
. qq|</td> |
|
122 |
. $locale->text('ID') . qq|</td> |
|
126 | 123 |
<td><input name="l_$form->{db}number" type=checkbox class=checkbox value=Y> | |
127 |
. $locale->text($label . ' Number') |
|
128 |
. qq|</td> |
|
124 |
. $locale->text($label . ' Number') . qq|</td> |
|
129 | 125 |
<td><input name="l_name" type=checkbox class=checkbox value=Y checked> | |
130 |
. $locale->text('Company Name') |
|
131 |
. qq|</td> |
|
126 |
. $locale->text('Company Name') . qq|</td> |
|
132 | 127 |
<td><input name="l_address" type=checkbox class=checkbox value=Y> | |
133 |
. $locale->text('Address') |
|
134 |
. qq|</td> |
|
128 |
. $locale->text('Address') . qq|</td> |
|
135 | 129 |
</tr> |
136 | 130 |
<tr> |
137 | 131 |
<td><input name="l_contact" type=checkbox class=checkbox value=Y checked> | |
138 |
. $locale->text('Contact') |
|
139 |
. qq|</td> |
|
132 |
. $locale->text('Contact') . qq|</td> |
|
140 | 133 |
<td><input name="l_phone" type=checkbox class=checkbox value=Y checked> | |
141 |
. $locale->text('Phone') |
|
142 |
. qq|</td> |
|
134 |
. $locale->text('Phone') . qq|</td> |
|
143 | 135 |
<td><input name="l_fax" type=checkbox class=checkbox value=Y> | |
144 |
. $locale->text('Fax') |
|
145 |
. qq|</td> |
|
136 |
. $locale->text('Fax') . qq|</td> |
|
146 | 137 |
<td><input name="l_email" type=checkbox class=checkbox value=Y checked> | |
147 |
. $locale->text('E-mail') |
|
148 |
. qq|</td> |
|
138 |
. $locale->text('E-mail') . qq|</td> |
|
149 | 139 |
</tr> |
150 | 140 |
<tr> |
151 | 141 |
<td><input name="l_taxnumber" type=checkbox class=checkbox value=Y> | |
152 |
. $locale->text('Tax Number') |
|
153 |
. qq|</td> |
|
142 |
. $locale->text('Tax Number') . qq|</td> |
|
154 | 143 |
$gifi |
155 | 144 |
<td><input name="l_sic_code" type=checkbox class=checkbox value=Y> | |
156 |
. $locale->text('SIC') |
|
157 |
. qq|</td> |
|
145 |
. $locale->text('SIC') . qq|</td> |
|
158 | 146 |
<td><input name="l_business" type=checkbox class=checkbox value=Y> | |
159 |
. $locale->text('Type of Business') |
|
160 |
. qq|</td> |
|
147 |
. $locale->text('Type of Business') . qq|</td> |
|
161 | 148 |
</tr> |
162 | 149 |
<tr> |
163 | 150 |
<td><input name="l_invnumber" type=checkbox class=checkbox value=Y> | |
164 |
. $locale->text('Invoices') |
|
165 |
. qq|</td> |
|
151 |
. $locale->text('Invoices') . qq|</td> |
|
166 | 152 |
<td><input name="l_ordnumber" type=checkbox class=checkbox value=Y> | |
167 |
. $locale->text('Orders') |
|
168 |
. qq|</td> |
|
153 |
. $locale->text('Orders') . qq|</td> |
|
169 | 154 |
<td><input name="l_quonumber" type=checkbox class=checkbox value=Y> | |
170 |
. $locale->text('Quotations') |
|
171 |
. qq|</td> |
|
155 |
. $locale->text('Quotations') . qq|</td> |
|
172 | 156 |
</tr> |
173 | 157 |
</table> |
174 | 158 |
</td> |
... | ... | |
363 | 347 |
|
364 | 348 |
if ($ref->{id} eq $sameid) { |
365 | 349 |
map { $column_data{$_} = "<td> </td>" } @column_index; |
366 |
map { $column_data{$_} = "<td>$ref->{$_} </td>" } (invnumber, ordnumber, quonumber); |
|
367 | 350 |
} else { |
368 | 351 |
map { $column_data{$_} = "<td>$ref->{$_} </td>" } @column_index; |
369 | 352 |
|
... | ... | |
529 | 512 |
</tr> |
530 | 513 |
|; |
531 | 514 |
} |
532 |
|
|
533 | 515 |
$form->{selectbusiness} = qq|<option>\n|; |
534 | 516 |
map { |
535 |
$form->{selectbusiness} .= qq|<option value=$_->{id}>$_->{description}\n| |
|
517 |
$form->{selectbusiness} .= |
|
518 |
qq|<option value=$_->{id}>$_->{description}\n| |
|
536 | 519 |
} @{ $form->{all_business} }; |
537 | 520 |
if ($form->{business_save}) { |
538 | 521 |
$form->{selectbusiness} = $form->{business_save}; |
... | ... | |
596 | 579 |
|
597 | 580 |
$select_greeting = |
598 | 581 |
qq| <select name=selected_cp_greeting><option></option>|; |
599 |
map({ $select_greeting .= qq|<option>$_</option>|; } @{ $form->{GREETINGS} }); |
|
582 |
map( |
|
583 |
{ $select_greeting .= qq|<option>$_</option>|; } @{ $form->{GREETINGS} }); |
|
600 | 584 |
$select_greeting .= qq|</select>|; |
601 | 585 |
## /LINET |
602 | 586 |
|
587 |
if ($form->{db} eq 'customer') { |
|
588 |
#get pricegroup and form it |
|
589 |
$form->get_pricegroup(\%myconfig, { all => 1 }); |
|
590 |
|
|
591 |
$form->{pricegroup} = "$form->{klass}"; |
|
592 |
$form->{pricegroup_id} = "$form->{klass}"; |
|
593 |
|
|
594 |
if (@{ $form->{all_pricegroup} }) { |
|
595 |
|
|
596 |
$form->{selectpricegroup} = qq|<option>\n|; |
|
597 |
map { |
|
598 |
$form->{selectpricegroup} .= |
|
599 |
qq|<option value="$_->{id}">$_->{pricegroup}\n| |
|
600 |
} @{ $form->{all_pricegroup} }; |
|
601 |
} |
|
602 |
|
|
603 |
if ($form->{selectpricegroup}) { |
|
604 |
$form->{selectpricegroup} = $form->unescape($form->{selectpricegroup}); |
|
605 |
|
|
606 |
$pricegroup = |
|
607 |
qq|<input type=hidden name=selectpricegroup value="| |
|
608 |
. $form->escape($form->{selectpricegroup}, 1) . qq|">|; |
|
609 |
|
|
610 |
$form->{selectpricegroup} =~ |
|
611 |
s/(<option value="\Q$form->{klass}\E")/$1 selected/; |
|
612 |
|
|
613 |
$pricegroup .= qq|<select name=klass>$form->{selectpricegroup}</select>|; |
|
614 |
|
|
615 |
$group = $locale->text('Hola'); |
|
616 |
} |
|
617 |
} |
|
603 | 618 |
# $locale->text('Customer Number') |
604 | 619 |
# $locale->text('Vendor Number') |
605 | 620 |
$form->{fokus} = "ct.name"; |
... | ... | |
618 | 633 |
<table width=100%> |
619 | 634 |
<tr class=listheading> |
620 | 635 |
<th class=listheading colspan=2 width=50%>| |
621 |
. $locale->text('Billing Address') |
|
622 |
. qq|</th> |
|
636 |
. $locale->text('Billing Address') . qq|</th> |
|
623 | 637 |
<th class=listheading width=50%>| |
624 |
. $locale->text('Shipping Address') |
|
625 |
. qq|</th> |
|
638 |
. $locale->text('Shipping Address') . qq|</th> |
|
626 | 639 |
</tr> |
627 | 640 |
<tr height="5"></tr> |
628 | 641 |
$business_salesman |
... | ... | |
649 | 662 |
</tr> |
650 | 663 |
<tr> |
651 | 664 |
<th align=right nowrap>| |
652 |
. $locale->text('Zipcode') . "/" |
|
653 |
. $locale->text('City') |
|
654 |
. qq|</th> |
|
665 |
. $locale->text('Zipcode') . "/" . $locale->text('City') . qq|</th> |
|
655 | 666 |
<td><input name=zipcode size=5 tabindex=5 maxlength=10 value="$form->{zipcode}"> |
656 | 667 |
<input name=city size=30 tabindex=6 maxlength=75 value="$form->{city}"></td> |
657 | 668 |
<td><input name=shiptozipcode size=5 maxlength=10 value="$form->{shiptozipcode}"> |
... | ... | |
695 | 706 |
<table> |
696 | 707 |
<tr> |
697 | 708 |
<th align=right nowrap>| |
698 |
. $locale->text('Contact Person') |
|
699 |
. qq|</th> |
|
709 |
. $locale->text('Contact Person') . qq|</th> |
|
700 | 710 |
</tr> |
701 | 711 |
<tr> |
702 | 712 |
<th></th> |
... | ... | |
710 | 720 |
<tr> |
711 | 721 |
<th></th> |
712 | 722 |
<th align=left nowrap>| |
713 |
. $locale->text('Given Name') |
|
714 |
. qq|</th> |
|
723 |
. $locale->text('Given Name') . qq|</th> |
|
715 | 724 |
<td><input name=cp_givenname size=30 maxlength=40 value="$form->{cp_givenname}"></td> |
716 | 725 |
<th align=left nowrap>| . $locale->text('Name') . qq|</th> |
717 | 726 |
<td><input name=cp_name size=30 maxlength=40 value="$form->{cp_name}"></td> |
... | ... | |
747 | 756 |
<td><input name=creditlimit tabindex=13 size=9 value="$form->{creditlimit}"></td> |
748 | 757 |
<th align=right>| . $locale->text('Terms: Net') . qq|</th> |
749 | 758 |
<td><input name=terms tabindex=14 size=2 value="$form->{terms}">| |
750 |
. $locale->text('days') |
|
751 |
. qq|</td> |
|
759 |
. $locale->text('days') . qq|</td> |
|
752 | 760 |
<th align=right>| . $locale->text('Discount') . qq|</th> |
753 | 761 |
<td><input name=discount tabindex=15 size=4 value="$form->{discount}"> |
754 | 762 |
%</td> |
... | ... | |
773 | 781 |
<th align=right>| . $locale->text('Language') . qq|</th> |
774 | 782 |
<td><select name=language tabindex=23>$lang |
775 | 783 |
</select></td>|; |
784 |
if ($form->{db} eq 'customer'){ |
|
776 | 785 |
|
786 |
print qq| |
|
787 |
<th align=right>| . $locale->text('Preisklasse') . qq|</th> |
|
788 |
<td>$pricegroup</td>|; |
|
789 |
} |
|
777 | 790 |
print qq| </tr> |
778 | 791 |
<tr> |
779 | 792 |
<td align=right>| . $locale->text('Obsolete') . qq|</td> |
... | ... | |
835 | 848 |
<input type=hidden name=callback value="$form->{callback}"> |
836 | 849 |
<input type=hidden name=db value=$form->{db}> |
837 | 850 |
|
851 |
|
|
852 |
|
|
838 | 853 |
<br> |
839 | 854 |
$update_button |
840 | 855 |
<input class=submit type=submit name=action accesskey="s" value="| |
bin/mozilla/ic.pl | ||
---|---|---|
32 | 32 |
#====================================================================== |
33 | 33 |
|
34 | 34 |
use SL::IC; |
35 |
#use SL::PE; |
|
35 | 36 |
|
36 | 37 |
require "$form->{path}/io.pl"; |
37 | 38 |
|
... | ... | |
84 | 85 |
$button1 = qq| |
85 | 86 |
<td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td> |
86 | 87 |
<td><input type=button name=transdatefrom id="trigger1" value=| |
87 |
. $locale->text('button') |
|
88 |
. qq|></td> |
|
88 |
. $locale->text('button') . qq|></td> |
|
89 | 89 |
|; |
90 | 90 |
$button2 = qq| |
91 | 91 |
<td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td> |
92 | 92 |
<td><input type=button name=transdateto name=transdateto id="trigger2" value=| |
93 |
. $locale->text('button') |
|
94 |
. qq|></td> |
|
93 |
. $locale->text('button') . qq|></td> |
|
95 | 94 |
|; |
96 | 95 |
|
97 | 96 |
#write Trigger |
... | ... | |
132 | 131 |
|
133 | 132 |
$l_serialnumber = qq| |
134 | 133 |
<td><input name=l_serialnumber class=checkbox type=checkbox value=Y> | |
135 |
. $locale->text('Serial Number') |
|
136 |
. qq|</td> |
|
134 |
. $locale->text('Serial Number') . qq|</td> |
|
137 | 135 |
|; |
138 | 136 |
|
139 | 137 |
} |
... | ... | |
272 | 270 |
</tr> |
273 | 271 |
<tr> |
274 | 272 |
<th align=right nowrap>| |
275 |
. $locale->text('Part Description') |
|
276 |
. qq|</th> |
|
273 |
. $locale->text('Part Description') . qq|</th> |
|
277 | 274 |
<td colspan=3><input name=description size=40></td> |
278 | 275 |
</tr> |
279 | 276 |
<tr> |
... | ... | |
310 | 307 |
</tr> |
311 | 308 |
<tr> |
312 | 309 |
<th align=right nowrap>| |
313 |
. $locale->text('Include in Report') |
|
314 |
. qq|</th> |
|
310 |
. $locale->text('Include in Report') . qq|</th> |
|
315 | 311 |
<td colspan=3> |
316 | 312 |
<table> |
317 | 313 |
<tr> |
318 | 314 |
<td><input name=l_partnumber class=checkbox type=checkbox value=Y checked> | |
319 |
. $locale->text('Part Number') |
|
320 |
. qq|</td> |
|
315 |
. $locale->text('Part Number') . qq|</td> |
|
321 | 316 |
<td><input name=l_description class=checkbox type=checkbox value=Y checked> | |
322 |
. $locale->text('Part Description') |
|
323 |
. qq|</td> |
|
317 |
. $locale->text('Part Description') . qq|</td> |
|
324 | 318 |
$l_serialnumber |
325 | 319 |
<td><input name=l_unit class=checkbox type=checkbox value=Y checked> | |
326 |
. $locale->text('Unit of measure') |
|
327 |
. qq|</td> |
|
320 |
. $locale->text('Unit of measure') . qq|</td> |
|
328 | 321 |
</tr> |
329 | 322 |
<tr> |
330 | 323 |
<td><input name=l_listprice class=checkbox type=checkbox value=Y> | |
331 |
. $locale->text('List Price') |
|
332 |
. qq|</td> |
|
324 |
. $locale->text('List Price') . qq|</td> |
|
333 | 325 |
<td><input name=l_sellprice class=checkbox type=checkbox value=Y checked> | |
334 |
. $locale->text('Sell Price') |
|
335 |
. qq|</td> |
|
326 |
. $locale->text('Sell Price') . qq|</td> |
|
336 | 327 |
<td><input name=l_lastcost class=checkbox type=checkbox value=Y> | |
337 |
. $locale->text('Last Cost') |
|
338 |
. qq|</td> |
|
328 |
. $locale->text('Last Cost') . qq|</td> |
|
339 | 329 |
<td><input name=l_linetotal class=checkbox type=checkbox value=Y checked> | |
340 |
. $locale->text('Line Total') |
|
341 |
. qq|</td> |
|
330 |
. $locale->text('Line Total') . qq|</td> |
|
342 | 331 |
</tr> |
343 | 332 |
<tr> |
344 | 333 |
<td><input name=l_priceupdate class=checkbox type=checkbox value=Y> | |
345 |
. $locale->text('Updated') |
|
346 |
. qq|</td> |
|
334 |
. $locale->text('Updated') . qq|</td> |
|
347 | 335 |
<td><input name=l_bin class=checkbox type=checkbox value=Y> | |
348 |
. $locale->text('Bin') |
|
349 |
. qq|</td> |
|
336 |
. $locale->text('Bin') . qq|</td> |
|
350 | 337 |
<td><input name=l_rop class=checkbox type=checkbox value=Y> | |
351 |
. $locale->text('ROP') |
|
352 |
. qq|</td> |
|
338 |
. $locale->text('ROP') . qq|</td> |
|
353 | 339 |
<td><input name=l_weight class=checkbox type=checkbox value=Y> | |
354 |
. $locale->text('Weight') |
|
355 |
. qq|</td> |
|
340 |
. $locale->text('Weight') . qq|</td> |
|
356 | 341 |
</tr> |
357 | 342 |
<tr> |
358 | 343 |
<td><input name=l_image class=checkbox type=checkbox value=Y> | |
359 |
. $locale->text('Image') |
|
360 |
. qq|</td> |
|
344 |
. $locale->text('Image') . qq|</td> |
|
361 | 345 |
<td><input name=l_drawing class=checkbox type=checkbox value=Y> | |
362 |
. $locale->text('Drawing') |
|
363 |
. qq|</td> |
|
346 |
. $locale->text('Drawing') . qq|</td> |
|
364 | 347 |
<td><input name=l_microfiche class=checkbox type=checkbox value=Y> | |
365 |
. $locale->text('Microfiche') |
|
366 |
. qq|</td> |
|
348 |
. $locale->text('Microfiche') . qq|</td> |
|
367 | 349 |
<td><input name=l_partsgroup class=checkbox type=checkbox value=Y> | |
368 |
. $locale->text('Group') |
|
369 |
. qq|</td> |
|
350 |
. $locale->text('Group') . qq|</td> |
|
370 | 351 |
</tr> |
371 | 352 |
<tr> |
372 | 353 |
<td><input name=l_subtotal class=checkbox type=checkbox value=Y> | |
373 |
. $locale->text('Subtotal') |
|
374 |
. qq|</td> |
|
354 |
. $locale->text('Subtotal') . qq|</td> |
|
375 | 355 |
<td><input name=l_soldtotal class=checkbox type=checkbox value=Y> | |
376 |
. $locale->text('soldtotal') |
|
377 |
. qq|</td> |
|
356 |
. $locale->text('soldtotal') . qq|</td> |
|
378 | 357 |
</tr> |
379 | 358 |
</table> |
380 | 359 |
</td> |
... | ... | |
433 | 412 |
<table> |
434 | 413 |
<tr class=listheading> |
435 | 414 |
<th class=listheading nowrap>| |
436 |
. $locale->text('Part Number') |
|
437 |
. qq|</th> |
|
415 |
. $locale->text('Part Number') . qq|</th> |
|
438 | 416 |
<th class=listheading nowrap>| |
439 |
. $locale->text('Part Description') |
|
440 |
. qq|</th> |
|
417 |
. $locale->text('Part Description') . qq|</th> |
|
441 | 418 |
</tr> |
442 | 419 |
<tr valign=top> |
443 | 420 |
<td><input type=text name=partnumber size=20 value=></td> |
... | ... | |
858 | 835 |
$option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|; |
859 | 836 |
} |
860 | 837 |
|
861 |
@columns = |
|
862 |
$form->sort_columns( |
|
838 |
@columns = $form->sort_columns( |
|
863 | 839 |
qw(number partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal) |
864 |
);
|
|
840 |
); |
|
865 | 841 |
|
866 | 842 |
if ($form->{l_linetotal}) { |
867 | 843 |
$form->{l_onhand} = "Y"; |
... | ... | |
1441 | 1417 |
$option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|; |
1442 | 1418 |
} |
1443 | 1419 |
|
1444 |
@columns = |
|
1445 |
$form->sort_columns( |
|
1420 |
@columns = $form->sort_columns( |
|
1446 | 1421 |
qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal) |
1447 |
);
|
|
1422 |
); |
|
1448 | 1423 |
|
1449 | 1424 |
if ($form->{l_linetotal}) { |
1450 | 1425 |
$form->{l_onhand} = "Y"; |
... | ... | |
1921 | 1896 |
delete $form->{amount}; |
1922 | 1897 |
|
1923 | 1898 |
$form->get_partsgroup(\%myconfig, { all => 1 }); |
1899 |
|
|
1924 | 1900 |
$form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}"; |
1901 |
|
|
1925 | 1902 |
if (@{ $form->{all_partsgroup} }) { |
1926 | 1903 |
$form->{selectpartsgroup} = qq|<option>\n|; |
1927 | 1904 |
map { |
... | ... | |
2018 | 1995 |
} |
2019 | 1996 |
} |
2020 | 1997 |
} |
1998 |
|
|
2021 | 1999 |
if ($form->{selectpartsgroup}) { |
2022 | 2000 |
$form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup}); |
2023 | 2001 |
$partsgroup = |
... | ... | |
2044 | 2022 |
$lastcost = qq| |
2045 | 2023 |
<tr> |
2046 | 2024 |
<th align="right" nowrap="true">| |
2047 |
. $locale->text('Last Cost') |
|
2048 |
. qq|</th> |
|
2025 |
. $locale->text('Last Cost') . qq|</th> |
|
2049 | 2026 |
<td><input name=lastcost size=11 value=$form->{lastcost}></td> |
2050 | 2027 |
</tr> |
2051 | 2028 |
|; |
... | ... | |
2153 | 2130 |
<tr> |
2154 | 2131 |
<th align="right" nowrap>| . $locale->text('On Hand') . qq|</th> |
2155 | 2132 |
<th align=left nowrap class="plus$n"> | |
2156 |
. $form->format_amount(\%myconfig, $form->{onhand}) |
|
2157 |
. qq|</th> |
|
2133 |
. $form->format_amount(\%myconfig, $form->{onhand}) . qq|</th> |
|
2158 | 2134 |
</tr> |
2159 | 2135 |
|; |
2160 | 2136 |
|
... | ... | |
2183 | 2159 |
$vegv = qq| |
2184 | 2160 |
<tr> |
2185 | 2161 |
<th align="right" nowrap="true">| |
2186 |
. $locale->text('Verrechnungseinheit') |
|
2187 |
. qq|</th> |
|
2162 |
. $locale->text('Verrechnungseinheit') . qq|</th> |
|
2188 | 2163 |
<td><input name=ve size=10 value=$form->{ve}></td> |
2189 | 2164 |
</tr> |
2190 | 2165 |
<tr> |
2191 | 2166 |
<th align="right" nowrap="true">| |
2192 |
. $locale->text('Gesch?ftsvolumen') |
|
2193 |
. qq|</th> |
|
2167 |
. $locale->text('Gesch?ftsvolumen') . qq|</th> |
|
2194 | 2168 |
<td><input name=gv size=10 value=$form->{gv}></td> |
2195 | 2169 |
</tr> |
2196 | 2170 |
|; |
... | ... | |
2227 | 2201 |
$obsolete .= qq| |
2228 | 2202 |
<tr> |
2229 | 2203 |
<th align=right nowrap>| |
2230 |
. $locale->text('Shopartikel') |
|
2231 |
. qq|</th> |
|
2204 |
. $locale->text('Shopartikel') . qq|</th> |
|
2232 | 2205 |
<td><input class=checkbox type=checkbox name=shop value=1 $shopok></td> |
2233 | 2206 |
</tr> |
2234 | 2207 |
|; |
... | ... | |
2249 | 2222 |
$button1 = qq| |
2250 | 2223 |
<td width="13"><input name=priceupdate id=priceupdate size=11 title="$myconfig{dateformat}" value="$form->{priceupdate}"></td> |
2251 | 2224 |
<td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=| |
2252 |
. $locale->text('button') |
|
2253 |
. qq|></td> |
|
2225 |
. $locale->text('button') . qq|></td> |
|
2254 | 2226 |
|; |
2255 | 2227 |
|
2256 | 2228 |
#write Trigger |
... | ... | |
2314 | 2286 |
<table width="100%" height="100%"> |
2315 | 2287 |
<tr class="listheading"> |
2316 | 2288 |
<th class="listheading" align="center" colspan=2>| |
2317 |
. $locale->text('Link Accounts') |
|
2318 |
. qq|</th> |
|
2289 |
. $locale->text('Link Accounts') . qq|</th> |
|
2319 | 2290 |
</tr> |
2320 | 2291 |
$linkaccounts |
2321 | 2292 |
<tr> |
... | ... | |
2332 | 2303 |
<table width="100%"> |
2333 | 2304 |
<tr> |
2334 | 2305 |
<th align="right" nowrap="true">| |
2335 |
. $locale->text('Updated') |
|
2336 |
. qq|</th> |
|
2306 |
. $locale->text('Updated') . qq|</th> |
|
2337 | 2307 |
$button1 |
2338 | 2308 |
</tr> |
2339 | 2309 |
<tr> |
... | ... | |
2378 | 2348 |
<table width="100%"> |
2379 | 2349 |
<tr> |
2380 | 2350 |
<th colspan=2 align=right>| |
2381 |
. $locale->text('Total') |
|
2382 |
. qq| </th> |
|
2351 |
. $locale->text('Total') . qq| </th> |
|
2383 | 2352 |
<th align=right>| |
2384 |
. $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) |
|
2385 |
. qq|</th> |
|
2353 |
. $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th> |
|
2386 | 2354 |
</tr> |
2387 | 2355 |
</table> |
2388 | 2356 |
</td> |
... | ... | |
2415 | 2383 |
|; |
2416 | 2384 |
} |
2417 | 2385 |
|
2386 |
print qq| |
|
2387 |
<input type=hidden name=price_rows value=$form->{price_rows}>|; |
|
2388 |
|
|
2418 | 2389 |
print qq| |
2419 | 2390 |
<input class=submit type=submit name=action value="| |
2420 | 2391 |
. $locale->text('Save') . qq|">|; |
... | ... | |
2718 | 2689 |
if ($form->{item} eq 'service') { |
2719 | 2690 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } |
2720 | 2691 |
qw(sellprice listprice); |
2721 |
|
|
2722 | 2692 |
&form_header; |
2723 | 2693 |
&form_footer; |
2724 | 2694 |
} |
... | ... | |
2898 | 2868 |
<table> |
2899 | 2869 |
<tr> |
2900 | 2870 |
<th align="right" nowrap="true">| |
2901 |
. $locale->text('Part Number') |
|
2902 |
. qq|</th> |
|
2871 |
. $locale->text('Part Number') . qq|</th> |
|
2903 | 2872 |
<td><input name=partnumber size=20></td> |
2904 | 2873 |
<td> </td> |
2905 | 2874 |
</tr> |
2906 | 2875 |
<tr> |
2907 | 2876 |
<th align="right" nowrap="true">| |
2908 |
. $locale->text('Part Description') |
|
2909 |
. qq|</th> |
|
2877 |
. $locale->text('Part Description') . qq|</th> |
|
2910 | 2878 |
<td><input name=description size=40></td> |
2911 | 2879 |
</tr> |
2912 | 2880 |
</table> |
... | ... | |
3053 | 3021 |
$lxdebug->leave_sub(); |
3054 | 3022 |
} |
3055 | 3023 |
|
3024 |
sub price_row { |
|
3025 |
$lxdebug->enter_sub(); |
|
3026 |
|
|
3027 |
my ($numrows) = @_; |
|
3028 |
|
|
3029 |
print qq| |
|
3030 |
<tr> |
|
3031 |
<td> |
|
3032 |
<table width=100%> |
|
3033 |
<tr> |
|
3034 |
<th class="listheading">| . $locale->text('Preisklasse') . qq|</th> |
|
3035 |
<th class="listheading">| . $locale->text('Preis') . qq|</th> |
|
3036 |
</tr> |
|
3037 |
|; |
|
3038 |
for $i (1 .. $numrows) { |
|
3039 |
print qq| |
|
3040 |
<tr> |
|
3041 |
<td width=50%><input name="pricegroup_$i" size=30 value=$form->{"pricegroup_$i"} readonly></td> |
|
3042 |
<td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td> |
|
3043 |
<input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}"> |
|
3044 |
</tr> |
|
3045 |
|; |
|
3046 |
} |
|
3047 |
|
|
3048 |
print qq| |
|
3049 |
</table> |
|
3050 |
</td> |
|
3051 |
</tr> |
|
3052 |
|; |
|
3053 |
|
|
3054 |
$lxdebug->leave_sub(); |
|
3055 |
} |
|
3056 |
|
|
3056 | 3057 |
sub continue { &{ $form->{nextsub} } } |
bin/mozilla/io.pl | ||
---|---|---|
72 | 72 |
# $locale->text('Oct') |
73 | 73 |
# $locale->text('Nov') |
74 | 74 |
# $locale->text('Dec') |
75 |
use SL::IS; |
|
76 |
use SL::PE; |
|
75 | 77 |
use Data::Dumper; |
76 | 78 |
######################################## |
77 | 79 |
# Eintrag fuer Version 2.2.0 geaendert # |
... | ... | |
80 | 82 |
sub display_row { |
81 | 83 |
$lxdebug->enter_sub(); |
82 | 84 |
my $numrows = shift; |
83 |
|
|
85 |
print STDERR "io.pl-display_row\n"; |
|
84 | 86 |
if ($lizenzen && $form->{vc} eq "customer") { |
85 | 87 |
if ($form->{type} =~ /sales_order/) { |
86 | 88 |
@column_index = (runningnumber, partnumber, description, ship, qty); |
... | ... | |
99 | 101 |
} |
100 | 102 |
############## ENDE Neueintrag ################## |
101 | 103 |
|
102 |
push @column_index, qw(unit sellprice); |
|
104 |
push @column_index, qw(unit); |
|
105 |
|
|
106 |
#for pricegroups column |
|
107 |
if ($form->{type} =~ (/sales_quotation/) or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/)) or (($form->{level} eq undef) and ($form->{type} =~ /invoice/)) or ($form->{type} =~ /sales_order/)) { |
|
108 |
push @column_index, qw(sellprice_drag); |
|
109 |
} |
|
110 |
|
|
111 |
push @column_index, qw(sellprice); |
|
103 | 112 |
|
104 | 113 |
if ($form->{vc} eq 'customer') { |
105 | 114 |
push @column_index, qw(discount); |
... | ... | |
153 | 162 |
. $locale->text('Project') |
154 | 163 |
. qq|</th>|; |
155 | 164 |
$column_data{sellprice} = |
156 |
qq|<th align=left nowrap width=10 class=listheading>|
|
|
165 |
qq|<th align=left nowrap width=15 class=listheading>|
|
|
157 | 166 |
. $locale->text('Price') |
158 | 167 |
. qq|</th>|; |
168 |
$column_data{sellprice_drag} = |
|
169 |
qq|<th align=left nowrap width=15 class=listheading>| |
|
170 |
. $locale->text('Pricegroup') |
|
171 |
. qq|</th>|; |
|
159 | 172 |
$column_data{discount} = |
160 | 173 |
qq|<th align=left class=listheading>| |
161 | 174 |
. $locale->text('Discount') |
... | ... | |
201 | 214 |
map { |
202 | 215 |
$form->{"${_}_$i"} = |
203 | 216 |
$form->parse_amount(\%myconfig, $form->{"${_}_$i"}) |
204 |
} qw(qty ship discount sellprice); |
|
217 |
} qw(qty ship discount sellprice price_new price_old);
|
|
205 | 218 |
|
206 | 219 |
($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/); |
207 | 220 |
$dec = length $dec; |
... | ... | |
211 | 224 |
$form->round_amount( |
212 | 225 |
$form->{"sellprice_$i"} * $form->{"discount_$i"} / 100, |
213 | 226 |
$decimalplaces); |
227 |
|
|
214 | 228 |
$linetotal = |
215 | 229 |
$form->round_amount($form->{"sellprice_$i"} - $discount, $decimalplaces); |
216 | 230 |
$linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2); |
... | ... | |
239 | 253 |
} |
240 | 254 |
|
241 | 255 |
$column_data{qty} = |
242 |
qq|<td align=right><input name="qty_$i" size=5 value=| |
|
243 |
. $form->format_amount(\%myconfig, $form->{"qty_$i"}) |
|
244 |
. qq|></td>|; |
|
256 |
qq|<td align=right><input name="qty_$i" size=5 value=|.$form->format_amount(\%myconfig, $form->{"qty_$i"},0).qq|></td>|; |
|
245 | 257 |
$column_data{ship} = |
246 | 258 |
qq|<td align=right><input name="ship_$i" size=5 value=| |
247 | 259 |
. $form->format_amount(\%myconfig, $form->{"ship_$i"}) |
248 | 260 |
. qq|></td>|; |
249 | 261 |
$column_data{unit} = |
250 | 262 |
qq|<td><input name="unit_$i" size=5 value="$form->{"unit_$i"}"></td>|; |
251 |
$column_data{sellprice} = |
|
252 |
qq|<td align=right><input name="sellprice_$i" size=9 value=| |
|
253 |
. $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, |
|
254 |
$decimalplaces) |
|
255 |
. qq|></td>|; |
|
263 |
|
|
264 |
|
|
265 |
|
|
266 |
#print (STDERR "io.pl---111-i-$i", Dumper($form->{PRICES})); |
|
267 |
# build in dragdrop for pricesgroups |
|
268 |
if ($form->{"prices_$i"}) { |
|
269 |
print STDERR " YES prices\n"; |
|
270 |
$price_tmp = $form->format_amount(\%myconfig, $form->{"price_new_$i"}, 2); |
|
271 |
|
|
272 |
$column_data{sellprice_drag} = |
|
273 |
qq|<td align=right><select name="sellprice_drag_$i">$form->{"prices_$i"}</select></td>|; |
|
274 |
$column_data{sellprice} = |
|
275 |
qq|<td><input name="sellprice_$i" size=5 value=$price_tmp></td>|; |
|
276 |
} else { |
|
277 |
print STDERR " NO prices\n"; |
|
278 |
# for last row and report |
|
279 |
# set pricegroup dragdrop from report menu |
|
280 |
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 |
$prices = |
|
284 |
qq|<option value="$form->{"sellprice_$i"}--$form->{"pricegroup_id_$i"}" selected>$form->{"pricegroup_$i"}</option>\n|; |
|
285 |
|
|
286 |
$form->{"pricegroup_old_$i"} = $form->{"pricegroup_id_$i"}; |
|
287 |
|
|
288 |
$column_data{sellprice_drag} = |
|
289 |
qq|<td align=right><select name="sellprice_drag_$i">$prices</select></td>|; |
|
290 |
|
|
291 |
}else { |
|
292 |
# for last row |
|
293 |
$column_data{sellprice_drag} = |
|
294 |
qq|<td align=right><input name="sellprice_$i" size=9 value=| |
|
295 |
. $form->format_amount(\%myconfig, $form->{"prices_$i"}, |
|
296 |
$decimalplaces) |
|
297 |
. qq|></td>|; |
|
298 |
} |
|
299 |
|
|
300 |
$column_data{sellprice} = |
|
301 |
qq|<td><input name="sellprice_$i" size=5 value=| |
|
302 |
. $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, |
|
303 |
$decimalplaces) |
|
304 |
. qq|></td>|; |
|
305 |
} |
|
306 |
#print (STDERR "io.pl---555-i-$i", Dumper($form->{"price_old_$i"})); |
|
256 | 307 |
$column_data{discount} = |
257 | 308 |
qq|<td align=right><input name="discount_$i" size=3 value=| |
258 | 309 |
. $form->format_amount(\%myconfig, $form->{"discount_$i"}) |
... | ... | |
289 | 340 |
<input type=hidden name="orderitems_id_$i" value=$form->{"orderitems_id_$i"}> |
290 | 341 |
<input type=hidden name="bo_$i" value=$form->{"bo_$i"}> |
291 | 342 |
|
343 |
<input type=hidden name="pricegroup_old_$i" value=$form->{"pricegroup_old_$i"}> |
|
344 |
<input type=hidden name="price_old_$i" value=$form->{"price_old_$i"}> |
|
345 |
<input type=hidden name="price_new_$i" value=|.$form->format_amount(\%myconfig,$form->{"price_new_$i"}).qq|> |
|
346 |
|
|
292 | 347 |
<input type=hidden name="id_$i" value=$form->{"id_$i"}> |
293 | 348 |
<input type=hidden name="inventory_accno_$i" value=$form->{"inventory_accno_$i"}> |
294 | 349 |
<input type=hidden name="bin_$i" value="$form->{"bin_$i"}"> |
... | ... | |
357 | 412 |
$lxdebug->leave_sub(); |
358 | 413 |
} |
359 | 414 |
|
360 |
sub select_item { |
|
415 |
################################################## |
|
416 |
# build html-code for pricegroups in variable $form->{prices_$j} |
|
417 |
|
|
418 |
sub set_pricegroup { |
|
361 | 419 |
$lxdebug->enter_sub(); |
420 |
print STDERR "io.pl-set_pricegroup-i-$i\n"; |
|
421 |
for $j (1 .. $i) { |
|
422 |
|
|
423 |
my $pricegroup_old = $form->{"pricegroup_old_$i"}; |
|
424 |
if ($form->{PRICES}{ $j }) { |
|
425 |
$len = 0; |
|
426 |
$prices = ''; |
|
427 |
$price = 0; |
|
428 |
foreach $item (@{ $form->{PRICES}{ $j } }) { |
|
429 |
print STDERR "TEST--i--$i--jjj-$j\n"; |
|
430 |
# print STDERR "-VOR PREIS--$item->{price}--PREISGRUOP-$item->{pricegroup_id}\n"; |
|
431 |
$price = $form->round_amount($myconfig, $item->{price},5); |
|
432 |
$price = $form->format_amount($myconfig, $item->{price},2); |
|
433 |
$price = $item->{price}; |
|
434 |
# print STDERR "-NACH PREIS--$price--PREISGRUOP-$item->{pricegroup_id}\n"; |
|
435 |
$pricegroup_id = $item->{pricegroup_id}; |
|
436 |
$pricegroup = $item->{pricegroup}; |
|
437 |
# build dragdrop for pricegroups |
|
438 |
$prices .= |
|
439 |
qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|; |
|
440 |
|
|
441 |
$len += 1; |
|
442 |
# print STDERR "prices---$prices\n"; |
|
443 |
# set new selectedpricegroup_id and prices for "Preis" |
|
444 |
if ($item->{selected}) { |
|
445 |
$form->{"pricegroup_old_$j"} = $pricegroup_id; |
|
446 |
$form->{"price_new_$j"} = $price; |
|
447 |
$form->{"sellprice_$j"} = $price; |
|
448 |
} |
|
449 |
if ($len >= 1) { |
|
450 |
$form->{"prices_$j"} = $prices; |
|
451 |
} |
|
452 |
} |
|
453 |
} |
|
454 |
} |
|
455 |
print (STDERR "", Dumper($form->{PRICES})); |
|
456 |
$lxdebug->leave_sub(); |
|
457 |
} |
|
362 | 458 |
|
459 |
sub select_item { |
|
460 |
$lxdebug->enter_sub(); |
|
461 |
print STDERR "io.pl-select_item\n"; |
|
363 | 462 |
@column_index = qw(ndx partnumber description onhand sellprice); |
364 | 463 |
|
365 | 464 |
$column_data{ndx} = qq|<th> </th>|; |
... | ... | |
411 | 510 |
} |
412 | 511 |
|
413 | 512 |
map { $ref->{$_} =~ s/\"/"/g } qw(partnumber description unit); |
414 |
|
|
513 |
#sk tradediscount |
Auch abrufbar als: Unified diff
Preisgruppenerweiterung auf Basis von Andres Patch - Thanks
Preisgruppenverwaltung
...-Preiseingabe der Preisgruppen in Masken Waren,etc.
-Auswahl der Preisgruppen in den Verkaufsmasken
Erweiterung Datenbankschema