issue with offline sending through gearmanClient
[namibia] / module / Auction / src / Auction / Service / Auction.php
index 588627e..b2aca46 100644 (file)
@@ -21,7 +21,6 @@ class Auction extends \Auction\DataBin\Auction
                \Stock\Entity\Stock $stock, $previousState, array $routingData = array()
        )
        {
-               \Utility\Debug::errorLog('initNewItemFromStock' , $stock);
                #-> Establish initial increment value.
                $increments = $this->em
                        ->getRepository('\Auction\Entity\Increment')
@@ -37,7 +36,7 @@ class Auction extends \Auction\DataBin\Auction
                }
                #-> Create auction entry.
                if (isset($routingData['profileId']))
-               {\Utility\Debug::errorLog('reroute1' , "true");
+               {
                        $profile    = $this->em->find('User\\Entity\\Profile', $routingData['profileId']);
                        $email      = $profile->email;
                        $firstName  = $profile->firstName;
@@ -48,7 +47,7 @@ class Auction extends \Auction\DataBin\Auction
                        $profile    = $profile->id;
                }
                else
-               {\Utility\Debug::errorLog('reroute1' , "false");
+               {
                        $authData   = \Utility\Registry::getAuthData();
                        $email      = $authData['email'];
                        $firstName  = $authData['firstName'];
@@ -80,7 +79,7 @@ class Auction extends \Auction\DataBin\Auction
                $stock->highestBid  = 0.00;
                $stock->timesListed = $stats['numAuctions'];
                $this->em->flush($stock);
-               \Utility\Debug::errorLog('created stock' , "true");
+
                #-> Send loaded notification.
                #-> Attachments.
                $pdf = new \Auction\Pdf\Complete();
@@ -561,9 +560,15 @@ class Auction extends \Auction\DataBin\Auction
                        $this->workflowNode->setJob($item);
                        try
                        {
+                               \Utility\Debug::errorLog('currentbid',$item->currentBid->amount);
+                               \Utility\Debug::errorLog('reserve',$item->reservePrice);
+
                                if (!is_null($item->currentBid) && $item->currentBid->amount > $item->reservePrice)
                                {
                                        #-> We have a winner.
+                                       \Utility\Debug::errorLog('Winner',$item->id);
+
+
                                        $item->soldToCompany = $item->currentBid->company;
                                        $item->soldToProfile = $item->currentBid->profile;
                                        $this->workflowNode->changeState('This.Sold');
@@ -571,6 +576,7 @@ class Auction extends \Auction\DataBin\Auction
                                else
                                {
                                        #-> Each and every one a loser.
+                                       \Utility\Debug::errorLog('no winner',$item->id);
                                        $this->workflowNode->changeState('This.Relist');
                                }
                        }
@@ -592,6 +598,7 @@ class Auction extends \Auction\DataBin\Auction
                {
                        try
                        {
+                               \Utility\Debug::errorLog('setting data for mail',$item->id);
 
                                #-> General data prep.
                                $vehicle    = $item->stock->type->model->make->name
@@ -600,8 +607,15 @@ class Auction extends \Auction\DataBin\Auction
                                $currPrefix = \Utility\Definitions\Locale::getCurrencyPrefix() . ' ';
                                $oNotify    = new \Utility\Comms\Notification();
 
+                               \Utility\Debug::errorLog('jobstate',$item->jobState);
+                               \Utility\Debug::errorLog('currentbid',$item->currentBid->amount);
+                               \Utility\Debug::errorLog('reserve',$item->reservePrice);
+
                                if (!is_null($item->currentBid) && $item->currentBid->amount > $item->reservePrice && 'Sold' == $item->jobState)
                                {
+                                       \Utility\Debug::errorLog('sending mails',$item->jobState);
+
+
                                        #-> Update record to reflect winner.
                                        $item->soldToCompany = $item->currentBid->company;
                                        $item->soldToProfile = $item->currentBid->profile;