a:7:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:17:"LBS_RECD_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"updcost();
";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:19:"TOTAL_COST_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:12:"updcost();
";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:13:"onAfterDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:12:"updmaster();";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:12:"updmaster();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:13:"onAfterUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:12:"updmaster();";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:7:"updcost";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:39:"{price_lb} = {total_cost} / {lbs_recd};";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:21:"pack_pstemp_edit_grid";s:4:"nome";s:9:"updmaster";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1617:"sc_lookup(dataset,"SELECT sum(lbs_recd),sum(total_cost) FROM pstemp WHERE p_o_number= {p_o_number}");
$master_lbsshippe = {dataset[0][0]};
$master_lbsshippe = round($master_lbsshippe,0);
$master_totalcost = {dataset[0][1]};
$master_totalcost = round($master_totalcost,2);
sc_lookup(dataset,"SELECT lbs_ordere,lbs_warped,waste,lbs_retd,lbs_allocd FROM potemp WHERE p_o_number = {p_o_number}");
$master_lbsordere = {dataset[0][0]};
$master_lbsopen = $master_lbsordere - $master_lbsshippe;
$master_lbswarped = {dataset[0][1]};
$master_waste = {dataset[0][2]};
$master_lbsretd = {dataset[0][3]};	
$master_inventory = $master_lbsshippe - $master_lbswarped - $master_waste - $master_lbsretd;
$master_lbsallocd = {dataset[0][4]};
$master_lbsavail = $master_lbsordere - $master_lbsallocd;
$master_costlb = round($master_totalcost / $master_lbsshippe,2);
$master_tv = round($master_costlb * $master_inventory,2);
sc_master_value('lbs_shippe',$master_lbsshippe);
sc_master_value('total_cost',$master_totalcost);
sc_master_value('lbs_open',$master_lbsopen);
sc_master_value('inventory',$master_inventory);
sc_master_value('lbs_avail',$master_lbsavail);
sc_master_value('cost_lb',$master_costlb);
sc_master_value('tv', $master_tv);
sc_exec_sql("UPDATE potemp
             SET lbs_shippe = $master_lbsshippe,
				 total_cost = $master_totalcost,
            	 lbs_open = $master_lbsopen,
                 inventory = $master_inventory,
                 lbs_avail = $master_lbsavail,
                 cost_lb = $master_costlb,
                 tv = $master_tv
			WHERE p_o_number = {p_o_number}");
	";}}