Fix: Dates in old imported data should be at UTC time.
Fix: Use utc now for dates to have consistent dates across timezones.
This commit is contained in:
parent
823808d402
commit
07d13898c3
|
@ -14,12 +14,12 @@ call:copyQuery l-Modifiers "SELECT ModifierID, Name, CASE WHEN ShowInBill = 1 TH
|
|||
call:copyQuery m-Sections "SELECT NewID(), Location, 'f' FROM Test.dbo.PrintLocations GROUP BY Location;"
|
||||
call:copyQuery n-Printers "SELECT NewID(), Printer, Printer, 0x1d564103 FROM Test.dbo.PrintLocations GROUP BY Printer, CutCode;"
|
||||
call:copyQuery o-SectionPrinters "SELECT PrintLocationID, COALESCE(CAST(ProductGroupID AS Nvarchar(36)), '\N'), Location, Printer, Copies FROM Test.dbo.PrintLocations;"
|
||||
call:copyQuery p-Vouchers "SELECT VoucherID, Date, Pax, UserID, CreationDate, LastEditDate, COALESCE(CAST(BillID AS Nvarchar(36)), '\N'), TableID, CustomerID, COALESCE(Narration, '\N'), VoidReason, CASE WHEN Printed = 0 THEN '0' WHEN Void = 1 THEN '5' ELSE VoucherType END, KotID FROM Test.dbo.Vouchers;"
|
||||
call:copyQuery q-Kots "SELECT KotID, VoucherID, Code, TableID, Date, UserID FROM Test.dbo.Kots;"
|
||||
call:copyQuery p-Vouchers "SELECT VoucherID, DATEADD(minute, -330, Date), Pax, UserID, DATEADD(minute, -330, CreationDate), DATEADD(minute, -330, LastEditDate), COALESCE(CAST(BillID AS Nvarchar(36)), '\N'), TableID, CustomerID, COALESCE(Narration, '\N'), VoidReason, CASE WHEN Printed = 0 THEN '0' WHEN Void = 1 THEN '5' ELSE VoucherType END, KotID FROM Test.dbo.Vouchers;"
|
||||
call:copyQuery q-Kots "SELECT KotID, VoucherID, Code, TableID, DATEADD(minute, -330, Date), UserID FROM Test.dbo.Kots;"
|
||||
call:copyQuery r-Inventories "SELECT InventoryID, KotID, ProductID, SortOrder, Quantity, Price, CASE WHEN IsHappyHour = 1 THEN 't' ELSE 'f' END, VatRate, VatID, Discount FROM Test.dbo.Inventories;"
|
||||
call:copyQuery s-InventoryModifiers "SELECT InventoryModifierID, InventoryID, ModifierID, 0 FROM Test.dbo.InventoryModifiers;"
|
||||
call:copyQuery t-Overview "SELECT newid(), VoucherID, FoodTableID, Status FROM Test.dbo.FoodTables WHERE VoucherID IS NOT NULL;"
|
||||
call:copyQuery u-Reprints "SELECT ReprintID, UserID, Date, VoucherID FROM Test.dbo.Reprints;"
|
||||
call:copyQuery u-Reprints "SELECT ReprintID, UserID, DATEADD(minute, -330, Date), VoucherID FROM Test.dbo.Reprints;"
|
||||
call:copyQuery v-Settings "SELECT SettingID, Name, '{""Text"": ""' + Details + '""}' FROM Test.dbo.Settings;"
|
||||
call:copyQuery w-VoucherSettlements "SELECT VoucherSettlementID, VoucherID, Settled, Amount FROM Test.dbo.VoucherSettlements;"
|
||||
goto:eof
|
||||
|
|
|
@ -28,6 +28,6 @@ class Reprint(Base):
|
|||
|
||||
def __init__(self, voucher_id=None, user_id=None, id_=None):
|
||||
self.id = id_
|
||||
self.date = datetime.now()
|
||||
self.date = datetime.utcnow()
|
||||
self.voucher_id = voucher_id
|
||||
self.user_id = user_id
|
||||
|
|
|
@ -14,7 +14,9 @@ def optional_query_date(d: str = None) -> Optional[date]:
|
|||
|
||||
def effective_date(d: str = None) -> date:
|
||||
return (
|
||||
(datetime.now() - timedelta(minutes=settings.NEW_DAY_OFFSET_MINUTES)).date()
|
||||
(
|
||||
datetime.utcnow() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES - settings.NEW_DAY_OFFSET_MINUTES)
|
||||
).date()
|
||||
if d is None
|
||||
else datetime.strptime(d, "%d-%b-%Y").date()
|
||||
)
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
from datetime import date, datetime
|
||||
from datetime import date, datetime, timedelta
|
||||
from typing import List
|
||||
|
||||
from barker.core.config import settings
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
def report_start_date(s: str = None) -> date:
|
||||
|
@ -7,3 +11,12 @@ def report_start_date(s: str = None) -> date:
|
|||
|
||||
def report_finish_date(f: str = None) -> date:
|
||||
return date.today() if f is None else datetime.strptime(f, "%d-%b-%Y").date()
|
||||
|
||||
|
||||
def check_audit_permission(start_date: date, user_permissions: List[str]):
|
||||
today = (datetime.utcnow() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user_permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from datetime import date, timedelta
|
||||
from operator import or_
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Depends, Security
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.sql.expression import func
|
||||
|
||||
|
@ -14,7 +14,7 @@ from ...models.product_version import ProductVersion
|
|||
from ...models.voucher import Voucher
|
||||
from ...models.voucher_type import VoucherType
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -36,12 +36,7 @@ def beer_consumption(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["beer-sale-report"]),
|
||||
):
|
||||
if (date.today() - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
day = func.date_trunc("day", Voucher.date - timedelta(minutes=settings.NEW_DAY_OFFSET_MINUTES)).label("day")
|
||||
sum_ = func.sum(Inventory.quantity * ProductVersion.quantity).label("sum")
|
||||
list_ = (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from datetime import date, timedelta
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Depends, Security
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ...core.config import settings
|
||||
|
@ -14,7 +14,7 @@ from ...models.settlement import Settlement
|
|||
from ...models.voucher import Voucher
|
||||
from ...schemas.bill_settlement_report import BillSettlement, BillSettlementItem
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -36,12 +36,7 @@ def bill_details(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["bill-settlement-report"]),
|
||||
) -> BillSettlement:
|
||||
if (date.today() - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return BillSettlement(
|
||||
startDate=start_date,
|
||||
finishDate=finish_date,
|
||||
|
|
|
@ -3,7 +3,7 @@ import uuid
|
|||
from datetime import date, datetime, time, timedelta
|
||||
from typing import Dict, List
|
||||
|
||||
from fastapi import APIRouter, Cookie, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Cookie, Depends, Security
|
||||
from sqlalchemy import distinct
|
||||
from sqlalchemy.orm import Session, joinedload
|
||||
|
||||
|
@ -23,7 +23,7 @@ from ...schemas.cashier_report import (
|
|||
)
|
||||
from ...schemas.user import UserLink
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -45,12 +45,7 @@ def active_cashiers(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["cashier-report"]),
|
||||
) -> List[UserLink]:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return get_active_cashiers(start_date, finish_date, db)
|
||||
|
||||
|
||||
|
@ -85,12 +80,7 @@ def show_id(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["cashier-report"]),
|
||||
) -> CashierReport:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
user = UserLink(id=user.id_, name=user.name)
|
||||
return get_id(id_, start_date, finish_date, user, db)
|
||||
|
||||
|
@ -155,12 +145,7 @@ def print_report(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["cashier-report"]),
|
||||
) -> bool:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
report = get_id(id_, start_date, finish_date, UserLink(id=user.id_, name=user.name), db)
|
||||
print_cashier_report(report, device_id, db)
|
||||
return True
|
||||
|
@ -173,13 +158,7 @@ def show_blank(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["cashier-report"]),
|
||||
) -> CashierReport:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return CashierReport(
|
||||
startDate=start_date,
|
||||
finishDate=finish_date,
|
||||
|
|
|
@ -3,7 +3,7 @@ import uuid
|
|||
from datetime import date, datetime, time, timedelta
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter, Cookie, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Cookie, Depends, Security
|
||||
from sqlalchemy import func, or_
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
@ -19,7 +19,7 @@ from ...models.voucher_type import VoucherType
|
|||
from ...printing.discount_report import print_discount_report
|
||||
from ...schemas.discount_report import DiscountReport, DiscountReportItem
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -41,12 +41,7 @@ def discount_report(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["discount-report"]),
|
||||
) -> DiscountReport:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return DiscountReport(
|
||||
startDate=start_date,
|
||||
finishDate=finish_date,
|
||||
|
@ -96,12 +91,7 @@ def print_report(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["discount-report"]),
|
||||
) -> bool:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
report = DiscountReport(
|
||||
startDate=start_date,
|
||||
finishDate=finish_date,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from datetime import date, timedelta
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Depends, Security
|
||||
from sqlalchemy import func, or_
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
@ -16,7 +16,7 @@ from ...models.voucher import Voucher
|
|||
from ...models.voucher_type import VoucherType
|
||||
from ...schemas import to_camel
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -38,12 +38,7 @@ def product_sale_report_view(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["product-sale-report"]),
|
||||
):
|
||||
if (date.today() - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return {
|
||||
"startDate": start_date.strftime("%d-%b-%Y"),
|
||||
"finishDate": finish_date.strftime("%d-%b-%Y"),
|
||||
|
|
|
@ -3,7 +3,7 @@ import uuid
|
|||
from datetime import date, datetime, time, timedelta
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter, Cookie, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Cookie, Depends, Security
|
||||
from sqlalchemy import func, or_
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
@ -22,7 +22,7 @@ from ...printing.sale_report import print_sale_report
|
|||
from ...schemas.sale_report import SaleReport, SaleReportItem
|
||||
from ...schemas.user import UserLink
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
from .tax_report import get_tax
|
||||
|
||||
|
||||
|
@ -45,13 +45,7 @@ def get_sale_analysis(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["sale-report"]),
|
||||
) -> SaleReport:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return SaleReport(
|
||||
startDate=start_date,
|
||||
finishDate=finish_date,
|
||||
|
@ -131,12 +125,7 @@ def print_report(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["discount-report"]),
|
||||
) -> bool:
|
||||
today = (datetime.now() + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).date()
|
||||
if (today - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
report = SaleReport(
|
||||
startDate=start_date,
|
||||
finishDate=finish_date,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from datetime import date, timedelta
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Security, status
|
||||
from fastapi import APIRouter, Depends, Security
|
||||
from sqlalchemy import func
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
@ -15,7 +15,7 @@ from ...models.voucher import Voucher
|
|||
from ...models.voucher_type import VoucherType
|
||||
from ...schemas.tax_report import TaxReport, TaxReportItem
|
||||
from ...schemas.user_token import UserToken
|
||||
from . import report_finish_date, report_start_date
|
||||
from . import check_audit_permission, report_finish_date, report_start_date
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
@ -37,12 +37,7 @@ def get_tax_report(
|
|||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["tax-report"]),
|
||||
) -> TaxReport:
|
||||
if (date.today() - start_date).days > 5 and "audit" not in user.permissions:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Accounts Audit",
|
||||
)
|
||||
|
||||
check_audit_permission(start_date, user.permissions)
|
||||
return TaxReport(
|
||||
startDate=start_date.strftime("%d-%b-%Y"),
|
||||
finishDate=finish_date.strftime("%d-%b-%Y"),
|
||||
|
|
|
@ -72,7 +72,7 @@ def move_kot(
|
|||
user: UserToken = Security(get_user, scopes=["move-kot-to-new-table"]),
|
||||
):
|
||||
try:
|
||||
now = datetime.now()
|
||||
now = datetime.utcnow()
|
||||
check_if_voucher_is_unprinted(data.voucher_id, db)
|
||||
kots: int = db.query(func.count(Kot.id)).filter(Kot.voucher_id == data.voucher_id).scalar()
|
||||
if kots <= 1:
|
||||
|
|
|
@ -85,7 +85,7 @@ def do_save(
|
|||
db: Session,
|
||||
user: UserToken,
|
||||
):
|
||||
now = datetime.now()
|
||||
now = datetime.utcnow()
|
||||
product_date = (now + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES - settings.NEW_DAY_OFFSET_MINUTES)).date()
|
||||
check_permissions(None, voucher_type, user.permissions)
|
||||
|
||||
|
|
|
@ -154,14 +154,18 @@ def voucher_product(product_id: uuid.UUID, date_: datetime, is_happy_hour: bool,
|
|||
def voucher_info(item: Voucher, db: Session):
|
||||
return {
|
||||
"id": item.id,
|
||||
"date": item.date.strftime("%H:%M"),
|
||||
"dateTip": item.date.strftime("%d-%b-%Y %H:%M:%S"),
|
||||
"date": (item.date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime("%H:%M"),
|
||||
"dateTip": (item.date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime("%d-%b-%Y %H:%M:%S"),
|
||||
"pax": item.pax,
|
||||
"user": {"id": item.user_id, "name": item.user.name},
|
||||
"creationDate": item.creation_date.strftime("%H:%M"),
|
||||
"creationDateTip": item.creation_date.strftime("%d-%b-%Y %H:%M:%S"),
|
||||
"lastEditDate": item.last_edit_date.strftime("%H:%M"),
|
||||
"lastEditDateTip": item.last_edit_date.strftime("%d-%b-%Y %H:%M:%S"),
|
||||
"creationDate": (item.creation_date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime("%H:%M"),
|
||||
"creationDateTip": (item.creation_date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime(
|
||||
"%d-%b-%Y %H:%M:%S"
|
||||
),
|
||||
"lastEditDate": (item.last_edit_date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime("%H:%M"),
|
||||
"lastEditDateTip": (item.last_edit_date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime(
|
||||
"%d-%b-%Y %H:%M:%S"
|
||||
),
|
||||
"kotId": item.kot_id,
|
||||
"billId": item.full_bill_id,
|
||||
"table": {"id": item.food_table_id, "name": item.food_table.name},
|
||||
|
@ -174,7 +178,7 @@ def voucher_info(item: Voucher, db: Session):
|
|||
{
|
||||
"id": k.id,
|
||||
"code": k.code,
|
||||
"date": k.date.strftime("%d-%b-%Y %H:%M:%S"),
|
||||
"date": (k.date + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES)).strftime("%d-%b-%Y %H:%M:%S"),
|
||||
"user": {"id": k.user_id, "name": k.user.name},
|
||||
"inventories": [
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ def split(
|
|||
user: UserToken = Security(get_user, scopes=["split-bill"]),
|
||||
):
|
||||
try:
|
||||
now = datetime.now()
|
||||
now = datetime.utcnow()
|
||||
update_table = u
|
||||
item: Voucher = db.query(Voucher).filter(Voucher.id == id_).first()
|
||||
item.bill_id = None
|
||||
|
|
|
@ -58,7 +58,7 @@ def update(
|
|||
user: UserToken = Security(get_user),
|
||||
):
|
||||
try:
|
||||
now = datetime.now()
|
||||
now = datetime.utcnow()
|
||||
product_date = (
|
||||
now + timedelta(minutes=settings.TIMEZONE_OFFSET_MINUTES - settings.NEW_DAY_OFFSET_MINUTES)
|
||||
).date()
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
</ng-container>
|
||||
<ng-container matColumnDef="time-details">
|
||||
<mat-header-cell *matHeaderCellDef class="deep-purple-100 bold right-align"
|
||||
><span [matTooltip]="bs.bill.dateTip | localTime">{{ bs.bill.date | localTime }}</span
|
||||
> / <span [matTooltip]="bs.bill.creationDateTip | localTime">{{
|
||||
bs.bill.creationDate | localTime
|
||||
><span [matTooltip]="bs.bill.dateTip">{{ bs.bill.date }}</span
|
||||
> / <span [matTooltip]="bs.bill.creationDateTip">{{
|
||||
bs.bill.creationDate
|
||||
}}</span
|
||||
> / <span [matTooltip]="bs.bill.lastEditDateTip | localTime">{{
|
||||
bs.bill.lastEditDate | localTime
|
||||
> / <span [matTooltip]="bs.bill.lastEditDateTip">{{
|
||||
bs.bill.lastEditDate
|
||||
}}</span></mat-header-cell
|
||||
>
|
||||
</ng-container>
|
||||
|
|
Loading…
Reference in New Issue