débug comparaison de l'adresse de livraison
This commit is contained in:
@@ -7,6 +7,7 @@ class cls_Addresses:
|
|||||||
self.items.append(items)
|
self.items.append(items)
|
||||||
def get_item_by_AVS(self, seek):
|
def get_item_by_AVS(self, seek):
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
|
|
||||||
if item.AVS == seek:
|
if item.AVS == seek:
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,12 @@ class Check_addresses_popup(Toplevel):
|
|||||||
|
|
||||||
|
|
||||||
if int(debitor["code"]) < 100:
|
if int(debitor["code"]) < 100:
|
||||||
|
if item_1["selfish"]:
|
||||||
|
force_color = "green"
|
||||||
|
else:
|
||||||
|
force_color = None
|
||||||
self.add_compares_element(new_frame=lbf_addr_2_new, old_frame=lbf_addr_2_old, label="Adresse livraison:", str1=item_1["addr_2"],
|
self.add_compares_element(new_frame=lbf_addr_2_new, old_frame=lbf_addr_2_old, label="Adresse livraison:", str1=item_1["addr_2"],
|
||||||
str2=self.ifNotNull(item_2.addr_2))
|
str2=self.ifNotNull(item_2.addr_2),force_color_1=force_color)
|
||||||
|
|
||||||
|
|
||||||
str_address_1 += item_1['insurance_policy_number'].replace('.', '')
|
str_address_1 += item_1['insurance_policy_number'].replace('.', '')
|
||||||
@@ -104,19 +108,23 @@ class Check_addresses_popup(Toplevel):
|
|||||||
return ret
|
return ret
|
||||||
return value.strip()
|
return value.strip()
|
||||||
|
|
||||||
def add_compares_element(self,new_frame, old_frame,str1, str2, label):
|
def add_compares_element(self,new_frame, old_frame,str1, str2, label, force_color_1=None):
|
||||||
label_font = font.Font(weight='bold', size=9)
|
label_font = font.Font(weight='bold', size=9)
|
||||||
|
|
||||||
value_color = "black"
|
value_color_1 = "black"
|
||||||
|
value_color_2 = "black"
|
||||||
con = ""
|
con = ""
|
||||||
if str1 != str2:
|
if str1 != str2:
|
||||||
value_color = "red"
|
value_color_1 = "red"
|
||||||
|
value_color_2 = "red"
|
||||||
con = "*"
|
con = "*"
|
||||||
|
if force_color_1 is not None:
|
||||||
|
value_color_1 = force_color_1
|
||||||
|
|
||||||
Label(new_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
Label(new_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
||||||
Label(new_frame, text=con + str(str1) + con, fg=value_color, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
Label(new_frame, text=con + str(str1) + con, fg=value_color_1, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
||||||
Label(old_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
Label(old_frame, text=str(label), font=label_font).grid(row=self.x_row, column=0, sticky="W")
|
||||||
Label(old_frame, text=con + str(str2) + con, fg=value_color, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
Label(old_frame, text=con + str(str2) + con, fg=value_color_2, anchor="w", justify=LEFT).grid(row=self.x_row, column=1, sticky="W")
|
||||||
|
|
||||||
self.x_row += 1
|
self.x_row += 1
|
||||||
|
|
||||||
|
|||||||
7
main.py
7
main.py
@@ -289,7 +289,6 @@ class ClercAttrib2Biz():
|
|||||||
file_addresses_path = os.path.join(temp_dir, f"adresses.dbf")
|
file_addresses_path = os.path.join(temp_dir, f"adresses.dbf")
|
||||||
if os.path.exists(file_addresses_path):
|
if os.path.exists(file_addresses_path):
|
||||||
for record in DBF(file_addresses_path, load=True):
|
for record in DBF(file_addresses_path, load=True):
|
||||||
|
|
||||||
o_addresse = cls_addresse()
|
o_addresse = cls_addresse()
|
||||||
o_addresse.AVS = str(record["AD_CODE"])
|
o_addresse.AVS = str(record["AD_CODE"])
|
||||||
o_addresse.lastName =str( record["AD_NOM"])
|
o_addresse.lastName =str( record["AD_NOM"])
|
||||||
@@ -398,7 +397,7 @@ class ClercAttrib2Biz():
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def compare_old_and_new_adresses(self, new, old, code):
|
def compare_old_and_new_adresses(self, new, old, code):
|
||||||
|
print(f"compare_old_and_new_adresses ")
|
||||||
if self.ifNotNull(new['insurance_policy_number']).replace('.','') != old.AVS:
|
if self.ifNotNull(new['insurance_policy_number']).replace('.','') != old.AVS:
|
||||||
print("compare adresse exit avs")
|
print("compare adresse exit avs")
|
||||||
return False
|
return False
|
||||||
@@ -421,9 +420,11 @@ class ClercAttrib2Biz():
|
|||||||
if not new["selfish"]:
|
if not new["selfish"]:
|
||||||
print(f"Exit selfish")
|
print(f"Exit selfish")
|
||||||
return False
|
return False
|
||||||
elif old.addr_2 == None:
|
if old.addr_2 != "None":
|
||||||
print(f"Exit addr_2 = {old.addr_2}/{new['selfish']}")
|
print(f"Exit addr_2 = {old.addr_2}/{new['selfish']}")
|
||||||
|
print(old.addr_2 != "None")
|
||||||
return False
|
return False
|
||||||
|
print("return True (same)")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user