Revision 815c3639
Von Martin Helmling mh@waldpark.octosoft.eu vor etwa 8 Jahren hinzugefügt
SL/DB/Manager/PartsClassification.pm | ||
---|---|---|
19 | 19 |
return $obj->abbreviation?$obj->abbreviation:undef; |
20 | 20 |
} |
21 | 21 |
|
22 |
sub get_separate_abbreviation { |
|
23 |
my ($class,$id) = @_; |
|
24 |
my $obj = $class->get_first(query => [ id => $id ]); |
|
25 |
return $obj->report_separate?$obj->abbreviation:''; |
|
26 |
} |
|
27 |
|
|
22 | 28 |
1; |
SL/DB/MetaSetup/PartsClassification.pm | ||
---|---|---|
12 | 12 |
abbreviation => { type => 'text' }, |
13 | 13 |
description => { type => 'text' }, |
14 | 14 |
id => { type => 'serial', not_null => 1 }, |
15 |
report_separate => { type => 'boolean', default => 'false' }, |
|
15 | 16 |
used_for_purchase => { type => 'boolean', default => 'true' }, |
16 | 17 |
used_for_sale => { type => 'boolean', default => 'true' }, |
17 | 18 |
); |
SL/IC.pm | ||
---|---|---|
1757 | 1757 |
my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type); |
1758 | 1758 |
push @{ $template_arrays{part_type} }, $type_abbr; |
1759 | 1759 |
push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id); |
1760 |
push @{ $template_arrays{separate} }, $::request->presenter->separate_abbreviation($prt->classification_id); |
|
1760 | 1761 |
} |
1761 | 1762 |
|
1762 | 1763 |
$main::lxdebug->leave_sub(); |
SL/IS.pm | ||
---|---|---|
149 | 149 |
# so that they can be sorted in later |
150 | 150 |
my %prepared_template_arrays = IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); |
151 | 151 |
my @prepared_arrays = keys %prepared_template_arrays; |
152 |
my @separate_totals = qw(non_separate_subtotal); |
|
152 | 153 |
|
153 | 154 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC'); |
154 | 155 |
my $project_cvar_configs = CVar->get_configs(module => 'Projects'); |
... | ... | |
332 | 333 |
push @{ $form->{TEMPLATE_ARRAYS}->{discount_nofmt} }, ($discount != 0) ? $discount * -1 : ''; |
333 | 334 |
push @{ $form->{TEMPLATE_ARRAYS}->{p_discount} }, $form->{"discount_$i"}; |
334 | 335 |
|
336 |
if ( $prepared_template_arrays{separate}[$i - 1] ) { |
|
337 |
my $pabbr = $prepared_template_arrays{separate}[$i - 1]; |
|
338 |
if ( ! $form->{"separate_${pabbr}_subtotal"} ) { |
|
339 |
push @separate_totals , "separate_${pabbr}_subtotal"; |
|
340 |
$form->{"separate_${pabbr}_subtotal"} = 0; |
|
341 |
} |
|
342 |
$form->{"separate_${pabbr}_subtotal"} += $linetotal; |
|
343 |
} else { |
|
344 |
$form->{non_separate_subtotal} += $linetotal; |
|
345 |
} |
|
346 |
|
|
335 | 347 |
$form->{total} += $linetotal; |
336 | 348 |
$form->{nodiscount_total} += $nodiscount_linetotal; |
337 | 349 |
$form->{discount_total} += $discount; |
... | ... | |
539 | 551 |
$form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; |
540 | 552 |
|
541 | 553 |
$form->{username} = $myconfig->{name}; |
554 |
$form->{$_} = $form->format_amount($myconfig, $form->{$_}, 2) for @separate_totals; |
|
542 | 555 |
|
543 | 556 |
$main::lxdebug->leave_sub(); |
544 | 557 |
} |
SL/OE.pm | ||
---|---|---|
1331 | 1331 |
# so that they can be sorted in later |
1332 | 1332 |
my %prepared_template_arrays = IC->prepare_parts_for_printing(myconfig => $myconfig, form => $form); |
1333 | 1333 |
my @prepared_arrays = keys %prepared_template_arrays; |
1334 |
my @separate_totals = qw(non_separate_subtotal); |
|
1334 | 1335 |
|
1335 | 1336 |
$form->{TEMPLATE_ARRAYS} = { }; |
1336 | 1337 |
|
... | ... | |
1437 | 1438 |
push @{ $form->{TEMPLATE_ARRAYS}->{discount_nofmt} }, ($discount != 0) ? $discount * -1 : ''; |
1438 | 1439 |
push @{ $form->{TEMPLATE_ARRAYS}->{p_discount} }, $form->{"discount_$i"}; |
1439 | 1440 |
|
1441 |
if ( $prepared_template_arrays{separate}[$i - 1] ) { |
|
1442 |
my $pabbr = $prepared_template_arrays{separate}[$i - 1]; |
|
1443 |
if ( ! $form->{"separate_${pabbr}_subtotal"} ) { |
|
1444 |
push @separate_totals , "separate_${pabbr}_subtotal"; |
|
1445 |
$form->{"separate_${pabbr}_subtotal"} = 0; |
|
1446 |
} |
|
1447 |
$form->{"separate_${pabbr}_subtotal"} += $linetotal; |
|
1448 |
} else { |
|
1449 |
$form->{non_separate_subtotal} += $linetotal; |
|
1450 |
} |
|
1451 |
|
|
1440 | 1452 |
$form->{ordtotal} += $linetotal; |
1441 | 1453 |
$form->{nodiscount_total} += $nodiscount_linetotal; |
1442 | 1454 |
$form->{discount_total} += $discount; |
... | ... | |
1610 | 1622 |
$form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; |
1611 | 1623 |
|
1612 | 1624 |
$form->{order} = SL::DB::Manager::Order->find_by(id => $form->{id}) if $form->{id}; |
1625 |
$form->{$_} = $form->format_amount($myconfig, $form->{$_}, 2) for @separate_totals; |
|
1613 | 1626 |
|
1614 | 1627 |
$main::lxdebug->leave_sub(); |
1615 | 1628 |
} |
SL/Presenter/Part.pm | ||
---|---|---|
6 | 6 |
use SL::DB::Manager::PartsClassification; |
7 | 7 |
|
8 | 8 |
use Exporter qw(import); |
9 |
our @EXPORT = qw(part_picker part select_classification classification_abbreviation type_abbreviation type_and_classification);
|
|
9 |
our @EXPORT = qw(part_picker part select_classification classification_abbreviation type_abbreviation separate_abbreviation);
|
|
10 | 10 |
|
11 | 11 |
use Carp; |
12 | 12 |
|
... | ... | |
80 | 80 |
return $::locale->text(SL::DB::Manager::PartsClassification->get_abbreviation($id)); |
81 | 81 |
} |
82 | 82 |
|
83 |
sub separate_abbreviation { |
|
84 |
my ($self, $id) = @_; |
|
85 |
return $::locale->text(SL::DB::Manager::PartsClassification->get_separate_abbreviation($id)); |
|
86 |
} |
|
87 |
|
|
83 | 88 |
sub select_classification { |
84 | 89 |
my ($self, $name, %attributes) = @_; |
85 | 90 |
$attributes{value_key} = 'id'; |
doc/changelog | ||
---|---|---|
37 | 37 |
nun wird alternativ zur 'type'-Spalte die 'pclass'-Spalte mit zwei Buchstaben geparsed und entsprechend |
38 | 38 |
classification_id,assembly sowie inventory_accno_id gesetzt (oder type_id falls neue Implementierung eingebaut). |
39 | 39 |
|
40 |
- Option "Preis separat ausweisen" als neue Artikel-Klassifizierung |
|
41 |
|
|
42 |
- neuer boolcher Wert in parts_classification "report_separate" |
|
43 |
- editierbar unter Artikelklassifikation |
|
44 |
- In Aufträgen und Rechnungen werden die Zwischensummen LaTeX zur Verfügung gestellt. |
|
45 |
- <%partsclass_XXX_subtotal%> wobei XXX die Abkürzung der Klassifikation ist. |
|
46 |
- <%merchandise_value_subtotal%> der Rest der Positionen. |
|
47 |
|
|
48 |
Hintergrund: |
|
49 |
Preise von Artikeln wie "Verpackung" oder "Transport" müssen |
|
50 |
oftmals separat ausgewiesen werden, genau so wie der reine Warenwert. |
|
51 |
|
|
40 | 52 |
kleinere neue Features und Detailverbesserungen: |
41 | 53 |
|
42 | 54 |
- SEPA Überweisungen zusätzlich Kunden- oder Lieferantennummer im Verwendungszweck vorbelegen |
locale/de/all | ||
---|---|---|
2356 | 2356 |
'Report and misc. Preferences' => 'Sonstige Einstellungen', |
2357 | 2357 |
'Report date' => 'Berichtsdatum', |
2358 | 2358 |
'Report for' => 'Bericht für', |
2359 |
'Report seperately' => 'Preis separat ausweisen', |
|
2359 | 2360 |
'Reports' => 'Berichte', |
2360 | 2361 |
'Representative' => 'Vertreter', |
2361 | 2362 |
'Representative for Customer' => 'Vertreter für Kunden', |
sql/Pg-upgrade2/partsclassification_report_separate.sql | ||
---|---|---|
1 |
-- @tag: partsclassification_report_seperate |
|
2 |
-- @description: "Artikelklassifikation mit weiterer boolschen Variable für seperat ausweisen" |
|
3 |
-- @depends: parts_classifications |
|
4 |
ALTER TABLE parts_classifications ADD COLUMN report_separate BOOLEAN DEFAULT 'f'; |
templates/webpages/parts_classification/form.html | ||
---|---|---|
22 | 22 |
<td>[% LxERP.t8('Used for Sale') %]</td> |
23 | 23 |
<td>[% L.checkbox_tag("parts_classification.used_for_sale", checked=(SELF.parts_classification.used_for_sale ? 1:'')) %]</td> |
24 | 24 |
</tr> |
25 |
<tr> |
|
26 |
<td>[% LxERP.t8('Report seperately') %]</td> |
|
27 |
<td>[% L.checkbox_tag("parts_classification.report_separate", checked=(SELF.parts_classification.report_separate ? 1:'')) %]</td> |
|
28 |
</tr> |
|
25 | 29 |
</table> |
26 | 30 |
|
27 | 31 |
<p> |
templates/webpages/parts_classification/list.html | ||
---|---|---|
18 | 18 |
<th>[%- LxERP.t8('TypeAbbreviation') %]</th> |
19 | 19 |
<th>[%- LxERP.t8('Used for Purchase') %]</th> |
20 | 20 |
<th>[%- LxERP.t8('Used for Sale') %]</th> |
21 |
<th>[%- LxERP.t8('Report seperately') %]</th> |
|
21 | 22 |
</tr> |
22 | 23 |
</thead> |
23 | 24 |
|
... | ... | |
33 | 34 |
<td>[%- HTML.escape(LxERP.t8(parts_classification.abbreviation)) %]</td> |
34 | 35 |
<td>[% IF parts_classification.used_for_purchase %][% LxERP.t8('Yes') %][% ELSE %][% LxERP.t8('No') %][% END %]</td> |
35 | 36 |
<td>[% IF parts_classification.used_for_sale %][% LxERP.t8('Yes') %][% ELSE %][% LxERP.t8('No') %][% END %]</td> |
37 |
<td>[% IF parts_classification.report_separate %][% LxERP.t8('Yes') %][% ELSE %][% LxERP.t8('No') %][% END %]</td> |
|
36 | 38 |
</tr> |
37 | 39 |
[%- END %] |
38 | 40 |
</tbody> |
Auch abrufbar als: Unified diff
Artikel-Klassifizierung: Neue Option "Preis separat ausweisen"
- neuer boolcher Wert in der Tabelle parts_classification: "report_separate"
- editierbar unter Artikelklassifikation
- In Aufträgen und Rechnungen werden die Zwischensummen LaTeX zur Verfügung gestellt.
- <%separate_XXX_subtotal%> wobei XXX die Abkürzung der Klassifikation ist.
- <%non_separate_subtotal%> der Rest der Positionen, z.B. reiner Warenwert.
Hintergrund:
Preise von Artikeln wie "Verpackung" oder "Transport" müssen
oftmals separat ausgewiesen werden, genau so wie der reine Warenwert.