Files
crm.twinpol.com/modules/EcmReceipts2/update_item_id.php

10 lines
575 B
PHP
Raw Normal View History

2025-05-12 15:44:39 +00:00
<?
$w=$GLOBALS[db]->query("select * from ecmreceipts where id='8aa03944-fc72-26ec-8eb4-4b718085454e'");
while($r=$GLOBALS[db]->fetchByAssoc($w)){
$ww=$GLOBALS[db]->query("select * from ecmreceiptitems where ecmreceipt_id='".$r['id']."'");
while($rr=$GLOBALS[db]->fetchByAssoc($ww)){
$rrr=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select id from ecmreceiptitems where ecmreceipt_id='".$r['ecmreceipt_id']."' and ecmproduct_id='".$rr['ecmproduct_id']."'"));
echo "update ecmreceiptitems set ecmreceiptitem_id='".$rrr['id']."' where id='".$rr['id']."';<br>";
}
}
?>