From: Moritz Bunkus Date: Wed, 18 Jan 2017 09:40:08 +0000 (+0100) Subject: SL::DB::(Purchase)Invoice: neue Funktion »mark_as_paid« X-Git-Tag: release-3.5.4~1698 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b186a8eb0ff43ca1d67e7416f1eef2d11bf4501a;p=kivitendo-erp.git SL::DB::(Purchase)Invoice: neue Funktion »mark_as_paid« Sie macht nichts weiter, als »paid« auf »amount« zu setzen. --- diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index fab4974f3..0ef8d614e 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -577,6 +577,12 @@ sub link { return $html; } +sub mark_as_paid { + my ($self) = @_; + + $self->update_attributes(paid => $self->amount); +} + 1; __END__ @@ -760,6 +766,10 @@ Mandatory params are =back +=item C + +Marks the invoice as paid by setting its C member to the value of C. + =back =head1 TODO diff --git a/SL/DB/PurchaseInvoice.pm b/SL/DB/PurchaseInvoice.pm index 91a5b54b2..08be07f33 100644 --- a/SL/DB/PurchaseInvoice.pm +++ b/SL/DB/PurchaseInvoice.pm @@ -3,6 +3,7 @@ package SL::DB::PurchaseInvoice; use strict; use Carp; +use Data::Dumper; use SL::DB::MetaSetup::PurchaseInvoice; use SL::DB::Manager::PurchaseInvoice; @@ -198,4 +199,37 @@ sub add_ap_amount_row { return $acc_trans; }; +sub mark_as_paid { + my ($self) = @_; + + $self->update_attributes(paid => $self->amount); +} + 1; + + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +SL::DB::PurchaseInvoice: Rose model for purchase invoices (table "ap") + +=head1 FUNCTIONS + +=over 4 + +=item C + +Marks the invoice as paid by setting its C member to the value of C. + +=back + +=head1 AUTHOR + +Moritz Bunkus Em.bunkus@linet-services.deE + +=cut