Files
crm.e5.pl/modules/EcmStockDocInsideOuts/rwtotal.php
2024-04-27 09:23:34 +02:00

15 lines
478 B
PHP

<?php
$db = $GLOBALS['db'];
global $app_list_strings;
$query2=$db->query("select ROUND(sum(op.quantity*op.price),2) as total,rw.document_no,rw.id from
ecmstockdocinsideouts as rw
join ecmstockoperations as op on op.parent_id=rw.id
where rw.total='0.00'
GROUP BY op.parent_id order by rw.date_entered desc");
while($r = $db->fetchByAssoc($query2)){
$db->query("update ecmstockdocinsideouts set
total='".$r['total']."'
where id='".$r['id']."'");
}
;
?>