This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

36
modules/Accounts/test.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
$query="select parent_id from ecminvoiceouts where deleted=0";
$res=$GLOBALS['db']->query($query);
$accounts=[];
while($dane=$GLOBALS['db']->fetchByAssoc($res)){
$accounts[$dane['parent_id']]['inv']=1;
$accounts[$dane['parent_id']]['id']=$dane['parent_id'];
}
$query="select parent_id from documents_accounts where parent_type='Account'";
$res=$GLOBALS['db']->query($query);
while($dane=$GLOBALS['db']->fetchByAssoc($res)){
$accounts[$dane['parent_id']]['doc']=1;
$accounts[$dane['parent_id']]['id']=$dane['parent_id'];
}
foreach ($accounts as $ac){
if($ac['doc']==1 && $ac['inv']==1){
echo "update accounts set account_type='rs' where id='".$ac['id']."';<br>";
}
}
foreach ($accounts as $ac){
if($ac['doc']==1 && $ac['inv']==1){
$acc = new Account();
$acc->retrieve($ac['id']);
echo $acc->name.'<br>';
}
}
?>