$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');
else
{
#-> Each and every one a loser.
+ \Utility\Debug::errorLog('no winner',$item->id);
$this->workflowNode->changeState('This.Relist');
}
}
{
try
{
+ \Utility\Debug::errorLog('setting data for mail',$item->id);
#-> General data prep.
$vehicle = $item->stock->type->model->make->name
$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;