[freeside-commits] branch FREESIDE_3_BRANCH updated. c54bf9bd1bfcdc57ad2dd68a12d90968a15fbe4c
Ivan
ivan at 420.am
Sun Aug 25 21:06:44 PDT 2013
The branch, FREESIDE_3_BRANCH has been updated
via c54bf9bd1bfcdc57ad2dd68a12d90968a15fbe4c (commit)
from 89a380b8ead73e8762a8687dcc9a3d5deff3d629 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c54bf9bd1bfcdc57ad2dd68a12d90968a15fbe4c
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sun Aug 25 21:06:43 2013 -0700
continue sales person work: customer and package selection, commissions, reporting. RT#23402
diff --git a/FS/FS/sales_pkg_class.pm b/FS/FS/sales_pkg_class.pm
index 0fb7e86..90867a8 100644
--- a/FS/FS/sales_pkg_class.pm
+++ b/FS/FS/sales_pkg_class.pm
@@ -2,7 +2,7 @@ package FS::sales_pkg_class;
use base qw( FS::Record );
use strict;
-#use FS::Record qw( qsearch qsearchs );
+use FS::Record qw( qsearchs ); # qsearch qsearchs );
use FS::sales;
use FS::pkg_class;
@@ -110,6 +110,17 @@ sub check {
$self->SUPER::check;
}
+sub pkg_class {
+ my $self = shift;
+ qsearchs('pkg_class', { 'classnum' => $self->classnum });
+}
+
+sub classname {
+ my $self = shift;
+ my $pkg_class = $self->pkg_class;
+ $pkg_class ? $pkg_class->classname : '(no package class)';
+}
+
=back
=head1 BUGS
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 9d33804..eddcd1c 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -339,7 +339,8 @@ tie my %report_sales, 'Tie::IxHash',
'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ],
'Rated Call Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg_detail.html', 'Sales report and graph (by agent, package class, usage class and/or date range)' ],
'Sales with Advertising Source' => [ $fsurl.'search/report_cust_bill_pkg_referral.html' ],
- 'Sales with Agent Commissions' => [ $fsurl.'search/report_agent_commission.html' ],
+ 'Agent Commissions' => [ $fsurl.'search/report_agent_commission.html' ],
+ 'Sales Person Commissions' => [ $fsurl.'search/report_sales_commission.html' ],
;
tie my %report_financial, 'Tie::IxHash';
diff --git a/httemplate/search/report_sales_commission.html b/httemplate/search/report_sales_commission.html
new file mode 100644
index 0000000..03527f6
--- /dev/null
+++ b/httemplate/search/report_sales_commission.html
@@ -0,0 +1,24 @@
+<% include('/elements/header.html', 'Sales person commission report' ) %>
+
+<FORM ACTION="sales_commission.html">
+
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+<% include( '/elements/tr-select-agent.html' ) %>
+
+<% include( '/elements/tr-select-sales.html' ) %>
+
+<% include( '/elements/tr-input-beginning_ending.html', ) %>
+
+</TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="Get Report">
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+
+</%init>
diff --git a/httemplate/search/sales_commission.html b/httemplate/search/sales_commission.html
new file mode 100644
index 0000000..19e1188
--- /dev/null
+++ b/httemplate/search/sales_commission.html
@@ -0,0 +1,23 @@
+<& elements/search.html,
+ 'title' => 'Sales person commission report',
+ 'name_singular' => 'sales person',
+# 'redirect' => sub { #my( $sales, $cgi ) = @);
+# $saleslink;
+# },
+ 'header' => [ 'Sales person', 'Sales', 'Commission', ],
+ 'fields' => [ 'salesperson', sub{'XXX';}, sub{'XXX';}, ],
+ 'links' => [ '', $saleslink, $commissionlink ],
+ 'query' => { 'table' => 'sales', },
+ 'count_query' => 'SELECT COUNT(*) FROM sales',
+ 'disableable' => 1,
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+
+my $saleslink = [ 'sales_pkg_class.html?salesnum=', 'salesnum' ];
+
+my $commissionlink = ''; #XXX
+
+</%init>
diff --git a/httemplate/search/sales_pkg_class.html b/httemplate/search/sales_pkg_class.html
new file mode 100644
index 0000000..bb67c70
--- /dev/null
+++ b/httemplate/search/sales_pkg_class.html
@@ -0,0 +1,22 @@
+<& elements/search.html,
+ 'title' => $sales->salesperson. ' commission package classes',
+ 'name_singular' => 'package class',
+ 'header' => [ 'Package class', 'Sales', 'Commission', ],
+ 'fields' => [ 'classname', sub{'XXX';}, sub{'XXX';}, ],
+ #'links'
+ 'query' => { 'table' => 'sales_pkg_class',
+ 'hashref' => { 'salesnum' => $salesnum },
+ },
+ 'count_query' => "SELECT COUNT(*) FROM sales_pkg_class WHERE salesnum = $salesnum",
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+
+$cgi->param('salesnum') =~ /^(\d+)$/ or die 'illegal salesnum';
+my $salesnum = $1;
+my $sales = qsearchs('sales', { 'salesnum'=>$salesnum } )
+ or die 'unknown salesnum';
+
+</%init>
-----------------------------------------------------------------------
Summary of changes:
FS/FS/sales_pkg_class.pm | 13 ++++++++++-
httemplate/elements/menu.html | 3 +-
...ommission.html => report_sales_commission.html} | 8 ++++--
httemplate/search/sales_commission.html | 23 ++++++++++++++++++++
httemplate/search/sales_pkg_class.html | 22 +++++++++++++++++++
5 files changed, 64 insertions(+), 5 deletions(-)
copy httemplate/search/{report_agent_commission.html => report_sales_commission.html} (59%)
create mode 100644 httemplate/search/sales_commission.html
create mode 100644 httemplate/search/sales_pkg_class.html
More information about the freeside-commits
mailing list