Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6348a23d

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

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

Dunning: Ursprungs-Rechnungsbeleg konfigurierbar (neu oder bestehender)

Unterschiede anzeigen:

SL/DB/MetaSetup/Default.pm
dunning_ar_amount_fee => { type => 'integer' },
dunning_ar_amount_interest => { type => 'integer' },
dunning_creator => { type => 'enum', check_in => [ 'current_employee', 'invoice_employee' ], db_type => 'dunning_creator', default => 'current_employee' },
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' },
duns => { type => 'text' },
email_attachment_part_files_checked => { type => 'boolean', default => 'true' },
email_attachment_record_files_checked => { type => 'boolean', default => 'true' },
SL/DN.pm
}
$query =
qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar, dunning_creator
qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar, dunning_creator,
dunning_original_invoice_creation_mode
FROM defaults|;
($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}, $form->{dunning_creator})
($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}, $form->{dunning_creator},
$form->{dunning_original_invoice_creation_mode})
= selectrow_query($form, $dbh, $query);
$main::lxdebug->leave_sub();
......
}
$query = qq|UPDATE defaults SET dunning_ar_amount_fee = ?, dunning_ar_amount_interest = ?, dunning_ar = ?,
dunning_creator = ?|;
dunning_creator = ?, dunning_original_invoice_creation_mode = ?|;
@values = (conv_i($form->{AR_amount_fee}), conv_i($form->{AR_amount_interest}), conv_i($form->{AR}),
$form->{dunning_creator});
$form->{dunning_creator}, $form->{dunning_original_invoice_creation_mode});
do_query($form, $dbh, $query, @values);
return 1;
......
die "Invalid invoice object" unless ref($invoice) eq 'SL::DB::Invoice';
my $filestore_enabled = SL::DB::Default->get->webdav
|| SL::DB::Default->get->doc_storage;
if ($::instance_conf->get_dunning_original_invoice_creation_mode eq 'use_last_created_or_create_new'
&& $filestore_enabled) {
my ($file_name, $file_path);
# search file in files and webdav
if (SL::DB::Default->get->doc_storage) {
my $file_entry = SL::DB::Manager::File->get_first(
query => [
object_type => $invoice->type,
object_id => $invoice->id,
],
);
if ($file_entry) {
my $file = SL::File::Object->new(
db_file => $file_entry,
id => $file_entry->id,
loaded => 1,
);
$file_name = $file->file_name();
$file_path = $file->get_file();
}
} elsif (SL::DB::Default->get->webdav) {
my $webdav = SL::Webdav->new(
type => $invoice->type,
number => $invoice->record_number,
);
my @latest_object = $webdav->get_all_latest();
if (scalar @latest_object) {
$file_name = $latest_object[0]->basename . "." . $latest_object[0]->extension;
$file_path = $latest_object[0]->full_filedescriptor();
}
} # end file search
my $attachment_filename = $form->get_formname_translation('invoice') . "_" . $invoice->invnumber . ".pdf";
if ($file_name ne '' and $file_path ne '') {
my $spool = $::lx_office_conf{paths}->{spool};
my $spool_path = File::Spec->catfile($spool, $file_name);
copy($file_path, $spool_path) or die "The copy operation failed: $!";
push @{ $form->{DUNNING_PDFS} } , $file_name;
push @{ $form->{DUNNING_PDFS_EMAIL} } , {
'path' => $file_path,
'name' => $file_name, };
push @{ $form->{DUNNING_PDFS_STORAGE} }, {
'dunning_id' => $dunning_id,
'path' => $file_path,
'name' => $file_name };
return;
}
}
my $print_form = Form->new('');
$print_form->{type} = 'invoice';
$print_form->{formname} = 'invoice',
locale/de/all
'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen',
'Create new quotation/order' => 'Neues Angebot/neuen Auftrag anlegen',
'Create new qutoation/order' => 'Neues Angebot/neuen Auftrag anlegen',
'Create new record.' => 'Erstelle neuen Beleg.',
'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
'Create new version' => 'Neue Version anlegen',
'Create one from the context menu by right-clicking on this text.' => 'Erstellen Sie einen aus dem Kontextmenü, indem Sie auf diesen Text rechtsklicken.',
......
'Include invalid warehouses ' => 'Ungültige Lager berücksichtigen',
'Include invoices with direct debit' => 'Inklusive Rechnungen mit Lastschrifteinzug',
'Include links to sales quotations' => 'Verknüpfungen zu Verkaufsangeboten anzeigen',
'Include original Invoices?' => 'Original-Rechnung hinzufügen?',
'Include original Invoices?' => 'Ursprungs-Rechnungen hinzufügen?',
'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.',
'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.',
'Includeable in reports' => 'In Berichten anzeigbar',
......
'Orientation' => 'Seitenformat',
'Orig. Size w/h' => 'Orig. Größe b/h',
'Origin of personal data' => 'Herkunft der personenbezogenen Daten',
'Original Invoice' => 'Ursprungs-Rechnung',
'Original Invoices?' => 'Ursprungs-Rechnungen?',
'Orphaned' => 'Nie benutzt',
'Orphaned currencies' => 'Verwaiste Währungen',
'Other Matches' => 'Andere Treffer',
......
'Use existing templates' => 'Vorhandene Druckvorlagen verwenden',
'Use for Factur-X/ZUGFeRD' => 'Nutzung mit Factur-X/ZUGFeRD',
'Use for Swiss QR-Bill' => 'Nutzung mit Schweizer QR-Rechnung',
'Use last created record or create new.' => 'Nutze zuletzt erstellten Beleg oder erstelle einen neuen.',
'Use linked items' => 'Verknüpfte Positionen verwenden',
'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',
'Use settings from client configuration' => 'Einstellungen aus Mandantenkonfiguration folgen',
locale/en/all
'Create new quotation or order' => '',
'Create new quotation/order' => '',
'Create new qutoation/order' => '',
'Create new record.' => '',
'Create new templates from master templates' => '',
'Create new version' => '',
'Create one from the context menu by right-clicking on this text.' => '',
......
'Orientation' => '',
'Orig. Size w/h' => '',
'Origin of personal data' => '',
'Original Invoice' => '',
'Original Invoices?' => '',
'Orphaned' => '',
'Orphaned currencies' => '',
'Other Matches' => '',
......
'Use existing templates' => '',
'Use for Factur-X/ZUGFeRD' => '',
'Use for Swiss QR-Bill' => '',
'Use last created record or create new.' => '',
'Use linked items' => '',
'Use master default bin for Default Transfer, if no default bin for the part is configured' => '',
'Use settings from client configuration' => '',
sql/Pg-upgrade2/defaults_set_invoice_creation_mode_for_dunning_attachment.sql
-- @tag: defaults_set_invoice_creation_mode_for_dunning_attachment
-- @description: Ursprungs-Rechnung von Mahnung konfigurierbar machen
-- @depends: release_3_7_0
CREATE TYPE invoice_creation_mode AS
ENUM ('create_new', 'use_last_created_or_create_new');
ALTER TABLE defaults
ADD COLUMN dunning_original_invoice_creation_mode invoice_creation_mode
default 'create_new';
templates/design40_webpages/dunning/edit_config.html
<td>[% L.select_tag('dunning_creator', [ [ 'current_employee', LxERP.t8('Current Employee') ],[ 'invoice_employee', LxERP.t8('Employee from the original invoice') ] ], default=dunning_creator) %]
</td>
</tr>
<tr>
<th align="right">[% 'Original Invoice' | $T8 %]</th>
<td>[% L.select_tag('dunning_original_invoice_creation_mode', [
[ 'create_new', LxERP.t8('Create new record.') ],
[ 'use_last_created_or_create_new',
LxERP.t8('Use last created record or create new.') ],
], default=dunning_original_invoice_creation_mode) %]
</td>
</tr>
</tbody>
</table>
templates/design40_webpages/dunning/show_invoices.html
[% L.checkbox_tag('selectall_email', checkall='INPUT[name*=email_]', checked=all_email) %]
</th>
<th class="center">
<label for="selectall_include_invoices">[% 'Include original Invoices?' | $T8 %]</label>
<label for="selectall_include_invoices">[% 'Original Invoices?' | $T8 %]</label>
[% L.checkbox_tag('selectall_include_invoices', checkall='INPUT[name*=include_invoice_]', checked=all_include_invoices) %]
</th>
<th>[% 'Customername' | $T8 %]</th>
templates/webpages/dunning/edit_config.html
<td>[% L.select_tag('dunning_creator', [ [ 'current_employee', LxERP.t8('Current Employee') ],[ 'invoice_employee', LxERP.t8('Employee from the original invoice') ] ], default=dunning_creator) %]
</td>
</tr>
<tr>
<th align="right">[% 'Original Invoice' | $T8 %]</th>
<td>[% L.select_tag('dunning_original_invoice_creation_mode', [
[ 'create_new', LxERP.t8('Create new record.') ],
[ 'use_last_created_or_create_new',
LxERP.t8('Use last created record or create new.') ],
], default=dunning_original_invoice_creation_mode) %]
</td>
</tr>
</table>
<input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
templates/webpages/dunning/show_invoices.html
</th>
<th class="listheading">
[% L.checkbox_tag('selectall_include_invoices', checkall='INPUT[name*=include_invoice_]', checked=all_include_invoices) %]
<label for="selectall_include_invoices">[% 'Include original Invoices?' | $T8 %]</label>
<label for="selectall_include_invoices">[% 'Original Invoices?' | $T8 %]</label>
</th>
<th class="listheading">[% 'Customername' | $T8 %]</th>

Auch abrufbar als: Unified diff