a.binder 8 yıl önce
ebeveyn
işleme
b732c2aa2f

+ 7 - 4
SE/dev/audit_krs_con_digger/audit_krs_con_digger.php

@@ -48,6 +48,9 @@ $tables['X']['BI_audit_ENERGA_RUM_KONTRAHENCI']['rel']['pesel']='PESEL';
 
 $tables['Z']['BI_audit_CEIDG']['rel']['nip']='nip';
 $tables['Z']['BI_audit_CEIDG']['rel']['regon']='regon';
+$tables['Z']['BI_audit_CEIDG']['rel_and']['adres']['miejscowosc']='miejscowosc';
+$tables['Z']['BI_audit_CEIDG']['rel_and']['adres']['ulica']='ulica';
+$tables['Z']['BI_audit_CEIDG']['rel_and']['adres']['kodPocztowy']='kodPocztowy';
 $tables['Z']['BI_audit_CEIDG']['ref'][19]='BI_audit_CEIDG_pelnomocnicy';
 $tables['Z']['BI_audit_CEIDG']['ref'][18]='BI_audit_CEIDG_powiazania';
 
@@ -294,12 +297,12 @@ function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop) {
 				 
 				 dig_next($hist_loop, $tables['Z'][$T],$h,$loop,$hist_time);
 				 //rel dzieci
-				 if(isset($tables[$T]['ref'])) {
+				 if(isset($tables['Z'][$T]['ref'])) {
 				 echo "<br>#296 try to ref tables <pre>";
 				  	print_r($tables[$T]['ref']);
 				 echo "</pre>";
 				 
-					 foreach($tables[$T]['ref'] as $ref_id => $ref_table) {
+					 foreach($tables['Z'][$T]['ref'] as $ref_id => $ref_table) {
 						 $sql_ref=" select REMOTE_PRIMARY_KEY from `CRM__#REF_TABLE__".$ref_id."` where `PRIMARY_KEY`=".$h->ID." ";
 						 $res_rel=$db->query($sql_ref) or die('211 blad '.$sql_ref);
 						 echo "<br>#297 ".$sql_ref;
@@ -317,13 +320,13 @@ function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop) {
 					 }
 				 
 				 }
-				 if(isset($tables[$T]['backref'])) {
+				 if(isset($tables['Z'][$T]['backref'])) {
 				 echo "<br>#296 try to backref tables <pre>";
 				  	print_r($tables[$T]['backref']);
 				 echo "</pre>";
 				 
 				 
-					 foreach($tables[$T]['backref'] as $ref_id => $ref_table) {
+					 foreach($tables['Z'][$T]['backref'] as $ref_id => $ref_table) {
 						 $sql_ref=" select PRIMARY_KEY from `CRM__#REF_TABLE__".$ref_id."` where `REMOTE_PRIMARY_KEY`=".$h->ID." ";
 						 $res_rel=$db->query($sql_ref) or die('318 blad '.$sql_ref);
 						 echo "<br>#319 backref ".$sql_ref;