daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest May 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for ($i = 0; $i < $products->count(); $i++)
  2.         {
  3.             $w8rec = $products[$i]->producer->is_w8_recieved == 1;
  4.             $w9rec = $products[$i]->producer->is_w9_recieved == 1;
  5.             $contractrec = $products[$i]->producer->is_contract_received == 1;
  6.             $not_missing = ($w8rec OR $w9rec) AND $contractrec  ;
  7.                                
  8.             if ( ! $not_missing AND $products[$i]->status =='pending')  
  9.             {
  10.                 $products[$i]->status = 'missing_paperwork';
  11.                 $missing_string = 'Missing '.($w8rec ? '' : 'W8 ').($w9rec ? '' : 'W9 ').($contractrec ? '' : 'Contract');
  12.                 $products[$i]->missing_paperwork = $missing_string;
  13.                 $products[$i]->save();
  14.                 $data['user'] = $products[$i]->producer->user;
  15.                 $data['product'] = $products[$i];
  16.                 Event::run("email.missing_paperwork",$data);
  17.             }          
  18.            
  19.         }  
  20.         $view = View::factory("products/pending")
  21.                         ->set("products",$products);
RAW Paste Data
Top