Commit e300971b authored by Gladys Forte's avatar Gladys Forte

update submit

parent 1a40d0d8
This diff is collapsed.
...@@ -396,6 +396,23 @@ def cancel_overdue(request): ...@@ -396,6 +396,23 @@ def cancel_overdue(request):
return True return True
def get_max_batchno(request):
try:
max_id = models.ChangeRequestHistory.objects.all(
).order_by("-batch_no")[0]
if max_id:
max_batch = max_id.batch_no.split("-")
max_batch = int(max_batch[2].lstrip("0")) + 1
batchno = number_generator("BATCH", max_batch)
else:
batchno = number_generator("BATCH", 1)
except:
batchno = number_generator("BATCH", 1)
return batchno
def crhistory_save(batch_no, main_action, def crhistory_save(batch_no, main_action,
action, entity, form_code, action, entity, form_code,
fromValue, toValue): fromValue, toValue):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment