diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php
index 5a5ccaca..8e592da0 100755
--- a/controllers/jobs_controller.php
+++ b/controllers/jobs_controller.php
@@ -84,6 +84,47 @@ class JobsController extends AppController {
$this->set('year', $year);
$this->set('month', $month);
+
+ if(isset($month) && isset($year)) { //After a Specific Month for a Year
+
+ $nMonth = date('m',strtotime($month));
+
+ $startDate = $year.'-'.$nMonth.'-01';
+
+ $startDateTime = strtotime($startDate);
+
+ $numberOfDaysInMonth = date('t', $startDateTime);
+
+ $endDate = $year.'-'.$nMonth.'-'.$numberOfDaysInMonth;
+
+
+
+ $jobs = $this->Job->find('all', array('conditions'=>
+ array('Job.date_order_received BETWEEN ? AND ?'=>array($startDate, $endDate))));
+
+ $this->set('jobs', $jobs);
+
+ $this->set('principleList',$this->Job->Enquiry->Principle->find('list'));
+
+ $this->set('startDate',$startDate);
+ $this->set('endDate',$endDate);
+
+
+ }
+
+ elseif(isset($year) && !isset($month)) { //After a whole Years Stats.
+
+ }
+
+ else {
+ echo "Failure";
+ }
+
+
+ //$this->set('jobs', )
+
+
+
}
@@ -101,7 +142,15 @@ class JobsController extends AppController {
$time = strtotime($job['Job']['date_order_received']);
$year = date('Y', $time); //ISO-8601 year number
$month = date('F', $time);
- $monthList[$year][$month][] = $job;
+ //$monthList[$year][$month][] = $job;
+
+ if(!isset($monthList[$year][$month])) {
+ $monthList[$year][$month] = 1;
+ }
+ else {
+ $monthList[$year][$month]++;
+ }
+
}
krsort($monthList);
diff --git a/views/jobs/get_editable_row.ctp b/views/jobs/get_editable_row.ctp
index efd40e4d..fc5a28b4 100644
--- a/views/jobs/get_editable_row.ctp
+++ b/views/jobs/get_editable_row.ctp
@@ -122,7 +122,7 @@ else {
=$form->input('gross_profit_aud', array('value'=>$job['Job']['gross_profit_aud'], 'label'=>false ));?>
|
- Net Export Sales Conv to AUD?
+ =$form->input('net_export_sales_aud', array('value'=>$job['Job']['net_export_sales_aud'], 'label'=>false ));?>
|
=$form->input('gross_profit_exports_aud', array('value'=>$job['Job']['gross_profit_exports_aud'], 'label'=>false));?>
diff --git a/views/jobs/get_viewable_row.ctp b/views/jobs/get_viewable_row.ctp
index 7745d577..4a718bc1 100644
--- a/views/jobs/get_viewable_row.ctp
+++ b/views/jobs/get_viewable_row.ctp
@@ -49,7 +49,7 @@
| =$job['Job']['gross_profit_aud'];?>
|
- Net Export Sales Conv to AUD?
+ =$job['Job']['net_export_sales_aud'];?>
|
=$job['Job']['gross_profit_exports_aud'];?>
@@ -57,7 +57,7 @@
|
=$job['Job']['gp_percent'];?>
|
-
+
=$job['Job']['ato_exchange_rate'];?>
|
diff --git a/views/jobs/index.ctp b/views/jobs/index.ctp
index 3af05fbc..f22fcb44 100644
--- a/views/jobs/index.ctp
+++ b/views/jobs/index.ctp
@@ -55,7 +55,7 @@ echo $paginator->counter(array(
sort('Gross Sales AUD');?> |
sort('Net Sales AUD');?> |
sort('Gross Profit AUD');?> |
- sort('Net Export Sales Converted to Or Charged in AUD');?> |
+ sort('Net Export Sales Converted to Or Invoiced in AUD');?> |
sort('Gross Profit Value Export in AUD');?> |
sort('GP% Excl Commissions');?> |
sort('ATO Exchange Rate');?> |
@@ -129,7 +129,7 @@ echo $paginator->counter(array(
=$job['Job']['gross_profit_aud'];?>
|
- Net Export Sales Conv to AUD?
+ =$job['Job']['net_export_sales_aud'];?>
|
=$job['Job']['gross_profit_exports_aud'];?>
diff --git a/views/jobs/reports.ctp b/views/jobs/reports.ctp
index d03562ae..f63bc7bb 100644
--- a/views/jobs/reports.ctp
+++ b/views/jobs/reports.ctp
@@ -10,8 +10,8 @@
- =$year?>
- $job):?>
- - =$month;?>
+ $count):?>
+ - =$month;?> (=$count?>)
diff --git a/views/jobs/view_report.ctp b/views/jobs/view_report.ctp
index 429ee5af..cb8c5c45 100644
--- a/views/jobs/view_report.ctp
+++ b/views/jobs/view_report.ctp
@@ -2,4 +2,89 @@
if(isset($month)):?>
=$month?>
-
\ No newline at end of file
+
+
+
+
+
+ | Order Received |
+ Job Number |
+ Enquiry Number |
+ Principle |
+ Customer |
+ Sale Currency |
+ Gross Sales AUD |
+ Net Sales AUD |
+ Gross Profit AUD |
+ Net Sales Converted to or Charge in AUD |
+ GP% Excl Commissions |
+ ATO Exchange Rate |
+
+
+
+
+
+
+ | =$job['Job']['date_order_received'];?> |
+ =$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?>
+ |
+
+ =$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
+ |
+ =$principleList[$job['Enquiry']['principle_id']];?> |
+
+ =$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?> |
+
+
+ =$job['Currency']['name'];?>
+ |
+
+
+ =$job['Job']['company_gross_sales_aud'];?>
+
+ |
+
+ =$job['Job']['net_sales_aud'];?>
+ |
+
+ =$job['Job']['gross_profit_aud'];?>
+ |
+
+
+ =$job['Job']['gross_profit_exports_aud'];?>
+ |
+
+ =$job['Job']['gp_percent'];?>
+ |
+
+
+ =$job['Job']['ato_exchange_rate'];?>
+ |
+ =$job['Job']['gross_australian_sales_foreign_currency'];?>
+ |
+
+ =$job['Job']['net_australian_sales_foreign_currency'];?>
+ |
+ =$job['Job']['gross_profit_value_australian_sales_foreign_currency'];?>
+ |
+
+ =$job['Job']['gross_export_sales_foreign_currency'];?>
+ |
+ =$job['Job']['net_export_sales_foreign_currency'];?>
+ |
+ =$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'];?>
+ |
+
+ =$job['Job']['gross_commissions'];?>
+ |
+ =$job['Job']['net_commissions'];?>
+ |
+
+
+
+
+
+
+
+print_r($jobs);
+?>
\ No newline at end of file
diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css
index 893d2f04..21f82e9c 100755
--- a/webroot/css/quotenik.css
+++ b/webroot/css/quotenik.css
@@ -1330,27 +1330,32 @@ select.job_status {
/* CSS for the Job Reporting */
#yearMonths {
- width: 10em;
+ width: 6em;
+ float: left;
+ margin-right: 4em;
+}
+
+#reports {
+ float: left;
}
ul.yearList {
list-style: none;
+ margin: 0;
padding-bottom: 1em;
+
}
ul.monthList {
list-style: none;
+ margin: 0;
padding-left: 0.5em;
}
-ul.yearList li.year {
- margin: 1em;
- font-size: 200%;
- cursor: pointer;
-}
ul.monthList li {
- margin-left:1em;
+ margin-left:0.5em;
margin-top:0.5em;
+ width: 10em;
}
span.month {
@@ -1360,9 +1365,3 @@ span.month {
span.year {
cursor: pointer;
}
-
-
-#fixedHeader {
- position: absolute;
- top: 20;
-}
\ No newline at end of file
diff --git a/webroot/js/job_reports.js b/webroot/js/job_reports.js
new file mode 100644
index 00000000..3c4d5268
--- /dev/null
+++ b/webroot/js/job_reports.js
@@ -0,0 +1,29 @@
+$(function() {
+
+
+ $(".year").click(function() {
+ var thisYear = $(this).html();
+ $.get('/jobs/viewReport/'+thisYear, function(data) {
+ $("#reports").html(data);
+ });
+;
+ });
+
+
+ $(".month").click(function() {
+ var thisMonth = $(this).html();
+ var thisYear = $(this).parents('.monthList').attr('id');
+
+ $.get('/jobs/viewReport/'+thisYear+'/'+thisMonth, function(data) {
+ $("#reports").html(data);
+ });
+
+ });
+
+
+
+
+});
+
+
+
|