a:10:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:19:"GR_LBS_REC_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"yieldcalc();";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:15:"GYARDS_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"yieldcalc();";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:19:"TOTAL_COST_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"yieldcalc();";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:14:"WASTE_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"yieldcalc();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:13:"onAfterDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:14:"postrectodo();";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:14:"postrectodo();";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:13:"onAfterUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:14:"postrectodo();";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:8;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:11:"postrectodo";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1214:"sc_lookup(dataset1, "SELECT gr_lbs_o, cost_lb_g FROM dyeorder WHERE dye_order = [var_p_o_number]");
$grlbo={dataset1[0][0]};
$costlbg={dataset1[0][1]};	
sc_lookup(dataset1, "SELECT sum(total_cost),sum(yards_recd),sum(gr_lbs_rec),sum(fin_lbs) FROM fgtemp WHERE p_o_number = [var_p_o_number]");
$totalcost={dataset1[0][0]};
$ydsrecd={dataset1[0][1]};
$grlbsrec={dataset1[0][2]};
$finlbs={dataset1[0][3]};	
$grlbsop = $grlbo-$grlbsrec;
$grvalue=$costlbg*$grlbsop;		 
if($grlbsrec>0)
{	
	$workloss = ($grlbsrec-$finlbs)/$grlbsrec;
	$costlbd=$totalcost/$grlbsrec;
	$gryld=$ydsrecd/$grlbsrec;
}
else
{
	$workloss=0;
	$costlbd=0;
	$gryld=0;
}
$costlbt=$costlbg+$costlbd;
if($gryld>0)
{
$costydt=$costlbt/$gryld;
}
else
{
$costydt=0;	
}
sc_exec_sql("UPDATE	dyeorder
             SET  gr_lbs_d = $grlbsrec,
				  gr_lbs_op = $grlbsop,
				  gr_value = $grvalue,
				  work_loss = $workloss,
                  cost_lb_d = $costlbd,
			      cost_lb_t = $costlbt,
				  cost_yd_t = $costydt,
				  dye_cost = $totalcost,
				  fin_lbs = $finlbs,
 			      yards_recd = $ydsrecd,
				  gr_yield = $gryld
           WHERE p_o_number = '[var_p_o_number]'");
sc_redir(dye_fgtemp_form);";}i:9;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:15:"dye_fgtemp_form";s:4:"nome";s:9:"yieldcalc";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:200:"{yards_recd}={gyards}-{waste};
{cost}={total_cost}/{gyards};
	if({gr_lbs_rec}>0)
{
{cost_lb_d}={total_cost}/{gr_lbs_rec};
{gr_yield} = {yards_recd} / {gr_lbs_rec};
}
else
{
{gr_yield} = 0;
}";}}