Revision c14aab2d
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
1474 | 1474 |
pdonumber = ?, |
1475 | 1475 |
yearend = ?, |
1476 | 1476 |
curr = ?, |
1477 |
businessnumber = ?|; |
|
1477 |
businessnumber = ?, |
|
1478 |
weightunit = ?|; |
|
1478 | 1479 |
my @values = ($accnos{inventory_accno}, $accnos{income_accno}, $accnos{expense_accno}, |
1479 | 1480 |
$accnos{fxgain_accno}, $accnos{fxloss_accno}, |
1480 | 1481 |
$form->{invnumber}, $form->{cnnumber}, |
... | ... | |
1484 | 1485 |
$form->{articlenumber}, $form->{servicenumber}, |
1485 | 1486 |
$form->{sdonumber}, $form->{pdonumber}, |
1486 | 1487 |
$form->{yearend}, $currency, |
1487 |
$form->{businessnumber}); |
|
1488 |
$form->{businessnumber}, $form->{weightunit});
|
|
1488 | 1489 |
do_query($form, $dbh, $query, @values); |
1489 | 1490 |
|
1490 | 1491 |
$dbh->commit(); |
... | ... | |
1574 | 1575 |
return $rc; |
1575 | 1576 |
} |
1576 | 1577 |
|
1578 |
sub get_defaults { |
|
1579 |
$main::lxdebug->enter_sub(); |
|
1580 |
|
|
1581 |
my $self = shift; |
|
1582 |
my %params = @_; |
|
1583 |
|
|
1584 |
my $myconfig = \%main::myconfig; |
|
1585 |
my $form = $main::form; |
|
1586 |
|
|
1587 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); |
|
1588 |
|
|
1589 |
my $defaults = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM defaults|) || {}; |
|
1590 |
|
|
1591 |
$defaults->{weightunit} ||= 'kg'; |
|
1592 |
|
|
1593 |
$main::lxdebug->leave_sub(); |
|
1594 |
|
|
1595 |
return $defaults; |
|
1596 |
} |
|
1597 |
|
|
1577 | 1598 |
sub defaultaccounts { |
1578 | 1599 |
$main::lxdebug->enter_sub(); |
1579 | 1600 |
|
... | ... | |
1587 | 1608 |
my $sth = $dbh->prepare($query); |
1588 | 1609 |
$sth->execute || $form->dberror($query); |
1589 | 1610 |
|
1590 |
$form->{defaults} = $sth->fetchrow_hashref(NAME_lc); |
|
1591 |
$form->{defaults}{IC} = $form->{defaults}{inventory_accno_id}; |
|
1592 |
$form->{defaults}{IC_income} = $form->{defaults}{income_accno_id}; |
|
1593 |
$form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id}; |
|
1594 |
$form->{defaults}{FX_gain} = $form->{defaults}{fxgain_accno_id}; |
|
1595 |
$form->{defaults}{FX_loss} = $form->{defaults}{fxloss_accno_id}; |
|
1611 |
$form->{defaults} = $sth->fetchrow_hashref(NAME_lc); |
|
1612 |
$form->{defaults}{IC} = $form->{defaults}{inventory_accno_id}; |
|
1613 |
$form->{defaults}{IC_income} = $form->{defaults}{income_accno_id}; |
|
1614 |
$form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id}; |
|
1615 |
$form->{defaults}{FX_gain} = $form->{defaults}{fxgain_accno_id}; |
|
1616 |
$form->{defaults}{FX_loss} = $form->{defaults}{fxloss_accno_id}; |
|
1617 |
|
|
1618 |
$form->{defaults}{weightunit} ||= 'kg'; |
|
1596 | 1619 |
|
1597 | 1620 |
$sth->finish; |
1598 | 1621 |
|
bin/mozilla/ic.pl | ||
---|---|---|
34 | 34 |
use POSIX qw(strftime); |
35 | 35 |
use List::Util qw(max); |
36 | 36 |
|
37 |
use SL::AM; |
|
37 | 38 |
use SL::IC; |
38 | 39 |
use SL::ReportGenerator; |
39 | 40 |
|
... | ... | |
1191 | 1192 |
my $idx = 0; |
1192 | 1193 |
my $same_item = $form->{parts}[0]{ $form->{sort} } if (scalar @{ $form->{parts} }); |
1193 | 1194 |
|
1195 |
my $defaults = AM->get_defaults(); |
|
1196 |
|
|
1194 | 1197 |
# postprocess parts |
1195 | 1198 |
foreach my $ref (@{ $form->{parts} }) { |
1196 | 1199 |
|
... | ... | |
1223 | 1226 |
|
1224 | 1227 |
map { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal); |
1225 | 1228 |
|
1229 |
$row->{weight}->{data} .= ' ' . $defaults->{weightunit}; |
|
1230 |
|
|
1226 | 1231 |
if (!$ref->{assemblyitem}) { |
1227 | 1232 |
foreach my $col (@subtotal_columns) { |
1228 | 1233 |
$totals{$col} += $onhand * $ref->{$col}; |
... | ... | |
1460 | 1465 |
|
1461 | 1466 |
$form->get_lists('price_factors' => 'ALL_PRICE_FACTORS', |
1462 | 1467 |
'partsgroup' => 'all_partsgroup', |
1463 |
'vendors' => 'ALL_VENDORS',);
|
|
1468 |
'vendors' => 'ALL_VENDORS',);
|
|
1464 | 1469 |
|
1465 | 1470 |
|
1466 | 1471 |
IC->retrieve_buchungsgruppen(\%myconfig, $form); |
... | ... | |
1472 | 1477 |
$units = AM->retrieve_units(\%myconfig, $form); |
1473 | 1478 |
$form->{ALL_UNITS} = [ map +{ name => $_ }, sort { $units->{$a}{sortkey} <=> $units->{$b}{sortkey} } keys %$units ]; |
1474 | 1479 |
|
1480 |
$form->{defaults} = AM->get_defaults(); |
|
1481 |
|
|
1475 | 1482 |
$form->{fokus} = "ic.partnumber"; |
1476 | 1483 |
|
1477 | 1484 |
$form->header; |
locale/de/all | ||
---|---|---|
1706 | 1706 |
'Warnings during template upgrade' => 'Warnungen bei Aktualisierung der Dokumentenvorlagen', |
1707 | 1707 |
'WebDAV link' => 'WebDAV-Link', |
1708 | 1708 |
'Weight' => 'Gewicht', |
1709 |
'Weight unit' => 'Gewichtseinheit', |
|
1709 | 1710 |
'What type of item is this?' => 'Was ist dieser Artikel?', |
1710 | 1711 |
'What\'s the <b>term</b> you\'re looking for?' => 'Nach welchem <b>Begriff</b> wollen Sie suchen?', |
1711 | 1712 |
'With Extension Of Time' => 'mit Dauerfristverl?ngerung', |
templates/webpages/am/edit_defaults_de.html | ||
---|---|---|
135 | 135 |
<td colspan="3"><input name="curr" size="20" value="[% HTML.escape(defaults_curr) %]"></td> |
136 | 136 |
</tr> |
137 | 137 |
|
138 |
<tr> |
|
139 |
<th align="right">Gewichtseinheit</th> |
|
140 |
<td colspan="3"><input name="weightunit" size="20" maxlength="5" value="[% HTML.escape(defaults_weightunit) %]"></td> |
|
141 |
</tr> |
|
142 |
|
|
138 | 143 |
</table> |
139 | 144 |
</p> |
140 | 145 |
|
templates/webpages/am/edit_defaults_master.html | ||
---|---|---|
135 | 135 |
<td colspan="3"><input name="curr" size="20" value="[% HTML.escape(defaults_curr) %]"></td> |
136 | 136 |
</tr> |
137 | 137 |
|
138 |
<tr> |
|
139 |
<th align="right"><translate>Weight unit</translate></th> |
|
140 |
<td colspan="3"><input name="weightunit" size="20" maxlength="5" value="[% HTML.escape(defaults_weightunit) %]"></td> |
|
141 |
</tr> |
|
142 |
|
|
138 | 143 |
</table> |
139 | 144 |
</p> |
140 | 145 |
|
templates/webpages/ic/form_header_de.html | ||
---|---|---|
208 | 208 |
<td> |
209 | 209 |
[%- IF is_assembly %] [% LxERP.format_amount(weight) %][%- END %] |
210 | 210 |
<input[% IF is_assembly %] type="hidden"[% END %] size="10" name="weight" value="[% LxERP.format_amount(weight) %]"> |
211 |
[% HTML.escape(defaults.weightunit) %] |
|
211 | 212 |
</td> |
212 | 213 |
</tr> |
213 | 214 |
[%- END %] |
templates/webpages/ic/form_header_master.html | ||
---|---|---|
208 | 208 |
<td> |
209 | 209 |
[%- IF is_assembly %] [% LxERP.format_amount(weight) %][%- END %] |
210 | 210 |
<input[% IF is_assembly %] type="hidden"[% END %] size="10" name="weight" value="[% LxERP.format_amount(weight) %]"> |
211 |
[% HTML.escape(defaults.weightunit) %] |
|
211 | 212 |
</td> |
212 | 213 |
</tr> |
213 | 214 |
[%- END %] |
Auch abrufbar als: Unified diff
Das Feld "Gewichtseinheit" in den Einstellungen wieder eingeführt und in den Warenstammdaten- und -berichtsmasken angezeigt.
Fix für Bug 963.