Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b36f0864

Von Peter Schulgin vor fast 8 Jahren hinzugefügt

  • ID b36f0864f0304deb66f4215c52b68351f90b2309
  • Vorgänger 57d4d221
  • Nachfolger c364e43e

Revert "Artikel-Klassifizierung: Neue Option "Preis separat ausweisen""

This reverts commit 815c3639a21ed53b288fd8bbb231e741c8e67ce5.

Unterschiede anzeigen:

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

  
28 22
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' },
16 15
  used_for_purchase => { type => 'boolean', default => 'true' },
17 16
  used_for_sale     => { type => 'boolean', default => 'true' },
18 17
);
SL/IC.pm
1758 1758
    my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type);
1759 1759
    push @{ $template_arrays{part_type} }, $type_abbr;
1760 1760
    push @{ $template_arrays{type_and_classific}},  $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id);
1761
    push @{ $template_arrays{separate}  },  $::request->presenter->separate_abbreviation($prt->classification_id);
1762 1761
  }
1763 1762

  
1764 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);
153 152

  
154 153
  my $ic_cvar_configs = CVar->get_configs(module => 'IC');
155 154
  my $project_cvar_configs = CVar->get_configs(module => 'Projects');
......
333 332
      push @{ $form->{TEMPLATE_ARRAYS}->{discount_nofmt} }, ($discount != 0) ? $discount * -1 : '';
334 333
      push @{ $form->{TEMPLATE_ARRAYS}->{p_discount} },     $form->{"discount_$i"};
335 334

  
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

  
347 335
      $form->{total}            += $linetotal;
348 336
      $form->{nodiscount_total} += $nodiscount_linetotal;
349 337
      $form->{discount_total}   += $discount;
......
551 539
  $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
552 540

  
553 541
  $form->{username} = $myconfig->{name};
554
  $form->{$_} = $form->format_amount($myconfig, $form->{$_}, 2) for @separate_totals;
555 542

  
556 543
  $main::lxdebug->leave_sub();
557 544
}
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);
1335 1334

  
1336 1335
  $form->{TEMPLATE_ARRAYS} = { };
1337 1336

  
......
1438 1437
      push @{ $form->{TEMPLATE_ARRAYS}->{discount_nofmt} }, ($discount != 0) ? $discount * -1 : '';
1439 1438
      push @{ $form->{TEMPLATE_ARRAYS}->{p_discount} },     $form->{"discount_$i"};
1440 1439

  
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

  
1452 1440
      $form->{ordtotal}         += $linetotal;
1453 1441
      $form->{nodiscount_total} += $nodiscount_linetotal;
1454 1442
      $form->{discount_total}   += $discount;
......
1622 1610
  $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
1623 1611

  
1624 1612
  $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;
1626 1613

  
1627 1614
  $main::lxdebug->leave_sub();
1628 1615
}
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 separate_abbreviation);
9
our @EXPORT = qw(part_picker part select_classification classification_abbreviation type_abbreviation type_and_classification);
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

  
88 83
sub select_classification {
89 84
  my ($self, $name, %attributes) = @_;
90 85
  $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

  
52 40
kleinere neue Features und Detailverbesserungen:
53 41

  
54 42
  - SEPA Überweisungen zusätzlich Kunden- oder Lieferantennummer im Verwendungszweck vorbelegen
locale/de/all
2357 2357
  'Report and misc. Preferences' => 'Sonstige Einstellungen',
2358 2358
  'Report date'                 => 'Berichtsdatum',
2359 2359
  'Report for'                  => 'Bericht für',
2360
  'Report seperately'           => 'Preis separat ausweisen',
2361 2360
  'Reports'                     => 'Berichte',
2362 2361
  'Representative'              => 'Vertreter',
2363 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>
29 25
  </table>
30 26

  
31 27
  <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>
22 21
    </tr>
23 22
    </thead>
24 23

  
......
34 33
     <td>[%- HTML.escape(LxERP.t8(parts_classification.abbreviation)) %]</td>
35 34
     <td>[% IF parts_classification.used_for_purchase %][% LxERP.t8('Yes') %][% ELSE %][%  LxERP.t8('No') %][% END %]</td>
36 35
     <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>
38 36
    </tr>
39 37
    [%- END %]
40 38
    </tbody>

Auch abrufbar als: Unified diff