Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6348a23d

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 6348a23d2c7956520870e6ccca26d65b464a102d
  • Vorgänger b0914304
  • Nachfolger ea5b6825

Dunning: Ursprungs-Rechnungsbeleg konfigurierbar (neu oder bestehender)

Unterschiede anzeigen:

SL/DB/MetaSetup/Default.pm
79 79
  dunning_ar_amount_fee                     => { type => 'integer' },
80 80
  dunning_ar_amount_interest                => { type => 'integer' },
81 81
  dunning_creator                           => { type => 'enum', check_in => [ 'current_employee', 'invoice_employee' ], db_type => 'dunning_creator', default => 'current_employee' },
82
  dunning_original_invoice_creation_mode    => { type => 'enum', check_in => [ 'create_new', 'use_last_created_or_create_new' ], db_type => 'invoice_creation_mode', default => 'create_new' },
82 83
  duns                                      => { type => 'text' },
83 84
  email_attachment_part_files_checked       => { type => 'boolean', default => 'true' },
84 85
  email_attachment_record_files_checked     => { type => 'boolean', default => 'true' },
SL/DN.pm
78 78
  }
79 79

  
80 80
  $query =
81
    qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar, dunning_creator
81
    qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar, dunning_creator,
82
              dunning_original_invoice_creation_mode
82 83
       FROM defaults|;
83
  ($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}, $form->{dunning_creator})
84
  ($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}, $form->{dunning_creator},
85
   $form->{dunning_original_invoice_creation_mode})
84 86
    = selectrow_query($form, $dbh, $query);
85 87

  
86 88
  $main::lxdebug->leave_sub();
......
147 149
  }
148 150

  
149 151
  $query  = qq|UPDATE defaults SET dunning_ar_amount_fee = ?, dunning_ar_amount_interest = ?, dunning_ar = ?,
150
               dunning_creator = ?|;
152
               dunning_creator = ?, dunning_original_invoice_creation_mode = ?|;
151 153
  @values = (conv_i($form->{AR_amount_fee}), conv_i($form->{AR_amount_interest}), conv_i($form->{AR}),
152
             $form->{dunning_creator});
154
             $form->{dunning_creator}, $form->{dunning_original_invoice_creation_mode});
153 155
  do_query($form, $dbh, $query, @values);
154 156

  
155 157
  return 1;
......
1218 1220

  
1219 1221
  die "Invalid invoice object" unless ref($invoice) eq 'SL::DB::Invoice';
1220 1222

  
1223
  my $filestore_enabled = SL::DB::Default->get->webdav
1224
                       || SL::DB::Default->get->doc_storage;
1225
  if ($::instance_conf->get_dunning_original_invoice_creation_mode eq 'use_last_created_or_create_new'
1226
      && $filestore_enabled) {
1227
    my ($file_name, $file_path);
1228
    # search file in files and webdav
1229
    if (SL::DB::Default->get->doc_storage) {
1230
      my $file_entry = SL::DB::Manager::File->get_first(
1231
        query => [
1232
          object_type => $invoice->type,
1233
          object_id   => $invoice->id,
1234
        ],
1235
      );
1236
      if ($file_entry) {
1237
        my $file = SL::File::Object->new(
1238
          db_file => $file_entry,
1239
          id => $file_entry->id,
1240
          loaded => 1,
1241
        );
1242
        $file_name = $file->file_name();
1243
        $file_path = $file->get_file();
1244
      }
1245
    } elsif (SL::DB::Default->get->webdav) {
1246
      my $webdav = SL::Webdav->new(
1247
        type   => $invoice->type,
1248
        number => $invoice->record_number,
1249
      );
1250
      my @latest_object = $webdav->get_all_latest();
1251
      if (scalar @latest_object) {
1252
        $file_name = $latest_object[0]->basename . "." . $latest_object[0]->extension;
1253
        $file_path = $latest_object[0]->full_filedescriptor();
1254
      }
1255
    } # end file search
1256

  
1257
    my $attachment_filename    = $form->get_formname_translation('invoice') . "_" . $invoice->invnumber . ".pdf";
1258
    if ($file_name ne '' and $file_path ne '') {
1259
      my $spool = $::lx_office_conf{paths}->{spool};
1260
      my $spool_path = File::Spec->catfile($spool, $file_name);
1261

  
1262
      copy($file_path, $spool_path) or die "The copy operation failed: $!";
1263

  
1264
      push @{ $form->{DUNNING_PDFS} }        , $file_name;
1265
      push @{ $form->{DUNNING_PDFS_EMAIL} }  , {
1266
        'path'       => $file_path,
1267
        'name'       => $file_name, };
1268
      push @{ $form->{DUNNING_PDFS_STORAGE} }, {
1269
        'dunning_id' => $dunning_id,
1270
        'path'       => $file_path,
1271
        'name'       => $file_name };
1272
      return;
1273
    }
1274
  }
