2021-12-16 17:54:31 +08:00
|
|
|
from extensions.common.base import *
|
2021-11-04 23:49:56 +08:00
|
|
|
from extensions.serializers import *
|
|
|
|
from extensions.exceptions import *
|
2021-12-26 23:00:08 +08:00
|
|
|
from apps.purchase.models import *
|
2021-11-04 23:49:56 +08:00
|
|
|
|
|
|
|
|
2021-12-26 23:00:08 +08:00
|
|
|
class PurchaseReportDetialSerializer(BaseSerializer):
|
|
|
|
"""采购明细"""
|
|
|
|
|
|
|
|
goods_number = CharField(source='goods.number', read_only=True, label='商品编号')
|
|
|
|
goods_name = CharField(source='goods.name', read_only=True, label='商品名称')
|
|
|
|
goods_barcode = CharField(source='goods.barcode', read_only=True, label='商品条码')
|
|
|
|
goods_spec = CharField(source='goods.spec', read_only=True, label='商品规格')
|
|
|
|
category_name = CharField(source='goods.category.name', read_only=True, label='分类名称')
|
|
|
|
unit_name = CharField(source='goods.unit.name', read_only=True, label='单位名称')
|
|
|
|
purchase_order_number = CharField(source='purchase_order.number', read_only=True, label='采购单号')
|
|
|
|
supplier_name = CharField(source='purchase_order.supplier.name', read_only=True, label='供应商名称')
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = PurchaseGoods
|
|
|
|
fields = ['id', 'goods', 'goods_number', 'goods_name', 'goods_barcode', 'goods_spec',
|
|
|
|
'purchase_quantity', 'category_name', 'unit_name', 'purchase_price', 'total_amount',
|
|
|
|
'purchase_order', 'purchase_order_number', 'supplier_name']
|
2021-11-04 23:49:56 +08:00
|
|
|
|
2021-12-26 23:00:08 +08:00
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
'PurchaseReportDetialSerializer',
|
2021-11-04 23:49:56 +08:00
|
|
|
]
|