a:1:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:16:"fv2_greige_clean";s:4:"nome";s:9:"onExecute";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:1133:"//************************************CLEANUP***********************************
//GRPCS CLEANUP
$delete_sql =
"
DELETE FROM grpcs
	WHERE ltrim(rtrim(piece)) = ''
       	OR AC = 'HORN'
		OR AC = 'FABL'
		OR AC = 'ORBI'
		OR AC = 'MILC'
		OR AC = 'VERA'
		OR AC = 'MCMU'
		OR AC = 'GUIF'
		OR AC = 'PACI'
		OR AC = 'GEHG'
";
sc_exec_sql($delete_sql);

$current_records = "DELETE from grpcs where adate < '2010/01/01' or adate is NULL";
sc_exec_sql($current_records);
$updatefields = 
	"
UPDATE grpcs
SET lbs_open=0,lbs_used=lbs_recd
WHERE 
Dye_order<>''
";
sc_exec_sql($updatefields);
$updatefields = 
	"
UPDATE grpcs
SET lbs_open=lbs_recd,lbs_used=0
WHERE 
Dye_order=''
";
sc_exec_sql($updatefields);
$updatefields = 
	"
UPDATE grpcs
SET rpd=racks/defects
WHERE 
defects>0
";
sc_exec_sql($updatefields);

// GREIGEPO CLEANUP
$delete_sql = 
"
DELETE FROM greigepo 
	where p_o_number = 'VF100' 
       OR p_o_number = 'VERA' 
       OR p_o_number = 'V1006' 
       OR p_o_number is null 
       OR p_o_number = ''
       OR p_o_number < '5612'
";


sc_exec_sql($delete_sql);
";}}