1275

  
1221 1276
  my $print_form          = Form->new('');
1222 1277
  $print_form->{type}     = 'invoice';
1223 1278
  $print_form->{formname} = 'invoice',
locale/de/all
885 885
  'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen',
886 886
  'Create new quotation/order'  => 'Neues Angebot/neuen Auftrag anlegen',
887 887
  'Create new qutoation/order'  => 'Neues Angebot/neuen Auftrag anlegen',
888
  'Create new record.'          => 'Erstelle neuen Beleg.',
888 889
  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
889 890
  'Create new version'          => 'Neue Version anlegen',
890 891
  'Create one from the context menu by right-clicking on this text.' => 'Erstellen Sie einen aus dem Kontextmenü, indem Sie auf diesen Text rechtsklicken.',
......
1963 1964
  'Include invalid warehouses ' => 'Ungültige Lager berücksichtigen',
1964 1965
  'Include invoices with direct debit' => 'Inklusive Rechnungen mit Lastschrifteinzug',
1965 1966
  'Include links to sales quotations' => 'Verknüpfungen zu Verkaufsangeboten anzeigen',
1966
  'Include original Invoices?'  => 'Original-Rechnung hinzufügen?',
1967
  'Include original Invoices?'  => 'Ursprungs-Rechnungen hinzufügen?',
1967 1968
  'Include sales quotations in the list of linked records, if the view for record links from sales order is enabled.' => 'Verkaufsangebote mit in die Liste der Verknüpfungen aufnehmen, wenn "Verknüpfte Belege immer vom Verkaufsauftrag ansehen" aktiv ist.',
1968 1969
  'Include the record itself in the list of linked records, if the view for record links from sales order is enabled.' => 'Verknüpfung zum Beleg selber mit in die Liste der Verknüpfungen aufnehmen, wenn "Verknüpfte Belege immer vom Verkaufsauftrag ansehen" aktiv ist.',
1969 1970
  'Includeable in reports'      => 'In Berichten anzeigbar',
......
2592 2593
  'Orientation'                 => 'Seitenformat',
2593 2594
  'Orig. Size w/h'              => 'Orig. Größe b/h',
2594 2595
  'Origin of personal data'     => 'Herkunft der personenbezogenen Daten',
2596
  'Original Invoice'            => 'Ursprungs-Rechnung',
2597
  'Original Invoices?'          => 'Ursprungs-Rechnungen?',
2595 2598
  'Orphaned'                    => 'Nie benutzt',
2596 2599
  'Orphaned currencies'         => 'Verwaiste Währungen',
2597 2600
  'Other Matches'               => 'Andere Treffer',
......
4447 4450
  'Use existing templates'      => 'Vorhandene Druckvorlagen verwenden',
4448 4451
  'Use for Factur-X/ZUGFeRD'    => 'Nutzung mit Factur-X/ZUGFeRD',
4449 4452
  'Use for Swiss QR-Bill'       => 'Nutzung mit Schweizer QR-Rechnung',
4453
  'Use last created record or create new.' => 'Nutze zuletzt erstellten Beleg oder erstelle einen neuen.',
4450 4454
  'Use linked items'            => 'Verknüpfte Positionen verwenden',
4451 4455
  'Use master default bin for Default Transfer, if no default bin for the part is configured' => 'Standardlagerplatz für Ein- / Auslagern über Standard-Lagerplatz, falls für die Ware kein expliziter Lagerplatz konfiguriert ist',
4452 4456
  'Use settings from client configuration' => 'Einstellungen aus Mandantenkonfiguration folgen',
locale/en/all
885 885
  'Create new quotation or order' => '',
886 886
  'Create new quotation/order'  => '',
887 887
  'Create new qutoation/order'  => '',
888
  'Create new record.'          => '',
888 889
  'Create new templates from master templates' => '',
889 890
  'Create new version'          => '',
890 891
  'Create one from the context menu by right-clicking on this text.' => '',
......
2590 2591
  'Orientation'                 => '',
