7 lines
404 B
PHP
7 lines
404 B
PHP
<?php
|
|
$w=$GLOBALS[db]->query("select id,parent_id from ecminvoiceoutolds where register_date>='2010-01-01' and (to_nip is null or to_nip='')");
|
|
while($r=$GLOBALS[db]->fetchByAssoc($w)){
|
|
$rr=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select sic_code from accounts where id='".$r['parent_id']."'"));
|
|
echo "update ecminvoiceoutolds set to_nip='".$rr['sic_code']."' where id='".$r['id']."';<br>";
|
|
}
|
|
?>
|