Bumped the version to 7
Fixed double exception being thrown Currency pipe broke the accounts pipe
This commit is contained in:
parent
1c2c98e7b5
commit
7b4756fe1a
brewman/routers
account.pyattendance.py
auth
cost_centre.pyemployee.pyemployee_benefit.pyincentive.pyissue.pyjournal.pyproduct.pyproduct_group.pypurchase.pypurchase_return.pyvoucher.pyoverlord
setup.py@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -49,9 +48,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.Account)
|
@router.put("/{id_}", response_model=schemas.Account)
|
||||||
@ -84,9 +81,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/{id}")
|
@router.delete("/{id}")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
from datetime import datetime, date, timedelta
|
from datetime import datetime, date, timedelta
|
||||||
|
|
||||||
from fastapi import APIRouter, HTTPException, status, Depends, Security, Request
|
from fastapi import APIRouter, HTTPException, status, Depends, Security, Request
|
||||||
@ -107,9 +106,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def date_range(start: date, stop: date, step=timedelta(days=1), inclusive=False):
|
def date_range(start: date, stop: date, step=timedelta(days=1), inclusive=False):
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from fastapi import APIRouter, HTTPException, status, Depends, Security
|
from fastapi import APIRouter, HTTPException, status, Depends, Security
|
||||||
@ -46,9 +45,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/{id_}")
|
@router.delete("/{id_}")
|
||||||
@ -68,9 +65,7 @@ def delete(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("/list")
|
@router.get("/list")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
@ -41,9 +40,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.Role)
|
@router.put("/{id_}", response_model=schemas.Role)
|
||||||
@ -66,9 +63,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def add_permissions(role: Role, permissions: List[schemas.PermissionItem], db):
|
def add_permissions(role: Role, permissions: List[schemas.PermissionItem], db):
|
||||||
@ -97,9 +92,7 @@ def delete(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("")
|
@router.get("")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
@ -41,9 +40,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("/me", response_model=schemas.User)
|
@router.get("/me", response_model=schemas.User)
|
||||||
@ -75,9 +72,7 @@ def update_me(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.User)
|
@router.put("/{id_}", response_model=schemas.User)
|
||||||
@ -103,9 +98,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def add_roles(user: User, roles: List[schemas.RoleItem], db: Session):
|
def add_roles(user: User, roles: List[schemas.RoleItem], db: Session):
|
||||||
@ -134,9 +127,7 @@ def delete(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("")
|
@router.get("")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
@ -42,9 +41,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.CostCentre)
|
@router.put("/{id_}", response_model=schemas.CostCentre)
|
||||||
@ -70,9 +67,8 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/{id_}")
|
@router.delete("/{id_}")
|
||||||
@ -96,9 +92,7 @@ def delete(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("")
|
@router.get("")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from sqlalchemy import desc
|
from sqlalchemy import desc
|
||||||
@ -51,9 +50,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.Employee)
|
@router.put("/{id_}", response_model=schemas.Employee)
|
||||||
@ -87,9 +84,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/{id_}")
|
@router.delete("/{id_}")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from math import ceil
|
from math import ceil
|
||||||
from typing import List
|
from typing import List
|
||||||
@ -75,9 +74,7 @@ def save_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def save(data: schema_in.EmployeeBenefitIn, date_: date, user: UserToken, db: Session) -> Voucher:
|
def save(data: schema_in.EmployeeBenefitIn, date_: date, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -163,9 +160,7 @@ def update_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update(id_: uuid.UUID, data: schema_in.EmployeeBenefitIn, user: UserToken, db: Session) -> Voucher:
|
def update(id_: uuid.UUID, data: schema_in.EmployeeBenefitIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -222,9 +217,7 @@ def get_id(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=output.Voucher)
|
@router.get("", response_model=output.Voucher)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
@ -73,9 +72,7 @@ def save_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def save(data: schema_in.IncentiveIn, user: UserToken, db: Session) -> Voucher:
|
def save(data: schema_in.IncentiveIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -138,9 +135,7 @@ def update_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update(id_: uuid.UUID, data: schema_in.IncentiveIn, user: UserToken, db: Session) -> Voucher:
|
def update(id_: uuid.UUID, data: schema_in.IncentiveIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -185,9 +180,7 @@ def get_id(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=output.Voucher)
|
@router.get("", response_model=output.Voucher)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
@ -69,9 +68,7 @@ def save_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def save(data: schema_in.IssueIn, user: UserToken, db: Session) -> (Voucher, Optional[bool]):
|
def save(data: schema_in.IssueIn, user: UserToken, db: Session) -> (Voucher, Optional[bool]):
|
||||||
@ -176,9 +173,7 @@ def update_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update(id_: uuid.UUID, data: schema_in.IssueIn, user: UserToken, db: Session) -> (Voucher, Optional[bool]):
|
def update(id_: uuid.UUID, data: schema_in.IssueIn, user: UserToken, db: Session) -> (Voucher, Optional[bool]):
|
||||||
@ -306,9 +301,7 @@ def get_id(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=output.Voucher)
|
@router.get("", response_model=output.Voucher)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import List
|
from typing import List
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -65,6 +64,7 @@ def save_route(
|
|||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e),
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e),
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
db.rollback()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
@ -111,9 +111,7 @@ def update_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update(id_: uuid.UUID, data: schema_in.JournalIn, user: UserToken, db: Session) -> Voucher:
|
def update(id_: uuid.UUID, data: schema_in.JournalIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -174,9 +172,7 @@ def get_id(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=output.Voucher)
|
@router.get("", response_model=output.Voucher)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@ -54,9 +53,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.Product)
|
@router.put("/{id_}", response_model=schemas.Product)
|
||||||
@ -93,9 +90,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/{id_}")
|
@router.delete("/{id_}")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
@ -42,9 +41,7 @@ def save(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.put("/{id_}", response_model=schemas.ProductGroup)
|
@router.put("/{id_}", response_model=schemas.ProductGroup)
|
||||||
@ -70,9 +67,7 @@ def update(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.delete("/{id_}")
|
@router.delete("/{id_}")
|
||||||
@ -96,9 +91,7 @@ def delete(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("")
|
@router.get("")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import List
|
from typing import List
|
||||||
@ -69,9 +68,7 @@ def save_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def save(data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
def save(data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -158,9 +155,7 @@ def update_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update(id_: uuid.UUID, data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
def update(id_: uuid.UUID, data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -301,9 +296,7 @@ def get_id(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=output.Voucher)
|
@router.get("", response_model=output.Voucher)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import List
|
from typing import List
|
||||||
@ -68,9 +67,7 @@ def save_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def save(data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
def save(data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -154,9 +151,7 @@ def update_route(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update(id_: uuid.UUID, data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
def update(id_: uuid.UUID, data: schema_in.PurchaseIn, user: UserToken, db: Session) -> Voucher:
|
||||||
@ -248,9 +243,7 @@ def get_id(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=output.Voucher)
|
@router.get("", response_model=output.Voucher)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import traceback
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
@ -67,9 +66,7 @@ def post_voucher(
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
raise HTTPException(
|
raise
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=traceback.format_exc(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def check_delete_permissions(voucher: Voucher, user: UserToken):
|
def check_delete_permissions(voucher: Voucher, user: UserToken):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "overlord",
|
"name": "overlord",
|
||||||
"version": "0.0.0",
|
"version": "7.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
<mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="getRowClass(row.id, row.posted)"
|
<mat-row *matRowDef="let row; columns: displayedColumns;" [class.selected]="selectedRowId === row.id"
|
||||||
(click)="selectRow(row.id)"></mat-row>
|
[class.unposted]="!row.posted && selectedRowId !== row.id" (click)="selectRow(row.id)"></mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator #paginator
|
<mat-paginator #paginator
|
||||||
|
@ -48,16 +48,6 @@ export class DaybookComponent implements OnInit {
|
|||||||
this.selectedRowId = id;
|
this.selectedRowId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowClass(id: string, posted: boolean): string {
|
|
||||||
if (this.selectedRowId === id) {
|
|
||||||
return 'selected';
|
|
||||||
} else if (!posted) {
|
|
||||||
return 'unposted';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
const l = this.prepareSubmit();
|
const l = this.prepareSubmit();
|
||||||
this.router.navigate(['daybook'], {
|
this.router.navigate(['daybook'], {
|
||||||
|
@ -133,7 +133,8 @@ export class JournalComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
rowAmount(amount: string = '', debit: number): any {
|
rowAmount(amount: string = '', debit: number): any {
|
||||||
try {
|
try {
|
||||||
const val = math.eval(amount.trim().replace(',', ''));
|
amount = amount.replace(new RegExp('(₹[\s]*)|(,)|(\s)', 'g'), '');
|
||||||
|
const val = math.eval(amount);
|
||||||
if (val < 0) {
|
if (val < 0) {
|
||||||
debit *= -1;
|
debit *= -1;
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,8 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
<mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="getRowClass(row.id, row.posted)"
|
<mat-row *matRowDef="let row; columns: displayedColumns;" [class.selected]="selectedRowId === row.id"
|
||||||
(click)="selectRow(row.id)"></mat-row>
|
[class.unposted]="!row.posted && selectedRowId !== row.id" (click)="selectRow(row.id)"></mat-row>
|
||||||
<mat-footer-row *matFooterRowDef="displayedColumns"></mat-footer-row>
|
<mat-footer-row *matFooterRowDef="displayedColumns"></mat-footer-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
|
@ -104,16 +104,6 @@ export class LedgerComponent implements OnInit, AfterViewInit {
|
|||||||
this.selectedRowId = id;
|
this.selectedRowId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowClass(id: string, posted: boolean): string {
|
|
||||||
if (this.selectedRowId === id) {
|
|
||||||
return 'selected';
|
|
||||||
} else if (!posted) {
|
|
||||||
return 'unposted';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
const info = this.getInfo();
|
const info = this.getInfo();
|
||||||
this.router.navigate(['ledger', info.account.id], {
|
this.router.navigate(['ledger', info.account.id], {
|
||||||
|
@ -141,7 +141,8 @@ export class PaymentComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
rowAmount(amount: string = ''): number {
|
rowAmount(amount: string = ''): number {
|
||||||
try {
|
try {
|
||||||
return math.eval(amount.trim().replace(',', ''));
|
amount = amount.replace(new RegExp('(₹[\s]*)|(,)|(\s)', 'g'), '');
|
||||||
|
return math.eval(amount);
|
||||||
} catch {
|
} catch {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,8 @@ export class ReceiptComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
rowAmount(amount: string = ''): number {
|
rowAmount(amount: string = ''): number {
|
||||||
try {
|
try {
|
||||||
return math.eval(amount.trim().replace(',', ''));
|
amount = amount.replace(new RegExp('(₹[\s]*)|(,)|(\s)', 'g'), '');
|
||||||
|
return math.eval(amount);
|
||||||
} catch {
|
} catch {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ export class AccountingPipe implements PipeTransform {
|
|||||||
if (value === null) {
|
if (value === null) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
const amount = +(value.replace(new RegExp('(₹ )|(,)', 'g'), ''));
|
const amount = +(value.replace(new RegExp('(₹[\s]*)|(,)', 'g'), ''));
|
||||||
return value.replace('-', '') + ((amount < 0) ? '\u00A0Cr' : '\u00A0Dr');
|
return value.replace('-', '') + ((amount < 0) ? '\u00A0Cr' : '\u00A0Dr');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -11,7 +11,7 @@ with open(os.path.join(here, 'requirements.txt'), "r") as r:
|
|||||||
requires = r.read().splitlines()
|
requires = r.read().splitlines()
|
||||||
|
|
||||||
setup(name='brewman',
|
setup(name='brewman',
|
||||||
version='6.0',
|
version='7.0',
|
||||||
description='brewman',
|
description='brewman',
|
||||||
long_description=README + '\n\n' + CHANGES,
|
long_description=README + '\n\n' + CHANGES,
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user