latest update
[namibia] / module / Auction / src / Auction / Report / HistoricGrid.php
1 <?php
2 namespace Auction\Report;
3
4
5
6 /**
7  * Stock Contyrol Report.
8  * @author andre.fourie
9  */
10 class HistoricGrid extends \Utility\Service\Report
11 {
12
13
14
15         /**
16          * @var string
17          */
18         protected $_title  = 'Auction Data Export';
19         /**
20          * @var string
21          */
22         protected $_subject = 'Vehicles on auction.';
23         /**
24          * @var string
25          */
26         protected $_description = 'Export of vehicles on auction.';
27         /**
28          * @var array
29          */
30         protected $_notes = array(
31                         'Confidential information, generated using Bid 4 Cars, for more information visit bid4cars.com.na'
32                         );
33         /**
34          * @var array
35          */
36         protected $_headers = array(
37                         'Make',
38                         'Model',
39                         'Type',
40                         'MM Code',
41                         'Year',
42                         'KM',
43                         'Trade Price',
44                         'Recon Costs',
45                         'Highest Bid',
46       'Date Solde'
47                         );
48         /**
49          * @var array
50          */
51         protected $_fields = array(
52                         'make_name',
53                         'model_name',
54                         'type_name',
55       'type_mmCode',
56                         'vehicleYear_name',
57                         'stock_km',
58                         'stock_tradePrice',
59             'stock_listPrice',
60                         'stock_damageTotal',
61                         'stock_highestBid',
62       'auction_endDate'
63                         );
64         /**
65          * @var array
66          */
67         protected $_totals = array(
68                         'stock_tradePrice',
69             'stock_listPrice',
70                         'stock_highestBid',
71                         'stock_damageTotal'
72                         );
73         /**
74          * @var array
75          */
76         protected $_currencyFields = array(
77                         'stock_tradePrice',
78             'stock_listPrice',
79                         'stock_highestBid',
80                         'stock_damageTotal'
81                         );
82
83
84
85         /**
86          * Build the dataset, or not.
87          */
88         public function build()
89         {
90                 #-> Data passed by DataBin Grid functionality.
91                 $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
92                 foreach ($this->_data as $rowId => $rowData)
93                 {
94                         $this->_data[$rowId]['auction_endDate'] = $rowData['auction_endDate']->format($dateTimeFormat);
95                 }
96         }
97
98 }