a:11:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"billing_invoice_form";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:51:"[var_invoice] = {invoice};
[var_bcode2] = {bcode};";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:8;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"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:9;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"billing_invoice_form";s:4:"nome";s:8:"smchange";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1153:"/**
 * Selecting a field from another table
 */

// Check for record
$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:10;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:20:"billing_invoice_form";s:4:"nome";s:6:"voidit";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:467:"/**
 * Update a record on another table
 */

// SQL statement parameters
$update_table  = 'invoice';      // Table name
$update_where  = "invoice = '[var_invoice]'"; // Where clause
$update_fields = array(   // Field list, add as many as needed
     "void = 'Y'",
     "void = 'Y'",
 );

// Update record
$update_sql = 'UPDATE ' . $update_table
    . ' SET '   . implode(', ', $update_fields)
    . ' WHERE ' . $update_where;
sc_exec_sql($update_sql);";}}