|
@@ -9,7 +9,7 @@ from apps.exceptions import CustomError
|
|
|
from apps.foundation.models import BizLog
|
|
|
from apps.serializer_errors import dump_serializer_errors
|
|
|
from models import PurchasePlan, PurchaseUser, PurchasePlanDetail, PurchasePrice, PurchaseOrder, PurchaseOrderDetail, \
|
|
|
- GodownEntry, PurchaseInvoiceImage, \
|
|
|
+ PurchaseInvoiceImage, \
|
|
|
PurchasePayment, PurchasePaymentDetail, GodownEntry, GodownEntryDetail, GodownEntryReturn, GodownEntryReturnDetail, \
|
|
|
PurchasePay
|
|
|
from libs.booleancharfield import BooleanCharField, PriceShowCharField, AmountShowCharField, CountShowCharField, \
|
|
@@ -430,6 +430,15 @@ class GodownEntrySerializer(serializers.ModelSerializer):
|
|
|
create_time = serializers.DateTimeField(format=base.DATETIME_FORMAT, read_only=True)
|
|
|
warehouse_text = serializers.CharField(source='warehouse.name', read_only=True)
|
|
|
purchase_order_no = serializers.CharField(source='purchase_order.no', read_only=True)
|
|
|
+ is_clear_text = serializers.SerializerMethodField()
|
|
|
+
|
|
|
+ def get_is_clear_text(self, obj):
|
|
|
+ payment = PurchasePayment.objects.filter(order=obj.purchase_order).first()
|
|
|
+ if payment and payment.is_clear:
|
|
|
+ return '是'
|
|
|
+ else:
|
|
|
+ return '否'
|
|
|
+
|
|
|
class Meta:
|
|
|
model = GodownEntry
|
|
|
fields = '__all__'
|
|
@@ -639,6 +648,7 @@ class PurchasePaymentSerializer(serializers.ModelSerializer):
|
|
|
supplier_bank = serializers.CharField(source='order.supplier.opening_bank', read_only=True)
|
|
|
order_no = serializers.CharField(source='order.no', read_only=True)
|
|
|
payment = BooleanCharField(source='is_pay', read_only=True)
|
|
|
+ is_clear_text = BooleanCharField(source='is_clear', read_only=True)
|
|
|
amount = AmountShowCharFieldWithTwoDecimalPlaces()
|
|
|
actual_amount = AmountShowCharFieldWithTwoDecimalPlaces()
|
|
|
apply_amount = AmountShowCharFieldWithTwoDecimalPlaces()
|