[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4033] branches/1.3/LedgerSMB/DBObject/Company.pm
- Subject: SF.net SVN: ledger-smb:[4033] branches/1.3/LedgerSMB/DBObject/Company.pm
- From: ..hidden..
- Date: Wed, 23 Nov 2011 08:13:49 +0000
Revision: 4033
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4033&view=rev
Author: einhverfr
Date: 2011-11-23 08:13:49 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
More work done on API for customer/vendor pricematrix views. API unconnected, all tests passing, and no existing functionality touched. Therefore safe to commit during freeze
Modified Paths:
--------------
branches/1.3/LedgerSMB/DBObject/Company.pm
Modified: branches/1.3/LedgerSMB/DBObject/Company.pm
===================================================================
--- branches/1.3/LedgerSMB/DBObject/Company.pm 2011-11-22 09:02:29 UTC (rev 4032)
+++ branches/1.3/LedgerSMB/DBObject/Company.pm 2011-11-23 08:13:49 UTC (rev 4033)
@@ -700,6 +700,61 @@
funcname => 'company__list_bank_account');
};
+=item get_pricematrix
+
+This routine gets the price matrix for the customer or vendor. The pricematrix
+info is stored in the pricematrix hash entry. If a customer (account_class=1),
+it also populates a pricematrix_pricegroup entry.
+
+=cut
+
+sub get_pricematrix {
+ my $self = shift @_;
+ @{$self->{pricematrix}} = $self->exec_method(
+ funcname => 'eca__get_pricematrix'
+ );
+ if ($self->{account_class} == 1){
+ @{$self->{pricematrix_pricegroup}}= $self->exec_method(
+ funcname => 'eca__get_pricematrix_by_pricegroup'
+ );
+ }
+}
+
+=item delete_pricematrix($entry_id)
+
+This deletes a pricematrix line identified by $entry_id
+
+=cut
+
+sub delete_pricematrix {
+ my $self = shift @_;
+ my ($entry_id) = @_;
+ my ($retval) = $self->exec_method(funcname => 'eca__delete_pricematrix',
+ args => [$self->{credit_id}, $entry_id]
+ );
+ return $retval;
+}
+
+
+=item save_pricematrix
+
+Updates or inserts the price matrix.
+
+=cut
+
+sub save_pricematrix {
+ my $self = shift @_;
+ for my $count (1 .. $self->{pm_rowcount}){
+ my $entry_id = $self->{"pm_$count"};
+ my @args = ();
+ for my $prop (qw()){
+ push @args, $self->{"${prop}_$entry_id"};
+ $self->execute_method(funcname => 'eca__save_pricematrix',
+ args => ..hidden..);
+ }
+ }
+}
+
=back
=head1 COPYRIGHT
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.