X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=a45adbf804d2999e2a24c7c531d62ac09875099a;hb=f0747a2f9c8d7a9d261c20b0d2a9d5911a6ad9b5;hp=50f3776860dd83277572d0df51ab803cae002e31;hpb=333d92646196eefe1b1d90d7b66719c53caa61c7;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 50f377686..a45adbf80 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -24,7 +24,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # Inventory invoicing module @@ -33,7 +34,6 @@ use SL::FU; use SL::IS; -use SL::PE; use SL::OE; use SL::MoreCommon qw(restore_form save_form); use Data::Dumper; @@ -472,7 +472,7 @@ sub form_footer { # follow ups if ($form->{id}) { - $form->{follow_ups} = FU->follow_ups('trans_id' => $form->{id}) || []; + $form->{follow_ups} = FU->follow_ups('trans_id' => $form->{id}, 'not_done' => 1) || []; $form->{follow_ups_unfinished} = ( sum map { $_->{due} * 1 } @{ $form->{follow_ups} } ) || 0; } @@ -546,6 +546,10 @@ sub mark_as_paid { $main::lxdebug->leave_sub(); } +sub show_draft { + update(); +} + sub update { $main::lxdebug->enter_sub(); @@ -966,6 +970,8 @@ sub storno { $form->{paidaccounts} = 0; map { my $key = $_; delete $form->{$key} if grep { $key =~ /^$_/ } qw(datepaid_ gldate_ acc_trans_id_ source_ memo_ paid_ exchangerate_ AR_paid_) } keys %{ $form }; + # record link invoice to storno + $form->{convert_from_ar_ids} = $form->{id}; $form->{storno_id} = $form->{id}; $form->{storno} = 1; $form->{id} = ""; @@ -973,7 +979,8 @@ sub storno { $form->{invdate} = DateTime->today->to_lxoffice; $form->{rowcount}++; # set new ids for storno invoice - delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"}; + # set new persistent ids for storno invoice items + $form->{"converted_from_invoice_id_$_"} = delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"}; post(); $main::lxdebug->leave_sub();