Revision 927ec727
Von Jan Büren vor mehr als 3 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
649 | 649 |
return $rc; |
650 | 650 |
} |
651 | 651 |
|
652 |
sub delete_transfers { |
|
653 |
$main::lxdebug->enter_sub(); |
|
654 |
|
|
655 |
my ($self) = @_; |
|
656 |
|
|
657 |
my $myconfig = \%main::myconfig; |
|
658 |
my $form = $main::form; |
|
659 |
|
|
660 |
my $rc = SL::DB::Order->new->db->with_transaction(sub { |
|
661 |
|
|
662 |
my $do = SL::DB::DeliveryOrder->new(id => $form->{id})->load; |
|
663 |
die "No valid delivery order found" unless ref $do eq 'SL::DB::DeliveryOrder'; |
|
664 |
|
|
665 |
my $dt = DateTime->today->subtract(days => $::instance_conf->get_undo_transfer_interval); |
|
666 |
croak "Wrong call. Please check undoing interval" unless DateTime->compare($do->itime, $dt) == 1; |
|
667 |
|
|
668 |
foreach my $doi (@{ $do->orderitems }) { |
|
669 |
foreach my $dois (@{ $doi->delivery_order_stock_entries}) { |
|
670 |
$dois->inventory->delete; |
|
671 |
$dois->delete; |
|
672 |
} |
|
673 |
} |
|
674 |
$do->update_attributes(delivered => 0); |
|
675 |
|
|
676 |
1; |
|
677 |
}); |
|
678 |
|
|
679 |
$main::lxdebug->leave_sub(); |
|
680 |
|
|
681 |
return $rc; |
|
682 |
} |
|
683 |
|
|
652 | 684 |
sub retrieve { |
653 | 685 |
$main::lxdebug->enter_sub(); |
654 | 686 |
|
SL/Form.pm | ||
---|---|---|
2964 | 2964 |
# $main::locale->text('SCREENED') |
2965 | 2965 |
# $main::locale->text('CANCELED') |
2966 | 2966 |
# $main::locale->text('IMPORT') |
2967 |
# $main::locale->text('UNDO TRANSFER') |
|
2967 | 2968 |
# $main::locale->text('UNIMPORT') |
2968 | 2969 |
# $main::locale->text('invoice') |
2969 | 2970 |
# $main::locale->text('proforma') |
bin/mozilla/do.pl | ||
---|---|---|
241 | 241 |
my @req_trans_desc = qw(kivi.SalesPurchase.check_transaction_description) x!!$::instance_conf->get_require_transaction_description_ps; |
242 | 242 |
my $is_customer = $::form->{vc} eq 'customer'; |
243 | 243 |
|
244 |
my $undo_date = DateTime->today->subtract(days => $::instance_conf->get_undo_transfer_interval); |
|
245 |
my $insertdate = DateTime->from_kivitendo($::form->{insertdate}); |
|
246 |
my $undo_transfer = 0; |
|
247 |
if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime') { |
|
248 |
# DateTime->compare it returns 1 if $dt1 > $dt2 |
|
249 |
$undo_transfer = DateTime->compare($insertdate, $undo_date) == 1 ? 1 : 0; |
|
250 |
} |
|
244 | 251 |
for my $bar ($::request->layout->get('actionbar')) { |
245 | 252 |
$bar->add( |
246 | 253 |
action => |
... | ... | |
314 | 321 |
disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef, |
315 | 322 |
only_if => !$is_customer && $::instance_conf->get_transfer_default, |
316 | 323 |
], |
324 |
action => [ |
|
325 |
t8('Undo Transfer'), |
|
326 |
submit => [ '#form', { action => "delete_transfers" } ], |
|
327 |
checks => [ 'kivi.validate_form' ], |
|
328 |
only_if => $::form->{delivered}, |
|
329 |
disabled => !$undo_transfer ? t8('Transfer date exceeds the maximum allowed interval.') : undef, |
|
330 |
], |
|
317 | 331 |
], # end of combobox "Transfer out" |
318 | 332 |
|
319 | 333 |
|
... | ... | |
969 | 983 |
|
970 | 984 |
$main::lxdebug->leave_sub(); |
971 | 985 |
} |
986 |
sub delete_transfers { |
|
987 |
$main::lxdebug->enter_sub(); |
|
988 |
|
|
989 |
check_do_access(); |
|
990 |
|
|
991 |
my $form = $main::form; |
|
992 |
my %myconfig = %main::myconfig; |
|
993 |
my $locale = $main::locale; |
|
994 |
my $ret; |
|
995 |
|
|
996 |
die "Invalid form type" unless $form->{type} =~ m/^(sales|purchase)_delivery_order$/; |
|
997 |
|
|
998 |
if ($ret = DO->delete_transfers()) { |
|
999 |
# saving the history |
|
1000 |
if(!exists $form->{addition}) { |
|
1001 |
$form->{snumbers} = qq|donumber_| . $form->{donumber}; |
|
1002 |
$form->{addition} = "UNDO TRANSFER"; |
|
1003 |
$form->save_history; |
|
1004 |
} |
|
1005 |
# /saving the history |
|
1006 |
|
|
1007 |
flash_later('info', $locale->text("Transfer undone.")); |
|
1008 |
|
|
1009 |
$form->{callback} = 'do.pl?action=edit&type=' . $form->{type} . '&id=' . $form->escape($form->{id}); |
|
1010 |
$form->redirect; |
|
1011 |
} |
|
1012 |
|
|
1013 |
$form->error($locale->text('Cannot undo delivery order transfer!') . $ret); |
|
1014 |
|
|
1015 |
$main::lxdebug->leave_sub(); |
|
1016 |
} |
|
972 | 1017 |
|
973 | 1018 |
sub invoice { |
974 | 1019 |
$main::lxdebug->enter_sub(); |
doc/changelog | ||
---|---|---|
36 | 36 |
Mahnung |
37 | 37 |
|
38 | 38 |
Kleinere neue Features und Detailverbesserungen: |
39 |
|
|
39 |
- Ausgelagerte Lieferscheinen können zurückgelagerte werden insofern der |
|
40 |
konfigurierbare Zurücklagerungszeitraum noch nicht überschritten ist. |
|
40 | 41 |
- Angebote und Aufträge im Ein- und Verkauf können optionale Positionen enthalten. |
41 | 42 |
Optionale Positionen werden in der zweiten Zeile der Position aktiviert. |
42 | 43 |
Die einzelne Position wird dann berechnet und erscheint im Ausdruck mit dem |
locale/de/all | ||
---|---|---|
590 | 590 |
'Cannot transfer negative entries.' => 'Kann keine negativen Mengen auslagern.', |
591 | 591 |
'Cannot transfer negative quantities.' => 'Negative Mengen können nicht ausgelagert werden.', |
592 | 592 |
'Cannot transfer. <br> Reason:<br>#1' => 'Kann nicht ein-/auslagern. <br>Grund:<br>#1', |
593 |
'Cannot undo delivery order transfer!' => 'Kann Lagerbewegung des Lieferscheins nicht zurücklagern!', |
|
593 | 594 |
'Cannot unlink payment for a closed period!' => 'Ein oder alle Bankbewegungen befinden sich innerhalb einer geschloßenen Periode. ', |
594 | 595 |
'Carry over account for year-end closing' => 'Saldenvortragskonto', |
595 | 596 |
'Carry over shipping address' => 'Lieferadresse übernehmen', |
... | ... | |
983 | 984 |
'Default transport article number' => 'Standard Versand / Transport-Erinnerungs-Artikel', |
984 | 985 |
'Default unit' => 'Standardeinheit', |
985 | 986 |
'Default value' => 'Standardwert', |
987 |
'Defines the interval where undoing transfers from a delivery order are allowed.' => 'Zeitintervall in Tagen, an denen ein Zurücklagern der Lagerbewegung innerhalb eines Lieferscheins möglich ist.', |
|
986 | 988 |
'Delete' => 'Löschen', |
987 | 989 |
'Delete Account' => 'Konto löschen', |
988 | 990 |
'Delete Attachments' => 'Anhänge löschen', |
... | ... | |
3822 | 3824 |
'Transfer To Stock' => 'Lagereingang', |
3823 | 3825 |
'Transfer all marked' => 'Markierte übernehmen', |
3824 | 3826 |
'Transfer data to Geierlein ELSTER application' => 'Daten in Geierlein ELSTER-Anwendung übernehmen', |
3827 |
'Transfer date exceeds the maximum allowed interval.' => 'Das Belegdatum ist älter als das maximale Zurücklagerungs-Intervall es zulässt.', |
|
3825 | 3828 |
'Transfer from warehouse' => 'Quelllager', |
3826 | 3829 |
'Transfer in' => 'Einlagern', |
3827 | 3830 |
'Transfer in via default' => 'Einlagern über Standard-Lagerplatz', |
... | ... | |
3833 | 3836 |
'Transfer qty' => 'Umlagermenge', |
3834 | 3837 |
'Transfer services via default' => 'Falls Ein- /Auslagern über Standardlagerplatz aktiviert ist, auch die Dienstleistungen standardmässig Ein- und Auslagern', |
3835 | 3838 |
'Transfer successful' => 'Lagervorgang erfolgreich', |
3839 |
'Transfer undone.' => 'Zurücklagerung erfolgreich', |
|
3836 | 3840 |
'Transferred' => 'Übernommen', |
3837 | 3841 |
'Translation' => 'Übersetzung', |
3838 | 3842 |
'Translations' => 'Übersetzungen', |
... | ... | |
3851 | 3855 |
'Type of Vendor' => 'Lieferantentyp', |
3852 | 3856 |
'TypeAbbreviation' => 'Typ-Abkürzung', |
3853 | 3857 |
'Types of Business' => 'Kunden-/Lieferantentypen', |
3858 |
'UNDO TRANSFER' => 'Zurücklagern', |
|
3854 | 3859 |
'UNIMPORT' => 'Import rückgängig', |
3855 | 3860 |
'USTVA' => 'USTVA', |
3856 | 3861 |
'USTVA 2004' => 'USTVA 2004', |
... | ... | |
3870 | 3875 |
'Unbalanced Ledger' => 'Bilanzfehler', |
3871 | 3876 |
'Unchecked custom variables will not appear in orders and invoices.' => 'Unmarkierte Variablen werden für diesen Artikel nicht in Aufträgen und Rechnungen angezeigt.', |
3872 | 3877 |
'Undo SEPA exports' => 'SEPA-Exporte rückgängig machen', |
3878 |
'Undo Transfer' => 'Zurücklagern', |
|
3879 |
'Undo Transfer Interval' => 'Zurücklagerungs-Intervall', |
|
3873 | 3880 |
'Unfinished follow-ups' => 'Nicht erledigte Wiedervorlagen', |
3874 | 3881 |
'Unfortunately you have no warehouse defined.' => 'Leider, gibt es kein Lager in diesem Mandanten.', |
3875 | 3882 |
'Unimport all' => 'Alle zurück zur Quelle', |
locale/en/all | ||
---|---|---|
590 | 590 |
'Cannot transfer negative entries.' => '', |
591 | 591 |
'Cannot transfer negative quantities.' => '', |
592 | 592 |
'Cannot transfer. <br> Reason:<br>#1' => '', |
593 |
'Cannot undo delivery order transfer!' => '', |
|
593 | 594 |
'Cannot unlink payment for a closed period!' => '', |
594 | 595 |
'Carry over account for year-end closing' => '', |
595 | 596 |
'Carry over shipping address' => '', |
... | ... | |
983 | 984 |
'Default transport article number' => '', |
984 | 985 |
'Default unit' => '', |
985 | 986 |
'Default value' => '', |
987 |
'Defines the interval where undoing transfers from a delivery order are allowed.' => '', |
|
986 | 988 |
'Delete' => '', |
987 | 989 |
'Delete Account' => '', |
988 | 990 |
'Delete Attachments' => '', |
... | ... | |
3821 | 3823 |
'Transfer To Stock' => '', |
3822 | 3824 |
'Transfer all marked' => '', |
3823 | 3825 |
'Transfer data to Geierlein ELSTER application' => '', |
3826 |
'Transfer date exceeds the maximum allowed interval.' => '', |
|
3824 | 3827 |
'Transfer from warehouse' => '', |
3825 | 3828 |
'Transfer in' => '', |
3826 | 3829 |
'Transfer in via default' => '', |
... | ... | |
3832 | 3835 |
'Transfer qty' => '', |
3833 | 3836 |
'Transfer services via default' => '', |
3834 | 3837 |
'Transfer successful' => '', |
3838 |
'Transfer undone.' => '', |
|
3835 | 3839 |
'Transferred' => '', |
3836 | 3840 |
'Translation' => '', |
3837 | 3841 |
'Translations' => '', |
... | ... | |
3850 | 3854 |
'Type of Vendor' => '', |
3851 | 3855 |
'TypeAbbreviation' => '', |
3852 | 3856 |
'Types of Business' => '', |
3857 |
'UNDO TRANSFER' => '', |
|
3853 | 3858 |
'UNIMPORT' => '', |
3854 | 3859 |
'USTVA' => '', |
3855 | 3860 |
'USTVA 2004' => '', |
... | ... | |
3869 | 3874 |
'Unbalanced Ledger' => '', |
3870 | 3875 |
'Unchecked custom variables will not appear in orders and invoices.' => '', |
3871 | 3876 |
'Undo SEPA exports' => '', |
3877 |
'Undo Transfer' => '', |
|
3878 |
'Undo Transfer Interval' => '', |
|
3872 | 3879 |
'Unfinished follow-ups' => '', |
3873 | 3880 |
'Unfortunately you have no warehouse defined.' => '', |
3874 | 3881 |
'Unimport all' => '', |
Auch abrufbar als: Unified diff
Lieferscheine neue Funktion Zurücklagern
Belege die nicht älter als das Zurücklagerungs-Intervall sind
können wieder "entlagert" werden.
Lieferschein die ausgelagert sind, wurden bisher strikter
als Rechnungen behandelt. Ein Zurücklagern war nur über
die Lagerkorrektur möglich.