From d0de41effb8dcc3c7ebae392e122217ca57553fb Mon Sep 17 00:00:00 2001 From: Irka Date: Tue, 18 Feb 2014 15:06:52 +0100 Subject: [PATCH] MT#5879 Add relation between accounting.cdr to billing.billing_zones_history to get calls list --- lib/NGCP/Schema/Result/cdr.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Schema/Result/cdr.pm b/lib/NGCP/Schema/Result/cdr.pm index 55bea454..8df1558e 100644 --- a/lib/NGCP/Schema/Result/cdr.pm +++ b/lib/NGCP/Schema/Result/cdr.pm @@ -208,7 +208,17 @@ for my $col (qw/init_time start_time/) { ); } } - +__PACKAGE__->belongs_to( + "source_customer_billing_zones_history", + "NGCP::Schema::Result::billing_zones_history", + { "bz_id" => "source_customer_billing_zone_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); sub TO_JSON { my ($self) = @_; return {