remove django #1
							
								
								
									
										361
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @@ -1,335 +1,26 @@ | |||||||
| # Created by https://www.toptal.com/developers/gitignore/api/emacs,python,django,venv | .DS_Store | ||||||
| # Edit at https://www.toptal.com/developers/gitignore?templates=emacs,python,django,venv | node_modules | ||||||
|  | /dist | ||||||
| ### Django ### |  | ||||||
| *.log | # local env files | ||||||
| *.pot | .env.local | ||||||
| *.pyc | .env.*.local | ||||||
| __pycache__/ |  | ||||||
| local_settings.py | # Log files | ||||||
| db.sqlite3 | npm-debug.log* | ||||||
| db.sqlite3-journal | yarn-debug.log* | ||||||
| media | yarn-error.log* | ||||||
|  | pnpm-debug.log* | ||||||
| # If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/ |  | ||||||
| # in your Git repository. Update and uncomment the following line accordingly. | # Editor directories and files | ||||||
| # <django-project-name>/staticfiles/ | .idea | ||||||
|  | .vscode | ||||||
| ### Django.Python Stack ### | *.suo | ||||||
| # Byte-compiled / optimized / DLL files | *.ntvs* | ||||||
| *.py[cod] | *.njsproj | ||||||
| *$py.class | *.sln | ||||||
|  | *.sw? | ||||||
| # C extensions | /.browserslistrc | ||||||
| *.so | /.editorconfig | ||||||
|  | /.eslintrc-auto-import.json | ||||||
| # Distribution / packaging | /.eslintrc.js | ||||||
| .Python |  | ||||||
| build/ |  | ||||||
| develop-eggs/ |  | ||||||
| dist/ |  | ||||||
| downloads/ |  | ||||||
| eggs/ |  | ||||||
| .eggs/ |  | ||||||
| lib/ |  | ||||||
| lib64/ |  | ||||||
| parts/ |  | ||||||
| sdist/ |  | ||||||
| var/ |  | ||||||
| wheels/ |  | ||||||
| share/python-wheels/ |  | ||||||
| *.egg-info/ |  | ||||||
| .installed.cfg |  | ||||||
| *.egg |  | ||||||
| MANIFEST |  | ||||||
|  |  | ||||||
| # PyInstaller |  | ||||||
| #  Usually these files are written by a python script from a template |  | ||||||
| #  before PyInstaller builds the exe, so as to inject date/other infos into it. |  | ||||||
| *.manifest |  | ||||||
| *.spec |  | ||||||
|  |  | ||||||
| # Installer logs |  | ||||||
| pip-log.txt |  | ||||||
| pip-delete-this-directory.txt |  | ||||||
|  |  | ||||||
| # Unit test / coverage reports |  | ||||||
| htmlcov/ |  | ||||||
| .tox/ |  | ||||||
| .nox/ |  | ||||||
| .coverage |  | ||||||
| .coverage.* |  | ||||||
| .cache |  | ||||||
| nosetests.xml |  | ||||||
| coverage.xml |  | ||||||
| *.cover |  | ||||||
| *.py,cover |  | ||||||
| .hypothesis/ |  | ||||||
| .pytest_cache/ |  | ||||||
| cover/ |  | ||||||
|  |  | ||||||
| # Translations |  | ||||||
| *.mo |  | ||||||
|  |  | ||||||
| # Django stuff: |  | ||||||
|  |  | ||||||
| # Flask stuff: |  | ||||||
| instance/ |  | ||||||
| .webassets-cache |  | ||||||
|  |  | ||||||
| # Scrapy stuff: |  | ||||||
| .scrapy |  | ||||||
|  |  | ||||||
| # Sphinx documentation |  | ||||||
| docs/_build/ |  | ||||||
|  |  | ||||||
| # PyBuilder |  | ||||||
| .pybuilder/ |  | ||||||
| target/ |  | ||||||
|  |  | ||||||
| # Jupyter Notebook |  | ||||||
| .ipynb_checkpoints |  | ||||||
|  |  | ||||||
| # IPython |  | ||||||
| profile_default/ |  | ||||||
| ipython_config.py |  | ||||||
|  |  | ||||||
| # pyenv |  | ||||||
| #   For a library or package, you might want to ignore these files since the code is |  | ||||||
| #   intended to run in multiple environments; otherwise, check them in: |  | ||||||
| # .python-version |  | ||||||
|  |  | ||||||
| # pipenv |  | ||||||
| #   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. |  | ||||||
| #   However, in case of collaboration, if having platform-specific dependencies or dependencies |  | ||||||
| #   having no cross-platform support, pipenv may install dependencies that don't work, or not |  | ||||||
| #   install all needed dependencies. |  | ||||||
| #Pipfile.lock |  | ||||||
|  |  | ||||||
| # poetry |  | ||||||
| #   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. |  | ||||||
| #   This is especially recommended for binary packages to ensure reproducibility, and is more |  | ||||||
| #   commonly ignored for libraries. |  | ||||||
| #   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control |  | ||||||
| #poetry.lock |  | ||||||
|  |  | ||||||
| # pdm |  | ||||||
| #   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. |  | ||||||
| #pdm.lock |  | ||||||
| #   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it |  | ||||||
| #   in version control. |  | ||||||
| #   https://pdm.fming.dev/#use-with-ide |  | ||||||
| .pdm.toml |  | ||||||
|  |  | ||||||
| # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm |  | ||||||
| __pypackages__/ |  | ||||||
|  |  | ||||||
| # Celery stuff |  | ||||||
| celerybeat-schedule |  | ||||||
| celerybeat.pid |  | ||||||
|  |  | ||||||
| # SageMath parsed files |  | ||||||
| *.sage.py |  | ||||||
|  |  | ||||||
| # Environments |  | ||||||
| .env |  | ||||||
| .venv |  | ||||||
| env/ |  | ||||||
| venv/ |  | ||||||
| ENV/ |  | ||||||
| env.bak/ |  | ||||||
| venv.bak/ |  | ||||||
|  |  | ||||||
| # Spyder project settings |  | ||||||
| .spyderproject |  | ||||||
| .spyproject |  | ||||||
|  |  | ||||||
| # Rope project settings |  | ||||||
| .ropeproject |  | ||||||
|  |  | ||||||
| # mkdocs documentation |  | ||||||
| /site |  | ||||||
|  |  | ||||||
| # mypy |  | ||||||
| .mypy_cache/ |  | ||||||
| .dmypy.json |  | ||||||
| dmypy.json |  | ||||||
|  |  | ||||||
| # Pyre type checker |  | ||||||
| .pyre/ |  | ||||||
|  |  | ||||||
| # pytype static type analyzer |  | ||||||
| .pytype/ |  | ||||||
|  |  | ||||||
| # Cython debug symbols |  | ||||||
| cython_debug/ |  | ||||||
|  |  | ||||||
| # PyCharm |  | ||||||
| #  JetBrains specific template is maintained in a separate JetBrains.gitignore that can |  | ||||||
| #  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore |  | ||||||
| #  and can be added to the global gitignore or merged into this file.  For a more nuclear |  | ||||||
| #  option (not recommended) you can uncomment the following to ignore the entire idea folder. |  | ||||||
| #.idea/ |  | ||||||
|  |  | ||||||
| ### Emacs ### |  | ||||||
| # -*- mode: gitignore; -*- |  | ||||||
| *~ |  | ||||||
| \#*\# |  | ||||||
| /.emacs.desktop |  | ||||||
| /.emacs.desktop.lock |  | ||||||
| *.elc |  | ||||||
| auto-save-list |  | ||||||
| tramp |  | ||||||
| .\#* |  | ||||||
|  |  | ||||||
| # Org-mode |  | ||||||
| .org-id-locations |  | ||||||
| *_archive |  | ||||||
|  |  | ||||||
| # flymake-mode |  | ||||||
| *_flymake.* |  | ||||||
|  |  | ||||||
| # eshell files |  | ||||||
| /eshell/history |  | ||||||
| /eshell/lastdir |  | ||||||
|  |  | ||||||
| # elpa packages |  | ||||||
| /elpa/ |  | ||||||
|  |  | ||||||
| # reftex files |  | ||||||
| *.rel |  | ||||||
|  |  | ||||||
| # AUCTeX auto folder |  | ||||||
| /auto/ |  | ||||||
|  |  | ||||||
| # cask packages |  | ||||||
| .cask/ |  | ||||||
|  |  | ||||||
| # Flycheck |  | ||||||
| flycheck_*.el |  | ||||||
|  |  | ||||||
| # server auth directory |  | ||||||
| /server/ |  | ||||||
|  |  | ||||||
| # projectiles files |  | ||||||
| .projectile |  | ||||||
|  |  | ||||||
| # directory configuration |  | ||||||
| .dir-locals.el |  | ||||||
|  |  | ||||||
| # network security |  | ||||||
| /network-security.data |  | ||||||
|  |  | ||||||
|  |  | ||||||
| ### Python ### |  | ||||||
| # Byte-compiled / optimized / DLL files |  | ||||||
|  |  | ||||||
| # C extensions |  | ||||||
|  |  | ||||||
| # Distribution / packaging |  | ||||||
|  |  | ||||||
| # PyInstaller |  | ||||||
| #  Usually these files are written by a python script from a template |  | ||||||
| #  before PyInstaller builds the exe, so as to inject date/other infos into it. |  | ||||||
|  |  | ||||||
| # Installer logs |  | ||||||
|  |  | ||||||
| # Unit test / coverage reports |  | ||||||
|  |  | ||||||
| # Translations |  | ||||||
|  |  | ||||||
| # Django stuff: |  | ||||||
|  |  | ||||||
| # Flask stuff: |  | ||||||
|  |  | ||||||
| # Scrapy stuff: |  | ||||||
|  |  | ||||||
| # Sphinx documentation |  | ||||||
|  |  | ||||||
| # PyBuilder |  | ||||||
|  |  | ||||||
| # Jupyter Notebook |  | ||||||
|  |  | ||||||
| # IPython |  | ||||||
|  |  | ||||||
| # pyenv |  | ||||||
| #   For a library or package, you might want to ignore these files since the code is |  | ||||||
| #   intended to run in multiple environments; otherwise, check them in: |  | ||||||
| # .python-version |  | ||||||
|  |  | ||||||
| # pipenv |  | ||||||
| #   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. |  | ||||||
| #   However, in case of collaboration, if having platform-specific dependencies or dependencies |  | ||||||
| #   having no cross-platform support, pipenv may install dependencies that don't work, or not |  | ||||||
| #   install all needed dependencies. |  | ||||||
|  |  | ||||||
| # poetry |  | ||||||
| #   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. |  | ||||||
| #   This is especially recommended for binary packages to ensure reproducibility, and is more |  | ||||||
| #   commonly ignored for libraries. |  | ||||||
| #   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control |  | ||||||
|  |  | ||||||
| # pdm |  | ||||||
| #   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. |  | ||||||
| #   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it |  | ||||||
| #   in version control. |  | ||||||
| #   https://pdm.fming.dev/#use-with-ide |  | ||||||
|  |  | ||||||
| # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm |  | ||||||
|  |  | ||||||
| # Celery stuff |  | ||||||
|  |  | ||||||
| # SageMath parsed files |  | ||||||
|  |  | ||||||
| # Environments |  | ||||||
|  |  | ||||||
| # Spyder project settings |  | ||||||
|  |  | ||||||
| # Rope project settings |  | ||||||
|  |  | ||||||
| # mkdocs documentation |  | ||||||
|  |  | ||||||
| # mypy |  | ||||||
|  |  | ||||||
| # Pyre type checker |  | ||||||
|  |  | ||||||
| # pytype static type analyzer |  | ||||||
|  |  | ||||||
| # Cython debug symbols |  | ||||||
|  |  | ||||||
| # PyCharm |  | ||||||
| #  JetBrains specific template is maintained in a separate JetBrains.gitignore that can |  | ||||||
| #  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore |  | ||||||
| #  and can be added to the global gitignore or merged into this file.  For a more nuclear |  | ||||||
| #  option (not recommended) you can uncomment the following to ignore the entire idea folder. |  | ||||||
|  |  | ||||||
| ### Python Patch ### |  | ||||||
| # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration |  | ||||||
| poetry.toml |  | ||||||
|  |  | ||||||
| # ruff |  | ||||||
| .ruff_cache/ |  | ||||||
|  |  | ||||||
| # LSP config files |  | ||||||
| pyrightconfig.json |  | ||||||
|  |  | ||||||
| ### venv ### |  | ||||||
| # Virtualenv |  | ||||||
| # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ |  | ||||||
| [Bb]in |  | ||||||
| [Ii]nclude |  | ||||||
| [Ll]ib |  | ||||||
| [Ll]ib64 |  | ||||||
| [Ll]ocal |  | ||||||
| [Ss]cripts |  | ||||||
| pyvenv.cfg |  | ||||||
| pip-selfcheck.json |  | ||||||
|  |  | ||||||
| # End of https://www.toptal.com/developers/gitignore/api/emacs,python,django,venv |  | ||||||
|  |  | ||||||
| /tienda_ilusion/don_confiao/static/frontend/ |  | ||||||
| /tienda_ilusion/don_confiao/frontend/don-confiao/.vite/ |  | ||||||
| /tienda_ilusion/don_confiao/frontend/don-confiao/.eslintrc.js |  | ||||||
| /tienda_ilusion/don_confiao/frontend/don-confiao/.eslintrc-auto-import.json |  | ||||||
| /tienda_ilusion/don_confiao/frontend/don-confiao/.editorconfig |  | ||||||
| /tienda_ilusion/don_confiao/frontend/don-confiao/.browserslistrc |  | ||||||
|   | |||||||
| @@ -1,8 +0,0 @@ | |||||||
| from python:3.12-slim |  | ||||||
|  |  | ||||||
| WORKDIR /app/ |  | ||||||
|  |  | ||||||
| COPY requirements.txt ./ |  | ||||||
| RUN pip install --no-cache-dir -r requirements.txt |  | ||||||
|  |  | ||||||
| CMD ["python", "manage.py", "runserver", "0.0.0.0:9090"] |  | ||||||
| @@ -1,27 +1,10 @@ | |||||||
| services: | services: | ||||||
|   nginx: |  | ||||||
|     build: |  | ||||||
|       context: ./ |  | ||||||
|       dockerfile: nginx.Dockerfile |  | ||||||
|     ports: |  | ||||||
|       - "7000:80" |  | ||||||
|     volumes: |  | ||||||
|       - ./nginx.conf:/etc/nginx/conf.d/default.conf |  | ||||||
|       - ./tienda_ilusion/don_confiao/static/frontend:/var/www/frontend/ |  | ||||||
|   django: |  | ||||||
|     build: |  | ||||||
|       context: ./ |  | ||||||
|       dockerfile: django.Dockerfile |  | ||||||
|     volumes: |  | ||||||
|       - ./tienda_ilusion:/app/ |  | ||||||
|     ports: |  | ||||||
|       - "7001:9090" |  | ||||||
|   frontend: |   frontend: | ||||||
|     build: |     build: | ||||||
|       context: ./ |       context: ./ | ||||||
|       dockerfile: vuetify.Dockerfile |       dockerfile: vuetify.Dockerfile | ||||||
|     volumes: |     volumes: | ||||||
|       - ./tienda_ilusion/don_confiao/frontend/don-confiao:/app/ |       - ./:/app/ | ||||||
|     ports: |     ports: | ||||||
|       - "7003:3000" |       - "7001:3000" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,10 +0,0 @@ | |||||||
| FROM nginx:latest |  | ||||||
|  |  | ||||||
| # Copiamos el archivo de configuración NGINX |  | ||||||
| COPY nginx.conf /etc/nginx/conf.d/default.conf |  | ||||||
|  |  | ||||||
| # Establecemos la variable de entorno para el proxy inverso |  | ||||||
| ENV DJANGO_PROXY_URL http://django:8000 |  | ||||||
|  |  | ||||||
| # Creamos un directorio estático |  | ||||||
| RUN mkdir -p /var/www/frontend |  | ||||||
							
								
								
									
										25
									
								
								nginx.conf
									
									
									
									
									
								
							
							
						
						| @@ -1,25 +0,0 @@ | |||||||
