pre sale & free sale deployment
This commit is contained in:
@@ -8,7 +8,10 @@ from apps.product.services.services import (
|
||||
from apps.pos_device.services.services import pos_organizations_sharing_information
|
||||
from apps.pos_device.pos.api.v1.serializers.device import DeviceSerializer
|
||||
from apps.product.exceptions import DistributionWeightException
|
||||
from apps.warehouse.services.services import create_extra_sale
|
||||
from apps.warehouse.services.services import (
|
||||
create_extra_sale,
|
||||
create_pre_sale
|
||||
)
|
||||
from apps.herd.pos.api.v1.serializers import RancherSerializer
|
||||
from apps.product.models import QuotaDistribution, Product
|
||||
from apps.warehouse import models as warehouse_models
|
||||
@@ -76,12 +79,12 @@ class InventoryEntrySerializer(serializers.ModelSerializer):
|
||||
),
|
||||
'base_prices': [
|
||||
{
|
||||
"text": "قیمت درب کارخانه", # noqa
|
||||
"text": "درب کارخانه", # noqa
|
||||
"name": "base_price_factory",
|
||||
"value": instance.distribution.quota.base_price_factory
|
||||
},
|
||||
{
|
||||
"text": "قیمت درب اتحادیه", # noqa
|
||||
"text": "درب اتحادیه", # noqa
|
||||
"name": "base_price_cooperative",
|
||||
"value": instance.distribution.quota.base_price_cooperative
|
||||
}
|
||||
@@ -146,9 +149,12 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
)
|
||||
total_price += item.total_price
|
||||
|
||||
# create extra sale
|
||||
# create extra sale for distribution
|
||||
create_extra_sale(transaction=transaction, sale_item=item)
|
||||
|
||||
# create pre sale for distribution
|
||||
create_pre_sale(transaction=transaction, sale_item=item)
|
||||
|
||||
transaction.transaction_price = total_price
|
||||
transaction.save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user