a:33:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:12:"LIN_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"amtupdate();";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:14:"PRICE_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"amtupdate();";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:11:"SQ_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"amtupdate();";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"UNIT_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"amtupdate();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:9:"amtupdate";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:117:"if ({UNIT} == 'LIN')
	{
	{amount} = {LIN} * {PRICE};
	}
if ({UNIT} == 'SQ')
	{
	{amount} = {SQ} * {PRICE};
	}	";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:11:"dl_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:29:"dlselect();
mismatchcheck();";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:17:"dlsearch_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:23:"[var_style]={dlsearch};";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:8:"dlselect";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:433:"$check_sql = "SELECT p_o_number,style,width,color,color_no,descriptio"
   . " FROM fgstock"
   . " WHERE dye_lot = '" . {dl} . "'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
    {dlpo} = {rs[0][0]};
	{dlstyle} = {rs[0][1]};
    {dlwidth} = {rs[0][2]}; 
	{dlcolor} = {rs[0][3]};
	{dlcolorno} = {rs[0][4]};
		{dldesc} = {rs[0][5]};
}
		else     // No row found
{			
    {dlpo} = '';
}

		";}i:8;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:5:"dluse";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:541:"{smuse}='';
{ouse}='';
{dye_lot}={dl};
{color} = {dlcolor};
{color_no} = {dlcolorno};
{width} = {dlwidth};
{style} = {dlstyle};
{descrip} = {dldesc};
{dye_order}={dlpo};
{lin}='';
{our_order}='';
{unit}='';
{price}='';
{amount}='';
{smit}='NONE';
{smselect}='';
 {smcolor} = '';
	{smwidth} = '';
	{smstyle} ='';
	{smdate} = '';
	{smourorder} = '';
	{smcustno} = '';	
	{smpo} = '';
	{smdl} = '';
	{smyds} = '';
	{smsq} = '';
	{smprice} ='';
	{smunit} = '';
	{smmemo} = '';
	{smcases} = '';
	{smdescrip} = '';

";}i:9;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"dluse_onClick";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:67:"if({dluse}=='Y')
{
	dluse();
}
ELSE
	{
		reloaddetail();
		}";}i:10;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"mismatchcheck";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:536:"if({dlcolor}<>{ocolor} AND {dl}<>'NONE' AND {oselect}<>'NONE' AND {oselect}<>'SPOT')
{
$javascript_title   = 'Mismatch Warning';  
$javascript_message = "Color Mismatch "."{ocolor}"."<>"."{dlcolor}";  
sc_ajax_message($javascript_message, $javascript_title);
}

if({dlstyle}<>{ostyle} AND {dl}<>'NONE' AND {oselect}<>'NONE' AND {oselect}<>'SPOT')
{
$javascript_title   = 'Mismatch Warning';  
$javascript_message = "Style Mismatch "."{ostyle}"."<>"."{dlstyle}";  
sc_ajax_message($javascript_message, $javascript_title);
}
";}i:11;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"onAfterDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:8:"



";}i:12;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:14:"refreshform();";}i:13;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"onAfterUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:14:"refreshform();";}i:14;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:17:"onApplicationInit";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:15;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:14:"onBeforeDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:2:"
";}i:16;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:14:"onBeforeInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:17;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:14:"onBeforeUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:18;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:327:"[var_invoice] = {invoice};
[var_smit] = {smit};
[var_item] = {item};
[var_bcode]={bcode};
[var_style]={style};
[var_dyelot]={dye_lot};
[var_ourorder]={our_order};
{smselect}='NONE';
//DONT SET CHECKBOX VARIABLE ON LOAD
//{smuse}='N';
{oselect}='NONE';
//{ouse}='';
{dl}='NONE';
//{dluse}='';
{dlsearch}={style};
";}i:19;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:10:"onNavigate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:20;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:10:"onValidate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:125:"if({our_order} == 'SPOT' and {lin}==0)
{
sc_error_message("LIN is a required field for automatic SPOT order creation!");
}";}i:21;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:17:"onValidateSuccess";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:22;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:7:"oselect";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:413:"$check_sql = "SELECT style,width,color,color_no,lin_sq,c_o_number,price"
   . " FROM asst"
   . " WHERE our_order = '" . {oselect} . "'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
 	{ostyle} = {rs[0][0]};
    {owidth} = {rs[0][1]};
	{ocolor} = {rs[0][2]};
	{ocolorno} = {rs[0][3]};
	{ounit} = {rs[0][4]};
	{ocustno} = {rs[0][5]};
	{oprice} = {rs[0][6]};
	{ouse}='';
}
	";}i:23;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:16:"oselect_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:28:"oselect();
mismatchcheck();";}i:24;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:4:"ouse";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:871:"{smuse}='';
{dluse}='';