| server { |  | ||||||
|     listen 80; |  | ||||||
|     server_name donconfiao.org; |  | ||||||
|  |  | ||||||
|     # location /frontend { |  | ||||||
|     #     alias /var/www/frontend/; |  | ||||||
|     #     autoindex on; |  | ||||||
|     # } |  | ||||||
|  |  | ||||||
|     location /frontend { |  | ||||||
|         proxy_pass http://frontend:3000/frontend; |  | ||||||
|         proxy_set_header Host $host; |  | ||||||
|         proxy_set_header X-Real-IP $remote_addr; |  | ||||||
|         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |  | ||||||
|         proxy_set_header X-Forwarded-Proto $scheme; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     location / { |  | ||||||
|         proxy_pass http://django:9090; |  | ||||||
|         proxy_set_header Host $host; |  | ||||||
|         proxy_set_header X-Real-IP $remote_addr; |  | ||||||
|         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |  | ||||||
|         proxy_set_header X-Forwarded-Proto $scheme; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB | 
| Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB | 
| @@ -1,2 +0,0 @@ | |||||||
| Django==5.0.6 |  | ||||||
| djangorestframework |  | ||||||
| Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B | 
| Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB | 
| Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B | 
| @@ -1,56 +1,60 @@ | |||||||
| class DjangoApi { | class DjangoApi { | ||||||
|  |   constructor() { | ||||||
|  |     this.base = 'http://localhost:7000'; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   getCustomers() { |   getCustomers() { | ||||||
|     const url = '/don_confiao/api/customers/'; |     const url = this.base + '/don_confiao/api/customers/'; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getProducts() { |   getProducts() { | ||||||
|     const url = '/don_confiao/api/products/'; |     const url = this.base + '/don_confiao/api/products/'; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getPaymentMethods() { |   getPaymentMethods() { | ||||||
|     const url = '/don_confiao/payment_methods/all/select_format'; |     const url = this.base + '/don_confiao/payment_methods/all/select_format'; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getSummaryPurchase(purchaseId) { |   getSummaryPurchase(purchaseId) { | ||||||
|     const url = `/don_confiao/resumen_compra_json/${purchaseId}`; |     const url = this.base + `/don_confiao/resumen_compra_json/${purchaseId}`; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getPurchasesForReconciliation() { |   getPurchasesForReconciliation() { | ||||||
|     const url = '/don_confiao/purchases/for_reconciliation'; |     const url = this.base + '/don_confiao/purchases/for_reconciliation'; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getListReconcliations(page, itemsPerPage) { |   getListReconcliations(page, itemsPerPage) { | ||||||
|     const url = `/don_confiao/api/reconciliate_jar/?page=${page}&page_size=${itemsPerPage}`; |     const url = this.base + `/don_confiao/api/reconciliate_jar/?page=${page}&page_size=${itemsPerPage}`; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getReconciliation(reconciliationId) { |   getReconciliation(reconciliationId) { | ||||||
|     const url = `/don_confiao/api/reconciliate_jar/${reconciliationId}/`; |     const url = this.base + `/don_confiao/api/reconciliate_jar/${reconciliationId}/`; | ||||||
|     return this.getRequest(url); |     return this.getRequest(url); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   isValidAdminCode(code) { |   isValidAdminCode(code) { | ||||||
|     const url = `/don_confiao/api/admin_code/validate/${code}` |     const url = this.base + `/don_confiao/api/admin_code/validate/${code}` | ||||||
|     return this.getRequest(url) |     return this.getRequest(url) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   createPurchase(purchase) { |   createPurchase(purchase) { | ||||||
|     const url = '/don_confiao/api/sales/'; |     const url = this.base + '/don_confiao/api/sales/'; | ||||||
|     return this.postRequest(url, purchase); |     return this.postRequest(url, purchase); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   createReconciliationJar(reconciliation) { |   createReconciliationJar(reconciliation) { | ||||||
|     const url = '/don_confiao/reconciliate_jar'; |     const url = this.base + '/don_confiao/reconciliate_jar'; | ||||||
|     return this.postRequest(url, reconciliation); |     return this.postRequest(url, reconciliation); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   createCustomer(customer) { |   createCustomer(customer) { | ||||||
|     const url = '/don_confiao/api/customers/'; |     const url = this.base + '/don_confiao/api/customers/'; | ||||||
|     return this.postRequest(url, customer); |     return this.postRequest(url, customer); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @@ -1,12 +0,0 @@ | |||||||
| from django.contrib import admin |  | ||||||
| from .models import ( |  | ||||||
|     Customer, Sale, SaleLine, Product, ProductCategory, Payment, |  | ||||||
|     ReconciliationJar) |  | ||||||
|  |  | ||||||
| admin.site.register(Customer) |  | ||||||
| admin.site.register(Sale) |  | ||||||
| admin.site.register(SaleLine) |  | ||||||
| admin.site.register(Product) |  | ||||||
| admin.site.register(ProductCategory) |  | ||||||
| admin.site.register(Payment) |  | ||||||
| admin.site.register(ReconciliationJar) |  | ||||||
| @@ -1,146 +0,0 @@ | |||||||
| from rest_framework import viewsets |  | ||||||
| from rest_framework.response import Response |  | ||||||
| from rest_framework.status import HTTP_400_BAD_REQUEST |  | ||||||
| from rest_framework.views import APIView |  | ||||||
| from rest_framework.pagination import PageNumberPagination |  | ||||||
|  |  | ||||||
| from .models import Sale, SaleLine, Customer, Product, ReconciliationJar, PaymentMethods, AdminCode |  | ||||||
| from .serializers import SaleSerializer, ProductSerializer, CustomerSerializer, ReconciliationJarSerializer, PaymentMethodSerializer, SaleForRenconciliationSerializer, SaleSummarySerializer |  | ||||||
|  |  | ||||||
| from decimal import Decimal |  | ||||||
| import json |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Pagination(PageNumberPagination): |  | ||||||
|     page_size = 10 |  | ||||||
|     page_size_query_param = 'page_size' |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class SaleView(viewsets.ModelViewSet): |  | ||||||
|     queryset = Sale.objects.all() |  | ||||||
|     serializer_class = SaleSerializer |  | ||||||
|  |  | ||||||
|     def create(self, request): |  | ||||||
|         data = request.data |  | ||||||
|         customer = Customer.objects.get(pk=data['customer']) |  | ||||||
|         date = data['date'] |  | ||||||
|         lines = data['saleline_set'] |  | ||||||
|         payment_method = data['payment_method'] |  | ||||||
|         sale = Sale.objects.create( |  | ||||||
|             customer=customer, |  | ||||||
|             date=date, |  | ||||||
|             payment_method=payment_method |  | ||||||
|         ) |  | ||||||
|  |  | ||||||
|         for line in lines: |  | ||||||
|             product = Product.objects.get(pk=line['product']) |  | ||||||
|             quantity = line['quantity'] |  | ||||||
|             unit_price = line['unit_price'] |  | ||||||
|             SaleLine.objects.create( |  | ||||||
|                 sale=sale, |  | ||||||
|                 product=product, |  | ||||||
|                 quantity=quantity, |  | ||||||
|                 unit_price=unit_price |  | ||||||
|             ) |  | ||||||
|  |  | ||||||
|         return Response( |  | ||||||
|             {'id': sale.id, 'message': 'Venta creada con exito'}, |  | ||||||
|             status=201 |  | ||||||
|         ) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class ProductView(viewsets.ModelViewSet): |  | ||||||
|     queryset = Product.objects.all() |  | ||||||
|     serializer_class = ProductSerializer |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class CustomerView(viewsets.ModelViewSet): |  | ||||||
|     queryset = Customer.objects.all() |  | ||||||
|     serializer_class = CustomerSerializer |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class ReconciliateJarView(APIView): |  | ||||||
|     def post(self, request): |  | ||||||
|         data = request.data |  | ||||||
|         cash_purchases_id = data.get('cash_purchases') |  | ||||||
|         serializer = ReconciliationJarSerializer(data=data) |  | ||||||
|         if serializer.is_valid(): |  | ||||||
|             cash_purchases = Sale.objects.filter(pk__in=cash_purchases_id) |  | ||||||
|             if not self._is_valid_total(cash_purchases, data.get('total_cash_purchases')): |  | ||||||
|                 return Response( |  | ||||||
|                     {'error': 'total_cash_purchases not equal to sum of all purchases.'}, |  | ||||||
|                     status=HTTP_400_BAD_REQUEST |  | ||||||
|                 ) |  | ||||||
|             reconciliation = serializer.save() |  | ||||||
|             other_purchases = self._get_other_purchases(data.get('other_totals')) |  | ||||||
|  |  | ||||||
|             self._link_purchases(reconciliation, cash_purchases, other_purchases) |  | ||||||
|             return Response({'id': reconciliation.id}) |  | ||||||
|         return Response(serializer.errors, status=HTTP_400_BAD_REQUEST) |  | ||||||
|  |  | ||||||
|     def get(self, request): |  | ||||||
|         reconciliations = ReconciliationJar.objects.all() |  | ||||||
|         serializer = ReconciliationJarSerializer(reconciliations, many=True) |  | ||||||
|         return Response(serializer.data) |  | ||||||
|  |  | ||||||
|     def _is_valid_total(self, purchases, total): |  | ||||||
|         calculated_total = sum(p.get_total() for p in purchases) |  | ||||||
|         return calculated_total == Decimal(total) |  | ||||||
|  |  | ||||||
|     def _get_other_purchases(self, other_totals): |  | ||||||
|         if not other_totals: |  | ||||||
|             return [] |  | ||||||
|         purchases = [] |  | ||||||
|         for method in other_totals: |  | ||||||
|             purchases.extend(other_totals[method]['purchases']) |  | ||||||
|         if purchases: |  | ||||||
|             return Sale.objects.filter(pk__in=purchases) |  | ||||||
|         return [] |  | ||||||
|  |  | ||||||
|     def _link_purchases(self, reconciliation, cash_purchases, other_purchases): |  | ||||||
|         for purchase in cash_purchases: |  | ||||||
|             purchase.reconciliation = reconciliation |  | ||||||
|             purchase.clean() |  | ||||||
|             purchase.save() |  | ||||||
|  |  | ||||||
|         for purchase in other_purchases: |  | ||||||
|             purchase.reconciliation = reconciliation |  | ||||||
|             purchase.clean() |  | ||||||
|             purchase.save() |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class PaymentMethodView(APIView): |  | ||||||
|     def get(self, request): |  | ||||||
|         serializer = PaymentMethodSerializer(PaymentMethods.choices, many=True) |  | ||||||
|         return Response(serializer.data) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class SalesForReconciliationView(APIView): |  | ||||||
|     def get(self, request): |  | ||||||
|         sales = Sale.objects.filter(reconciliation=None) |  | ||||||
|         grouped_sales = {} |  | ||||||
|  |  | ||||||
|         for sale in sales: |  | ||||||
|             if sale.payment_method not in grouped_sales.keys(): |  | ||||||
|                 grouped_sales[sale.payment_method] = [] |  | ||||||
|             serializer = SaleForRenconciliationSerializer(sale) |  | ||||||
|             grouped_sales[sale.payment_method].append(serializer.data) |  | ||||||
|  |  | ||||||
|         return Response(grouped_sales) |  | ||||||
|  |  | ||||||
| class SaleSummary(APIView): |  | ||||||
|     def get(self, request, id): |  | ||||||
|         sale = Sale.objects.get(pk=id) |  | ||||||
|         serializer = SaleSummarySerializer(sale) |  | ||||||
|         return Response(serializer.data) |  | ||||||
|  |  | ||||||
| class AdminCodeValidateView(APIView): |  | ||||||
|     def get(self, request, code): |  | ||||||
|         codes = AdminCode.objects.filter(value=code) |  | ||||||
|         return Response({'validCode': bool(codes)}) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class ReconciliateJarModelView(viewsets.ModelViewSet): |  | ||||||
|     queryset = ReconciliationJar.objects.all().order_by('-date_time') |  | ||||||
|     pagination_class = Pagination |  | ||||||
|     serializer_class = ReconciliationJarSerializer |  | ||||||
| @@ -1,6 +0,0 @@ | |||||||
| from django.apps import AppConfig |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class DonConfiaoConfig(AppConfig): |  | ||||||
|     default_auto_field = 'django.db.models.BigAutoField' |  | ||||||
|     name = 'don_confiao' |  | ||||||
| @@ -1,4 +0,0 @@ | |||||||
| nombre,correo,telefono |  | ||||||
| Alejandro Ayala,mono@disroot.org,3232321 |  | ||||||
| Mono Francisco,pablo@onecluster.org,321312312 |  | ||||||
| Pablo Bolivar,alejo@onecluster.org,3243242 |  | ||||||
| 
 | 
| @@ -1,4 +0,0 @@ | |||||||
| "producto","unidad","precio","categorias" |  | ||||||
| "Aceite","Unidad", 50000,"Aceites&Alimentos" |  | ||||||
| "Café","Unidad", 14000,"Cafes&Alimentos" |  | ||||||
| "Arroz","Unidad", 7000,"Cafes&Alimentos" |  | ||||||
| 
 | 
| @@ -1,4 +0,0 @@ | |||||||
| "producto","unidad","precio","categorias" |  | ||||||
| "Aceite","Unidad", 50000,"Aceites&Alimentos" |  | ||||||
| "Café","Unidad", 15000,"Cafes&Alimentos" |  | ||||||
| "Arroz","Unidad", 6000,"Alimentos&Granos" |  | ||||||
| 
 | 
| @@ -1 +0,0 @@ | |||||||
| #!/usr/bin/env python3 |  | ||||||
| @@ -1,66 +0,0 @@ | |||||||
| from django import forms |  | ||||||
| from django.forms.models import inlineformset_factory |  | ||||||
|  |  | ||||||
| from django.forms.widgets import DateInput, DateTimeInput |  | ||||||
|  |  | ||||||
| from .models import Sale, SaleLine, PaymentMethods |  | ||||||
|  |  | ||||||
| readonly_number_widget = forms.NumberInput(attrs={'readonly': 'readonly'}) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class ImportProductsForm(forms.Form): |  | ||||||
|     csv_file = forms.FileField() |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class ImportCustomersForm(forms.Form): |  | ||||||
|     csv_file = forms.FileField() |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class PurchaseForm(forms.ModelForm): |  | ||||||
|     class Meta: |  | ||||||
|         model = Sale |  | ||||||
|         fields = [ |  | ||||||
|             "customer", |  | ||||||
|             "date", |  | ||||||
|             "phone", |  | ||||||
|             "description", |  | ||||||
|         ] |  | ||||||
|         widgets = { |  | ||||||
|             'date': DateInput(attrs={'type': 'date'}) |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class PurchaseLineForm(forms.ModelForm): |  | ||||||
|     class Meta: |  | ||||||
|         model = SaleLine |  | ||||||
|         fields = [ |  | ||||||
|             "product", |  | ||||||
|             "quantity", |  | ||||||
|             "unit_price", |  | ||||||
|             "description", |  | ||||||
|         ] |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class PurchaseSummaryForm(forms.Form): |  | ||||||
|     quantity_lines = forms.IntegerField( |  | ||||||
|         widget=readonly_number_widget |  | ||||||
|     ) |  | ||||||
|     quantity_products = forms.IntegerField( |  | ||||||
|         widget=readonly_number_widget |  | ||||||
|     ) |  | ||||||
|     ammount = forms.DecimalField( |  | ||||||
|         max_digits=10, |  | ||||||
|         decimal_places=2, |  | ||||||
|         widget=readonly_number_widget |  | ||||||
|     ) |  | ||||||
|     payment_method = forms.ChoiceField( |  | ||||||
|         choices=[(PaymentMethods.CASH, PaymentMethods.CASH)], |  | ||||||
|     ) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| SaleLineFormSet = inlineformset_factory( |  | ||||||
|     Sale, |  | ||||||
|     SaleLine, |  | ||||||
|     extra=1, |  | ||||||
|     fields='__all__' |  | ||||||
| ) |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| .DS_Store |  | ||||||
| node_modules |  | ||||||
| /dist |  | ||||||
|  |  | ||||||
| # local env files |  | ||||||
| .env.local |  | ||||||
| .env.*.local |  | ||||||
|  |  | ||||||
| # Log files |  | ||||||
| npm-debug.log* |  | ||||||
| yarn-debug.log* |  | ||||||
| yarn-error.log* |  | ||||||
| pnpm-debug.log* |  | ||||||
|  |  | ||||||
| # Editor directories and files |  | ||||||
| .idea |  | ||||||
| .vscode |  | ||||||
| *.suo |  | ||||||
| *.ntvs* |  | ||||||
| *.njsproj |  | ||||||
| *.sln |  | ||||||
| *.sw? |  | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 15:25 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     initial = True |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='Sale', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| # Generated by Django 5.0.7 on 2024-08-03 15:01 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0001_initial'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='product', |  | ||||||
|             field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='don_confiao.product'), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,37 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 15:33 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0001_initial'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='customer', |  | ||||||
|             field=models.CharField(default='', max_length=100), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='date', |  | ||||||
|             field=models.DateField(default='2024-06-22', verbose_name='Date'), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='description', |  | ||||||
|             field=models.CharField(default='', max_length=255), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='phone', |  | ||||||
|             field=models.CharField(default='', max_length=13), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 15:50 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0002_sale_customer_sale_date_sale_description_sale_phone'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='SaleLine', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 16:00 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0003_saleline'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='quantity', |  | ||||||
|             field=models.IntegerField(null=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,20 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 16:05 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0004_saleline_quantity'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='sale', |  | ||||||
|             field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='don_confiao.sale'), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,31 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 18:56 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0005_saleline_sale'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='description', |  | ||||||
|             field=models.CharField(default='', max_length=255), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='product', |  | ||||||
|             field=models.CharField(default='', max_length=100), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='unit_price', |  | ||||||
|             field=models.DecimalField(decimal_places=2, default=0.0, max_digits=9), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 19:11 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0006_saleline_description_saleline_product_and_more'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='description', |  | ||||||
|             field=models.CharField(blank=True, max_length=255, null=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,23 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-22 19:16 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0007_alter_sale_description'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='phone', |  | ||||||
|             field=models.CharField(blank=True, max_length=13, null=True), |  | ||||||
|         ), |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='saleline', |  | ||||||
|             name='description', |  | ||||||
|             field=models.CharField(blank=True, max_length=255, null=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,30 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-29 18:55 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0008_alter_sale_phone_alter_saleline_description'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='ProductCategory', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|                 ('name', models.CharField(max_length=100)), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='Product', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|                 ('name', models.CharField(max_length=100)), |  | ||||||
|                 ('price', models.DecimalField(decimal_places=2, max_digits=9)), |  | ||||||
|                 ('measuring_unit', models.CharField(choices=[('UNIT', 'Unit')], default='UNIT', max_length=20)), |  | ||||||
|                 ('categories', models.ManyToManyField(to='don_confiao.productcategory')), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-29 21:04 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0009_productcategory_product'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='productcategory', |  | ||||||
|             name='name', |  | ||||||
|             field=models.CharField(max_length=100, unique=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-06-29 21:48 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0010_alter_productcategory_name'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='product', |  | ||||||
|             name='name', |  | ||||||
|             field=models.CharField(max_length=100, unique=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,23 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 14:50 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0011_alter_product_name'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='Payment', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|                 ('date_time', models.DateTimeField()), |  | ||||||
|                 ('type_payment', models.CharField(choices=[('CASH', 'Cash'), ('CONFIAR', 'Confiar'), ('BANCOLOMBIA', 'Bancolombia')], default='CASH', max_length=30)), |  | ||||||
|                 ('mount', models.DecimalField(decimal_places=2, max_digits=9)), |  | ||||||
|                 ('description', models.CharField(blank=True, max_length=255, null=True)), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 15:56 |  | ||||||
|  |  | ||||||
| from django.db import migrations |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0012_payment'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.RenameField( |  | ||||||
|             model_name='payment', |  | ||||||
|             old_name='mount', |  | ||||||
|             new_name='amount', |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,27 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 16:35 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0013_rename_mount_payment_amount'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='ReconciliationJar', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|                 ('date_time', models.DateTimeField()), |  | ||||||
|                 ('description', models.CharField(blank=True, max_length=255, null=True)), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='payment', |  | ||||||
|             name='reconciliation_jar', |  | ||||||
|             field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.RESTRICT, to='don_confiao.reconciliationjar'), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 16:36 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0014_reconciliationjar_payment_reconciliation_jar'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='payment', |  | ||||||
|             name='reconciliation_jar', |  | ||||||
|             field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.RESTRICT, to='don_confiao.reconciliationjar'), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,37 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 18:10 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0015_alter_payment_reconciliation_jar'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             name='cash_discrepancy', |  | ||||||
|             field=models.DecimalField(decimal_places=2, default=0, max_digits=9), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             name='cash_float', |  | ||||||
|             field=models.DecimalField(decimal_places=2, default=0, max_digits=9), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             name='cash_taken', |  | ||||||
|             field=models.DecimalField(decimal_places=2, default=0, max_digits=9), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             name='reconciler', |  | ||||||
|             field=models.CharField(default='Jorge', max_length=255), |  | ||||||
|             preserve_default=False, |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 18:15 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0016_reconciliationjar_cash_discrepancy_and_more'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             name='draft', |  | ||||||
|             field=models.BooleanField(default=False), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 18:19 |  | ||||||
|  |  | ||||||
| from django.db import migrations |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0017_reconciliationjar_draft'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.RenameField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             old_name='draft', |  | ||||||
|             new_name='valid', |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 19:56 |  | ||||||
|  |  | ||||||
| from django.db import migrations |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0018_rename_draft_reconciliationjar_valid'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.RenameField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             old_name='valid', |  | ||||||
|             new_name='is_valid', |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,17 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 20:13 |  | ||||||
|  |  | ||||||
| from django.db import migrations |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0019_rename_valid_reconciliationjar_is_valid'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.RemoveField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             name='cash_float', |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 22:16 |  | ||||||
|  |  | ||||||
| from django.db import migrations |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0020_remove_reconciliationjar_cash_float'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.RenameField( |  | ||||||
|             model_name='reconciliationjar', |  | ||||||
|             old_name='reconciler', |  | ||||||
|             new_name='reconcilier', |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-07-13 22:39 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0021_rename_reconciler_reconciliationjar_reconcilier'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='payment', |  | ||||||
|             name='reconciliation_jar', |  | ||||||
|             field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.RESTRICT, to='don_confiao.reconciliationjar'), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,14 +0,0 @@ | |||||||
| # Generated by Django 5.0.7 on 2024-08-03 15:04 |  | ||||||
|  |  | ||||||
| from django.db import migrations |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0002_alter_saleline_product'), |  | ||||||
|         ('don_confiao', '0022_alter_payment_reconciliation_jar'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.7 on 2024-08-03 15:14 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0023_merge_20240803_1504'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='product', |  | ||||||
|             name='name', |  | ||||||
|             field=models.CharField(max_length=100), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,21 +0,0 @@ | |||||||
| # Generated by Django 5.0.7 on 2024-08-03 15:40 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0024_alter_product_name'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='Customer', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|                 ('name', models.CharField(max_length=100)), |  | ||||||
|                 ('address', models.CharField(max_length=100)), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| # Generated by Django 5.0.7 on 2024-08-03 15:55 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0025_customer'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='sale', |  | ||||||
|             name='customer', |  | ||||||
|             field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='don_confiao.customer'), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.7 on 2024-08-03 16:32 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0026_alter_sale_customer'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='product', |  | ||||||
|             name='name', |  | ||||||
|             field=models.CharField(max_length=100, unique=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-08-17 14:22 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0027_alter_product_name'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='customer', |  | ||||||
|             name='address', |  | ||||||
|             field=models.CharField(blank=True, max_length=100, null=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-08-17 19:28 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0028_alter_customer_address'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='customer', |  | ||||||
|             name='name', |  | ||||||
|             field=models.CharField(default=None, max_length=100), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,22 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-08-17 21:00 |  | ||||||
|  |  | ||||||
| import django.db.models.deletion |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0029_alter_customer_name'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.CreateModel( |  | ||||||
|             name='PaymentSale', |  | ||||||
|             fields=[ |  | ||||||
|                 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |  | ||||||
|                 ('payment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='don_confiao.payment')), |  | ||||||
|                 ('sale', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='don_confiao.sale')), |  | ||||||
|             ], |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,23 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-10-26 22:01 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0030_paymentsale'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.RenameField( |  | ||||||
|             model_name='customer', |  | ||||||
|             old_name='address', |  | ||||||
|             new_name='email', |  | ||||||
|         ), |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='customer', |  | ||||||
|             name='phone', |  | ||||||
|             field=models.CharField(blank=True, max_length=100, null=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Generated by Django 5.0.6 on 2024-10-26 22:21 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('don_confiao', '0031_rename_address_customer_email_customer_phone'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AddField( |  | ||||||
|             model_name='customer', |  | ||||||
|             name='address', |  | ||||||
|             field=models.CharField(blank=True, max_length=100, null=True), |  | ||||||
|         ), |  | ||||||
|     ] |  | ||||||