Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
global $db;
$w=$GLOBALS[db]->query("select id,wz_id,document_no,type,ecmreceipt_id from ecmreceipts where register_date>='".$_REQUEST['date_from']."%' and register_date<='".$_REQUEST['date_to']."' and deleted='0'");
while($r=$GLOBALS[db]->fetchByAssoc($w)){
//echo $r['document_no'].'<br>';
$ww=$GLOBALS[db]->query("select id,ecmproduct_id from ecmreceiptitems where ecmreceipt_id='".$r['id']."'");
while($rr=$GLOBALS[db]->fetchByAssoc($ww)){
if($r['type']!="normal"){
$rcor=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select wz_id from ecmreceipts where id='".$r['ecmreceipt_id']."'"));
$r['wz_id']=$rcor['wz_id'];
}
$rrr=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select price from ecmstockoperations where parent_id='".$r['wz_id']."' and product_id='".$rr['ecmproduct_id']."'"));
$purchase_price=$rrr['price'];
echo $rr['code']."<br>";
//if($purchase_price<=0){
$GLOBALS[db]->query("update ecmreceiptitems set purchase_price='".$purchase_price."' where ecmreceipt_id='".$r['id']."' and ecmproduct_id='".$rr['ecmproduct_id']."';");
//echo $purchase_price."<br>";
}
}
?>