a:8:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:16:"DEFECTS_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:9:"updRPD();";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:14:"RACKS_onChange";s:4:"tipo";s:1:"A";s:5:"parms";s:0:"";s:6:"codigo";s:9:"updRPD();";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:13:"onAfterDelete";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:18:"updNGO();
post();";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:18:"updNGO();
post();";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:13:"onAfterUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:18:"updNGO();
post();";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:4:"post";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1290:"//UPDATE WARP INVENTORY 
sc_lookup(dataset,"SELECT top_p_o_,bot_p_o_ FROM greigepo 
                   WHERE p_o_number = '{p_o_number}'");  //COMMENT HERE
$toppo = {dataset[0][0]};
$botpo = {dataset[0][1]}; 
sc_lookup(dataset, "SELECT SUM(top_ship) FROM greigepo 
                    WHERE top_p_o_ = $toppo");
$toplbs = {dataset[0][0]};
sc_lookup(dataset, "SELECT SUM(bot_ship) FROM greigepo 
                    WHERE bot_p_o_ = $toppo");
$toplbs = $toplbs + {dataset[0][0]};
sc_lookup(dataset, "SELECT SUM(top_ship) FROM greigepo 
                    WHERE top_p_o_ = $botpo");
$botlbs = {dataset[0][0]};
sc_lookup(dataset, "SELECT SUM(bot_ship) FROM greigepo 
                    WHERE bot_p_o_ = $botpo");
$botlbs = $botlbs + {dataset[0][0]};
sc_exec_sql("UPDATE warppo                                           
             SET lbs_knit = $toplbs,
                 inventory = lbs_recd - lbs_knit - lbs_sold - waste,
                 tv = inventory*cost_lb_t
             WHERE p_o_number = $toppo");
sc_exec_sql("UPDATE warppo                                          
             SET lbs_knit = $botlbs,
	             inventory = lbs_recd - lbs_knit - lbs_sold - waste,
                 tv = inventory*cost_lb_t
             WHERE p_o_number = $botpo");";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:6:"updNGO";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1428:"//UPDATE NGO FROM GRPCS
sc_lookup(dataset,"SELECT SUM(lbs_recd) FROM grpcs WHERE invoice='{invoice}'");
$master_lbsrecd = {dataset[0][0]};
sc_master_value('lbs', $master_lbsrecd);
sc_exec_sql("UPDATE ngo
             SET lbs = $master_lbsrecd
             WHERE invoice={invoice}");
//UPDATE GREIGEPO FROM NGO
sc_lookup(dataset,"SELECT SUM(lbs), SUM(totalkc) FROM ngo WHERE p_o_number = {p_o_number}");
$master_gpo_lbs = {dataset[0][0]};
$master_gpo_totalkc = {dataset[0][1]};
sc_exec_sql("UPDATE greigepo
              SET lbs = $master_gpo_lbs,
                  totalkc = $master_gpo_totalkc
              WHERE p_o_number = {p_o_number}");
//UPDATE GREIGEPO FROM GRPCS
sc_lookup(dataset,"SELECT SUM(lbs_recd), SUM(lbs_used) FROM grpcs WHERE p_o_number = {p_o_number}");
$master_grpcs_lbsrecd = {dataset[0][0]};
$master_grpcs_lbsused = {dataset[0][1]};
$master_grpcs_lbsopen = round($master_grpcs_lbsrecd - $master_grpcs_lbsused,2);
sc_exec_sql("UPDATE greigepo
              SET lbs = $master_gpo_lbs,
                  lbs_dyed = $master_grpcs_lbsused,
                  pinv = $master_grpcs_lbsopen,
                  inventory = $master_gpo_lbs - $master_grpcs_lbsused,
                  amount = inventory * cost_lb,
                  top_ship = (top_lbs/(top_lbs+bot_lbs)) * lbs,
                  bot_ship = (bot_lbs/(top_lbs+bot_lbs)) * lbs
              WHERE p_o_number = {p_o_number}");";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:22:"greige_grpcs_edit_grid";s:4:"nome";s:6:"updRPD";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:26:"{rpd} = {racks}/{defects};";}}