diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php index d5d5d46c..6173bff5 100755 --- a/controllers/jobs_controller.php +++ b/controllers/jobs_controller.php @@ -127,22 +127,29 @@ class JobsController extends AppController { if(isset($month) && isset($year)) { //After a Specific Month for a Year - $nMonth = date('m',strtotime($month)); - - $startDate = $year.'-'.$nMonth.'-01'; + + + $startDate = $year.'-'.$month.'-01'; $startDateTime = strtotime($startDate); $numberOfDaysInMonth = date('t', $startDateTime); - $endDate = $year.'-'.$nMonth.'-'.$numberOfDaysInMonth; - + $endDate = $year.'-'.$month.'-'.$numberOfDaysInMonth; + $jobRangeTitle = "$month/$year"; $jobs = $this->Job->find('all', array('conditions'=> - array('Job.date_order_received BETWEEN ? AND ?'=>array($startDate, $endDate)))); + array('Job.date_order_received BETWEEN ? AND ?'=>array($startDate, $endDate)), + 'order'=>'Job.date_order_received ASC')); + /* $dateStringFormat = 'j F Y'; + $dateString['first'] = date($dateStringFormat, $firstDayUnix); + $dateString['last'] = date($dateStringFormat, $lastDayUnix); +*/ + $this->set('jobRangeTitle', $jobRangeTitle); + $this->set('year', $year); $this->set('month', $month); @@ -296,7 +303,6 @@ class JobsController extends AppController { $startFYunix = $this->getFirstDayFY($year); //1 July of $year. - $month = date('n', $time); if($time < $startFYunix) { //Date is before 1 July $year. $lastYear = $year - 1; diff --git a/views/jobs/reports.ctp b/views/jobs/reports.ctp index c6ff95b6..cce89107 100644 --- a/views/jobs/reports.ctp +++ b/views/jobs/reports.ctp @@ -18,7 +18,9 @@ -
| Gross Sales AUD | +Net Sales AUD | +Gross Profit AUD | +Net Export Sales Converted to Or Invoiced in AUD | +Gross Profit Value Export in AUD | +GP% Excl Commissions | + +Gross Australian Sales Foreign Currency | +Net Australian Sales Foreign Currency | +Gross Profit value Australian Sales Foreign Currency | +Gross Export Sales Foreign Currency | +Net Export Sales Foreign Currency | +Gross Profit Value After Discount Exports Foreign Currency | +Gross Commissions | +Net Commisions | + +
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| =$number->currency($totals['company_gross_sales_aud']);?> | +=$number->currency($totals['net_sales_aud']);?> | +=$number->currency($totals['gross_profit_aud']);?> | + +=$number->currency($totals['net_export_sales_aud']);?> | +=$number->currency($totals['gross_profit_exports_aud']);?> | +=$number->toPercentage($totals['gp_percent']);?> | + +=$number->currency($totals['gross_australian_sales_foreign_currency']);?> | +=$number->currency($totals['net_australian_sales_foreign_currency']);?> | +=$number->currency($totals['gross_profit_value_australian_sales_foreign_currency']);?> | +=$number->currency($totals['gross_export_sales_foreign_currency']);?> | +=$number->currency($totals['net_export_sales_foreign_currency']);?> | +=$number->currency($totals['gross_profit_value_after_discount_exports_foreign_currency']);?> | +=$number->currency($totals['gross_commissions']);?> | +=$number->currency($totals['net_commissions']);?> | + +
| Order Received | -All Paid | -All Sent | -Status | -Sale Category | -Job Type | -Shipment Category | -Job Number | -Enquiry Number | -Principle | -CMC POs | -Customer | -Sale Currency | -Gross Sales AUD | -Net Sales AUD | -Gross Profit AUD | -Net Export Sales Converted to Or Invoiced in AUD | -Gross Profit Value Export in AUD | -GP% Excl Commissions | -ATO Exchange Rate | -Gross Australian Sales Foreign Currency | -Net Australian Sales Foreign Currency | -Gross Profit value Australian Sales Foreign Currency | -Gross Export Sales Foreign Currency | -Net Export Sales Foreign Currency | -Gross Profit Value After Discount Exports Foreign Currency | -Gross Commissions | -Net Commisions | -
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| //Order Recd ?> | -//All Paid ?> | -//All Sent ?> | -//Status ?> | -//Sale Cat ?> | -//Job Type ?> | -// Ship Cat ?> | -// Job No ?> | -// Enq No ?> | -// Principle ?> | -// CMC PO ?> | -// Customer ?> | -// Sale Currenct ?> | -=$number->currency($totals['company_gross_sales_aud']);?> | -=$number->currency($totals['net_sales_aud']);?> | -=$number->currency($totals['gross_profit_aud']);?> | - -=$number->currency($totals['net_export_sales_aud']);?> | -=$number->currency($totals['gross_profit_exports_aud']);?> | -=$number->toPercentage($totals['gp_percent']);?> | -//ATO Exch Rate?> | -=$number->currency($totals['gross_australian_sales_foreign_currency']);?> | -=$number->currency($totals['net_australian_sales_foreign_currency']);?> | -=$number->currency($totals['gross_profit_value_australian_sales_foreign_currency']);?> | -=$number->currency($totals['gross_export_sales_foreign_currency']);?> | -=$number->currency($totals['net_export_sales_foreign_currency']);?> | -=$number->currency($totals['gross_profit_value_after_discount_exports_foreign_currency']);?> | -=$number->currency($totals['gross_commissions']);?> | -=$number->currency($totals['net_commissions']);?> | - -