From b186a8eb0ff43ca1d67e7416f1eef2d11bf4501a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 18 Jan 2017 10:40:08 +0100 Subject: [PATCH] =?utf8?q?SL::DB::(Purchase)Invoice:=20neue=20Funktion=20?= =?utf8?q?=C2=BBmark=5Fas=5Fpaid=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sie macht nichts weiter, als »paid« auf »amount« zu setzen. --- SL/DB/Invoice.pm | 10 ++++++++++ SL/DB/PurchaseInvoice.pm | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) 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 -- 2.20.1