17 lines
862 B
PHP
17 lines
862 B
PHP
|
|
<?php
|
||
|
|
$w=$GLOBALS[db]->query("SELECT *
|
||
|
|
FROM `ecmstockdoccorrects`
|
||
|
|
WHERE `date_modified` > '2010-03-10'
|
||
|
|
AND `modified_user_id` LIKE '708f958e-7e5a-e1f1-095b-4a02afc3a628'");
|
||
|
|
while($r=$GLOBALS[db]->fetchByAssoc($w)){
|
||
|
|
//echo $r['document_no']."<br>";
|
||
|
|
$ww=$GLOBALS[db]->query("select * from ecmstockdoccorrectitems where ecmstockdoccorrect_id='".$r['id']."'");
|
||
|
|
while($rr=$GLOBALS[db]->fetchByAssoc($ww)){
|
||
|
|
//echo $rr['quantity']." ".$rr['code']." <br>";
|
||
|
|
if($rr['quantity']<0)$type=0;
|
||
|
|
else $type=1;
|
||
|
|
echo "update ecmstockdoccorrectitems set quantity='".(-1*$rr['quantity'])."' where id='".$rr['id']."' and ecmproduct_id='".$rr['ecmproduct_id']."' and ecmstockdoccorrect_id='".$rr['ecmstockdoccorrect_id']."';<br>";
|
||
|
|
echo "update ecmstockoperations set type='".$type."' where parent_id='".$r['id']."' and product_id='".$rr['ecmproduct_id']."';<br>";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
?>
|