Files
crm.twinpol.com/modules/EcmNoteOuts/calculatePurchase.php

10 lines
315 B
PHP
Raw Normal View History

2025-05-12 15:44:39 +00:00
<?php
$db=$GLOBALS['db'];
$r=$db->query("select * from ecmnoteouts");
while($a=$db->fetchByAssoc($r)){
$db->query("update ecmnoteouts set purchase_price=(select round(sum(quantity*price_purchase),2) as sum from ecmnoteoutitems
where ecmnoteout_id='".$a['id']."') where id='".$a['id']."'
");
}
?>