|
|
@ -194,22 +194,26 @@ def check_vehicle_update(vehicle_list=None): |
|
|
|
|
|
|
|
kms_mapping_status = frappe.db.sql( |
|
|
|
'''SELECT active_status FROM {0}.`tabKilometer Mapping` where name LIKE '{1}' and substring(name,-5,2)= '{2}';''' |
|
|
|
.format(current_db_name, vari['name'] + "%", l_id))[0][0] |
|
|
|
.format(current_db_name, vari['name'] + "%", l_id)) |
|
|
|
|
|
|
|
if vari['active_status'] == 'Active': |
|
|
|
vari['active_status'] = True |
|
|
|
else: |
|
|
|
vari['active_status'] = False |
|
|
|
|
|
|
|
if kms_mapping_status == 'Active': |
|
|
|
kms_active_status = True |
|
|
|
else: |
|
|
|
kms_active_status = False |
|
|
|
|
|
|
|
vari.update({'kms_mapping_active_status': kms_active_status}) |
|
|
|
vari['Assets'] = var_asset |
|
|
|
total_count += len(var_asset) |
|
|
|
if var_asset: |
|
|
|
vari['Assets'] = var_asset |
|
|
|
total_count += len(var_asset) |
|
|
|
|
|
|
|
if kms_mapping_status: |
|
|
|
kms_mapping_status = kms_mapping_status[0][0] |
|
|
|
if kms_mapping_status: |
|
|
|
if kms_mapping_status == 'Active': |
|
|
|
kms_active_status = True |
|
|
|
else: |
|
|
|
kms_active_status = False |
|
|
|
vari.update({'kms_mapping_active_status': kms_active_status}) |
|
|
|
|
|
|
|
# -1 Due to NONE value in parent mapping |
|
|
|
total_count += len(appendDict[d]) - 1 |
|
|
|
variant_out['Variant'] = vari |
|
|
|