forked from erp-dev/erp
feat: added prefix to human_id
This commit is contained in:
@@ -138,11 +138,11 @@ class PurchaseOrder(OrderItemsAggregationMixin, OrderDirectionMixin, OrderCounte
|
||||
"""
|
||||
人类可读编号(虚拟编号,不落库)。
|
||||
|
||||
规则与 printing.PrintingOrder.human_id / SalesOrder.human_id 保持一致:YYYYMMDD{6位id}
|
||||
规则与 SalesOrder.human_id 保持一致:CG + YYYYMMDD{6位id}
|
||||
"""
|
||||
if self.id is None or self.created_at is None:
|
||||
return ""
|
||||
return f"{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
return f"CG{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
|
||||
class Meta:
|
||||
verbose_name = '采购单'
|
||||
@@ -275,11 +275,11 @@ class SalesOrder(OrderItemsAggregationMixin, OrderDirectionMixin, OrderCounterpa
|
||||
"""
|
||||
人类可读编号(虚拟编号,不落库)。
|
||||
|
||||
规则与 printing.PrintingOrder.human_id 保持一致:YYYYMMDD{6位id}
|
||||
规则:XS + YYYYMMDD{6位id}
|
||||
"""
|
||||
if self.id is None or self.created_at is None:
|
||||
return ""
|
||||
return f"{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
return f"XS{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
|
||||
class Meta:
|
||||
verbose_name = '销售单'
|
||||
@@ -422,11 +422,11 @@ class PurchaseReturnOrder(OrderItemsAggregationMixin, OrderDirectionMixin, Order
|
||||
"""
|
||||
人类可读编号(虚拟编号,不落库)。
|
||||
|
||||
规则与 printing.PrintingOrder.human_id / SalesOrder.human_id 保持一致:YYYYMMDD{6位id}
|
||||
规则与 SalesOrder.human_id 保持一致:CT + YYYYMMDD{6位id}
|
||||
"""
|
||||
if self.id is None or self.created_at is None:
|
||||
return ""
|
||||
return f"{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
return f"CT{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
|
||||
def get_direction(self) -> int:
|
||||
return -1
|
||||
@@ -547,11 +547,11 @@ class SalesReturnOrder(OrderItemsAggregationMixin, OrderDirectionMixin, OrderCou
|
||||
"""
|
||||
人类可读编号(虚拟编号,不落库)。
|
||||
|
||||
规则与 printing.PrintingOrder.human_id / SalesOrder.human_id 保持一致:YYYYMMDD{6位id}
|
||||
规则与 SalesOrder.human_id 保持一致:XT + YYYYMMDD{6位id}
|
||||
"""
|
||||
if self.id is None or self.created_at is None:
|
||||
return ""
|
||||
return f"{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
return f"XT{self.created_at.year}{self.created_at.month:02d}{self.created_at.day:02d}{self.id:06d}"
|
||||
|
||||
def get_direction(self) -> int:
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user