Commit fea815fa authored by Gladys Forte's avatar Gladys Forte

Merge pull request #131 in RMS/api-main-service from gladys-dev2 to RMSv2

* commit 'cd98baab':
  updated DB
  update submit
parents 1a40d0d8 cd98baab
This diff is collapsed.
......@@ -396,6 +396,23 @@ def cancel_overdue(request):
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,
action, entity, form_code,
fromValue, toValue):
......
This diff is collapsed.
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