From f80a17face29cff2f398622cebc2321802a8662f Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 4 Aug 2014 01:40:27 +0200 Subject: [PATCH] =?utf8?q?DB=20Code=20f=C3=BCr=20Buchungsgruppe=20und=20Ta?= =?utf8?q?xzoneChart=20aufger=C3=A4umt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In SL::DB::Manager::Buchungsgruppe die Methoden inventory_accno und inventory_accno_description entfernt, da hier einfach inventory_account->accno und inventory_account->description benutzt werden können. --- SL/DB/Buchungsgruppe.pm | 12 ------------ SL/DB/TaxzoneChart.pm | 6 +++--- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/SL/DB/Buchungsgruppe.pm b/SL/DB/Buchungsgruppe.pm index 1b5bdad59..3504e2a41 100644 --- a/SL/DB/Buchungsgruppe.pm +++ b/SL/DB/Buchungsgruppe.pm @@ -25,18 +25,6 @@ sub validate { return @errors; } -sub inventory_accno { - my ($self) = @_; - require SL::DB::Manager::Chart; - return SL::DB::Manager::Chart->find_by(id => $self->inventory_accno_id) ? SL::DB::Manager::Chart->find_by(id => $self->inventory_accno_id)->accno() : undef; -} - -sub inventory_accno_description { - my ($self) = @_; - require SL::DB::Manager::Chart; - return SL::DB::Manager::Chart->find_by(id => $self->inventory_accno_id) ? SL::DB::Manager::Chart->find_by(id => $self->inventory_accno_id)->description() : undef; -} - sub income_accno_id { my ($self, $taxzone) = @_; diff --git a/SL/DB/TaxzoneChart.pm b/SL/DB/TaxzoneChart.pm index 4eb0ea8b9..6a98845bc 100644 --- a/SL/DB/TaxzoneChart.pm +++ b/SL/DB/TaxzoneChart.pm @@ -22,9 +22,9 @@ sub get_all_accounts_by_buchungsgruppen_id { my %list = (); - #inventory_accno der Buchungsgruppe: - $list{inventory_accno} = SL::DB::Manager::Buchungsgruppe->find_by(id => $buchungsgruppen_id)->inventory_accno; - $list{inventory_accno_description} = SL::DB::Manager::Buchungsgruppe->find_by(id => $buchungsgruppen_id)->inventory_accno_description; + # inventory_accno and description of the Buchungsgruppe: + $list{inventory_accno} = SL::DB::Manager::Buchungsgruppe->find_by(id => $buchungsgruppen_id)->inventory_account->accno; + $list{inventory_accno_description} = SL::DB::Manager::Buchungsgruppe->find_by(id => $buchungsgruppen_id)->inventory_account->description; foreach my $taxzonechart (@{ $all_taxzonecharts }) { $list{ $taxzonechart->taxzone_id }{taxzone_chart_id} = $taxzonechart->id; -- 2.20.1