a:8:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:13:"CODE_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"anychange();";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:16:"PERCENT_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"anychange();";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:9:"anychange";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:336:"/**
 * Selecting a field from another table
 */

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

if (isset({rs[0][0]}))     // Row found
{
    {amount} = {rs[0][0]}*{percent};
}
		else     // No row found
{
		    {amount} = '0';
}";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:13:"updateline();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:13:"onAfterUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:13:"updateline();";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:12:"totalcost();";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:9:"totalcost";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:160:"$check_sql = "SELECT sum(amount)"
   . " FROM cmatch"
   . " WHERE style = '" . {style} . "'";

sc_lookup(rs, $check_sql);
[var_totalamt] = {rs[0][0]};

";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"line_cmatch_edit_grid";s:4:"nome";s:10:"updateline";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:413:"$check_sql = "SELECT sum(amount)"
   . " FROM cmatch"
   . " WHERE style = '" . {style} . "'";

sc_lookup(rs, $check_sql);

$master_field = 'stdcost';
$master_value = {rs[0][0]} / [var_conv];
sc_format_num($master_value, ',', '.', 2, 'S', '1', '');
sc_master_value($master_field, $master_value);

sc_exec_sql("UPDATE line
			   SET STDCOST = $master_value
			 WHERE style = '" . {style} . "'");


";}}