init
This commit is contained in:
36
modules/Accounts/test.php
Normal file
36
modules/Accounts/test.php
Normal 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>';
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user