Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9fc89302

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 9fc8930202800be95368313cbc2ee8547c549960
  • Vorgänger 5d125bb7
  • Nachfolger 3dc39ccd

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
1207 1207

  
1208 1208
  die "Invalid invoice object" unless ref($invoice) eq 'SL::DB::Invoice';
1209 1209

  
1210
  my $filestore_enabled = SL::DB::Default->get->webdav
1211
                       || SL::DB::Default->get->doc_storage;
1212
  if ($::instance_conf->get_dunning_original_invoice_creation_mode eq 'use_last_created_or_create_new'
1213
      && $filestore_enabled) {
1214
    my ($file_name, $file_path);
1215
    # search file in files and webdav
1216
    if (SL::DB::Default->get->doc_storage) {
1217
      my $file_entry = SL::DB::Manager::File->get_first(
1218
        query => [
1219
          object_type => $invoice->type,
1220
          object_id   => $invoice->id,
1221
        ],
1222
      );
1223
      if ($file_entry) {
1224
        my $file = SL::File::Object->new(
1225
          db_file => $file_entry,
1226
          id => $file_entry->id,
1227
          loaded => 1,
1228
        );
1229
        $file_name = $file->file_name();
1230
        $file_path = $file->get_file();
1231
      }
1232
    } elsif (SL::DB::Default->get->webdav) {
1233
      my $webdav = SL::Webdav->new(
1234
        type   => $invoice->type,
1235
        number => $invoice->record_number,
1236
      );
1237
      my @latest_object = $webdav->get_all_latest();
1238
      if (scalar @latest_object) {
1239
        $file_name = $latest_object[0]->basename . "." . $latest_object[0]->extension;
1240
        $file_path = $latest_object[0]->full_filedescriptor();
1241
      }
1242
    } # end file search
1243
    $main::lxdebug->dump(0, "TST: file_name", $file_name);
1244
    $main::lxdebug->dump(0, "TST: file_path", $file_path);
1245

  
1246
    my $attachment_filename    = $form->get_formname_translation('invoice') . "_" . $invoice->invnumber . ".pdf";
1247
    if ($file_name ne '' and $file_path ne '') {
1248
      my $spool = $::lx_office_conf{paths}->{spool};
1249
      my $spool_path = File::Spec->catfile($spool, $file_name);
1250

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

  
1253
      push @{ $form->{DUNNING_PDFS} }        , $file_name;
1254
      push @{ $form->{DUNNING_PDFS_EMAIL} }  , {
1255
        'path'       => $file_path,
1256
        'name'       => $file_name, };
1257
      push @{ $form->{DUNNING_PDFS_STORAGE} }, {
1258
        'dunning_id' => $dunning_id,
1259
        'path'       => $file_path,
1260
        'name'       => $file_name };
1261
      $main::lxdebug->dump(0, "TST: form", $form);
1262
      return;
1263
    }
1264
  }
1265

  
1210 1266
  my $print_form          = Form->new('');
1211 1267
  $print_form->{type}     = 'invoice';
1212 1268
  $print_form->{formname} = 'invoice',
locale/de/all
884 884
  'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen',
885 885
  'Create new quotation/order'  => 'Neues Angebot/neuen Auftrag anlegen',
886 886
  'Create new qutoation/order'  => 'Neues Angebot/neuen Auftrag anlegen',
887
  'Create new record.'          => 'Erstelle neuen Beleg.',
887 888
  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
888 889
  'Create new version'          => 'Neue Version anlegen',
889 890
  'Create one from the context menu by right-clicking on this text.' => 'Erstellen Sie einen aus dem Kontextmenü, indem Sie auf diesen Text rechtsklicken.',
......
1961 1962
  'Include invalid warehouses ' => 'Ungültige Lager berücksichtigen',
1962 1963
  'Include invoices with direct debit' => 'Inklusive Rechnungen mit Lastschrifteinzug',
1963 1964
  'Include links to sales quotations' => 'Verknüpfungen zu Verkaufsangeboten anzeigen',
1964
  'Include original Invoices?'  => 'Original-Rechnung hinzufügen?',
1965
  'Include original Invoices?'  => 'Ursprungs-Rechnungen hinzufügen?',
1965 1966
  '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.',
1966 1967
  '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.',
1967 1968
  'Includeable in reports'      => 'In Berichten anzeigbar',
......
2589 2590
  'Orientation'                 => 'Seitenformat',
2590 2591
  'Orig. Size w/h'              => 'Orig. Größe b/h',
2591 2592
  'Origin of personal data'     => 'Herkunft der personenbezogenen Daten',
2593
  'Original Invoice'            => 'Ursprungs-Rechnung',
2594
  'Original Invoices?'          => 'Ursprungs-Rechnungen?',
2592 2595
  'Orphaned'                    => 'Nie benutzt',
2593 2596
  'Orphaned currencies'         => 'Verwaiste Währungen',
2594 2597
  'Other Matches'               => 'Andere Treffer',
......
4439 4442
  'Use existing templates'      => 'Vorhandene Druckvorlagen verwenden',
4440 4443
  'Use for Factur-X/ZUGFeRD'    => 'Nutzung mit Factur-X/ZUGFeRD',
4441 4444
  'Use for Swiss QR-Bill'       => 'Nutzung mit Schweizer QR-Rechnung',
4445
  'Use last created record or create new.' => 'Nutze zuletzt erstellten Beleg oder erstelle einen neuen.',
4442 4446
  'Use linked items'            => 'Verknüpfte Positionen verwenden',
4443 4447
  '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',
4444 4448
  'Use settings from client configuration' => 'Einstellungen aus Mandantenkonfiguration folgen',
locale/en/all
884 884
  'Create new quotation or order' => '',
885 885
  'Create new quotation/order'  => '',
886 886
  'Create new qutoation/order'  => '',
887
  'Create new record.'          => '',
887 888
  'Create new templates from master templates' => '',
888 889
  'Create new version'          => '',
889 890
  'Create one from the context menu by right-clicking on this text.' => '',
......
2588 2589
  'Orientation'                 => '',
2589 2590
  'Orig. Size w/h'              => '',
2590 2591
  'Origin of personal data'     => '',
2592
  'Original Invoice'            => '',
2593
  'Original Invoices?'          => '',
2591 2594
  'Orphaned'                    => '',
2592 2595
  'Orphaned currencies'         => '',
2593 2596
  'Other Matches'               => '',
......
4248 4251
  'To user login'               => '',
4249 4252
  'Today'                       => '',
4250 4253
  'Toggle marker'               => '',
4254
  'Toggle selection'            => '',
4251 4255
  'Too many results (#1 from #2).' => '',
4252 4256
  'Too much recursions in assembly tree (>100)' => '',
4253 4257
  'Top'                         => '',
......
4436 4440
  'Use existing templates'      => '',
4437 4441
  'Use for Factur-X/ZUGFeRD'    => '',
4438 4442
  'Use for Swiss QR-Bill'       => '',
4443
  'Use last created record or create new.' => '',
4439 4444
  'Use linked items'            => '',
4440 4445
  'Use master default bin for Default Transfer, if no default bin for the part is configured' => '',
4441 4446
  '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