initial commit
[namibia] / module / Valuation / src / Valuation / DataBin / Valuation.php
1 <?php
2
3 namespace Valuation\DataBin;
4
5 /**
6  * Manage Valuation data.
7  * @author andre.fourie
8  */
9 class Valuation extends \Workspace\Service\DataBin
10 {
11
12         /**
13          * @var array
14          */
15         protected $meta = array(
16                 'Base'        => 'Valuation',
17                 'DatasetName' => 'valuations',
18                 'Entity'      => '\Valuation\Entity\Valuation',
19                 'References'  => array(
20                         'stock'                 => '\Stock\Entity\Stock',
21                         'createdBy'             => '\User\Entity\Profile',
22                         'valuatedBy'            => '\User\Entity\Profile',
23                         'salesProfile'          => '\User\Entity\Profile',
24                         'managerProfile'        => '\User\Entity\Profile',
25                         'region'                => '\Location\Entity\Region',
26                         'city'                  => '\Location\Entity\Town',
27             'dealNotDoneSelection'  => '\Valuation\Entity\DealNotDoneSelection',
28             'sendToStockFrom'       => '\Valuation\Entity\SendToStockFrom'
29                 ),
30                 'Dependants'  => array()
31         );
32
33
34         /**
35          * @var array
36          */
37         protected $metaList = array(
38                 'Contract'      => 'Recurring',
39                 'RequireAuth'   => true,
40                 'RequiredInput' => array(),
41                 'OptionalInput' => array(
42                         'Filter' => array(
43                                 'created'                   => 'Date',
44                                 'updated'                   => 'Date',
45                                 'valuationNumber'           => 'String12',
46                                 'stock'                     => 'Id',
47                                 'department'                => 'Department',
48                                 'valuationNumber'           => 'String12',
49                                 'createdBy'                 => 'Id',
50                                 'valuatedBy'                => 'Id',
51                                 'salesProfile'              => 'Id',
52                                 'managerProfile'            => 'Id',
53                                 'firstName'                 => 'String50',
54                                 'familyName'                => 'String50',
55                                 'idNumber'                  => 'IdNumber',
56                                 'mobile'                    => 'Mobile',
57                                 'email'                     => 'String250',
58                 'bankSettlement'             => 'Decimal',
59                                 'amountOffered'             => 'Decimal',
60                                 'overAllowance'             => 'Decimal',
61                                 'standInValue'              => 'Decimal',
62                                 'projectedRetail'           => 'Decimal',
63                                 'plannedMargin'             => 'Decimal',
64                                 'jobState'                  => 'String25',
65                                 'type'                      => 'Id',
66                                 'isPublicCustomer'          => 'Boolean',
67                                 'customerAddressStreet'     => 'String150',
68                                 'customerAddressStreetName' => 'String150',
69                                 'customerAddressSuburb'     => 'String150',
70                                 'customerAddressCity'       => 'String150',
71                                 'customerAddressPostalCode' => 'String150',
72                         )
73                 ),
74                 'Filter'        => array(),
75                 'Fields'        => array(
76                         'valuationNumber',
77                         'stock',
78                         'department',
79                         'createdBy',
80                         'valuatedBy',
81                         'salesProfile',
82                         'managerProfile',
83                         'firstName',
84                         'familyName',
85                         'jobState',
86                         'type',
87                         'isPublicCustomer',
88                         'customerAddressStreet',
89                         'customerAddressStreetName',
90                         'customerAddressSuburb',
91                         'customerAddressCity',
92                         'customerAddressPostalCode'
93                 ),
94                 'Expand'        => array()
95         );
96
97         /**
98          * @var array
99          */
100         protected $metaSelectList = array(
101                 'Contract'      => 'Recurring',
102                 'RequireAuth'   => true,
103                 'RequiredInput' => array(),
104                 'OptionalInput' => array(
105                         'Filter' => array(
106                                 'created'                   => 'Date',
107                                 'updated'                   => 'Date',
108                                 'valuationNumber'           => 'String12',
109                                 'stock'                     => 'Id',
110                                 'department'                => 'Department',
111                                 'valuationNumber'           => 'String12',
112                                 'createdBy'                 => 'Id',
113                                 'valuatedBy'                => 'Id',
114                                 'salesProfile'              => 'Id',
115                                 'managerProfile'            => 'Id',
116                                 'firstName'                 => 'String50',
117                                 'familyName'                => 'String50',
118                                 'idNumber'                  => 'IdNumber',
119                                 'mobile'                    => 'Mobile',
120                                 'email'                     => 'String250',
121                 'bankSettlement'             => 'Decimal',
122                                 'amountOffered'             => 'Decimal',
123                                 'overAllowance'             => 'Decimal',
124                                 'standInValue'              => 'Decimal',
125                                 'projectedRetail'           => 'Decimal',
126                                 'plannedMargin'             => 'Decimal',
127                                 'jobState'                  => 'String25',
128                                 'customerAddressStreet'     => 'String150',
129                                 'customerAddressStreetName' => 'String150',
130                                 'customerAddressSuburb'     => 'String150',
131                                 'customerAddressCity'       => 'String150',
132                                 'customerAddressPostalCode' => 'String150'
133                         )
134                 ),
135                 'Filter'        => array(),
136                 'Label'         => array(
137                         'Format' => '[valuationNumber] ([firstName] [familyName])',
138                         'Fields' => array('valuationNumber', 'firstName', 'familyName')
139                 )
140         );
141
142         /**
143          * @var array
144          */
145         protected $metaGrid = array(
146                 'Type'            => 'Grid',
147                 'RequireAuth'     => true,
148                 'Export'          => true,
149                 'Builder'         => '\Valuation\Report\ValuationGrid',
150                 'Writer'          => '\Utility\Export\ExcelReport',
151                 'Output'          => 'Download',
152                 'Contract'        => 'Recurring',
153                 'Options'         => array(
154                         'Boolean' => array(
155                                 'ExportToExcel' => false
156                         )
157                 ),
158                 'RequiredInput'   => array(),
159                 'OptionalInput'   => array(
160                         'Grid' => array(
161                                 'NumberOfRecords' => 'Integer',
162                                 'Page'            => 'Integer',
163                                 'Filter'          => 'Array',
164                                 'OrderBy'         => 'Array',
165                         )
166                 ),
167                 'Base'            => 'stock',
168                 'NumberOfRecords' => 20,
169                 'Query'           => 'SELECT [SELECTION]
170                 FROM \Valuation\Entity\Valuation valuation
171                 JOIN valuation.stock stock
172                 JOIN stock.company company
173                 JOIN stock.vehicleYear vehicleYear
174                 JOIN stock.type type
175                 JOIN type.model model
176                 JOIN model.make make
177                 LEFT JOIN valuation.dealNotDoneSelection dealNotDoneSelection
178                 LEFT JOIN valuation.sendToStockFrom sendToStockFrom
179                 LEFT JOIN company.group companyGroup
180                 LEFT JOIN company.groupDivision groupDivision
181                 LEFT JOIN valuation.createdBy createdProfile
182                 LEFT JOIN valuation.salesProfile salesProfile
183                 LEFT JOIN valuation.managerProfile managerProfile
184                 LEFT JOIN stock.exteriorColour exteriorColour
185                 LEFT JOIN stock.priceGuide priceGuide
186                 [WHERE] [ORDER]',
187                 'Selection'       => 'valuation, stock, company, companyGroup, groupDivision, exteriorColour, vehicleYear, make, model, type, salesProfile, managerProfile, priceGuide, dealNotDoneSelection, sendToStockFrom',
188                 'Filter'          => array(
189                         'valuation.archived' => false,
190                         'valuation.jobState' => '!=Stock'
191                 ),
192                 'OrderBy'         => array('stock.created' => 'DESC'),
193                 'Fields'          => array(
194                         'id',
195                         'salesProfile'   => array(
196                                 'firstName',
197                                 'familyName'
198                         ),
199             'dealNotDoneSelection'=> array(
200                 'name'
201             ),
202             'sendToStockFrom'=> array(
203                 'name'
204             ),
205                         'managerProfile' => array(
206                                 'firstName',
207                                 'familyName'
208                         ),
209                         'stock'          => array(
210                                 'referenceNumber',
211                                 'created'     => 'DateTime',
212                                 'registrationNumber',
213                                 'vinNumber',
214                                 'type'        => array(
215                                         'name',
216                                         'mmCode',
217                                         'model' => array(
218                                                 'name',
219                                                 'make' => array(
220                                                         'name'
221                                                 )
222                                         ),
223                                 ),
224                                 'vehicleYear' => array(
225                                         'name'
226                                 ),
227                                 'km',
228                                 'tradePrice',
229                                 'retailPrice',
230                                 'listPrice',
231                                 'loadedOnPriceGuide',
232                                 'numberOfOffers',
233                                 'highestOffer',
234                                 'priceGuide'  => array(
235                                         'id'
236                                 )
237                         ),
238                         'amountOffered',
239                         'jobState',
240                         'previousState'
241                 )
242         );
243
244         /**
245          * @var array
246          */
247         protected $metaView = array(
248                 'Type'        => 'View',
249                 'Expand'      => array(
250                         'model',
251                         'make',
252                         'type'
253                 ),
254                 'Intersect'   => array(),
255                 'ExpandDepth' => 2
256         );
257
258         /**
259          * @var array
260          */
261         protected $metaCreatePublic = array(
262                 'Type'                   => 'Create',
263                 'Contract'               => 'Recurring',
264                 'Flags'                  => array(
265                         'NewStockItem.FromValuation' => true,
266                         'NewValuationItem.Status'    => 'This.NewValuation'
267                 ),
268                 'RelatedEntityFromInput' => array(
269                         'Stock' => array(
270                                 'Workflow' => '\Stock\Workflow',
271                                 'Service'  => '\Stock\Service\Stock',
272                                 'Field'    => 'stock'
273                         )
274                 ),
275                 'ExecuteBefore'          => array(
276                         'addCustomVehicles'
277                 ),
278                 'ExecuteAfter'           => array(
279                         'sendToMobileQueue',
280                         'sendToValuators',
281                         'setStockLink',
282                         'generateHistoryList',
283                         'checkCreatedBy'
284                 ),
285                 'RequiredInput'          => array(
286                         'Valuation' => array(
287                                 'firstName'  => 'String50',
288                                 'familyName' => 'String50',
289                                 'mobile'     => 'Mobile'
290                         ),
291                         'Stock'     => array(
292                                 'vehicleYear'        => 'Id',
293                                 'registrationNumber' => 'String15',
294                                 'fuelType'           => 'Id',
295                                 'transmissionType'   => 'Id'
296                         )
297                 ),
298                 'OptionalInput'          => array(
299                         'Valuation' => array(
300                                 'department'                => 'Department',
301                                 'idNumber'                  => 'IdNumber',
302                                 'email'                     => 'String250',
303                                 'region'                    => 'Id',
304                                 'city'                      => 'Id',
305                                 'street'                    => 'String100',
306                                 'requiredPrice'             => 'Decimal',
307                 'bankSettlement'            => 'Decimal',
308                                 'amountOffered'             => 'Decimal',
309                                 'overAllowance'             => 'Decimal',
310                                 'standInValue'              => 'Decimal',
311                                 'projectedRetail'           => 'Decimal',
312                                 'plannedMargin'             => 'Decimal',
313                                 'valuators'                 => 'Array',
314                                 'sighted'                   => 'Boolean',
315                                 'licenseDiscExpired'        => 'Boolean',
316                                 'customerAddressStreet'     => 'String150',
317                                 'customerAddressStreetName' => 'String150',
318                                 'customerAddressSuburb'     => 'String150',
319                                 'customerAddressCity'       => 'String150',
320                                 'customerAddressPostalCode' => 'String150',
321                 'sendToStockFrom'           => 'Id',
322                 'dealNotDoneSelection'      => 'Id',
323                 'dealNotDoneReason'         => 'String150',
324                         ),
325                         'Stock'     => array(
326                                 'category'             => 'Id',
327                                 'make'                 => 'Id',
328                                 'model'                => 'Id',
329                                 'type'                 => 'Id',
330                                 'region'               => 'Id',
331                                 'vinNumber'            => 'String40',
332                                 'engineNumber'         => 'String40',
333                                 'exteriorColour'       => 'Id',
334                                 'interiorColour'       => 'Id',
335                                 'condition'            => 'Id',
336                                 'km'                   => 'Integer',
337                                 'upholstery'           => 'Id',
338                                 'papers'               => 'Id',
339                                 'natis'                => 'Id',
340                                 'spareKeys'            => 'Boolean',
341                                 'fullServiceHistory'   => 'Id',
342                                 'fshNotes'             => 'String500',
343                                 'tradePrice'           => 'Decimal',
344                                 'retailPrice'          => 'Decimal',
345                                 'listPrice'            => 'Decimal',
346                                 'purchasePrice'        => 'Decimal',
347                                 'salePrice'            => 'Decimal',
348                                 'mainImage'            => 'Id',
349                                 'frontImage'           => 'Id',
350                                 'rightImage'           => 'Id',
351                                 'leftImage'            => 'Id',
352                                 'backImage'            => 'Id',
353                                 'interiorImage'        => 'Id',
354                                 'engineImage'          => 'Id',
355                                 'natisImage'           => 'Id',
356                                 'accessories'          => 'Collection',
357                                 'accessoryNotes'       => 'String500',
358                                 'damages'              => 'Collection',
359                                 'damageTotal'          => 'Decimal',
360                                 'previousRepairsNoted' => 'Boolean',
361                                 'previousRepairsNotes' => 'String500',
362                                 'damageNotes'          => 'String500',
363                                 'coverReceived'        => 'String500',
364                                 'publicCentre'         => 'Id',
365                                 'makeManual'           => 'String150',
366                                 'modelManual'          => 'String150',
367                                 'typeManual'           => 'String150'
368                         )
369                 )
370         );
371
372
373         /**
374          * @var array
375          */
376         protected $metaCreateCustomerPublic = array(
377                 'Type'                   => 'Create',
378                 'Contract'               => 'Recurring',
379                 'Flags'                  => array(
380                         'NewStockItem.FromValuation' => true,
381                         'NewValuationItem.Status'    => 'This.NewValuation'
382                 ),
383                 'RelatedEntityFromInput' => array(
384                         'Stock' => array(
385                                 'Workflow' => '\Stock\Workflow',
386                                 'Service'  => '\Stock\Service\Stock',
387                                 'Field'    => 'stock'
388                         )
389                 ),
390                 'ExecuteBefore'          => array(
391                         'addCustomVehicles'
392                 ),
393                 'ExecuteAfter'           => array(
394                         'sendToMobileQueue',
395                         'sendToValuators',
396                         'setStockLinkCustomer',
397                         'setStockLink',
398                         'generateHistoryList',
399                         'checkCreatedBy',
400             'sendEmailToValuator'
401                 ),
402                 'RequiredInput'          => array(
403                         'Valuation' => array(
404                                 'firstName'  => 'String50',
405                                 'familyName' => 'String50',
406                                 'mobile'     => 'Mobile'
407                         ),
408                         'Stock'     => array(
409                                 'vehicleYear'        => 'Id',
410                                 'registrationNumber' => 'String15',
411                                 'fuelType'           => 'Id',
412                                 'transmissionType'   => 'Id'
413                         )
414                 ),
415                 'OptionalInput'          => array(
416                         'Valuation' => array(
417                                 'department'                => 'Department',
418                                 'idNumber'                  => 'IdNumber',
419                                 'email'                     => 'String250',
420                                 'region'                    => 'Id',
421                                 'city'                      => 'Id',
422                                 'street'                    => 'String100',
423                                 'requiredPrice'             => 'Decimal',
424                 'bankSettlement'             => 'Decimal',
425                                 'amountOffered'             => 'Decimal',
426                                 'overAllowance'             => 'Decimal',
427                                 'standInValue'              => 'Decimal',
428                                 'projectedRetail'           => 'Decimal',
429                                 'plannedMargin'             => 'Decimal',
430                                 'valuators'                 => 'Array',
431                                 'sighted'                   => 'Boolean',
432                                 'licenseDiscExpired'        => 'Boolean',
433                                 'customerAddressStreet'     => 'String150',
434                                 'customerAddressStreetName' => 'String150',
435                                 'customerAddressSuburb'     => 'String150',
436                                 'customerAddressCity'       => 'String150',
437                                 'customerAddressPostalCode' => 'String150',
438                 'sendToStockFrom'           => 'Id',
439                 'dealNotDoneSelection'      => 'Id',
440                 'dealNotDoneReason'         => 'String150',
441                         ),
442                         'Stock'     => array(
443                                 'category'             => 'Id',
444                                 'make'                 => 'Id',
445                                 'model'                => 'Id',
446                                 'type'                 => 'Id',
447                                 'region'               => 'Id',
448                                 'vinNumber'            => 'String40',
449                                 'engineNumber'         => 'String40',
450                                 'exteriorColour'       => 'Id',
451                                 'interiorColour'       => 'Id',
452                                 'condition'            => 'Id',
453                                 'km'                   => 'Integer',
454                                 'upholstery'           => 'Id',
455                                 'papers'               => 'Id',
456                                 'natis'                => 'Id',
457                                 'spareKeys'            => 'Boolean',
458                                 'fullServiceHistory'   => 'Id',
459                                 'fshNotes'             => 'String500',
460                                 'tradePrice'           => 'Decimal',
461                                 'retailPrice'          => 'Decimal',
462                                 'listPrice'            => 'Decimal',
463                                 'purchasePrice'        => 'Decimal',
464                                 'salePrice'            => 'Decimal',
465                                 'mainImage'            => 'Id',
466                                 'frontImage'           => 'Id',
467                                 'rightImage'           => 'Id',
468                                 'leftImage'            => 'Id',
469                                 'backImage'            => 'Id',
470                                 'interiorImage'        => 'Id',
471                                 'engineImage'          => 'Id',
472                                 'natisImage'           => 'Id',
473                                 'accessories'          => 'Collection',
474                                 'accessoryNotes'       => 'String500',
475                                 'damages'              => 'Collection',
476                                 'damageTotal'          => 'Decimal',
477                                 'previousRepairsNoted' => 'Boolean',
478                                 'previousRepairsNotes' => 'String500',
479                                 'damageNotes'          => 'String500',
480                                 'coverReceived'        => 'String500',
481                                 'publicCentre'         => 'Id',
482                                 'makeManual'           => 'String150',
483                                 'modelManual'          => 'String150',
484                                 'typeManual'           => 'String150'
485                         )
486                 )
487         );
488
489
490         /**
491          * @var array
492          */
493         protected $metaCreateCompleteCustomerPublic = array(
494                 'Type'                   => 'Create',
495                 'Contract'               => 'Recurring',
496                 'Flags'                  => array(
497                         'NewStockItem.FromValuation' => true,
498                         'NewValuationItem.Status'    => 'This.PendingValuation'
499                 ),
500                 'RelatedEntityFromInput' => array(
501                         'Stock' => array(
502                                 'Workflow' => '\Stock\Workflow',
503                                 'Service'  => '\Stock\Service\Stock',
504                                 'Field'    => 'stock'
505                         )
506                 ),
507                 'ExecuteBefore'          => array(
508                         'addCustomVehicles'
509                 ),
510                 'ExecuteAfter'           => array(
511                         'sendToMobileQueue',
512                         'sendToValuators',
513                         'setStockLinkCustomer',
514                         'setStockLink',
515                         'generateHistoryList',
516                         'checkCreatedBy',
517                         'setAppointmentData',
518                         'pushCreateAction'
519                 ),
520                 'RequiredInput'          => array(
521                         'Valuation' => array(
522                                 'firstName'  => 'String50',
523                                 'familyName' => 'String50',
524                                 'mobile'     => 'Mobile'
525                         ),
526                         'Stock'     => array(
527                                 'vehicleYear'        => 'Id',
528                                 'registrationNumber' => 'String15',
529                                 'fuelType'           => 'Id',
530                                 'transmissionType'   => 'Id'
531                         )
532                 ),
533                 'OptionalInput'          => array(
534                         'Valuation' => array(
535                                 'department'                => 'Department',
536                                 'idNumber'                  => 'IdNumber',
537                                 'email'                     => 'String250',
538                                 'region'                    => 'Id',
539                                 'city'                      => 'Id',
540                                 'street'                    => 'String100',
541                                 'requiredPrice'             => 'Decimal',
542                 'bankSettlement'             => 'Decimal',
543                                 'amountOffered'             => 'Decimal',
544                                 'overAllowance'             => 'Decimal',
545                                 'standInValue'              => 'Decimal',
546                                 'projectedRetail'           => 'Decimal',
547                                 'plannedMargin'             => 'Decimal',
548                                 'valuators'                 => 'Array',
549                                 'sighted'                   => 'Boolean',
550                                 'licenseDiscExpired'        => 'Boolean',
551                                 'customerAddressStreet'     => 'String150',
552                                 'customerAddressStreetName' => 'String150',
553                                 'customerAddressSuburb'     => 'String150',
554                                 'customerAddressCity'       => 'String150',
555                 'customerAddressPostalCode' => 'String150',
556                                 'valuatorSelected'          => 'Id',
557                                 'dateSelected'              => 'Date',
558                                 'timeSelected'              => 'String150',
559                                 'timeIdSelected'            => 'Id',
560                 'sendToStockFrom'           => 'Id',
561                 'dealNotDoneSelection'      => 'Id',
562                 'dealNotDoneReason'         => 'String150',
563                         ),
564                         'Stock'     => array(
565                                 'category'             => 'Id',
566                                 'make'                 => 'Id',
567                                 'model'                => 'Id',
568                                 'type'                 => 'Id',
569                                 'region'               => 'Id',
570                                 'vinNumber'            => 'String40',
571                                 'engineNumber'         => 'String40',
572                                 'exteriorColour'       => 'Id',
573                                 'interiorColour'       => 'Id',
574                                 'condition'            => 'Id',
575                                 'km'                   => 'Integer',
576                                 'upholstery'           => 'Id',
577                                 'papers'               => 'Id',
578                                 'natis'                => 'Id',
579                                 'spareKeys'            => 'Boolean',
580                                 'fullServiceHistory'   => 'Id',
581                                 'fshNotes'             => 'String500',
582                                 'tradePrice'           => 'Decimal',
583                                 'retailPrice'          => 'Decimal',
584                                 'listPrice'            => 'Decimal',
585                                 'purchasePrice'        => 'Decimal',
586                                 'salePrice'            => 'Decimal',
587                                 'mainImage'            => 'Id',
588                                 'frontImage'           => 'Id',
589                                 'rightImage'           => 'Id',
590                                 'leftImage'            => 'Id',
591                                 'backImage'            => 'Id',
592                                 'interiorImage'        => 'Id',
593                                 'engineImage'          => 'Id',
594                                 'natisImage'           => 'Id',
595                                 'accessories'          => 'Collection',
596                                 'accessoryNotes'       => 'String500',
597                                 'damages'              => 'Collection',
598                                 'damageTotal'          => 'Decimal',
599                                 'previousRepairsNoted' => 'Boolean',
600                                 'previousRepairsNotes' => 'String500',
601                                 'damageNotes'          => 'String500',
602                                 'coverReceived'        => 'String500',
603                                 'publicCentre'         => 'Id',
604                                 'makeManual'           => 'String150',
605                                 'modelManual'          => 'String150',
606                                 'typeManual'           => 'String150'
607                         )
608                 )
609         );
610
611     /**
612      * @var array
613      */
614     protected $metaUpdateCompleteCustomerPublic = array(
615         'Type'                   => 'Update',
616         'Contract'               => 'UseOnce',
617         'RequireAuth'            => false,
618         'Expand'                 => array(
619             'category',
620             'make',
621             'model',
622             'type',
623             'stock',
624             'priceGuide',
625             'mainImage',
626             'frontImage',
627             'rightImage',
628             'leftImage',
629             'backImage',
630             'interiorImage',
631             'engineImage',
632             'natisImage',
633             'createdBy',
634             'valuatedBy',
635             'salesProfile',
636             'valuators',
637             'region',
638             'city',
639             'company',
640             'contact'
641         ),
642         'ExecuteBefore'          => array(
643             'updateCustomVehicles'
644         ),
645         'ExecuteAfter'           => array(
646             'sendToMobileQueue',
647             'pushUpdateAction',
648             'setAppointmentData'
649         ),
650         'RelatedEntityFromInput' => array(
651             'Stock' => array(
652                 'Workflow' => '\Stock\Workflow',
653                 'Service'  => '\Stock\Service\Stock',
654                 'Field'    => 'stock'
655             )
656         ),
657         'RequiredInput'          => array(
658             'Valuation' => array(
659                 'firstName'  => 'String50',
660                 'familyName' => 'String50',
661                 'mobile'     => 'Mobile'
662             ),
663             'Stock'     => array()
664         ),
665         'OptionalInput'          => array(
666             'Valuation' => array(
667                 'department'                => 'Department',
668                 'idNumber'                  => 'IdNumber',
669                 'email'                     => 'String250',
670                 'region'                    => 'Id',
671                 'city'                      => 'Id',
672                 'street'                    => 'String100',
673                 'requiredPrice'             => 'Decimal',
674                 'bankSettlement'             => 'Decimal',
675                 'amountOffered'             => 'Decimal',
676                 'overAllowance'             => 'Decimal',
677                 'standInValue'              => 'Decimal',
678                 'projectedRetail'           => 'Decimal',
679                 'plannedMargin'             => 'Decimal',
680                 'valuators'                 => 'Array',
681                 'sighted'                   => 'Boolean',
682                 'licenseDiscExpired'        => 'Boolean',
683                 'customerAddressStreet'     => 'String150',
684                 'customerAddressStreetName' => 'String150',
685                 'customerAddressSuburb'     => 'String150',
686                 'customerAddressCity'       => 'String150',
687                 'customerAddressPostalCode' => 'String150',
688                 'valuatorSelected'          => 'Id',
689                 'dateSelected'              => 'Date',
690                 'timeSelected'              => 'String150',
691                 'timeIdSelected'            => 'Id',
692                 'sendToStockFrom'           => 'Id',
693                 'dealNotDoneSelection'      => 'Id',
694                 'dealNotDoneReason'         => 'String150',
695             ),
696             'Stock'     => array(
697                 'category'             => 'Id',
698                 'make'                 => 'Id',
699                 'model'                => 'Id',
700                 'type'                 => 'Id',
701                 'region'               => 'Id',
702                 'vinNumber'            => 'String40',
703                 'engineNumber'         => 'String40',
704                 'exteriorColour'       => 'Id',
705                 'interiorColour'       => 'Id',
706                 'condition'            => 'Id',
707                 'km'                   => 'Integer',
708                 'upholstery'           => 'Id',
709                 'papers'               => 'Id',
710                 'natis'                => 'Id',
711                 'spareKeys'            => 'Boolean',
712                 'fullServiceHistory'   => 'Id',
713                 'fshNotes'             => 'String500',
714                 'tradePrice'           => 'Decimal',
715                 'retailPrice'          => 'Decimal',
716                 'listPrice'            => 'Decimal',
717                 'purchasePrice'        => 'Decimal',
718                 'salePrice'            => 'Decimal',
719                 'mainImage'            => 'Id',
720                 'frontImage'           => 'Id',
721                 'rightImage'           => 'Id',
722                 'leftImage'            => 'Id',
723                 'backImage'            => 'Id',
724                 'interiorImage'        => 'Id',
725                 'engineImage'          => 'Id',
726                 'natisImage'           => 'Id',
727                 'accessories'          => 'Collection',
728                 'accessoryNotes'       => 'String500',
729                 'damages'              => 'Collection',
730                 'damageTotal'          => 'Decimal',
731                 'previousRepairsNoted' => 'Boolean',
732                 'previousRepairsNotes' => 'String500',
733                 'damageNotes'          => 'String500',
734                 'coverReceived'        => 'String500',
735                 'publicCentre'         => 'Id',
736                 'makeManual'           => 'String150',
737                 'modelManual'          => 'String150',
738                 'typeManual'           => 'String150'
739             )
740         )
741     );
742
743         /**
744          * @var array
745          */
746         protected $metaCreateNew = array(
747                 'Type'                   => 'Create',
748                 'Contract'               => 'Recurring',
749                 'RequireAuth'            => true,
750                 'Flags'                  => array(
751                         'NewStockItem.FromValuation' => true,
752                         'NewValuationItem.Status'    => 'This.NewValuation'
753                 ),
754                 'RelatedEntityFromInput' => array(
755                         'Stock' => array(
756                                 'Workflow' => '\Stock\Workflow',
757                                 'Service'  => '\Stock\Service\Stock',
758                                 'Field'    => 'stock'
759                         )
760                 ),
761                 'ExecuteBefore'          => array(
762                         'addCustomVehicles'
763                 ),
764                 'ExecuteAfter'           => array(
765                         'sendToMobileQueue',
766                         'sendToValuators',
767                         'setStockLink',
768                         'generateHistoryList',
769                         'checkCreatedBy',
770                         'pushCreateAction'
771                 ),
772                 'RequiredInput'          => array(
773                         'Valuation' => array(
774                                 'firstName'  => 'String50',
775                                 'familyName' => 'String50',
776                                 'mobile'     => 'Mobile'
777                         ),
778                         'Stock'     => array(
779                                 'vehicleYear'        => 'Id',
780                                 'registrationNumber' => 'String15',
781                                 'fuelType'           => 'Id',
782                                 'transmissionType'   => 'Id'
783                         )
784                 ),
785                 'OptionalInput'          => array(
786                         'Valuation' => array(
787                                 'department'                => 'Department',
788                                 'idNumber'                  => 'IdNumber',
789                                 'email'                     => 'String250',
790                                 'region'                    => 'Id',
791                                 'city'                      => 'Id',
792                                 'street'                    => 'String100',
793                                 'requiredPrice'             => 'Decimal',
794                 'bankSettlement'             => 'Decimal',
795                                 'amountOffered'             => 'Decimal',
796                                 'overAllowance'             => 'Decimal',
797                                 'standInValue'              => 'Decimal',
798                                 'projectedRetail'           => 'Decimal',
799                                 'plannedMargin'             => 'Decimal',
800                                 'valuators'                 => 'Array',
801                                 'sighted'                   => 'Boolean',
802                                 'licenseDiscExpired'        => 'Boolean',
803                                 'customerAddressStreet'     => 'String150',
804                                 'customerAddressStreetName' => 'String150',
805                                 'customerAddressSuburb'     => 'String150',
806                                 'customerAddressCity'       => 'String150',
807                                 'customerAddressPostalCode' => 'String150',
808                 'sendToStockFrom'           => 'Id',
809                 'dealNotDoneSelection'      => 'Id',
810                 'dealNotDoneReason'         => 'String150',
811                         ),
812                         'Stock'     => array(
813                                 'category'             => 'Id',
814                                 'make'                 => 'Id',
815                                 'model'                => 'Id',
816                                 'type'                 => 'Id',
817                                 'region'               => 'Id',
818                                 'vinNumber'            => 'String40',
819                                 'engineNumber'         => 'String40',
820                                 'exteriorColour'       => 'Id',
821                                 'interiorColour'       => 'Id',
822                                 'condition'            => 'Id',
823                                 'km'                   => 'Integer',
824                                 'upholstery'           => 'Id',
825                                 'papers'               => 'Id',
826                                 'natis'                => 'Id',
827                                 'spareKeys'            => 'Boolean',
828                                 'fullServiceHistory'   => 'Id',
829                                 'fshNotes'             => 'String500',
830                                 'tradePrice'           => 'Decimal',
831                                 'retailPrice'          => 'Decimal',
832                                 'listPrice'            => 'Decimal',
833                                 'purchasePrice'        => 'Decimal',
834                                 'salePrice'            => 'Decimal',
835                                 'mainImage'            => 'Id',
836                                 'frontImage'           => 'Id',
837                                 'rightImage'           => 'Id',
838                                 'leftImage'            => 'Id',
839                                 'backImage'            => 'Id',
840                                 'interiorImage'        => 'Id',
841                                 'engineImage'          => 'Id',
842                                 'natisImage'           => 'Id',
843                                 'accessories'          => 'Collection',
844                                 'accessoryNotes'       => 'String500',
845                                 'damages'              => 'Collection',
846                                 'damageTotal'          => 'Decimal',
847                                 'previousRepairsNoted' => 'Boolean',
848                                 'previousRepairsNotes' => 'String500',
849                                 'damageNotes'          => 'String500',
850                                 'coverReceived'        => 'String500',
851                                 'publicCentre'         => 'Id',
852                                 'makeManual'           => 'String150',
853                                 'modelManual'          => 'String150',
854                                 'typeManual'           => 'String150'
855                         )
856                 )
857         );
858
859         /**
860          * @var array
861          */
862         protected $metaCreatePending = array(
863                 'Type'                   => 'Create',
864                 'Contract'               => 'Recurring',
865                 'RequireAuth'            => true,
866                 'Flags'                  => array(
867                         'NewStockItem.FromValuation' => true,
868                         'NewValuationItem.Status'    => 'This.PendingValuation'
869                 ),
870                 'RelatedEntityFromInput' => array(
871                         'Stock' => array(
872                                 'Workflow' => '\Stock\Workflow',
873                                 'Service'  => '\Stock\Service\Stock',
874                                 'Field'    => 'stock'
875                         )
876                 ),
877                 'ExecuteBefore'          => array(
878                         'addCustomVehicles'
879                 ),
880                 'ExecuteAfter'           => array(
881                         'setValuatorFromAuth',
882                         'setStockLink',
883                         'generateHistoryList',
884                         'pushCreateAction'
885                 ),
886                 'RequiredInput'          => array(
887                         'Valuation' => array(
888                                 'firstName'  => 'String50',
889                                 'familyName' => 'String50',
890                                 'mobile'     => 'Mobile'
891                         ),
892                         'Stock'     => array(
893                                 'vehicleYear'        => 'Id',
894                                 'registrationNumber' => 'String15',
895                                 'fuelType'           => 'Id',
896                                 'transmissionType'   => 'Id'
897                         )
898                 ),
899                 'OptionalInput'          => array(
900                         'Valuation' => array(
901                                 'department'                => 'Department',
902                                 'idNumber'                  => 'IdNumber',
903                                 'email'                     => 'String250',
904                                 'region'                    => 'Id',
905                                 'city'                      => 'Id',
906                                 'street'                    => 'String100',
907                                 'requiredPrice'             => 'Decimal',
908                 'bankSettlement'             => 'Decimal',
909                                 'amountOffered'             => 'Decimal',
910                                 'overAllowance'             => 'Decimal',
911                                 'standInValue'              => 'Decimal',
912                                 'projectedRetail'           => 'Decimal',
913                                 'plannedMargin'             => 'Decimal',
914                                 'sighted'                   => 'Boolean',
915                                 'publicCentre'              => 'Id',
916                                 'licenseDiscExpired'        => 'Boolean',
917                                 'customerAddressStreet'     => 'String150',
918                                 'customerAddressStreetName' => 'String150',
919                                 'customerAddressSuburb'     => 'String150',
920                                 'customerAddressCity'       => 'String150',
921                                 'customerAddressPostalCode' => 'String150',
922                 'sendToStockFrom'           => 'Id',
923                 'dealNotDoneSelection'      => 'Id',
924                 'dealNotDoneReason'         => 'String150',
925                         ),
926                         'Stock'     => array(
927                                 'category'             => 'Id',
928                                 'make'                 => 'Id',
929                                 'model'                => 'Id',
930                                 'type'                 => 'Id',
931                                 'region'               => 'Id',
932                                 'vinNumber'            => 'String40',
933                                 'engineNumber'         => 'String40',
934                                 'exteriorColour'       => 'Id',
935                                 'interiorColour'       => 'Id',
936                                 'condition'            => 'Id',
937                                 'km'                   => 'Integer',
938                                 'upholstery'           => 'Id',
939                                 'papers'               => 'Id',
940                                 'natis'                => 'Id',
941                                 'spareKeys'            => 'Boolean',
942                                 'fullServiceHistory'   => 'Id',
943                                 'fshNotes'             => 'String500',
944                                 'tradePrice'           => 'Decimal',
945                                 'retailPrice'          => 'Decimal',
946                                 'listPrice'            => 'Decimal',
947                                 'purchasePrice'        => 'Decimal',
948                                 'salePrice'            => 'Decimal',
949                                 'mainImage'            => 'Id',
950                                 'frontImage'           => 'Id',
951                                 'rightImage'           => 'Id',
952                                 'leftImage'            => 'Id',
953                                 'backImage'            => 'Id',
954                                 'interiorImage'        => 'Id',
955                                 'engineImage'          => 'Id',
956                                 'natisImage'           => 'Id',
957                                 'accessories'          => 'Collection',
958                                 'accessoryNotes'       => 'String500',
959                                 'damages'              => 'Collection',
960                                 'damageTotal'          => 'Decimal',
961                                 'previousRepairsNoted' => 'Boolean',
962                                 'previousRepairsNotes' => 'String500',
963                                 'damageNotes'          => 'String500',
964                                 'coverReceived'        => 'String500',
965                                 'makeManual'           => 'String150',
966                                 'modelManual'          => 'String150',
967                                 'typeManual'           => 'String150'
968                         )
969                 )
970         );
971
972         /**
973          * @var array
974          */
975         protected $metaCreateComplete = array(
976                 'Type'                   => 'Create',
977                 'Contract'               => 'Recurring',
978                 'RequireAuth'            => true,
979                 'Flags'                  => array(
980                         'NewStockItem.FromValuation' => true,
981                         'NewValuationItem.Status'    => 'This.CompleteValuation'
982                 ),
983                 'RelatedEntityFromInput' => array(
984                         'Stock' => array(
985                                 'Workflow' => '\Stock\Workflow',
986                                 'Service'  => '\Stock\Service\Stock',
987                                 'Field'    => 'stock'
988                         )
989                 ),
990                 'ExecuteBefore'          => array(
991                         'addCustomVehicles'
992                 ),
993                 'ExecuteAfter'           => array(
994                         'setValuatorFromAuth',
995                         'sendToSales',
996                         'setStockLink',
997                         'generateHistoryList',
998                         'pushCreateAction'
999                 ),
1000                 'RequiredInput'          => array(
1001                         'Valuation' => array(
1002                                 'firstName'     => 'String50',
1003                                 'familyName'    => 'String50',
1004                                 'mobile'        => 'Mobile',
1005                                 'amountOffered' => 'Decimal',
1006                                 'salesProfile'  => 'Id'
1007                         ),
1008                         'Stock'     => array(
1009                                 'vehicleYear'        => 'Id',
1010                                 'registrationNumber' => 'String15',
1011                                 'fuelType'           => 'Id',
1012                                 'transmissionType'   => 'Id'
1013                         )
1014                 ),
1015                 'OptionalInput'          => array(
1016                         'Valuation' => array(
1017                                 'department'                => 'Department',
1018                                 'idNumber'                  => 'IdNumber',
1019                                 'email'                     => 'String250',
1020                                 'region'                    => 'Id',
1021                                 'city'                      => 'Id',
1022                                 'street'                    => 'String100',
1023                 'bankSettlement'             => 'Decimal',
1024                                 'requiredPrice'             => 'Decimal',
1025                                 'overAllowance'             => 'Decimal',
1026                                 'standInValue'              => 'Decimal',
1027                                 'projectedRetail'           => 'Decimal',
1028                                 'plannedMargin'             => 'Decimal',
1029                                 'salesComments'             => 'String500',
1030                                 'customerComments'          => 'String500',
1031                                 'sighted'                   => 'Boolean',
1032                                 'publicCentre'              => 'Id',
1033                                 'licenseDiscExpired'        => 'Boolean',
1034                                 'customerAddressStreet'     => 'String150',
1035                                 'customerAddressStreetName' => 'String150',
1036                                 'customerAddressSuburb'     => 'String150',
1037                                 'customerAddressCity'       => 'String150',
1038                                 'customerAddressPostalCode' => 'String150',
1039                 'sendToStockFrom'           => 'Id',
1040                 'dealNotDoneSelection'      => 'Id',
1041                 'dealNotDoneReason'         => 'String150',
1042                         ),
1043                         'Stock'     => array(
1044                                 'category'             => 'Id',
1045                                 'make'                 => 'Id',
1046                                 'model'                => 'Id',
1047                                 'type'                 => 'Id',
1048                                 'region'               => 'Id',
1049                                 'vinNumber'            => 'String40',
1050                                 'engineNumber'         => 'String40',
1051                                 'exteriorColour'       => 'Id',
1052                                 'interiorColour'       => 'Id',
1053                                 'condition'            => 'Id',
1054                                 'km'                   => 'Integer',
1055                                 'upholstery'           => 'Id',
1056                                 'papers'               => 'Id',
1057                                 'natis'                => 'Id',
1058                                 'spareKeys'            => 'Boolean',
1059                                 'fullServiceHistory'   => 'Id',
1060                                 'fshNotes'             => 'String500',
1061                                 'tradePrice'           => 'Decimal',
1062                                 'retailPrice'          => 'Decimal',
1063                                 'listPrice'            => 'Decimal',
1064                                 'purchasePrice'        => 'Decimal',
1065                                 'salePrice'            => 'Decimal',
1066                                 'mainImage'            => 'Id',
1067                                 'frontImage'           => 'Id',
1068                                 'rightImage'           => 'Id',
1069                                 'leftImage'            => 'Id',
1070                                 'backImage'            => 'Id',
1071                                 'interiorImage'        => 'Id',
1072                                 'engineImage'          => 'Id',
1073                                 'natisImage'           => 'Id',
1074                                 'accessories'          => 'Collection',
1075                                 'accessoryNotes'       => 'String500',
1076                                 'damages'              => 'Collection',
1077                                 'damageTotal'          => 'Decimal',
1078                                 'previousRepairsNoted' => 'Boolean',
1079                                 'previousRepairsNotes' => 'String500',
1080                                 'damageNotes'          => 'String500',
1081                                 'coverReceived'        => 'String500',
1082                                 'makeManual'           => 'String150',
1083                                 'modelManual'          => 'String150',
1084                                 'typeManual'           => 'String150'
1085                         )
1086                 )
1087         );
1088
1089
1090         /**
1091          * @var array
1092          */
1093         protected $metaCreateCompleteSendToCustomer = array(
1094                 'Type'                   => 'Create',
1095                 'Contract'               => 'Recurring',
1096                 'RequireAuth'            => true,
1097                 'Flags'                  => array(
1098                         'NewStockItem.FromValuation' => true,
1099                         'NewValuationItem.Status'    => 'This.CompleteValuation'
1100                 ),
1101                 'RelatedEntityFromInput' => array(
1102                         'Stock' => array(
1103                                 'Workflow' => '\Stock\Workflow',
1104                                 'Service'  => '\Stock\Service\Stock',
1105                                 'Field'    => 'stock'
1106                         )
1107                 ),
1108                 'ExecuteBefore'          => array(
1109                         'addCustomVehicles'
1110                 ),
1111                 'ExecuteAfter'           => array(
1112                         'setValuatorFromAuth',
1113                         'setStockLink',
1114                         'generateHistoryList',
1115                         'sendPublicCustomerEmail',
1116                         'pushCreateAction'
1117                 ),
1118                 'RequiredInput'          => array(
1119                         'Valuation' => array(
1120                                 'firstName'     => 'String50',
1121                                 'familyName'    => 'String50',
1122                                 'mobile'        => 'Mobile',
1123                                 'amountOffered' => 'Decimal',
1124                         ),
1125                         'Stock'     => array(
1126                                 'vehicleYear'        => 'Id',
1127                                 'registrationNumber' => 'String15',
1128                                 'fuelType'           => 'Id',
1129                                 'transmissionType'   => 'Id'
1130                         )
1131                 ),
1132                 'OptionalInput'          => array(
1133                         'Valuation' => array(
1134                                 'department'                => 'Department',
1135                                 'idNumber'                  => 'IdNumber',
1136                                 'email'                     => 'String250',
1137                                 'region'                    => 'Id',
1138                                 'city'                      => 'Id',
1139                                 'street'                    => 'String100',
1140                 'bankSettlement'             => 'Decimal',
1141                                 'requiredPrice'             => 'Decimal',
1142                                 'overAllowance'             => 'Decimal',
1143                                 'standInValue'              => 'Decimal',
1144                                 'projectedRetail'           => 'Decimal',
1145                                 'plannedMargin'             => 'Decimal',
1146                                 'customerComments'          => 'String500',
1147                                 'sighted'                   => 'Boolean',
1148                                 'publicCentre'              => 'Id',
1149                                 'licenseDiscExpired'        => 'Boolean',
1150                                 'customerAddressStreet'     => 'String150',
1151                                 'customerAddressStreetName' => 'String150',
1152                                 'customerAddressSuburb'     => 'String150',
1153                                 'customerAddressCity'       => 'String150',
1154                                 'customerAddressPostalCode' => 'String150',
1155                 'sendToStockFrom'           => 'Id',
1156                 'dealNotDoneSelection'      => 'Id',
1157                 'dealNotDoneReason'         => 'String150',
1158                         ),
1159                         'Stock'     => array(
1160                                 'category'             => 'Id',
1161                                 'make'                 => 'Id',
1162                                 'model'                => 'Id',
1163                                 'type'                 => 'Id',
1164                                 'region'               => 'Id',
1165                                 'vinNumber'            => 'String40',
1166                                 'engineNumber'         => 'String40',
1167                                 'exteriorColour'       => 'Id',
1168                                 'interiorColour'       => 'Id',
1169                                 'condition'            => 'Id',
1170                                 'km'                   => 'Integer',
1171                                 'upholstery'           => 'Id',
1172                                 'papers'               => 'Id',
1173                                 'natis'                => 'Id',
1174                                 'spareKeys'            => 'Boolean',
1175                                 'fullServiceHistory'   => 'Id',
1176                                 'fshNotes'             => 'String500',
1177                                 'tradePrice'           => 'Decimal',
1178                                 'retailPrice'          => 'Decimal',
1179                                 'listPrice'            => 'Decimal',
1180                                 'purchasePrice'        => 'Decimal',
1181                                 'salePrice'            => 'Decimal',
1182                                 'mainImage'            => 'Id',
1183                                 'frontImage'           => 'Id',
1184                                 'rightImage'           => 'Id',
1185                                 'leftImage'            => 'Id',
1186                                 'backImage'            => 'Id',
1187                                 'interiorImage'        => 'Id',
1188                                 'engineImage'          => 'Id',
1189                                 'natisImage'           => 'Id',
1190                                 'accessories'          => 'Collection',
1191                                 'accessoryNotes'       => 'String500',
1192                                 'damages'              => 'Collection',
1193                                 'damageTotal'          => 'Decimal',
1194                                 'previousRepairsNoted' => 'Boolean',
1195                                 'previousRepairsNotes' => 'String500',
1196                                 'damageNotes'          => 'String500',
1197                                 'coverReceived'        => 'String500',
1198                                 'makeManual'           => 'String150',
1199                                 'modelManual'          => 'String150',
1200                                 'typeManual'           => 'String150'
1201                         )
1202                 )
1203         );
1204
1205         /**
1206          * @var array
1207          */
1208         protected $metaCreatePriceGuide = array(
1209                 'Type'                   => 'Create',
1210                 'Contract'               => 'Recurring',
1211                 'RequireAuth'            => true,
1212                 'Flags'                  => array(
1213                         'NewStockItem.FromValuation' => true,
1214                         'NewValuationItem.Status'    => 'PriceGuide.NewItemFromValuation'
1215                 ),
1216                 'RelatedEntityFromInput' => array(
1217                         'Stock' => array(
1218                                 'Workflow' => '\Stock\Workflow',
1219                                 'Service'  => '\Stock\Service\Stock',
1220                                 'Field'    => 'stock'
1221                         )
1222                 ),
1223                 'ExecuteBefore'          => array(
1224                         'addCustomVehicles',
1225                         'pushCreateAction'
1226                 ),
1227                 'ExecuteAfter'           => array(
1228                         'setValuatorFromAuth',
1229                         'setStockLink',
1230                         'generateHistoryList'
1231                 ),
1232                 'RequiredInput'          => array(
1233                         'Context'   => array(
1234                                 'clubs' => 'Array'
1235                         ),
1236                         'Valuation' => array(
1237                                 'firstName'  => 'String50',
1238                                 'familyName' => 'String50',
1239                                 'mobile'     => 'Mobile'
1240                         ),
1241                         'Stock'     => array(
1242                                 'vehicleYear'        => 'Id',
1243                                 'registrationNumber' => 'String15',
1244                                 'fuelType'           => 'Id',
1245                                 'transmissionType'   => 'Id'
1246                         )
1247                 ),
1248                 'OptionalInput'          => array(
1249                         'Valuation' => array(
1250                                 'department'                => 'Department',
1251                                 'idNumber'                  => 'IdNumber',
1252                                 'email'                     => 'String250',
1253                                 'region'                    => 'Id',
1254                                 'city'                      => 'Id',
1255                                 'street'                    => 'String100',
1256                                 'requiredPrice'             => 'Decimal',
1257                                 'overAllowance'             => 'Decimal',
1258                                 'standInValue'              => 'Decimal',
1259                                 'projectedRetail'           => 'Decimal',
1260                                 'plannedMargin'             => 'Decimal',
1261                                 'sighted'                   => 'Boolean',
1262                                 'licenseDiscExpired'        => 'Boolean',
1263                                 'customerAddressStreet'     => 'String150',
1264                                 'customerAddressStreetName' => 'String150',
1265                                 'customerAddressSuburb'     => 'String150',
1266                                 'customerAddressCity'       => 'String150',
1267                                 'customerAddressPostalCode' => 'String150',
1268                 'sendToStockFrom'           => 'Id',
1269                 'dealNotDoneSelection'      => 'Id',
1270                 'dealNotDoneReason'         => 'String150',
1271                         ),
1272                         'Stock'     => array(
1273                                 'category'             => 'Id',
1274                                 'make'                 => 'Id',
1275                                 'model'                => 'Id',
1276                                 'type'                 => 'Id',
1277                                 'region'               => 'Id',
1278                                 'vinNumber'            => 'String40',
1279                                 'engineNumber'         => 'String40',
1280                                 'exteriorColour'       => 'Id',
1281                                 'interiorColour'       => 'Id',
1282                                 'condition'            => 'Id',
1283                                 'km'                   => 'Integer',
1284                                 'upholstery'           => 'Id',
1285                                 'papers'               => 'Id',
1286                                 'natis'                => 'Id',
1287                                 'spareKeys'            => 'Boolean',
1288                                 'fullServiceHistory'   => 'Id',
1289                                 'fshNotes'             => 'String500',
1290                                 'tradePrice'           => 'Decimal',
1291                                 'retailPrice'          => 'Decimal',
1292                                 'listPrice'            => 'Decimal',
1293                                 'purchasePrice'        => 'Decimal',
1294                                 'salePrice'            => 'Decimal',
1295                                 'mainImage'            => 'Id',
1296                                 'frontImage'           => 'Id',
1297                                 'rightImage'           => 'Id',
1298                                 'leftImage'            => 'Id',
1299                                 'backImage'            => 'Id',
1300                                 'interiorImage'        => 'Id',
1301                                 'engineImage'          => 'Id',
1302                                 'natisImage'           => 'Id',
1303                                 'accessories'          => 'Collection',
1304                                 'accessoryNotes'       => 'String500',
1305                                 'damages'              => 'Collection',
1306                                 'damageTotal'          => 'Decimal',
1307                                 'previousRepairsNoted' => 'Boolean',
1308                                 'previousRepairsNotes' => 'String500',
1309                                 'damageNotes'          => 'String500',
1310                                 'coverReceived'        => 'String500',
1311                                 'makeManual'           => 'String150',
1312                                 'modelManual'          => 'String150',
1313                                 'typeManual'           => 'String150'
1314                         )
1315                 )
1316         );
1317
1318         /**
1319          * @var array
1320          */
1321         protected $metaCreateStock = array(
1322                 'Type'                   => 'Create',
1323                 'Contract'               => 'Recurring',
1324                 'RequireAuth'            => true,
1325                 'ExecuteBefore'          => array(
1326                         'addCustomVehicles'
1327                 ),
1328                 'Flags'                  => array(
1329                         'NewValuationItem.Status' => 'This.Stock'
1330                 ),
1331                 'RelatedEntityFromInput' => array(
1332                         'Stock' => array(
1333                                 'Workflow' => '\Stock\Workflow',
1334                                 'Service'  => '\Stock\Service\Stock',
1335                                 'Field'    => 'stock'
1336                         )
1337                 ),
1338                 'ExecuteAfter'           => array(
1339                         'setValuatorFromAuth',
1340                         'setStockLink',
1341                         'generateHistoryList',
1342                         'pushCreateAction'
1343                 ),
1344                 'RequiredInput'          => array(
1345                         'Stock' => array(
1346                                 'stockNumber'        => 'String20',
1347                                 'vehicleYear'        => 'Id',
1348                                 'registrationNumber' => 'String15',
1349                                 'fuelType'           => 'Id',
1350                                 'transmissionType'   => 'Id'
1351                         )
1352                 ),
1353                 'OptionalInput'          => array(
1354                         'Valuation' => array(
1355                                 'department'                => 'Department',
1356                                 'idNumber'                  => 'IdNumber',
1357                                 'email'                     => 'String250',
1358                                 'region'                    => 'Id',
1359                                 'city'                      => 'Id',
1360                                 'street'                    => 'String100',
1361                                 'requiredPrice'             => 'Decimal',
1362                                 'overAllowance'             => 'Decimal',
1363                                 'standInValue'              => 'Decimal',
1364                                 'projectedRetail'           => 'Decimal',
1365                                 'plannedMargin'             => 'Decimal',
1366                                 'firstName'                 => 'String50',
1367                                 'familyName'                => 'String50',
1368                                 'mobile'                    => 'Mobile',
1369                                 'sighted'                   => 'Boolean',
1370                                 'licenseDiscExpired'        => 'Boolean',
1371                                 'customerAddressStreet'     => 'String150',
1372                                 'customerAddressStreetName' => 'String150',
1373                                 'customerAddressSuburb'     => 'String150',
1374                                 'customerAddressCity'       => 'String150',
1375                                 'customerAddressPostalCode' => 'String150',
1376                 'sendToStockFrom'           => 'Id',
1377                 'dealNotDoneSelection'      => 'Id',
1378                 'dealNotDoneReason'         => 'String150',
1379                         ),
1380                         'Stock'     => array(
1381                                 'category'             => 'Id',
1382                                 'make'                 => 'Id',
1383                                 'model'                => 'Id',
1384                                 'type'                 => 'Id',
1385                                 'region'               => 'Id',
1386                                 'vinNumber'            => 'String40',
1387                                 'engineNumber'         => 'String40',
1388                                 'exteriorColour'       => 'Id',
1389                                 'interiorColour'       => 'Id',
1390                                 'condition'            => 'Id',
1391                                 'km'                   => 'Integer',
1392                                 'upholstery'           => 'Id',
1393                                 'papers'               => 'Id',
1394                                 'natis'                => 'Id',
1395                                 'spareKeys'            => 'Boolean',
1396                                 'fullServiceHistory'   => 'Id',
1397                                 'fshNotes'             => 'String500',
1398                                 'tradePrice'           => 'Decimal',
1399                                 'retailPrice'          => 'Decimal',
1400                                 'listPrice'            => 'Decimal',
1401                                 'purchasePrice'        => 'Decimal',
1402                                 'salePrice'            => 'Decimal',
1403                                 'mainImage'            => 'Id',
1404                                 'frontImage'           => 'Id',
1405                                 'rightImage'           => 'Id',
1406                                 'leftImage'            => 'Id',
1407                                 'backImage'            => 'Id',
1408                                 'interiorImage'        => 'Id',
1409                                 'engineImage'          => 'Id',
1410                                 'natisImage'           => 'Id',
1411                                 'accessories'          => 'Collection',
1412                                 'accessoryNotes'       => 'String500',
1413                                 'damages'              => 'Collection',
1414                                 'damageTotal'          => 'Decimal',
1415                                 'previousRepairsNoted' => 'Boolean',
1416                                 'previousRepairsNotes' => 'String500',
1417                                 'damageNotes'          => 'String500',
1418                                 'coverReceived'        => 'String500',
1419                                 'makeManual'           => 'String150',
1420                                 'modelManual'          => 'String150',
1421                                 'typeManual'           => 'String150'
1422                         )
1423                 )
1424         );
1425
1426
1427
1428         /**
1429          * @var array
1430          */
1431         protected $metaUpdateStock = array(
1432                 'Type'                   => 'Update',
1433                 'Contract'               => 'UseOnce',
1434                 'RequireAuth'            => true,
1435                 'ExecuteBefore'          => array(
1436                         'addCustomVehicles'
1437                 ),
1438                 'Flags'                  => array(
1439                         'NewValuationItem.Status' => 'This.Stock'
1440                 ),
1441                 'RelatedEntityFromInput' => array(
1442                         'Stock' => array(
1443                                 'Workflow' => '\Stock\Workflow',
1444                                 'Service'  => '\Stock\Service\Stock',
1445                                 'Field'    => 'stock'
1446                         )
1447                 ),
1448                 'ExecuteAfter'           => array(
1449                         'setValuatorFromAuth',
1450                         'setStockLink',
1451                         'generateHistoryList',
1452                         'pushUpdateAction'
1453                 ),
1454                 'RequiredInput'          => array(
1455                         'Stock' => array(
1456                                 'vehicleYear'        => 'Id',
1457                                 'registrationNumber' => 'String15',
1458                                 'fuelType'           => 'Id',
1459                                 'transmissionType'   => 'Id'
1460                         )
1461                 ),
1462                 'OptionalInput'          => array(
1463                         'Valuation' => array(
1464                                 'department'                => 'Department',
1465                                 'idNumber'                  => 'IdNumber',
1466                                 'email'                     => 'String250',
1467                                 'region'                    => 'Id',
1468                                 'city'                      => 'Id',
1469                                 'street'                    => 'String100',
1470                                 'requiredPrice'             => 'Decimal',
1471                                 'overAllowance'             => 'Decimal',
1472                                 'standInValue'              => 'Decimal',
1473                                 'projectedRetail'           => 'Decimal',
1474                                 'plannedMargin'             => 'Decimal',
1475                                 'firstName'                 => 'String50',
1476                                 'familyName'                => 'String50',
1477                                 'mobile'                    => 'Mobile',
1478                                 'sighted'                   => 'Boolean',
1479                                 'licenseDiscExpired'        => 'Boolean',
1480                                 'customerAddressStreet'     => 'String150',
1481                                 'customerAddressStreetName' => 'String150',
1482                                 'customerAddressSuburb'     => 'String150',
1483                                 'customerAddressCity'       => 'String150',
1484                                 'customerAddressPostalCode' => 'String150',
1485                 'sendToStockFrom'           => 'Id',
1486                 'dealNotDoneSelection'      => 'Id',
1487                 'dealNotDoneReason'         => 'String150',
1488                         ),
1489                         'Stock'     => array(
1490                                 'category'             => 'Id',
1491                                 'make'                 => 'Id',
1492                                 'model'                => 'Id',
1493                                 'type'                 => 'Id',
1494                                 'region'               => 'Id',
1495                                 'vinNumber'            => 'String40',
1496                                 'engineNumber'         => 'String40',
1497                                 'exteriorColour'       => 'Id',
1498                                 'interiorColour'       => 'Id',
1499                                 'condition'            => 'Id',
1500                                 'km'                   => 'Integer',
1501                                 'upholstery'           => 'Id',
1502                                 'papers'               => 'Id',
1503                                 'natis'                => 'Id',
1504                                 'spareKeys'            => 'Boolean',
1505                                 'fullServiceHistory'   => 'Id',
1506                                 'fshNotes'             => 'String500',
1507                                 'tradePrice'           => 'Decimal',
1508                                 'retailPrice'          => 'Decimal',
1509                                 'listPrice'            => 'Decimal',
1510                                 'purchasePrice'        => 'Decimal',
1511                                 'salePrice'            => 'Decimal',
1512                                 'mainImage'            => 'Id',
1513                                 'frontImage'           => 'Id',
1514                                 'rightImage'           => 'Id',
1515                                 'leftImage'            => 'Id',
1516                                 'backImage'            => 'Id',
1517                                 'interiorImage'        => 'Id',
1518                                 'engineImage'          => 'Id',
1519                                 'natisImage'           => 'Id',
1520                                 'accessories'          => 'Collection',
1521                                 'accessoryNotes'       => 'String500',
1522                                 'damages'              => 'Collection',
1523                                 'damageTotal'          => 'Decimal',
1524                                 'previousRepairsNoted' => 'Boolean',
1525                                 'previousRepairsNotes' => 'String500',
1526                                 'damageNotes'          => 'String500',
1527                                 'coverReceived'        => 'String500',
1528                                 'makeManual'           => 'String150',
1529                                 'modelManual'          => 'String150',
1530                                 'typeManual'           => 'String150'
1531                         )
1532                 )
1533         );
1534
1535         /**
1536          * @var array
1537          */
1538         protected $metaUpdate = array(
1539                 'Type'                   => 'Update',
1540                 'Contract'               => 'UseOnce',
1541                 'RequireAuth'            => true,
1542                 'ConditionalContract'    => array(
1543                         'noEditOnPgItemWithOffers'
1544                 ),
1545                 'Expand'                 => array(
1546                         'category',
1547                         'make',
1548                         'model',
1549                         'type',
1550                         'stock',
1551                         'priceGuide',
1552                         'mainImage',
1553                         'frontImage',
1554                         'rightImage',
1555                         'leftImage',
1556                         'backImage',
1557                         'interiorImage',
1558                         'engineImage',
1559                         'natisImage',
1560                         'createdBy',
1561                         'valuatedBy',
1562                         'salesProfile',
1563                         'valuators',
1564                         'region',
1565                         'city',
1566             'dealNotDoneSelection',
1567             'sendToStockFrom'
1568                 ),
1569                 'ExecuteBefore'          => array(
1570                         'updateCustomVehicles'
1571                 ),
1572                 'ExecuteAfter'           => array(
1573                         'sendToMobileQueue',
1574                         'sendToValuators',
1575                         'pushUpdateAction'
1576                 ),
1577                 'RelatedEntityFromInput' => array(
1578                         'Stock' => array(
1579                                 'Workflow' => '\Stock\Workflow',
1580                                 'Service'  => '\Stock\Service\Stock',
1581                                 'Field'    => 'stock'
1582                         )
1583                 ),
1584                 'RequiredInput'          => array(
1585                         'Valuation' => array(
1586                                 'firstName'  => 'String50',
1587                                 'familyName' => 'String50',
1588                                 'mobile'     => 'Mobile'
1589                         ),
1590                         'Stock'     => array(
1591                                 'vehicleYear'        => 'Id',
1592                                 'registrationNumber' => 'String15',
1593                                 'fuelType'           => 'Id',
1594                                 'transmissionType'   => 'Id'
1595                         )
1596                 ),
1597                 'OptionalInput'          => array(
1598                         'Valuation' => array(
1599                                 'department'                => 'Department',
1600                                 'idNumber'                  => 'IdNumber',
1601                                 'email'                     => 'String250',
1602                                 'region'                    => 'Id',
1603                                 'city'                      => 'Id',
1604                                 'street'                    => 'String100',
1605                                 'requiredPrice'             => 'Decimal',
1606                 'bankSettlement'             => 'Decimal',
1607                                 'amountOffered'             => 'Decimal',
1608                                 'overAllowance'             => 'Decimal',
1609                                 'standInValue'              => 'Decimal',
1610                                 'projectedRetail'           => 'Decimal',
1611                                 'plannedMargin'             => 'Decimal',
1612                                 'valuators'                 => 'Array',
1613                                 'sighted'                   => 'Boolean',
1614                                 'licenseDiscExpired'        => 'Boolean',
1615                                 'customerAddressStreet'     => 'String150',
1616                                 'customerAddressStreetName' => 'String150',
1617                                 'customerAddressSuburb'     => 'String150',
1618                                 'customerAddressCity'       => 'String150',
1619                                 'customerAddressPostalCode' => 'String150',
1620                 'sendToStockFrom'           => 'Id',
1621                 'dealNotDoneSelection'      => 'Id',
1622                 'dealNotDoneReason'         => 'String150',
1623                         ),
1624                         'Stock'     => array(
1625                                 'category'             => 'Id',
1626                                 'make'                 => 'Id',
1627                                 'model'                => 'Id',
1628                                 'type'                 => 'Id',
1629                                 'region'               => 'Id',
1630                                 'vinNumber'            => 'String40',
1631                                 'engineNumber'         => 'String40',
1632                                 'exteriorColour'       => 'Id',
1633                                 'interiorColour'       => 'Id',
1634                                 'condition'            => 'Id',
1635                                 'km'                   => 'Integer',
1636                                 'upholstery'           => 'Id',
1637                                 'papers'               => 'Id',
1638                                 'natis'                => 'Id',
1639                                 'spareKeys'            => 'Boolean',
1640                                 'fullServiceHistory'   => 'Id',
1641                                 'stockNumber'          => 'String20',
1642                                 'fshNotes'             => 'String500',
1643                                 'tradePrice'           => 'Decimal',
1644                                 'retailPrice'          => 'Decimal',
1645                                 'listPrice'            => 'Decimal',
1646                                 'purchasePrice'        => 'Decimal',
1647                                 'salePrice'            => 'Decimal',
1648                                 'mainImage'            => 'Id',
1649                                 'frontImage'           => 'Id',
1650                                 'rightImage'           => 'Id',
1651                                 'leftImage'            => 'Id',
1652                                 'backImage'            => 'Id',
1653                                 'interiorImage'        => 'Id',
1654                                 'engineImage'          => 'Id',
1655                                 'natisImage'           => 'Id',
1656                                 'accessories'          => 'Collection',
1657                                 'accessoryNotes'       => 'String500',
1658                                 'damages'              => 'Collection',
1659                                 'damageTotal'          => 'Decimal',
1660                                 'previousRepairsNoted' => 'Boolean',
1661                                 'previousRepairsNotes' => 'String500',
1662                                 'damageNotes'          => 'String500',
1663                                 'coverReceived'        => 'String500',
1664                                 'makeManual'           => 'String150',
1665                                 'modelManual'          => 'String150',
1666                                 'typeManual'           => 'String150'
1667                         )
1668                 )
1669         );
1670
1671
1672         /**
1673          * @var array
1674          */
1675         protected $metaUpdateCheck = array(
1676                 'Type'                   => 'Update',
1677                 'Contract'               => 'UseOnce',
1678                 'RequireAuth'            => false,
1679                 'ConditionalContract'    => array(
1680                         'noEditOnPgItemWithOffers'
1681                 ),
1682                 'Expand'                 => array(
1683                         'category',
1684                         'make',
1685                         'model',
1686                         'type',
1687                         'stock',
1688                         'priceGuide',
1689                         'mainImage',
1690                         'frontImage',
1691                         'rightImage',
1692                         'leftImage',
1693                         'backImage',
1694                         'interiorImage',
1695                         'engineImage',
1696                         'natisImage',
1697                         'createdBy',
1698                         'valuatedBy',
1699                         'salesProfile',
1700                         'valuators',
1701                         'region',
1702                         'city',
1703                         'company',
1704                         'contact'
1705                 ),
1706                 'ExecuteBefore'          => array(
1707                         'updateCustomVehicles'
1708                 ),
1709                 'ExecuteAfter'           => array(
1710                         'sendToMobileQueue',
1711                         'sendToValuators',
1712                         'pushUpdateAction'
1713                 ),
1714                 'RelatedEntityFromInput' => array(
1715                         'Stock' => array(
1716                                 'Workflow' => '\Stock\Workflow',
1717                                 'Service'  => '\Stock\Service\Stock',
1718                                 'Field'    => 'stock'
1719                         )
1720                 ),
1721                 'RequiredInput'          => array(
1722                         'Valuation' => array(
1723                                 'firstName'  => 'String50',
1724                                 'familyName' => 'String50',
1725                                 'mobile'     => 'Mobile'
1726                         ),
1727                         'Stock'     => array(
1728                                 'vehicleYear'        => 'Id',
1729                                 'registrationNumber' => 'String15',
1730                                 'fuelType'           => 'Id',
1731                                 'transmissionType'   => 'Id'
1732                         )
1733                 ),
1734                 'OptionalInput'          => array(
1735                         'Valuation' => array(
1736                                 'department'                => 'Department',
1737                                 'idNumber'                  => 'IdNumber',
1738                                 'email'                     => 'String250',
1739                                 'region'                    => 'Id',
1740                                 'city'                      => 'Id',
1741                                 'street'                    => 'String100',
1742                                 'requiredPrice'             => 'Decimal',
1743                 'bankSettlement'             => 'Decimal',
1744                                 'amountOffered'             => 'Decimal',
1745                                 'overAllowance'             => 'Decimal',
1746                                 'standInValue'              => 'Decimal',
1747                                 'projectedRetail'           => 'Decimal',
1748                                 'plannedMargin'             => 'Decimal',
1749                                 'valuators'                 => 'Array',
1750                                 'sighted'                   => 'Boolean',
1751                                 'licenseDiscExpired'        => 'Boolean',
1752                                 'customerAddressStreet'     => 'String150',
1753                                 'customerAddressStreetName' => 'String150',
1754                                 'customerAddressSuburb'     => 'String150',
1755                                 'customerAddressCity'       => 'String150',
1756                                 'customerAddressPostalCode' => 'String150',
1757                 'sendToStockFrom'           => 'Id',
1758                 'dealNotDoneSelection'      => 'Id',
1759                 'dealNotDoneReason'         => 'String150',
1760                         ),
1761                         'Stock'     => array(
1762                                 'category'             => 'Id',
1763                                 'make'                 => 'Id',
1764                                 'model'                => 'Id',
1765                                 'type'                 => 'Id',
1766                                 'region'               => 'Id',
1767                                 'vinNumber'            => 'String40',
1768                                 'engineNumber'         => 'String40',
1769                                 'exteriorColour'       => 'Id',
1770                                 'interiorColour'       => 'Id',
1771                                 'condition'            => 'Id',
1772                                 'km'                   => 'Integer',
1773                                 'upholstery'           => 'Id',
1774                                 'papers'               => 'Id',
1775                                 'natis'                => 'Id',
1776                                 'spareKeys'            => 'Boolean',
1777                                 'fullServiceHistory'   => 'Id',
1778                                 'stockNumber'          => 'String20',
1779                                 'fshNotes'             => 'String500',
1780                                 'tradePrice'           => 'Decimal',
1781                                 'retailPrice'          => 'Decimal',
1782                                 'listPrice'            => 'Decimal',
1783                                 'purchasePrice'        => 'Decimal',
1784                                 'salePrice'            => 'Decimal',
1785                                 'mainImage'            => 'Id',
1786                                 'frontImage'           => 'Id',
1787                                 'rightImage'           => 'Id',
1788                                 'leftImage'            => 'Id',
1789                                 'backImage'            => 'Id',
1790                                 'interiorImage'        => 'Id',
1791                                 'engineImage'          => 'Id',
1792                                 'natisImage'           => 'Id',
1793                                 'accessories'          => 'Collection',
1794                                 'accessoryNotes'       => 'String500',
1795                                 'damages'              => 'Collection',
1796                                 'damageTotal'          => 'Decimal',
1797                                 'previousRepairsNoted' => 'Boolean',
1798                                 'previousRepairsNotes' => 'String500',
1799                                 'damageNotes'          => 'String500',
1800                                 'coverReceived'        => 'String500',
1801                                 'makeManual'           => 'String150',
1802                                 'modelManual'          => 'String150',
1803                                 'typeManual'           => 'String150'
1804                         )
1805                 )
1806         );
1807
1808
1809         /**
1810          * @var array
1811          */
1812         protected $metaUpdateCompleteCheck = array(
1813                 'Type'                   => 'Update',
1814                 'Contract'               => 'UseOnce',
1815                 'RequireAuth'            => false,
1816                 'ConditionalContract'    => array(
1817                         'noEditOnPgItemWithOffers'
1818                 ),
1819                 'Expand'                 => array(
1820                         'category',
1821                         'make',
1822                         'model',
1823                         'type',
1824                         'stock',
1825                         'priceGuide',
1826                         'mainImage',
1827                         'frontImage',
1828                         'rightImage',
1829                         'leftImage',
1830                         'backImage',
1831                         'interiorImage',
1832                         'engineImage',
1833                         'natisImage',
1834                         'createdBy',
1835                         'valuatedBy',
1836                         'salesProfile',
1837                         'valuators',
1838                         'region',
1839                         'city',
1840                         'company',
1841                         'contact'
1842                 ),
1843                 'ExecuteBefore'          => array(
1844                         'updateCustomVehicles'
1845                 ),
1846                 'ExecuteAfter'           => array(
1847                         'sendToMobileQueue',
1848                         'pushUpdateAction'
1849                 ),
1850                 'RelatedEntityFromInput' => array(
1851                         'Stock' => array(
1852                                 'Workflow' => '\Stock\Workflow',
1853                                 'Service'  => '\Stock\Service\Stock',
1854                                 'Field'    => 'stock'
1855                         )
1856                 ),
1857                 'RequiredInput'          => array(
1858                         'Valuation' => array(
1859                                 'firstName'  => 'String50',
1860                                 'familyName' => 'String50',
1861                                 'mobile'     => 'Mobile'
1862                         ),
1863                         'Stock'     => array()
1864                 ),
1865                 'OptionalInput'          => array(
1866                         'Valuation' => array(
1867                                 'department'                => 'Department',
1868                                 'idNumber'                  => 'IdNumber',
1869                                 'email'                     => 'String250',
1870                                 'region'                    => 'Id',
1871                                 'city'                      => 'Id',
1872                                 'street'                    => 'String100',
1873                                 'requiredPrice'             => 'Decimal',
1874                 'bankSettlement'             => 'Decimal',
1875                                 'amountOffered'             => 'Decimal',
1876                                 'overAllowance'             => 'Decimal',
1877                                 'standInValue'              => 'Decimal',
1878                                 'projectedRetail'           => 'Decimal',
1879                                 'plannedMargin'             => 'Decimal',
1880                                 'valuators'                 => 'Array',
1881                                 'sighted'                   => 'Boolean',
1882                                 'licenseDiscExpired'        => 'Boolean',
1883                                 'customerAddressStreet'     => 'String150',
1884                                 'customerAddressStreetName' => 'String150',
1885                                 'customerAddressSuburb'     => 'String150',
1886                                 'customerAddressCity'       => 'String150',
1887                                 'customerAddressPostalCode' => 'String150',
1888                 'sendToStockFrom'           => 'Id',
1889                 'dealNotDoneSelection'      => 'Id',
1890                 'dealNotDoneReason'         => 'String150',
1891                         ),
1892                         'Stock'     => array(
1893                                 'vehicleYear'          => 'Id',
1894                                 'registrationNumber'   => 'String15',
1895                                 'fuelType'             => 'Id',
1896                                 'transmissionType'     => 'Id',
1897                                 'category'             => 'Id',
1898                                 'make'                 => 'Id',
1899                                 'model'                => 'Id',
1900                                 'type'                 => 'Id',
1901                                 'region'               => 'Id',
1902                                 'vinNumber'            => 'String40',
1903                                 'engineNumber'         => 'String40',
1904                                 'exteriorColour'       => 'Id',
1905                                 'interiorColour'       => 'Id',
1906                                 'condition'            => 'Id',
1907                                 'km'                   => 'Integer',
1908                                 'upholstery'           => 'Id',
1909                                 'papers'               => 'Id',
1910                                 'natis'                => 'Id',
1911                                 'spareKeys'            => 'Boolean',
1912                                 'fullServiceHistory'   => 'Id',
1913                                 'stockNumber'          => 'String20',
1914                                 'fshNotes'             => 'String500',
1915                                 'tradePrice'           => 'Decimal',
1916                                 'retailPrice'          => 'Decimal',
1917                                 'listPrice'            => 'Decimal',
1918                                 'purchasePrice'        => 'Decimal',
1919                                 'salePrice'            => 'Decimal',
1920                                 'mainImage'            => 'Id',
1921                                 'frontImage'           => 'Id',
1922                                 'rightImage'           => 'Id',
1923                                 'leftImage'            => 'Id',
1924                                 'backImage'            => 'Id',
1925                                 'interiorImage'        => 'Id',
1926                                 'engineImage'          => 'Id',
1927                                 'natisImage'           => 'Id',
1928                                 'accessories'          => 'Collection',
1929                                 'accessoryNotes'       => 'String500',
1930                                 'damages'              => 'Collection',
1931                                 'damageTotal'          => 'Decimal',
1932                                 'previousRepairsNoted' => 'Boolean',
1933                                 'previousRepairsNotes' => 'String500',
1934                                 'damageNotes'          => 'String500',
1935                                 'coverReceived'        => 'String500',
1936                                 'makeManual'           => 'String150',
1937                                 'modelManual'          => 'String150',
1938                                 'typeManual'           => 'String150'
1939                         )
1940                 )
1941         );
1942
1943         /**
1944          * @var array
1945          */
1946         protected $metaLimitedUpdate = array(
1947                 'Type'          => 'Update',
1948                 'Contract'      => 'UseOnce',
1949                 'RequireAuth'   => true,
1950                 'ExecuteAfter'  => array(
1951                         'pushUpdateAction'
1952                 ),
1953                 'Expand'        => array(
1954                         'stock',
1955                         'category',
1956                         'make',
1957                         'model',
1958                         'type',
1959                         'mainImage',
1960                         'frontImage',
1961                         'rightImage',
1962                         'leftImage',
1963                         'backImage',
1964                         'interiorImage',
1965                         'engineImage',
1966                         'natisImage',
1967                         'createdBy',
1968                         'valuatedBy',
1969                         'salesProfile'
1970                 ),
1971                 'RequiredInput' => array(),
1972                 'OptionalInput' => array()
1973         );
1974
1975
1976         /**
1977          * @var array
1978          */
1979         protected $metaPriceGuideMoveToComplete = array(
1980                 'Type'          => 'Update',
1981                 'Contract'      => 'UseOnce',
1982                 'ExecuteAfter'  => array(
1983                         'setPreviousStateToComplete',
1984                         'pushUpdateAction'
1985                 ),
1986                 'RequiredInput' => array(
1987                         'Valuation' => array(
1988                                 'amountOffered' => 'Decimal',
1989                                 'salesProfile'  => 'Id'
1990                         )
1991                 ),
1992                 'OptionalInput' => array(
1993                         'Valuation' => array(
1994                                 'salesComments' => 'String500',
1995                                 'bankSettlement' => 'Decimal',
1996                         )
1997                 )
1998         );
1999
2000         /**
2001          * @var array
2002          */
2003         protected $metaSendToSales = array(
2004                 'Type'          => 'Update',
2005                 'Contract'      => 'UseOnce',
2006                 'RequireAuth'   => true,
2007                 'ExecuteAfter'  => array(
2008                         'sendToSales',
2009                         'pushUpdateAction'
2010                 ),
2011                 'RequiredInput' => array(
2012                         'Valuation' => array(
2013                                 'amountOffered' => 'Decimal',
2014                                 'salesProfile'  => 'Id'
2015                         )
2016                 ),
2017                 'OptionalInput' => array(
2018                         'Valuation' => array(
2019                                 'salesComments' => 'String500',
2020                                 'bankSettlement' => 'Decimal',
2021                         )
2022                 )
2023         );
2024
2025         /**
2026          * @var array
2027          */
2028         protected $metaSendToSalesFull = array(
2029                 'Type'                   => 'Update',
2030                 'Contract'               => 'UseOnce',
2031                 'RequireAuth'            => true,
2032                 'ExecuteBefore'          => array(
2033                         'updateCustomVehicles'
2034                 ),
2035                 'ExecuteAfter'           => array(
2036                         'sendToSales',
2037                         'pushUpdateAction'
2038                 ),
2039                 'RelatedEntityFromInput' => array(
2040                         'Stock' => array(
2041                                 'Workflow' => '\Stock\Workflow',
2042                                 'Service'  => '\Stock\Service\Stock',
2043                                 'Field'    => 'stock'
2044                         )
2045                 ),
2046                 'RequiredInput'          => array(
2047                         'Valuation' => array(
2048                                 'firstName'     => 'String50',
2049                                 'familyName'    => 'String50',
2050                                 'mobile'        => 'Mobile',
2051                                 'amountOffered' => 'Decimal',
2052                                 'salesProfile'  => 'Id'
2053                         ),
2054                         'Stock'     => array(
2055                                 'vehicleYear'        => 'Id',
2056                                 'registrationNumber' => 'String15',
2057                                 'fuelType'           => 'Id',
2058                                 'transmissionType'   => 'Id'
2059                         )
2060                 ),
2061                 'OptionalInput'          => array(
2062                         'Valuation' => array(
2063                                 'department'                => 'Department',
2064                                 'idNumber'                  => 'IdNumber',
2065                                 'email'                     => 'String250',
2066                                 'region'                    => 'Id',
2067                                 'city'                      => 'Id',
2068                                 'street'                    => 'String100',
2069                                 'requiredPrice'             => 'Decimal',
2070                 'bankSettlement'            => 'Decimal',
2071                                 'overAllowance'             => 'Decimal',
2072                                 'standInValue'              => 'Decimal',
2073                                 'projectedRetail'           => 'Decimal',
2074                                 'plannedMargin'             => 'Decimal',
2075                                 'salesComments'             => 'String500',
2076                                 'sighted'                   => 'Boolean',
2077                                 'licenseDiscExpired'        => 'Boolean',
2078                                 'customerAddressStreet'     => 'String150',
2079                                 'customerAddressStreetName' => 'String150',
2080                                 'customerAddressSuburb'     => 'String150',
2081                                 'customerAddressCity'       => 'String150',
2082                                 'customerAddressPostalCode' => 'String150',
2083                 'sendToStockFrom'           => 'Id',
2084                 'dealNotDoneSelection'      => 'Id',
2085                 'dealNotDoneReason'         => 'String150',
2086                         ),
2087                         'Stock'     => array(
2088                                 'category'             => 'Id',
2089                                 'type'                 => 'Id',
2090                                 'region'               => 'Id',
2091                                 'vinNumber'            => 'String40',
2092                                 'engineNumber'         => 'String40',
2093                                 'exteriorColour'       => 'Id',
2094                                 'interiorColour'       => 'Id',
2095                                 'condition'            => 'Id',
2096                                 'km'                   => 'Integer',
2097                                 'upholstery'           => 'Id',
2098                                 'papers'               => 'Id',
2099                                 'natis'                => 'Id',
2100                                 'spareKeys'            => 'Boolean',
2101                                 'fullServiceHistory'   => 'Id',
2102                                 'fshNotes'             => 'String500',
2103                                 'tradePrice'           => 'Decimal',
2104                                 'retailPrice'          => 'Decimal',
2105                                 'listPrice'            => 'Decimal',
2106                                 'purchasePrice'        => 'Decimal',
2107                                 'salePrice'            => 'Decimal',
2108                                 'mainImage'            => 'Id',
2109                                 'frontImage'           => 'Id',
2110                                 'rightImage'           => 'Id',
2111                                 'leftImage'            => 'Id',
2112                                 'backImage'            => 'Id',
2113                                 'interiorImage'        => 'Id',
2114                                 'engineImage'          => 'Id',
2115                                 'natisImage'           => 'Id',
2116                                 'accessories'          => 'Collection',
2117                                 'accessoryNotes'       => 'String500',
2118                                 'damages'              => 'Collection',
2119                                 'damageTotal'          => 'Decimal',
2120                                 'previousRepairsNoted' => 'Boolean',
2121                                 'previousRepairsNotes' => 'String500',
2122                                 'damageNotes'          => 'String500',
2123                                 'coverReceived'        => 'String500',
2124                                 'makeManual'           => 'String150',
2125                                 'modelManual'          => 'String150',
2126                                 'typeManual'           => 'String150'
2127                         )
2128                 )
2129         );
2130
2131
2132         /**
2133          * @var array
2134          */
2135         protected $metaSendToCustomerFull = array(
2136                 'Type'                   => 'Update',
2137                 'Contract'               => 'UseOnce',
2138                 'RequireAuth'            => true,
2139                 'ExecuteBefore'          => array(
2140                         'updateCustomVehicles'
2141                 ),
2142                 'ExecuteAfter'           => array(
2143                         'sendPublicCustomerEmail',
2144                         'pushUpdateAction'
2145                 ),
2146                 'RelatedEntityFromInput' => array(
2147                         'Stock' => array(
2148                                 'Workflow' => '\Stock\Workflow',
2149                                 'Service'  => '\Stock\Service\Stock',
2150                                 'Field'    => 'stock'
2151                         )
2152                 ),
2153                 'RequiredInput'          => array(
2154                         'Valuation' => array(
2155                                 'firstName'     => 'String50',
2156                                 'familyName'    => 'String50',
2157                                 'mobile'        => 'Mobile',
2158                                 'amountOffered' => 'Decimal'
2159                         ),
2160                         'Stock'     => array(
2161                                 'vehicleYear'        => 'Id',
2162                                 'registrationNumber' => 'String15',
2163                                 'fuelType'           => 'Id',
2164                                 'transmissionType'   => 'Id'
2165                         )
2166                 ),
2167                 'OptionalInput'          => array(
2168                         'Valuation' => array(
2169                                 'department'                => 'Department',
2170                                 'idNumber'                  => 'IdNumber',
2171                                 'email'                     => 'String250',
2172                                 'region'                    => 'Id',
2173                                 'city'                      => 'Id',
2174                                 'street'                    => 'String100',
2175                                 'requiredPrice'             => 'Decimal',
2176                 'bankSettlement'            => 'Decimal',
2177                                 'overAllowance'             => 'Decimal',
2178                                 'standInValue'              => 'Decimal',
2179                                 'projectedRetail'           => 'Decimal',
2180                                 'plannedMargin'             => 'Decimal',
2181                                 'customerComments'          => 'String500',
2182                                 'sighted'                   => 'Boolean',
2183                                 'licenseDiscExpired'        => 'Boolean',
2184                                 'salesProfile'              => 'Id',
2185                                 'customerAddressStreet'     => 'String150',
2186                                 'customerAddressStreetName' => 'String150',
2187                                 'customerAddressSuburb'     => 'String150',
2188                                 'customerAddressCity'       => 'String150',
2189                                 'customerAddressPostalCode' => 'String150',
2190                 'sendToStockFrom'           => 'Id',
2191                 'dealNotDoneSelection'      => 'Id',
2192                 'dealNotDoneReason'         => 'String150',
2193                         ),
2194                         'Stock'     => array(
2195                                 'category'             => 'Id',
2196                                 'type'                 => 'Id',
2197                                 'region'               => 'Id',
2198                                 'vinNumber'            => 'String40',
2199                                 'engineNumber'         => 'String40',
2200                                 'exteriorColour'       => 'Id',
2201                                 'interiorColour'       => 'Id',
2202                                 'condition'            => 'Id',
2203                                 'km'                   => 'Integer',
2204                                 'upholstery'           => 'Id',
2205                                 'papers'               => 'Id',
2206                                 'natis'                => 'Id',
2207                                 'spareKeys'            => 'Boolean',
2208                                 'fullServiceHistory'   => 'Id',
2209                                 'fshNotes'             => 'String500',
2210                                 'tradePrice'           => 'Decimal',
2211                                 'retailPrice'          => 'Decimal',
2212                                 'listPrice'            => 'Decimal',
2213                                 'purchasePrice'        => 'Decimal',
2214                                 'salePrice'            => 'Decimal',
2215                                 'mainImage'            => 'Id',
2216                                 'frontImage'           => 'Id',
2217                                 'rightImage'           => 'Id',
2218                                 'leftImage'            => 'Id',
2219                                 'backImage'            => 'Id',
2220                                 'interiorImage'        => 'Id',
2221                                 'engineImage'          => 'Id',
2222                                 'natisImage'           => 'Id',
2223                                 'accessories'          => 'Collection',
2224                                 'accessoryNotes'       => 'String500',
2225                                 'damages'              => 'Collection',
2226                                 'damageTotal'          => 'Decimal',
2227                                 'previousRepairsNoted' => 'Boolean',
2228                                 'previousRepairsNotes' => 'String500',
2229                                 'damageNotes'          => 'String500',
2230                                 'coverReceived'        => 'String500',
2231                                 'makeManual'           => 'String150',
2232                                 'modelManual'          => 'String150',
2233                                 'typeManual'           => 'String150'
2234                         )
2235                 )
2236         );
2237
2238         /**
2239          * @var array
2240          */
2241         protected $metaSendToPriceGuide = array(
2242                 'Type'                   => 'Update',
2243                 'Contract'               => 'UseOnce',
2244                 'RequireAuth'            => true,
2245                 'ExecuteBefore'          => array(
2246                         'updateCustomVehicles'
2247                 ),
2248                 'ExecuteAfter'           => array(
2249                         'checkCreatedBy',
2250                         'pushUpdateAction'
2251                 ),
2252                 'RelatedEntityFromInput' => array(
2253                         'Stock' => array(
2254                                 'Workflow' => '\Stock\Workflow',
2255                                 'Service'  => '\Stock\Service\Stock',
2256                                 'Field'    => 'stock'
2257                         )
2258                 ),
2259                 'RequiredInput'          => array(
2260                         'Context'   => array(
2261                                 'clubs' => 'Array'
2262                         ),
2263                         'Valuation' => array(
2264                                 'firstName'  => 'String50',
2265                                 'familyName' => 'String50',
2266                                 'mobile'     => 'Mobile'
2267                         ),
2268                         'Stock'     => array(
2269                                 'vehicleYear'        => 'Id',
2270                                 'type'               => 'Id',
2271                                 'registrationNumber' => 'String15',
2272                                 'fuelType'           => 'Id',
2273                                 'transmissionType'   => 'Id'
2274                         )
2275                 ),
2276                 'OptionalInput'          => array(
2277                         'Valuation' => array(
2278                                 'department'                => 'Department',
2279                                 'idNumber'                  => 'IdNumber',
2280                                 'email'                     => 'String250',
2281                                 'region'                    => 'Id',
2282                                 'city'                      => 'Id',
2283                                 'street'                    => 'String100',
2284                                 'requiredPrice'             => 'Decimal',
2285                                 'overAllowance'             => 'Decimal',
2286                                 'standInValue'              => 'Decimal',
2287                                 'projectedRetail'           => 'Decimal',
2288                                 'plannedMargin'             => 'Decimal',
2289                                 'sighted'                   => 'Boolean',
2290                                 'licenseDiscExpired'        => 'Boolean',
2291                                 'customerAddressStreet'     => 'String150',
2292                                 'customerAddressStreetName' => 'String150',
2293                                 'customerAddressSuburb'     => 'String150',
2294                                 'customerAddressCity'       => 'String150',
2295                                 'customerAddressPostalCode' => 'String150',
2296                 'sendToStockFrom'           => 'Id',
2297                 'dealNotDoneSelection'      => 'Id',
2298                 'dealNotDoneReason'         => 'String150',
2299                         ),
2300                         'Stock'     => array(
2301                                 'category'             => 'Id',
2302                                 'region'               => 'Id',
2303                                 'vinNumber'            => 'String40',
2304                                 'engineNumber'         => 'String40',
2305                                 'exteriorColour'       => 'Id',
2306                                 'interiorColour'       => 'Id',
2307                                 'condition'            => 'Id',
2308                                 'km'                   => 'Integer',
2309                                 'upholstery'           => 'Id',
2310                                 'papers'               => 'Id',
2311                                 'natis'                => 'Id',
2312                                 'spareKeys'            => 'Boolean',
2313                                 'fullServiceHistory'   => 'Id',
2314                                 'fshNotes'             => 'String500',
2315                                 'tradePrice'           => 'Decimal',
2316                                 'retailPrice'          => 'Decimal',
2317                                 'listPrice'            => 'Decimal',
2318                                 'purchasePrice'        => 'Decimal',
2319                                 'salePrice'            => 'Decimal',
2320                                 'mainImage'            => 'Id',
2321                                 'frontImage'           => 'Id',
2322                                 'rightImage'           => 'Id',
2323                                 'leftImage'            => 'Id',
2324                                 'backImage'            => 'Id',
2325                                 'interiorImage'        => 'Id',
2326                                 'engineImage'          => 'Id',
2327                                 'natisImage'           => 'Id',
2328                                 'accessories'          => 'Collection',
2329                                 'accessoryNotes'       => 'String500',
2330                                 'damages'              => 'Collection',
2331                                 'damageTotal'          => 'Decimal',
2332                                 'previousRepairsNoted' => 'Boolean',
2333                                 'previousRepairsNotes' => 'String500',
2334                                 'damageNotes'          => 'String500',
2335                                 'coverReceived'        => 'String500',
2336                                 'makeManual'           => 'String150',
2337                                 'modelManual'          => 'String150',
2338                                 'typeManual'           => 'String150'
2339                         )
2340                 )
2341         );
2342
2343
2344         /**
2345          * @var array
2346          */
2347         protected $metaSendToStock = array(
2348                 'Type'                   => 'Update',
2349                 'Contract'               => 'UseOnce',
2350                 'RequireAuth'            => true,
2351                 'ExecuteBefore'          => array(
2352                         'updateCustomVehicles'
2353                 ),
2354                 'ExecuteAfter'           => array(
2355                         'checkCreatedBy',
2356                         'pushUpdateAction'
2357                 ),
2358                 'RelatedEntityFromInput' => array(
2359                         'Stock' => array(
2360                                 'Workflow' => '\Stock\Workflow',
2361                                 'Service'  => '\Stock\Service\Stock',
2362                                 'Field'    => 'stock'
2363                         )
2364                 ),
2365                 'RequiredInput'          => array(
2366                         'Stock' => array(
2367                                 'stockNumber' => 'String20'
2368                         )
2369                 ),
2370                 'OptionalInput'          => array(
2371                         'Stock' => array(
2372                 'jobState'                  => 'String25',
2373                                 'category'             => 'Id',
2374                                 'vehicleYear'          => 'Id',
2375                                 'type'                 => 'Id',
2376                                 'registrationNumber'   => 'String15',
2377                                 'fuelType'             => 'Id',
2378                                 'transmissionType'     => 'Id',
2379                                 'region'               => 'Id',
2380                                 'vinNumber'            => 'String40',
2381                                 'engineNumber'         => 'String40',
2382                                 'exteriorColour'       => 'Id',
2383                                 'interiorColour'       => 'Id',
2384                                 'condition'            => 'Id',
2385                                 'km'                   => 'Integer',
2386                                 'upholstery'           => 'Id',
2387                                 'papers'               => 'Id',
2388                                 'natis'                => 'Id',
2389                                 'spareKeys'            => 'Boolean',
2390                                 'fullServiceHistory'   => 'Id',
2391                                 'fshNotes'             => 'String500',
2392                                 'tradePrice'           => 'Decimal',
2393                                 'retailPrice'          => 'Decimal',
2394                                 'listPrice'            => 'Decimal',
2395                                 'purchasePrice'        => 'Decimal',
2396                                 'salePrice'            => 'Decimal',
2397                                 'mainImage'            => 'Id',
2398                                 'frontImage'           => 'Id',
2399                                 'rightImage'           => 'Id',
2400                                 'leftImage'            => 'Id',
2401                                 'backImage'            => 'Id',
2402                                 'interiorImage'        => 'Id',
2403                                 'engineImage'          => 'Id',
2404                                 'natisImage'           => 'Id',
2405                                 'accessories'          => 'Collection',
2406                                 'accessoryNotes'       => 'String500',
2407                                 'damages'              => 'Collection',
2408                                 'damageTotal'          => 'Decimal',
2409                                 'previousRepairsNoted' => 'Boolean',
2410                                 'previousRepairsNotes' => 'String500',
2411                                 'damageNotes'          => 'String500',
2412                                 'coverReceived'        => 'String500',
2413                                 'makeManual'           => 'String150',
2414                                 'modelManual'          => 'String150',
2415                                 'typeManual'           => 'String150'
2416                         )
2417                 )
2418         );
2419
2420         /**
2421          * @var array
2422          */
2423         protected $metaDelete = array(
2424                 'Contract'     => 'UseOnce',
2425                 'RequireAuth'  => true,
2426                 'ExecuteAfter' => array(
2427                         'pushDeleteAction'
2428                 )
2429         );
2430
2431         /**
2432          * @var array
2433          */
2434         protected $metaRouteMoveToPending = array(
2435                 'Type'         => 'Route',
2436                 'Contract'     => 'UseOnce',
2437                 'RequireAuth'  => true,
2438                 'ExecuteAfter' => array(
2439                         'pushUpdateAction'
2440                 ),
2441                 'Destination'  => 'This.PendingValuation',
2442                 'Surrogate'    => 'metaUpdate'
2443         );
2444
2445         /**
2446          * @var array
2447          */
2448         protected $metaRouteMoveToComplete = array(
2449                 'Type'         => 'Route',
2450                 'Contract'     => 'UseOnce',
2451                 'RequireAuth'  => true,
2452                 'ExecuteAfter' => array(
2453                         'pushUpdateAction'
2454                 ),
2455                 'Destination'  => 'This.CompleteValuation',
2456                 'Surrogate'    => 'metaSendToSalesFull'
2457         );
2458
2459         /**
2460          * @var array
2461          */
2462         protected $metaRouteMoveToCustomerComplete = array(
2463                 'Type'        => 'Route',
2464                 'Contract'    => 'UseOnce',
2465                 'RequireAuth' => true,
2466                 'Destination' => 'This.CompleteValuation',
2467                 'Surrogate'   => 'metaSendToCustomerFull'
2468         );
2469
2470         /**
2471          * @var array
2472          */
2473         protected $metaRouteSendToStock = array(
2474                 'Type'        => 'Route',
2475                 'Contract'    => 'UseOnce',
2476                 'RequireAuth' => true,
2477                 'Destination' => 'Stock.Handover',
2478                 'Surrogate'   => 'metaSendToStock'
2479         );
2480
2481         /**
2482          * @var array
2483          */
2484         protected $metaRouteSendToPriceGuide = array(
2485                 'Type'         => 'Route',
2486                 'Contract'     => 'UseOnce',
2487                 'RequireAuth'  => true,
2488                 'ExecuteAfter' => array(
2489                         'pushUpdateAction'
2490                 ),
2491                 'Destination'  => 'PriceGuide.NewItemFromValuation',
2492                 'Surrogate'    => 'metaSendToPriceGuide'
2493         );
2494
2495
2496
2497         /**
2498          * Dynamic filtering.
2499          */
2500         public function __construct()
2501         {
2502                 $authData = \Utility\Registry::getAuthData();
2503                 switch (\Utility\Registry::getUserType())
2504                 {
2505                         case 'B4C User':
2506                                 $groupFilter = \Utility\Registry::getSudo('Group', false);
2507                                 if ($groupFilter)
2508                                 {
2509                                         $this->metaGrid['Filter']['IDENTITY(company.group)'] = $groupFilter;
2510                                 }
2511                                 $divisionFilter = \Utility\Registry::getSudo('Division', false);
2512                                 if ($divisionFilter)
2513                                 {
2514                                         $this->metaGrid['Filter']['IDENTITY(company.groupDivision)'] = $divisionFilter;
2515                                 }
2516                                 $companyFilter = \Utility\Registry::getSudo('Company', false);
2517                                 if ($companyFilter)
2518                                 {
2519                                         $this->metaGrid['Filter']['company.id'] = $companyFilter;
2520                                 }
2521                                 break;