2591 2592
  'Orig. Size w/h'              => '',
2592 2593
  'Origin of personal data'     => '',
2594
  'Original Invoice'            => '',
2595
  'Original Invoices?'          => '',
2593 2596
  'Orphaned'                    => '',
2594 2597
  'Orphaned currencies'         => '',
2595 2598
  'Other Matches'               => '',
......
4444 4447
  'Use existing templates'      => '',
4445 4448
  'Use for Factur-X/ZUGFeRD'    => '',
4446 4449
  'Use for Swiss QR-Bill'       => '',
4450
  'Use last created record or create new.' => '',
4447 4451
  'Use linked items'            => '',
4448 4452
  'Use master default bin for Default Transfer, if no default bin for the part is configured' => '',
4449 4453
  'Use settings from client configuration' => '',
sql/Pg-upgrade2/defaults_set_invoice_creation_mode_for_dunning_attachment.sql
1
-- @tag: defaults_set_invoice_creation_mode_for_dunning_attachment
2
-- @description: Ursprungs-Rechnung von Mahnung konfigurierbar machen
3
-- @depends: release_3_7_0
4

  
5
CREATE TYPE invoice_creation_mode AS
6
  ENUM ('create_new', 'use_last_created_or_create_new');
7
ALTER TABLE defaults
8
  ADD COLUMN dunning_original_invoice_creation_mode invoice_creation_mode
9
  default 'create_new';
10

  
templates/design40_webpages/dunning/edit_config.html
169 169
      <td>[% L.select_tag('dunning_creator', [ [ 'current_employee', LxERP.t8('Current Employee') ],[ 'invoice_employee', LxERP.t8('Employee from the original invoice') ]  ], default=dunning_creator) %]
170 170
      </td>
171 171
    </tr>
172
    <tr>
173
      <th align="right">[% 'Original Invoice' | $T8 %]</th>
174
      <td>[% L.select_tag('dunning_original_invoice_creation_mode', [
175
                 [ 'create_new', LxERP.t8('Create new record.') ],
176
                 [ 'use_last_created_or_create_new',
177
                   LxERP.t8('Use last created record or create new.') ],
178
              ], default=dunning_original_invoice_creation_mode) %]
179
      </td>
180
    </tr>
172 181
  </tbody>
173 182
</table>
174 183

  
templates/design40_webpages/dunning/show_invoices.html
33 33
      [% L.checkbox_tag('selectall_email', checkall='INPUT[name*=email_]', checked=all_email) %]
34 34
    </th>
35 35
    <th class="center">
36
      <label for="selectall_include_invoices">[% 'Include original Invoices?' | $T8 %]</label>
36
      <label for="selectall_include_invoices">[% 'Original Invoices?' | $T8 %]</label>
37 37
      [% L.checkbox_tag('selectall_include_invoices', checkall='INPUT[name*=include_invoice_]', checked=all_include_invoices) %]
38 38
    </th>
39 39
    <th>[% 'Customername' | $T8 %]</th>
templates/webpages/dunning/edit_config.html
128 128
    <td>[% L.select_tag('dunning_creator', [ [ 'current_employee', LxERP.t8('Current Employee') ],[ 'invoice_employee', LxERP.t8('Employee from the original invoice') ]  ], default=dunning_creator) %]
129 129
    </td>
130 130
   </tr>
131
    <tr>
132
      <th align="right">[% 'Original Invoice' | $T8 %]</th>
133
      <td>[% L.select_tag('dunning_original_invoice_creation_mode', [
134
                 [ 'create_new', LxERP.t8('Create new record.') ],
135
                 [ 'use_last_created_or_create_new',
136
                   LxERP.t8('Use last created record or create new.') ],
137
              ], default=dunning_original_invoice_creation_mode) %]
138
      </td>
139
    </tr>
131 140
  </table>
132 141

  
133 142
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
templates/webpages/dunning/show_invoices.html
32 32
   </th>
33 33
   <th class="listheading">
34 34
    [% L.checkbox_tag('selectall_include_invoices', checkall='INPUT[name*=include_invoice_]', checked=all_include_invoices) %]
35
    <label for="selectall_include_invoices">[% 'Include original Invoices?' | $T8 %]</label>
35
    <label for="selectall_include_invoices">[% 'Original Invoices?' | $T8 %]</label>
36 36
   </th>
37 37

  
38 38
   <th class="listheading">[% 'Customername' | $T8 %]</th>

Auch abrufbar als: Unified diff