Revision 217d32f3
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
148 | 148 |
|
149 | 149 |
my @arrays = |
150 | 150 |
qw(runningnumber number description longdescription qty ship unit bin |
151 |
deliverydate_oe ordnumber_oe transdate_oe licensenumber validuntil
|
|
151 |
deliverydate_oe ordnumber_oe transdate_oe validuntil |
|
152 | 152 |
partnotes serialnumber reqdate sellprice listprice netprice |
153 | 153 |
discount p_discount discount_sub nodiscount_sub |
154 | 154 |
linetotal nodiscount_linetotal tax_rate projectnumber projectdescription |
... | ... | |
214 | 214 |
push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description}; |
215 | 215 |
push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} }, $form->{"partsgroup_$i"}; |
216 | 216 |
push @{ $form->{TEMPLATE_ARRAYS}->{reqdate} }, $form->{"reqdate_$i"}; |
217 |
|
|
218 |
if ($form->{lizenzen}) { |
|
219 |
if ($form->{"licensenumber_$i"}) { |
|
220 |
$query = qq|SELECT licensenumber, validuntil FROM license WHERE id = ?|; |
|
221 |
my ($licensenumber, $validuntil) = selectrow_query($form, $dbh, $query, conv_i($form->{"licensenumber_$i"})); |
|
222 |
push(@{ $form->{TEMPLATE_ARRAYS}->{licensenumber} }, $licensenumber); |
|
223 |
push(@{ $form->{TEMPLATE_ARRAYS}->{validuntil} }, $locale->date($myconfig, $validuntil, 0)); |
|
224 |
|
|
225 |
} else { |
|
226 |
push(@{ $form->{TEMPLATE_ARRAYS}->{licensenumber} }, ""); |
|
227 |
push(@{ $form->{TEMPLATE_ARRAYS}->{validuntil} }, ""); |
|
228 |
} |
|
229 |
} |
|
230 |
|
|
231 |
# listprice |
|
232 |
push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"}); |
|
217 |
push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"}); |
|
233 | 218 |
|
234 | 219 |
my $sellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"}); |
235 | 220 |
my ($dec) = ($sellprice =~ /\.(\d+)/); |
... | ... | |
740 | 725 |
conv_i($form->{"marge_price_factor_$i"})); |
741 | 726 |
do_query($form, $dbh, $query, @values); |
742 | 727 |
|
743 |
if ($form->{lizenzen} && $form->{"licensenumber_$i"}) { |
|
744 |
$query = |
|
745 |
qq|INSERT INTO licenseinvoice (trans_id, license_id) |
|
746 |
VALUES ((SELECT id FROM invoice WHERE trans_id = ? ORDER BY oid DESC LIMIT 1), ?)|; |
|
747 |
@values = (conv_i($form->{"id"}), conv_i($form->{"licensenumber_$i"})); |
|
748 |
do_query($form, $dbh, $query, @values); |
|
749 |
} |
|
750 |
|
|
751 | 728 |
CVar->save_custom_variables(module => 'IC', |
752 | 729 |
sub_module => 'invoice', |
753 | 730 |
trans_id => $invoice_id, |
... | ... | |
1359 | 1336 |
my @values = (conv_i($form->{id})); |
1360 | 1337 |
do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE trans_id = ?|, @values); |
1361 | 1338 |
do_query($form, $dbh, qq|DELETE FROM invoice WHERE trans_id = ?|, @values); |
1362 |
|
|
1363 |
if ($form->{lizenzen}) { |
|
1364 |
$query = |
|
1365 |
qq|DELETE FROM licenseinvoice |
|
1366 |
WHERE trans_id in (SELECT id FROM invoice WHERE trans_id = ?)|; |
|
1367 |
do_query($form, $dbh, $query, @values); |
|
1368 |
} |
|
1369 |
|
|
1370 | 1339 |
do_query($form, $dbh, qq|DELETE FROM shipto WHERE (trans_id = ?) AND (module = 'AR')|, @values); |
1371 | 1340 |
|
1372 | 1341 |
$main::lxdebug->leave_sub(); |
... | ... | |
1583 | 1552 |
|
1584 | 1553 |
} |
1585 | 1554 |
|
1586 |
if ($form->{lizenzen}) { |
|
1587 |
$query = qq|SELECT l.licensenumber, l.id AS licenseid FROM license l, licenseinvoice li WHERE l.id = li.license_id AND li.trans_id = ?|; |
|
1588 |
my ($licensenumber, $licenseid) = selectrow_query($form, $dbh, $query, conv_i($ref->{invoice_pos})); |
|
1589 |
$ref->{lizenzen} = "<option value=\"$licenseid\">$licensenumber</option>"; |
|
1590 |
} |
|
1591 |
|
|
1592 | 1555 |
$ref->{qty} *= -1 if $form->{type} eq "credit_note"; |
1593 | 1556 |
|
1594 | 1557 |
chop $ref->{taxaccounts}; |
... | ... | |
1943 | 1906 |
$ref->{onhand} *= 1; |
1944 | 1907 |
|
1945 | 1908 |
push @{ $form->{item_list} }, $ref; |
1946 |
|
|
1947 |
if ($form->{lizenzen}) { |
|
1948 |
if ($ref->{inventory_accno} > 0) { |
|
1949 |
$query = |
|
1950 |
qq|SELECT l.* |
|
1951 |
FROM license l |
|
1952 |
WHERE l.parts_id = ? AND NOT l.id IN (SELECT li.license_id FROM licenseinvoice li)|; |
|
1953 |
my $stw = prepare_execute_query($form, $dbh, $query, conv_i($ref->{id})); |
|
1954 |
while (my $ptr = $stw->fetchrow_hashref('NAME_lc')) { |
|
1955 |
push @{ $form->{LIZENZEN}{ $ref->{id} } }, $ptr; |
|
1956 |
} |
|
1957 |
$stw->finish; |
|
1958 |
} |
|
1959 |
} |
|
1960 | 1909 |
} |
1961 | 1910 |
$sth->finish; |
1962 | 1911 |
$_->[1]->finish for @translation_queries; |
Auch abrufbar als: Unified diff
Feature "Lizenzen" entfernt
Hat grob gesehen niemand benutzt, es funktionierte nicht, und wurde
seit gefühlten 20 Jahren nicht weiter entwickelt.