project item updated
This commit is contained in:
parent
73d41b8e10
commit
40bf6d8ae1
|
|
@ -1,6 +1,6 @@
|
|||
from typing import Union
|
||||
|
||||
from api_library.date_time_actions.date_functions import system_arrow
|
||||
from api_library.date_time_actions.date_functions import system_arrow, client_arrow
|
||||
from databases import (
|
||||
BuildDecisionBookProjects,
|
||||
BuildDecisionBookProjectPerson,
|
||||
|
|
@ -216,6 +216,8 @@ class ProjectDecisionBookApprovalEventMethods(MethodToEvent):
|
|||
data: ApprovalsBuildDecisionBookProjects,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
BuildDecisionBookPayments.client_arrow = client_arrow
|
||||
BuildDecisionBookPayments.client_arrow.timezone = token_dict.timezone or "GMT+3"
|
||||
if isinstance(token_dict, EmployeeTokenObject):
|
||||
raise BuildDecisionBookProjects.raise_http_exception(
|
||||
status_code="HTTP_403_FORBIDDEN",
|
||||
|
|
@ -260,6 +262,7 @@ class ProjectDecisionBookApprovalEventMethods(MethodToEvent):
|
|||
message="This project is not allowed for this occupant",
|
||||
data={},
|
||||
)
|
||||
|
||||
decision_book_project = BuildDecisionBookProjects.filter_one(
|
||||
BuildDecisionBookProjects.id
|
||||
== decision_book_project_person.build_decision_book_project_id,
|
||||
|
|
@ -306,12 +309,13 @@ class ProjectDecisionBookApprovalEventMethods(MethodToEvent):
|
|||
process_date=str(local_date),
|
||||
process_date_m=int(local_date.month),
|
||||
process_date_y=int(local_date.year),
|
||||
payment_plan_time_periods=str(decision_book_project.project_type),
|
||||
period_time=f"{local_date.year}-{str(local_date.month).zfill(2)}",
|
||||
decision_book_project_id=decision_book_project.id,
|
||||
decision_book_project_uu_id=str(decision_book_project.uu_id),
|
||||
**book_payment_dict,
|
||||
)
|
||||
created_book_payment.save_and_confirm()
|
||||
return
|
||||
|
||||
updated_decision_book_project = decision_book_project.update(**data_dict)
|
||||
updated_decision_book_project.save_and_confirm()
|
||||
return AlchemyJsonResponse(
|
||||
|
|
|
|||
Loading…
Reference in New Issue