a:18:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:0:"";s:4:"tipo";s:0:"";s:5:"parms";s:0:"";s:6:"codigo";s:575:"$update_sql = "
UPDATE doit
SET invoice='',it=''
WHERE (invoice='[var_invoice]') AND (it='[var_item]')";
sc_exec_sql($update_sql);
$update_sql = "
UPDATE n3case
SET invoice='',it=''
WHERE (invoice='[var_invoice]') AND (it='[var_item]')";
sc_exec_sql($update_sql);

$smit='{smit}';
if (isset($smit) && strlen($smit)>0)
{
$update_sql = "
UPDATE doit
SET invoice='{invoice}', it='{item}'
WHERE smit='{smit}'";
sc_exec_sql($update_sql);

$update_sql = "
UPDATE n3case
SET invoice='{invoice}', it='{item}'
WHERE smit='{smit}'";
sc_exec_sql($update_sql);
}";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:14:"APPNO_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:11:"smchange();";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:14:"BCODE_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:15:"billtoupdate();";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:14:"SCODE_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:15:"shiptoupdate();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:14:"TERMS_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:10:"chddays();";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:12:"billtoupdate";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:893:"$getadd="select prefix,name,address1,address2,city,state,zip_code,country from veratex2.custbill
where bcode='{bcode}'";
sc_lookup(rs,$getadd);	
if (isset({rs[0][0]}))
	{
	$prefix={rs[0][0]};	
		}
else
	{
     $prefix='';
		}
if (isset({rs[0][1]}))
	{
	$name={rs[0][1]};	
		}
else
	{
     $name='';
		}
if (isset({rs[0][2]}))
	{
	{Badd1}={rs[0][2]};	
		}
else
	{
     {Badd1}='';
		}
if (isset({rs[0][3]}))
	{
	{Badd2}={rs[0][3]};	
		}
else
	{
     {Badd2}='';
		}
if (isset({rs[0][4]}))
{
$city={rs[0][4]};
}
else
	{
		$city='';
	}
if (isset({rs[0][5]}))
{
	$state={rs[0][5]};
}
else
	{
		$state='';
		}
if (isset({rs[0][6]}))
	{
		$zip={rs[0][6]};
}
else
	{
		$zip='';
			}
{bname}=$prefix.' '.$name;
		{Badd3}=$city." ".$state."  ".$zip;

if (isset({rs[0][7]}))
	{
	{Badd4}={rs[0][7]};	
		}
else
	{
     {Badd4}='';
		}
";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:7:"chddays";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:325:"/**
 * Selecting a field from another table
 */

// Check for record
$check_sql = "SELECT ddays"
   . " FROM terms"
   . " WHERE terms = '{terms}'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
    {dday} = {rs[0][0]};
    }
		else     // No row found
{
		    {dday} = 'UNK';
    }
";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:13:"onAfterInsert";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:24:"fv2_billing_invoice_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:24:"fv2_billing_invoice_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:24:"fv2_billing_invoice_form";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:146:"if({void}=='Y')
{
sc_btn_display('Void', 'off');
}


[var_invoice] = {invoice};
[var_bcode2] = {bcode};
billtoupdate();
shiptoupdate();
";}i:11;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:10:"onNavigate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:12;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:17:"onValidateSuccess";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:13;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:11:"refreshform";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:48:"sc_redir("fv2_billing_invoice_form","","_self");";}i:14;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:12:"shiptoupdate";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:891:"$getadd="select prefix,name,address1,address2,city,state,zip_code,country from veratex2.custship
where scode='{scode}'";
sc_lookup(rs,$getadd);	
if (isset({rs[0][0]}))
	{
	$prefix={rs[0][0]};	
		}
else
	{
     $prefix='';
		}
if (isset({rs[0][1]}))
	{
	$name={rs[0][1]};	
		}
else
	{
     $name='';
		}
if (isset({rs[0][2]}))
	{
	{Sadd1}={rs[0][2]};	
		}
else
	{
     {Sadd1}='';
		}
if (isset({rs[0][3]}))
	{
	{Sadd2}={rs[0][3]};	
		}
else
	{
     {Sadd2}='';
		}
if (isset({rs[0][4]}))
{
$city={rs[0][4]};
}
else
	{
		$city='';
	}
if (isset({rs[0][5]}))
{
	$state={rs[0][5]};
}
else
	{
		$state='';
		}
if (isset({rs[0][6]}))
	{
		$zip={rs[0][6]};
}
else
	{
		$zip='';
			}
{sname}=$prefix.' '.$name;
		{Sadd3}=$city." ".$state."  ".$zip;

if (isset({rs[0][7]}))
	{
	{Sadd4}={rs[0][7]};	
		}
else
	{
     {Sadd4}='';
		}";}i:15;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:8:"smchange";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1079:"$check_sql = "SELECT BL,b1,s1,sdate,add_ons,add_charge,via1,cases"
   . " FROM doship"
   . " WHERE SM = '" . {APPNO} . "'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
    {bcode} = {rs[0][1]};
    {scode} = {rs[0][2]};
	{date} = {rs[0][3]};
		{add_ons} = {rs[0][4]};
			{add_charge} = {rs[0][5]};
				{shippedvia} = {rs[0][6]};
					{cases} = {rs[0][7]};
}
		else     // No row found
{
		    {bcode} = '';
    {scode} = '';
	{date} = '';
		    {add_ons} = '';
    {add_charge} = '';
	{shippedvia} = '';
	{cases} = '';
}
/**
 * Selecting a field from another table
 */

// Check for record
$check_sql = "SELECT sm,terms, terms2,salesman,factor"
   . " FROM doit"
   . " WHERE sm = '" . {APPNO} . "'";
sc_lookup(rs2, $check_sql);

if (isset({rs2[0][0]}))     // Row found
{
    {terms} = {rs2[0][1]};
    {terms2} = {rs2[0][2]};
		{salesman} = {rs2[0][3]};
    {factored} = {rs2[0][4]};
		 
}
		else     // No row found
{
		    {terms} = '';
    {terms2} = '';
	 {salesman} = '';
    {factored} = '';
}
";}i:16;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:4:"temp";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:420:"/**
 * Selecting a field from another table
 */

// Check for record
$check_sql = "SELECT state_name, region"
   . " FROM States"
   . " WHERE state_id = '" . {field_state_id} . "'";
sc_lookup(rs, $check_sql);

if (isset({rs[0][0]}))     // Row found
{
    {other_field} = {rs[0][0]};
    {other_region} = {rs[0][1]};
}
		else     // No row found
{
		    {other_field} = '';
    {other_region} = '';
}";}i:17;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:24:"fv2_billing_invoice_form";s:4:"nome";s:6:"voidit";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:130:"$voidit="UPDATE invoice SET void='Y' WHERE invoice='{invoice}'";
sc_exec_sql($voidit);
echo "The invoice has been voided.";
	
";}}