a:14:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:16:"FIN_LBS_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:13:"yieldcalc2();";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_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:13:"yieldcalc2();";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:15:"GYARDS_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:13:"yieldcalc2();";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:19:"TOTAL_COST_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:13:"yieldcalc2();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:14:"WASTE_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:13:"yieldcalc2();";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:7:"makefgi";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:520:"$insert_sql="
INSERT INTO fgstock(
	INVOICE,
 		P_O_NUMBER,
		DYE_LOT,
		LOCATION,
		STYLE,
		COLOR,
		COLOR_NO,
		WIDTH,
		DESCRIPTIO,
		YARDS_RECD,
		COST,
		TRANS,
		FINISH,
		FIN_NO,
		PUTUP,
		C1YARDS,
		OPEN
)
	SELECT
 		INVOICE,
 		P_O_NUMBER,
		DYE_LOT,
		LOCATION,
		STYLE,
		COLOR,
		COLOR_NO,
		WIDTH,
		DESCRIPTIO,
		YARDS_RECD,
		COST,
		TRANS,
		FINISH,
		FIN_NO,
		PUTUP,
		C1YARDS,
		YARDS_RECD
	FROM dorec
	WHERE dye_lot='[var_dyelot]'";
sc_exec_sql($insert_sql);";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:13:"onAfterDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:2:"
";}i:8;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:13:"onAfterUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:9;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:14:"onBeforeDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:10;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:166:"[var_do]={p_o_number};
[var_style]={style};
[var_color]={color};
[var_colorno]={color_no};
[var_width]={width};
[var_dyelot]={dye_lot};
[var_olddl]={dye_lot};
";}i:11;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:10:"onValidate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:44:"////yieldcalc2();
//[var_dyelot]={dye_lot};";}i:12;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:9:"updatefgi";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:794:"//this takes care of dye lot changea and updates case records too
$updatesql="
UPDATE  fgstock  
SET     dye_lot='{dye_lot}',
		invoice='{invoice}',
		location='{location}',
		style='{style}',
		color='{color}',
		color_no='{color_no}',
		width='{width}',
		descriptio='{descriptio}',
		yards_recd='{yards_recd}',
		cost='{cost}',
		trans='{trans}',
		finish='{finish}',
		fin_no='{fin_no}',
		putup='{putup}',
		c1yards='{c1yards}',
		open=yards_recd-shipped
WHERE   
	dye_lot = '[var_olddl]' 
";
sc_exec_sql($updatesql);
$updatesql="
UPDATE   veratex2.n3case
SET     dye_lot='{dye_lot}',
		style='{style}',
		color='{color}',
		color_no='{color_no}',
		width='{width}'
WHERE   
	dye_lot = '[var_olddl]' 
";
sc_exec_sql($updatesql);
[var_olddl]={dye_lot};

";}i:13;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_dye_dorec_form";s:4:"nome";s:10:"yieldcalc2";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:310:"{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};
	if({fin_lbs}>0)
{
	{work_loss}=({gr_lbs_rec}-{fin_lbs})/{gr_lbs_rec};
}
else
{
	{work_loss}=0;
}

}
else
{
{gr_yield} = 0;
}
";}}