a:1:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"fv2_billing_import";s:4:"nome";s:9:"onExecute";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:814:"// this is done in mysql cron job on ls4

$clear_table = 'Truncate table fairlanevrtx2.invoice';
$import_table = "Insert into fairlanevrtx2.invoice 
					select * from fairlanevrtx.invoice 
						where (invoice>'09547')" ;
$update_table="
UPDATE
	fairlanevrtx2.invoice
SET
	FACTORED='N'
";
sc_exec_sql($clear_table);
sc_exec_sql($import_table);
sc_exec_sql($update_table);
echo 'Invoice table initiated.';

$clear_table = 'Truncate table fairlanevrtx2.item';
$import_table = "Insert into fairlanevrtx2.item select * from fairlanevrtx.item where (invoice>'09547')";
sc_exec_sql($clear_table);
sc_exec_sql($import_table);
$update_table="
UPDATE
	fairlanevrtx2.item
SET
	amount=lin*price
";
sc_exec_sql($update_table);
echo 'Item table initialized.';
echo "Billing tables Initialized.";
";}}