Compare commits

..

No commits in common. "master" and "v0.1.0" have entirely different histories.

9 changed files with 20 additions and 69 deletions

View file

@ -1,9 +1,3 @@
## v0.1.1 (2025-02-20)
### Fix
- set vendor name, sku when refreshing neworder batch row
## v0.1.0 (2025-01-13)
### Feat

View file

@ -1,7 +1,6 @@
# Sideshow-COREPOS
This package adds [CORE-POS](https://www.core-pos.com/) integration
for [Sideshow](https://pypi.org/project/Sideshow/).
This package adds CORE-POS integration for Sideshow.
Full docs are at https://rattailproject.org/docs/sideshow-corepos/

View file

@ -11,6 +11,7 @@ from importlib.metadata import version as get_version
project = 'Sideshow-COREPOS'
copyright = '2025, Lance Edgar'
author = 'Lance Edgar'
release = '0.1'
release = get_version('Sideshow-COREPOS')
# -- General configuration ---------------------------------------------------
@ -27,8 +28,8 @@ templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
'sideshow': ('https://docs.wuttaproject.org/sideshow/', None),
'wuttjamaican': ('https://docs.wuttaproject.org/wuttjamaican/', None),
'sideshow': ('https://rattailproject.org/docs/sideshow/', None),
'wuttjamaican': ('https://rattailproject.org/docs/wuttjamaican/', None),
}

View file

@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "Sideshow-COREPOS"
version = "0.1.1"
version = "0.1.0"
description = "Case/Special Order Tracker for CORE-POS"
readme = "README.md"
authors = [
@ -27,14 +27,12 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Office/Business",
"Topic :: Software Development :: Libraries :: Python Modules",
]
license = {text = "GNU General Public License v3+"}
requires-python = ">= 3.8"
dependencies = [
"Sideshow>=0.7.1",
"Wutta-COREPOS[web]>=0.3.0",
"Sideshow>=0.3.0",
"Wutta-COREPOS[web]>=0.2.0",
]
[project.optional-dependencies]

View file

@ -198,14 +198,6 @@ class NewOrderBatchHandler(base.NewOrderBatchHandler):
row.department_id = product.department_number
row.department_name = product.department.name if product.department else None
row.special_order = False
row.vendor_name = None
row.vendor_item_code = None
item = product.default_vendor_item
if item:
row.vendor_name = item.vendor.name if item.vendor else None
row.vendor_item_code = item.sku
row.case_size = self.get_case_size_for_external_product(product)
row.unit_cost = product.cost
row.unit_price_reg = self.get_unit_price_reg_for_external_product(product)

View file

@ -44,8 +44,7 @@ def main(global_config, **settings):
pyramid_config = base.make_pyramid_config(settings)
# configure DB sessions
if hasattr(wutta_config, 'core_office_op_engine'):
CoreOpSession.configure(bind=wutta_config.core_office_op_engine)
CoreOpSession.configure(bind=wutta_config.core_office_op_engine)
# bring in the rest of Sideshow
pyramid_config.include('sideshow.web')
@ -54,15 +53,15 @@ def main(global_config, **settings):
return pyramid_config.make_wsgi_app()
def make_wsgi_app(config=None):
def make_wsgi_app():
"""
Make and return the WSGI app (generic entry point).
"""
return base.make_wsgi_app(main, config=config)
return base.make_wsgi_app(main)
def make_asgi_app(config=None):
def make_asgi_app():
"""
Make and return the ASGI app (generic entry point).
"""
return base.make_asgi_app(main, config=config)
return base.make_asgi_app(main)

View file

@ -259,5 +259,3 @@ class TestNewOrderBatchHandler(DataTestCase):
self.assertEqual(row.product_size, "32oz")
self.assertEqual(row.case_size, decimal.Decimal('12.3400'))
self.assertEqual(row.unit_price_reg, decimal.Decimal('4.19'))
self.assertEqual(row.vendor_name, 'Acme Distributors')
self.assertEqual(row.vendor_item_code, '1234')

View file

@ -1,18 +0,0 @@
# -*- coding: utf-8; -*-
from wuttjamaican.testing import ConfigTestCase
from sideshow_corepos import config as mod
class TestSideshowCoreposConfig(ConfigTestCase):
def test_basic(self):
self.assertIsNone(self.config.get('wutta.batch.neworder.handler.spec'))
ext = mod.SideshowCoreposConfig()
ext.configure(self.config)
self.assertEqual(self.config.get('wutta.batch.neworder.handler.spec'),
'sideshow_corepos.batch.neworder:NewOrderBatchHandler')

View file

@ -1,44 +1,32 @@
# -*- coding: utf-8; -*-
import sqlalchemy as sa
from wuttjamaican.testing import DataTestCase
from wuttjamaican.testing import FileTestCase, ConfigTestCase
from asgiref.wsgi import WsgiToAsgi
from pyramid.router import Router
from wutta_corepos.web.db import CoreOpSession
from sideshow_corepos.web import app as mod
class TestMain(DataTestCase):
class TestMain(FileTestCase):
def test_basic(self):
global_config = None
settings = {'wutta_config': self.config}
myconf = self.write_file('my.conf', '')
settings = {'wutta.config': myconf}
app = mod.main(global_config, **settings)
self.assertIsInstance(app, Router)
self.assertIsNone(CoreOpSession.session_factory.kw['bind'])
def test_corepos_engine(self):
engine = sa.create_engine('sqlite://')
self.config.core_office_op_engine = engine
settings = {'wutta_config': self.config}
app = mod.main(None, **settings)
self.assertIsInstance(app, Router)
self.assertIs(CoreOpSession.session_factory.kw['bind'], engine)
class TestMakeWsgiApp(DataTestCase):
class TestMakeWsgiApp(ConfigTestCase):
def test_basic(self):
wsgi = mod.make_wsgi_app(config=self.config)
wsgi = mod.make_wsgi_app()
self.assertIsInstance(wsgi, Router)
class TestMakeAsgiApp(DataTestCase):
class TestMakeAsgiApp(ConfigTestCase):
def test_basic(self):
asgi = mod.make_asgi_app(config=self.config)
asgi = mod.make_asgi_app()
self.assertIsInstance(asgi, WsgiToAsgi)