Add php files
This commit is contained in:
19
modules/EcmInvoiceOuts/repairTransactions.php
Executable file
19
modules/EcmInvoiceOuts/repairTransactions.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
global $current_user;
|
||||
|
||||
|
||||
$db = $GLOBALS ['db'];
|
||||
|
||||
$inv = $db->query ( "SELECT * FROM ecminvoiceouts where parent_payer_nip!='' and deleted=0" );
|
||||
|
||||
while ( $i = $db->fetchByAssoc($inv) ) {
|
||||
$a = new Account();
|
||||
$a->retrieve_by_string_fields(['to_vatid'=>$i['parent_payer_nip']]);
|
||||
$db->query ( "update ecmtransactions set parent_id='".$a->id."',parent_name='".$a->name."' where record_id='" . $i['id']. "'");
|
||||
// echo '<br>";
|
||||
}
|
||||
|
||||
echo 'e';
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user