Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Data Fiscalization #12

Closed
hoosnick opened this issue Aug 18, 2023 · 3 comments · Fixed by #41
Closed

Dynamic Data Fiscalization #12

hoosnick opened this issue Aug 18, 2023 · 3 comments · Fixed by #41
Assignees
Labels
enhancement New feature or request

Comments

@hoosnick
Copy link
Member

hoosnick commented Aug 18, 2023

Add a detail object to Order model

Detail key Type Summary Required
receipt_type Number Sale/Refund = 0
shipping Object Delivery
items Array Commodity item
{
    "result": {
        "allow": true,
        "detail": {
            "receipt_type" : 0,
            "shipping": {},
            "items": []
        }
    }
}

Items array parameters:

Name Type Description Required
discount Number Discount based on quantity of products or services (tiyins)
title String Product or service name
price Number Price per unit of products or services (tiyins)
count Number Quantity of products or services
code String ICPS (Identification code of product or service)
units Number Measurement unit code
package_code String Product packaging code
vat_percent Number Percentage of VAT payable for this product

Shipping object parameters (optional field):

Name Type Description Required
title String Maybe delivery location
price Number Cost of delivery

With only required objects and their keys, we need to add like following for each product or service in our Order model:

"detail": {
  "receipt_type": 0,
  "items": [
    {
      "title": "<product-or-service-name>",
      "price": "<price>",
      "count": "<quantity-int>",
      "code":  "<ICPS>",
      "package_code": "<package-code>"
      "vat_percent": "<percent-int>",
    }
  ]
}
@hoosnick hoosnick self-assigned this Aug 18, 2023
@hoosnick hoosnick converted this from a draft issue Aug 18, 2023
@hoosnick hoosnick added the enhancement New feature or request label Aug 18, 2023
@hoosnick hoosnick mentioned this issue Aug 18, 2023
@hoosnick hoosnick moved this from In Progress to Test in Enhancements Aug 18, 2023
This was referenced Aug 24, 2023
@hoosnick hoosnick linked a pull request Aug 24, 2023 that will close this issue
@hoosnick
Copy link
Member Author

hoosnick commented Sep 10, 2023

BaseOrder:

Detail key Type Summary Required
receipt_type int Sale/Refund = 0
amount bigint Amount
items m2m Commodity item
shipping fk ShippingDetail

Item:

Name Type Description Required
discount bigint Discount based on quantity of products or services (tiyins)
title str Product or service name
price bigint Price per unit of products or services (tiyins)
count int Quantity of products or services
fiscal_data fk FiscalData

FiscalData:

Name Type Description Required
code str ICPS (Identification code of product or service)
units int Measurement unit code
package_code str Product packaging code
vat_percent int Percentage of VAT payable for this product

ShippingDetail:

Name Type Description Required
title str Maybe delivery location
price bigint Cost of delivery

Example of Usage:

from django.db import models

from payme.models import Item, BaseOrder

class Product(models.Model):
    item = models.ForeignKey(Item)
    image = models.CharField(max_length=255)
    desc = models.CharField(max_length=255)

class Order(BaseOrder):
    user_id = models.IntegerField()
    user_comment = models.CharField(max_length=255)

@hoosnick
Copy link
Member Author

hoosnick commented Oct 5, 2023

count of items problem:
https://t.me/c/1924284038/1/5680

@hoosnick hoosnick pinned this issue Dec 13, 2023
@hoosnick hoosnick unpinned this issue Dec 13, 2023
@hoosnick hoosnick changed the title Dynamic ICPS (Identification Code of Product and Service) Dynamic Data Fiscalization Jan 21, 2024
@hoosnick hoosnick moved this from Test to In Progress in Enhancements Feb 16, 2024
@Muhammadali-Akbarov
Copy link
Member

fixed on version 3+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants