Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f49ad7f1

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID f49ad7f1f479daf79dd78d3ff0e0894c1e6c311c
  • Vorgänger c5db99b7
  • Nachfolger 02a56915

Felder end_date, terminated, extend_automatically_by ergänzt

Unterschiede anzeigen:

SL/DB/MetaSetup/PeriodicInvoicesConfig.pm
10 10
  table   => 'periodic_invoices_configs',
11 11

  
12 12
  columns => [
13
    id          => { type => 'integer', not_null => 1, sequence => 'id' },
14
    oe_id       => { type => 'integer', not_null => 1 },
15
    periodicity => { type => 'varchar', length => 10, not_null => 1 },
16
    print       => { type => 'boolean', default => 'false' },
17
    printer_id  => { type => 'integer' },
18
    copies      => { type => 'integer' },
19
    active      => { type => 'boolean', default => 'true' },
20
    start_date  => { type => 'date' },
21
    ar_chart_id => { type => 'integer', not_null => 1 },
13
    id                      => { type => 'integer', not_null => 1, sequence => 'id' },
14
    oe_id                   => { type => 'integer', not_null => 1 },
15
    periodicity             => { type => 'varchar', length => 10, not_null => 1 },
16
    print                   => { type => 'boolean', default => 'false' },
17
    printer_id              => { type => 'integer' },
18
    copies                  => { type => 'integer' },
19
    active                  => { type => 'boolean', default => 'true' },
20
    start_date              => { type => 'date' },
21
    ar_chart_id             => { type => 'integer', not_null => 1 },
22
    terminated              => { type => 'boolean', default => 'false' },
23
    end_date                => { type => 'date' },
24
    extend_automatically_by => { type => 'integer' },
22 25
  ],
23 26

  
24 27
  primary_key_columns => [ 'id' ],
SL/OE.pm
589 589
  $obj->update_attributes(%{ $config });
590 590
}
591 591

  
592
sub load_periodic_invoice_config {
593
  my $self = shift;
594
  my $form = shift;
595

  
596
  delete $form->{periodic_invoices_config};
597

  
598
  if ($form->{id}) {
599
    my $config_obj = SL::DB::Manager::PeriodicInvoicesConfig->find_by(oe_id => $form->{id});
600

  
601
    if ($config_obj) {
602
      my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity start_date_as_date end_date_as_date extend_automatically_by ar_chart_id
603
                                                      print printer_id copies) };
604
      $form->{periodic_invoices_config} = YAML::Dump($config);
605
    }
606
  }
607
}
608

  
592 609
sub _close_quotations_rfqs {
593 610
  $main::lxdebug->enter_sub();
594 611

  
......
965 982
    }
966 983
    $sth->finish;
967 984

  
968
    delete $form->{periodic_invoices_config};
969
    if ($form->{id} && ($form->{type} eq 'sales_order')) {
970
      $query = qq|SELECT periodicity, start_date, print, printer_id, copies, active, ar_chart_id FROM periodic_invoices_configs WHERE oe_id = ? LIMIT 1|;
971
      $ref   = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id}));
972

  
973
      $form->{periodic_invoices_config} = YAML::Dump($ref) if ($ref);
974
    }
