Revision 0e0ff150
Von Jan Büren vor fast 14 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
1358 | 1358 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); |
1359 | 1359 |
|
1360 | 1360 |
my %accnos; |
1361 |
map { ($accnos{$_}) = split(m/--/, $form->{$_}) } qw(inventory_accno income_accno expense_accno fxgain_accno fxloss_accno); |
|
1361 |
map { ($accnos{$_}) = split(m/--/, $form->{$_}) } qw(inventory_accno income_accno expense_accno fxgain_accno fxloss_accno ar_paid_accno);
|
|
1362 | 1362 |
|
1363 | 1363 |
$form->{curr} =~ s/ //g; |
1364 | 1364 |
my @currencies = grep { $_ ne '' } split m/:/, $form->{curr}; |
... | ... | |
1373 | 1373 |
expense_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), |
1374 | 1374 |
fxgain_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), |
1375 | 1375 |
fxloss_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), |
1376 |
ar_paid_accno_id = (SELECT c.id FROM chart c WHERE c.accno = ?), |
|
1376 | 1377 |
invnumber = ?, |
1377 | 1378 |
cnnumber = ?, |
1378 | 1379 |
sonumber = ?, |
... | ... | |
1385 | 1386 |
servicenumber = ?, |
1386 | 1387 |
sdonumber = ?, |
1387 | 1388 |
pdonumber = ?, |
1388 |
yearend = ?, |
|
1389 | 1389 |
curr = ?, |
1390 | 1390 |
businessnumber = ?, |
1391 | 1391 |
weightunit = ?|; |
1392 | 1392 |
my @values = ($accnos{inventory_accno}, $accnos{income_accno}, $accnos{expense_accno}, |
1393 |
$accnos{fxgain_accno}, $accnos{fxloss_accno}, |
|
1393 |
$accnos{fxgain_accno}, $accnos{fxloss_accno}, $accnos{ar_paid_accno},
|
|
1394 | 1394 |
$form->{invnumber}, $form->{cnnumber}, |
1395 | 1395 |
$form->{sonumber}, $form->{ponumber}, |
1396 | 1396 |
$form->{sqnumber}, $form->{rfqnumber}, |
1397 | 1397 |
$form->{customernumber}, $form->{vendornumber}, |
1398 | 1398 |
$form->{articlenumber}, $form->{servicenumber}, |
1399 | 1399 |
$form->{sdonumber}, $form->{pdonumber}, |
1400 |
$form->{yearend}, $currency,
|
|
1400 |
$currency, |
|
1401 | 1401 |
$form->{businessnumber}, $form->{weightunit}); |
1402 | 1402 |
do_query($form, $dbh, $query, @values); |
1403 | 1403 |
|
... | ... | |
1492 | 1492 |
$form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id}; |
1493 | 1493 |
$form->{defaults}{FX_gain} = $form->{defaults}{fxgain_accno_id}; |
1494 | 1494 |
$form->{defaults}{FX_loss} = $form->{defaults}{fxloss_accno_id}; |
1495 |
$form->{defaults}{AR_paid} = $form->{defaults}{ar_paid_accno_id}; |
|
1495 | 1496 |
|
1496 | 1497 |
$form->{defaults}{weightunit} ||= 'kg'; |
1497 | 1498 |
|
... | ... | |
1571 | 1572 |
if $ref->{taxnumber}; |
1572 | 1573 |
$form->{taxrates}{ $ref->{accno} }{rate} = $ref->{rate} if $ref->{rate}; |
1573 | 1574 |
} |
1575 |
# Abfrage für Standard Umlaufvermögenskonto |
|
1576 |
$query = |
|
1577 |
qq|SELECT id, accno, description, link | . |
|
1578 |
qq|FROM chart | . |
|
1579 |
qq|WHERE link LIKE ? |. |
|
1580 |
qq|ORDER BY accno|; |
|
1581 |
$sth = prepare_execute_query($form, $dbh, $query, '%AR%'); |
|
1582 |
$sth->execute || $form->dberror($query);# |
|
1583 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
|
1584 |
foreach my $item (split(/:/, $ref->{link})) { |
|
1585 |
if ($item eq "AR_paid") { |
|
1586 |
%{ $form->{IC}{AR_paid}{ $ref->{accno} } } = ( |
|
1587 |
id => $ref->{id}, |
|
1588 |
description => $ref->{description} |
|
1589 |
); |
|
1590 |
} |
|
1591 |
} |
|
1592 |
} |
|
1574 | 1593 |
|
1575 | 1594 |
$sth->finish; |
1576 | 1595 |
$dbh->disconnect; |
SL/IS.pm | ||
---|---|---|
2159 | 2159 |
return $result; |
2160 | 2160 |
} |
2161 | 2161 |
|
2162 |
sub get_standard_accno_current_assets { |
|
2163 |
$main::lxdebug->enter_sub(); |
|
2164 |
|
|
2165 |
my ($self, $myconfig, $form) = @_; |
|
2166 |
|
|
2167 |
my $dbh = $form->dbconnect($myconfig); |
|
2168 |
|
|
2169 |
my $query = qq| SELECT accno FROM chart WHERE id = (SELECT ar_paid_accno_id FROM defaults)|; |
|
2170 |
my ($result) = selectrow_query($form, $dbh, $query); |
|
2171 |
|
|
2172 |
$dbh->disconnect(); |
|
2173 |
|
|
2174 |
$main::lxdebug->leave_sub(); |
|
2175 |
|
|
2176 |
return $result; |
|
2177 |
} |
|
2178 |
|
|
2162 | 2179 |
1; |
bin/mozilla/cp.pl | ||
---|---|---|
78 | 78 |
|
79 | 79 |
CP->paymentaccounts(\%myconfig, \%$form); |
80 | 80 |
|
81 |
# Standard Konto für Umlaufvermögen |
|
82 |
my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form); |
|
83 |
|
|
81 | 84 |
$form->{selectaccount} = ""; |
82 | 85 |
$form->{"select$form->{ARAP}"} = ""; |
83 | 86 |
|
84 |
map { $form->{selectaccount} .= "<option>$_->{accno}--$_->{description}\n" } |
|
85 |
@{ $form->{PR}{"$form->{ARAP}_paid"} }; |
|
86 |
map { |
|
87 |
$form->{"select$form->{ARAP}"} .= |
|
88 |
"<option>$_->{accno}--$_->{description}\n" |
|
89 |
} @{ $form->{PR}{ $form->{ARAP} } }; |
|
87 |
map { $form->{selectaccount} .= "<option>$_->{accno}--$_->{description}\n"; |
|
88 |
$form->{account} = "$_->{accno}--$_->{description}" if ($_->{accno} eq $accno_arap) } @{ $form->{PR}{"$form->{ARAP}_paid"} }; |
|
89 |
|
|
90 |
# Braucht man das hier überhaupt? Erstmal auskommentieren .. jan 18.12.2010 |
|
91 |
# map { |
|
92 |
# $form->{"select$form->{ARAP}"} .= |
|
93 |
# "<option>$_->{accno}--$_->{description}\n" |
|
94 |
# } @{ $form->{PR}{ $form->{ARAP} } }; |
|
95 |
# ENDE LOESCHMICH in 2012 |
|
90 | 96 |
|
91 | 97 |
# currencies |
92 | 98 |
# oldcurrency ist zwar noch hier als fragment enthalten, wird aber bei |
bin/mozilla/ir.pl | ||
---|---|---|
171 | 171 |
foreach my $key (keys %{ $form->{AP_links} }) { |
172 | 172 |
|
173 | 173 |
foreach my $ref (@{ $form->{AP_links}{$key} }) { |
174 |
$form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
|
|
174 |
$form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}</option>";
|
|
175 | 175 |
} |
176 | 176 |
|
177 | 177 |
next unless $form->{acc_trans}{$key}; |
... | ... | |
393 | 393 |
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"}); |
394 | 394 |
$form->{paid_indices} = [ 1 .. $form->{paidaccounts} ]; |
395 | 395 |
|
396 |
# Standard Konto für Umlaufvermögen |
|
397 |
my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form); |
|
398 |
|
|
396 | 399 |
for my $i (1 .. $form->{paidaccounts}) { |
397 | 400 |
$form->{"selectAP_paid_$i"} = $form->{selectAP_paid}; |
398 |
$form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/; |
|
401 |
if (!$form->{"AP_paid_$i"}) { |
|
402 |
$form->{"selectAP_paid_$i"} =~ s/option>$accno_arap--(.*?)>/option selected>$accno_arap--$1>/; |
|
403 |
} else { |
|
404 |
$form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/; |
|
405 |
} |
|
406 |
|
|
399 | 407 |
$totalpaid += $form->{"paid_$i"}; |
400 | 408 |
} |
401 | 409 |
|
sql/Pg-upgrade2/add_ar_paid_defaults.sql | ||
---|---|---|
1 |
-- @tag: add_ar_paid_defaults |
|
2 |
-- @description: Standardkonto für ar_paid (Umlaufvermögenskonto == Bank) in der Tabelle defaults hinzugefügt |
|
3 |
-- @depends: release_2_6_1 |
|
4 |
-- @charset: utf-8 |
|
5 |
ALTER TABLE defaults ADD COLUMN ar_paid_accno_id integer; |
templates/webpages/am/edit_defaults.html | ||
---|---|---|
116 | 116 |
</select> |
117 | 117 |
</td> |
118 | 118 |
</tr> |
119 |
<tr> |
|
120 |
<th align="right" nowrap>[% 'Current assets account' | $T8 %]</th> |
|
121 |
<td colspan="3"> |
|
122 |
<select name="ar_paid_accno"> |
|
123 |
[%- FOREACH row = ACCNOS_AR_PAID %] |
|
124 |
<option value="[% HTML.escape(row.value) %]"[% IF row.selected %] selected[% END %]>[% HTML.escape(row.name) %]</option> |
|
125 |
[%- END %] |
|
126 |
</select> |
|
127 |
</td> |
|
128 |
</tr> |
|
119 | 129 |
|
120 | 130 |
<tr class="listheading"> |
121 | 131 |
<th colspan="4">[% 'Miscellaneous' | $T8 %]</th> |
Auch abrufbar als: Unified diff
Standard-Auswahl für Umlaufvermögenskonto (Bank) mandantenweit setzen. Ferner yearend aus AM.pm entfernt und schliessende </options> für selectAP_paid Array hinzugefügt