IF ({oselect}<>'SPOT')
{
{color} = {ocolor};
{color_no} = {ocolorno};
{width} = {owidth};
{style} = {ostyle};
{our_order} = {oselect};
{cust_order} = {ocustno};	
{price} = {oprice};
{unit} = {ounit};
{descrip} = {odesc};
sc_label('lin') = "LIN";	
}
ELSE
{
$check_sql = "SELECT line.desc FROM veratex2.line WHERE style = '{style}'";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]}))     
{
{descrip} = {rs[0][0]};
}
ELSE
{
{descrip} = '';
}
{our_order}='SPOT';
{date}=date('Y-m-d');
sc_label('lin') = "LIN <b style='color:red'>*</b>";
}
{smit}='NONE';
{smselect}='';
{smcolor} = '';
{smwidth} = '';
{smstyle} ='';
{smdate} = '';
{smcustno} = '';	
{smpo} = '';
{smdl} = '';
{smprice} ='';
{smunit} = '';
{smdescrip} = '';
{smyds} = '';
{smsq} = '';
{smourorder} = '';
{smmemo} = '';
{smcases} = '';
";}i:25;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:12:"ouse_onClick";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:65:"if({ouse}=='Y')
{
	ouse();
}
ELSE
	{
		reloaddetail();
		}";}i:26;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:11:"refreshform";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:52:"sc_redir("fv2_billing_item_single_form","","_self");";}i:27;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:12:"reloaddetail";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:892:"$check_sql = "SELECT smit, color, width, style, 
date, our_order, cust_order, dye_order, dye_lot, 
lin, sq, price, unit, memo, cases, descrip
FROM item WHERE invoice = '{invoice}' AND
item='{item}'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
    {smit} = {rs[0][0]};
    {color} = {rs[0][1]};
	{width} = {rs[0][2]};
	{style} = {rs[0][3]};
	{date} = {rs[0][4]};
	{our_order} = {rs[0][5]};
	{cust_order} = {rs[0][6]};	
	{dye_order} = {rs[0][7]};
	{dye_lot} = {rs[0][8]};
	{lin} = {rs[0][9]};
	{sq} = {rs[0][10]};
	{price} = {rs[0][11]};
	{unit} = {rs[0][12]};
	{memo} = {rs[0][13]};
	{cases} = {rs[0][14]};
	{descrip} = {rs[0][15]};
	if ({rs[0][12]} == 'LIN')
		{
			{amount} = {rs[0][11]} * {rs[0][9]};
		}
	if ({rs[0][12]} == 'SQ')
		{
			{amount} = {rs[0][11]} * {rs[0][10]};
		}	
}				
	else
		{
			echo 'Not found.';
		}

";}i:28;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:8:"smselect";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:898:"$check_sql = "SELECT smit,color, width, style, sdate, our_order, custno, p_o_number, dye_lot, lyards, syards, price, unit, memo, pcount, `desc`"
   . " FROM doit"
   . " WHERE smit = '" . {smselect} . "'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
    {smcolor} = {rs[0][1]};
	{smwidth} = {rs[0][2]};
	{smstyle} = {rs[0][3]};
	{smdate} = {rs[0][4]};
	{smourorder} = {rs[0][5]};
	{smcustno} = {rs[0][6]};	
	{smpo} = {rs[0][7]};
	{smdl} = {rs[0][8]};
	{smyds} = {rs[0][9]};
	{smsq} = {rs[0][10]};
	{smprice} = {rs[0][11]};
	{smunit} = {rs[0][12]};
	{smmemo} = {rs[0][13]};
	{smcases} = {rs[0][14]};
	{smdescrip} = {rs[0][15]};
	{smuse}='N';
	if ({rs[0][12]} == 'LIN')
		{
			{amount} = {rs[0][11]} * {rs[0][9]};
		}
	if ({rs[0][12]} == 'SQ')
		{
			{amount} = {rs[0][11]} * {rs[0][10]};
		}	
}				
	else
		{
			echo 'Not found.';
		}

";}i:29;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:17:"smselect_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:11:"smselect();";}i:30;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:5:"smuse";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:593:"{dluse}='';
{ouse}='';
{dl}='NONE';
{dlpo} ='';
{dlstyle} ='';
{dlwidth} ='';
{dlcolor} ='';
{dlcolorno} ='';
{oselect}='NONE';
{ostyle} ='';
{owidth} ='';
{ocolor} ='';
{ocolorno} ='';
{ounit} ='';
{ocustno} ='';
{oprice} ='';
{smit} = {smselect};
{color} = {smcolor};
{width} = {smwidth};
{style} = {smstyle};
{date} = {smdate};
{our_order} = {smourorder};
{cust_order} = {smcustno};	
{dye_order} = {smpo};
{dye_lot} = {smdl};
{lin} = {smyds};
{sq} = {smsq};
{price} = {smprice};
{unit} = {smunit};
{memo} = {smmemo};
{cases} = {smcases};
{descrip} = {smdesc};";}i:31;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:13:"smuse_onClick";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:67:"if({smuse}=='Y')
{
	smuse();
}
ELSE
	{
		reloaddetail();
		}";}i:32;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:28:"fv2_billing_item_single_form";s:4:"nome";s:17:"updatepackinglist";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:706:"$filename='/var/www/veratex.vrtxinc.com/myfile_'.date('m-d-Y_hisa');
	$output_sql = "
select concat(RPAD('.    ',23,' '),LPAD('.    ',10,' '))
union 
select concat(RPAD('.    ',23,' '),LPAD('.    ',10,' '))
union 
select concat(RPAD('ROLL#',23,' '),LPAD('YARDS',10,' '))
union
select concat(RPAD(concat(n3case.case,suffix),21,' '),' ',LPAD(yds,10,' '))
INTO OUTFILE '$filename' 
FROM n3case WHERE n3case.invoice='[var_invoice]' and n3case.it='[var_item]'
";
sc_exec_sql($output_sql);
$save_outfile="	
UPDATE item
SET memo = LOAD_FILE('$filename')
WHERE invoice = '[var_invoice]' and item='[var_item]'
";
sc_exec_sql($save_outfile);	
sc_redir("fv2_billing_item_single_form","","_self");
";}}