975

  
976 985
  } else {
977 986

  
978 987
    # get last name used
......
985 994

  
986 995
  Common::webdav_folder($form) if ($main::webdav);
987 996

  
997
  $self->load_periodic_invoice_config($form);
998

  
988 999
  my $rc = $dbh->commit;
989 1000

  
990 1001
  $main::lxdebug->leave_sub();
bin/mozilla/oe.pl
1963 1963
  $config = YAML::Load($::form->{periodic_invoices_config}) if $::form->{periodic_invoices_config};
1964 1964

  
1965 1965
  if ('HASH' ne ref $config) {
1966
    $config       =  {
1967
      periodicity => 'm',
1968
      start_date  => $::form->{transdate},
1969
      active      => 1,
1970
    };
1966
    $config =  { periodicity             => 'y',
1967
                 start_date_as_date      => $::form->{transdate},
1968
                 extend_automatically_by => 12,
1969
                 active                  => 1,
1970
               };
1971 1971
  }
1972 1972

  
1973 1973
  $config->{periodicity} = 'm' if none { $_ eq $config->{periodicity} } qw(m q y);
......
1992 1992

  
1993 1993
  check_oe_access();
1994 1994

  
1995
  $::form->isblank('start_date', $::locale->text('The start date is missing.'));
1996

  
1997
  my $config = { active       => $::form->{active} ? 1 : 0,
1998
                 periodicity  => (any { $_ eq $::form->{periodicity} } qw(m q y)) ? $::form->{periodicity} : 'm',
1999
                 start_date   => $::form->{start_date},
2000
                 print        => $::form->{print} ? 1 : 0,
2001
                 printer_id   => $::form->{print} ? $::form->{printer_id} * 1 : undef,
2002
                 copies       => $::form->{copies} * 1 ? $::form->{copies} : 1,
2003
                 ar_chart_id  => $::form->{ar_chart_id} * 1,
1995
  $::form->isblank('start_date_as_date', $::locale->text('The start date is missing.'));
1996

  
1997
  my $config = { active                  => $::form->{active}     ? 1 : 0,
1998
                 terminated              => $::form->{terminated} ? 1 : 0,
1999
                 periodicity             => (any { $_ eq $::form->{periodicity} } qw(m q y)) ? $::form->{periodicity} : 'm',
2000
                 start_date_as_date      => $::form->{start_date_as_date},
2001
                 end_date_as_date        => $::form->{end_date_as_date},
2002
                 print                   => $::form->{print} ? 1 : 0,
2003
                 printer_id              => $::form->{print} ? $::form->{printer_id} * 1 : undef,
2004
                 copies                  => $::form->{copies} * 1 ? $::form->{copies} : 1,
2005
                 extend_automatically_by => $::form->{extend_automatically_by} * 1 || undef,
2006
                 ar_chart_id             => $::form->{ar_chart_id} * 1,
2004 2007
               };
2005 2008

  
2006 2009
  $::form->{periodic_invoices_config} = YAML::Dump($config);
locale/de/all
689 689
  'Element disabled'            => 'Element deaktiviert',
690 690
  'Employee'                    => 'Bearbeiter',
691 691
  'Empty transaction!'          => 'Buchung ist leer!',
692
  'End date'                    => 'Enddatum',
692 693
  'Enter a description for this new draft.' => 'Geben Sie eine Beschreibung für diesen Entwurf ein.',
693 694
  'Enter longdescription'       => 'Langtext eingeben',
694 695
  'Enter the requested execution date or leave empty for the quickest possible execution:' => 'Geben Sie das jeweils gewünschte Ausführungsdatum an, oder lassen Sie das Feld leer für die schnellstmögliche Ausführung:',
......
735 736
  'Export date'                 => 'Exportdatum',
736 737
  'Export date from'            => 'Exportdatum von',
737 738
  'Export date to'              => 'Exportdatum bis',
739
  'Extend automatically by n months' => 'Automatische Verlängerung um x Monate',
738 740
  'Extended'                    => 'Gesamt',
739 741
  'Extension Of Time'           => 'Dauerfristverlängerung',
740 742
  'Factor'                      => 'Faktor',
......
1516 1518
  'Statement Balance'           => 'Sammelrechnungsbilanz',
1517 1519
  'Statement sent to'           => 'Sammelrechnung verschickt an',
1518 1520
  'Statements sent to printer!' => 'Sammelrechnungen an Drucker geschickt!',
1521
  'Status'                      => 'Status',
1519 1522
  'Step 1 of 3: Parts'          => 'Schritt 1 von 3: Waren',
1520 1523
  'Step 2'                      => 'Schritt 2',
1521 1524
  'Step 2 of 3: Services'       => 'Schritt 2 von 3: Dienstleistungen',
......
1641 1644
  'The dunning process started' => 'Der Mahnprozess ist gestartet.',
1642 1645
  'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
1643 1646
  'The email address is missing.' => 'Die Emailadresse fehlt.',
1647
  'The end date is the last day for which invoices will possibly be created.' => 'Das Enddatum ist das letztmögliche Datum, an dem eine Rechnung erzeugt wird.',
1644 1648
  'The factor is missing in row %d.' => 'Der Faktor fehlt in Zeile %d.',
1645 1649
  'The factor is missing.'      => 'Der Faktor fehlt.',
1646 1650
  'The first reason is that Lx-Office contained a bug which resulted in the wrong taxkeys being recorded for transactions in which two entries are posted for the same chart with different taxkeys.' => 'Zum Einen gab es einen Bug in Lx-Office, der dazu führte, dass bei Buchungen mit verschiedenen Steuerschlüssel auf ein Konto teilweise falsche Steuerschlüssel gespeichert wurden.',
......
2085 2089
  'tax_taxdescription'          => 'Steuername',
2086 2090
  'tax_taxkey'                  => 'Steuerschlüssel',
2087 2091
  'taxnumber'                   => 'Automatikkonto',
2092
  'terminated'                  => 'gekündigt',
2088 2093
  'to (date)'                   => 'bis',
2089 2094
  'to (time)'                   => 'bis',
2090 2095
  'transfer'                    => 'Umlagerung',
sql/Pg-upgrade2/periodic_invoices.sql
2 2
-- @description: Neue Tabellen und Spalten f?r Wiederkehrende Rechnungen
3 3
-- @depends: release_2_6_1
4 4
CREATE TABLE periodic_invoices_configs (
5
       id integer              NOT NULL DEFAULT nextval('id'),
6
       oe_id integer           NOT NULL,
7
       periodicity varchar(10) NOT NULL,
8
       print boolean                    DEFAULT 'f',
9
       printer_id integer,
10
       copies integer,
11
       active boolean                   DEFAULT 't',
12
       start_date date,
13
       ar_chart_id integer     NOT NULL,
5
       id                      integer     NOT NULL DEFAULT nextval('id'),
6
       oe_id                   integer     NOT NULL,
7
       periodicity             varchar(10) NOT NULL,
8
       print                   boolean               DEFAULT 'f',
9
       printer_id              integer,
10
       copies                  integer,
11
       active                  boolean               DEFAULT 't',
12
       terminated              boolean               DEFAULT 'f',
13
       start_date              date,
14
       end_date                date,
15
       ar_chart_id             integer     NOT NULL,
16
       extend_automatically_by integer,
14 17

  
15 18
       PRIMARY KEY (id),
16 19
       FOREIGN KEY (oe_id)       REFERENCES oe       (id),
......
19 22
);
20 23

  
21 24
CREATE TABLE periodic_invoices (
22
       id integer             NOT NULL DEFAULT nextval('id'),
23
       config_id integer      NOT NULL,
24
       ar_id integer          NOT NULL,
25
       period_start_date date NOT NULL,
26
       itime timestamp                 DEFAULT now(),
25
       id                integer   NOT NULL DEFAULT nextval('id'),
26
       config_id         integer   NOT NULL,
27
       ar_id             integer   NOT NULL,
28
       period_start_date date      NOT NULL,
29
       itime             timestamp          DEFAULT now(),
27 30

  
28 31
       PRIMARY KEY (id),
29 32
       FOREIGN KEY (config_id) REFERENCES periodic_invoices_configs (id),
templates/webpages/oe/edit_periodic_invoices_config.html
10 10
  <p>
11 11
   <table border="0">
12 12
    <tr>
13
     <th align="right">[%- LxERP.t8('Active') %]</th>
14
     <td>[% L.checkbox_tag("active", checked => active) %]</td>
13
     <th align="right">[% LxERP.t8('Status') %]</th>
14
     <td>[% L.checkbox_tag("active", checked => active, label => LxERP.t8('Active')) %]</td>
15
    </tr>
16

  
17
    <tr>
18
     <td>&nbsp;</td>
19
     <td>
20
      [% L.checkbox_tag('terminated', label => LxERP.t8('terminated'), checked => terminated) %]
21
     </td>
15 22
    </tr>
16 23

  
17 24
    <tr>
......
28 35
    <tr>
29 36
     <th align="right">[%- LxERP.t8('Start date') %]</th>
30 37
     <td valign="top">
31
      [% L.date_tag("start_date", start_date) %]
38
      [% L.date_tag("start_date_as_date", start_date_as_date) %]
39
     </td>
40
    </tr>
41

  
42
    <tr>
43
     <th align="right">[%- LxERP.t8('End date') %]<sup>(1)</sup></th>
44
     <td valign="top">
45
      [% L.date_tag("end_date_as_date", end_date_as_date) %]
46
     </td>
47
    </tr>
48

  
49
    <tr>
50
     <th align="right">[% LxERP.t8('Extend automatically by n months') %]</th>
51
     <td valign="top">
52
      [% L.input_tag("extend_automatically_by", extend_automatically_by, size => 10) %]
32 53
     </td>
33 54
    </tr>
34 55

  
......
60 81
   </table>
61 82
  </p>
62 83

  
84
  <hr>
85

  
86
  <p>(1): [%- LxERP.t8('The end date is the last day for which invoices will possibly be created.') %]</p>
87

  
63 88
  [% L.hidden_tag('action', 'save_periodic_invoices_config') %]
64 89

  
65 90
  <p>

Auch abrufbar als: Unified diff