[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6500] trunk/LedgerSMB



Revision: 6500
          http://sourceforge.net/p/ledger-smb/code/6500
Author:   einhverfr
Date:     2014-01-17 08:10:49 +0000 (Fri, 17 Jan 2014)
Log Message:
-----------
Fixing 916, deletign contact info results in error

Modified Paths:
--------------
    trunk/LedgerSMB/Entity/Contact.pm
    trunk/LedgerSMB/Entity/Location.pm
    trunk/LedgerSMB/Scripts/contact.pm

Modified: trunk/LedgerSMB/Entity/Contact.pm
===================================================================
--- trunk/LedgerSMB/Entity/Contact.pm	2014-01-17 08:04:32 UTC (rev 6499)
+++ trunk/LedgerSMB/Entity/Contact.pm	2014-01-17 08:10:49 UTC (rev 6500)
@@ -171,14 +171,22 @@
 
 deletes the record
 
+This can be called from $self->delete() if you have  a contact object, or it
+can be called as LedgerSMB::Entity::Contact::delete($hashref) if the hashref 
+contains either entity_id or credit_id, and location_id, and location class.
+
 =cut
 
 sub delete {
-    my ($self) = @_;
-    if ($self->credit_id){
-        $self->exec_method({funcname => 'eca__delete_contact'});
+    my ($ref) = @_;
+    if ($ref->{credit_id}){
+        __PACKAGE__->call_procedure(procname => 'eca__delete_contact',
+                                  args => [$ref->{credit_id}, $ref->{class_id},
+                                           $ref->{contact}]);
     } else {
-        $self->exec_method({funcname => 'entity__delete_contact'});
+        __PACKAGE__->call_procedure(procname => 'entity__delete_contact',
+                                  args => [$ref->{entity_id}, $ref->{class_id},
+                                           $ref->{contact}]);
     }
 }
 

Modified: trunk/LedgerSMB/Entity/Location.pm
===================================================================
--- trunk/LedgerSMB/Entity/Location.pm	2014-01-17 08:04:32 UTC (rev 6499)
+++ trunk/LedgerSMB/Entity/Location.pm	2014-01-17 08:10:49 UTC (rev 6500)
@@ -255,7 +255,7 @@
 Deletes the current location
 
 This can be called from $self->delete() if you have  a location object, or it
-can be called as LedgerSMB::Entity::Locateion::delete($hashref) if the hashref 
+can be called as LedgerSMB::Entity::Location::delete($hashref) if the hashref 
 contains either entity_id or credit_id, and location_id, and location class.
 
 =cut

Modified: trunk/LedgerSMB/Scripts/contact.pm
===================================================================
--- trunk/LedgerSMB/Scripts/contact.pm	2014-01-17 08:04:32 UTC (rev 6499)
+++ trunk/LedgerSMB/Scripts/contact.pm	2014-01-17 08:10:49 UTC (rev 6500)
@@ -636,9 +636,7 @@
 
 sub delete_contact {
     my ($request) = @_;
-    my $contact = LedgerSMB::Entity::Contact->new(%$request);
-    $contact->credit_id($request->{for_credit});
-    $contact->delete;
+    LedgerSMB::Entity::Contact::delete($request);
     $request->{target_div} = 'contact_info_div';
     get($request);
 }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits