Files
crm.e5.pl/modules/EcmProducts/updatevat.php

7 lines
386 B
PHP
Raw Normal View History

2024-04-27 09:23:34 +02:00
<?
$w=$GLOBALS['db']->query("select id,vat_value from ecmproducts");
while($r=$GLOBALS['db']->fetchByAssoc($w)){
$rr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select id,name from ecmvats where value='".$r['vat_value']."' and deleted='0'"));
$GLOBALS['db']->query("update ecmproducts set vat_name='".$rr['name']."',vat_id='".$rr['id']."' where id='".$r['id']."'");
}
?>