diff --git a/CHANGELOG.md b/CHANGELOG.md index 28bd885..1d49b0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,6 @@ All notable changes to rattail-corepos will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## v0.3.9 (2024-08-19) - -### Fix - -- improve logic for matching CORE stock purchase to Rattail payment - -## v0.3.8 (2024-08-18) - -### Fix - -- avoid deprecated base class for config extension -- work around, log error when datasync can't locate member - ## v0.3.7 (2024-08-13) ### Fix diff --git a/README.md b/README.md deleted file mode 100644 index cb82d29..0000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ - -# rattail-corepos - -Rattail is a retail software framework, released under the GNU General Public -License. - -This package contains software interfaces for the [CORE -POS](https://github.com/CORE-POS/IS4C) system. - -Please see Rattail's [home page](https://rattailproject.org/) for more -information. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..5f5141b --- /dev/null +++ b/README.rst @@ -0,0 +1,14 @@ + +rattail_corepos +=============== + +Rattail is a retail software framework, released under the GNU General Public +License. + +This package contains software interfaces for the `CORE POS`_ system. + +.. _`CORE POS`: https://github.com/CORE-POS/IS4C + +Please see Rattail's `home page`_ for more information. + +.. _`home page`: https://rattailproject.org/ diff --git a/pyproject.toml b/pyproject.toml index 11e679d..8a2bfde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,9 +6,9 @@ build-backend = "hatchling.build" [project] name = "rattail_corepos" -version = "0.3.9" +version = "0.3.7" description = "Rattail Software Interfaces for CORE POS" -readme = "README.md" +readme = "README.rst" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] license = {text = "GNU GPL v3+"} classifiers = [ @@ -33,10 +33,10 @@ dependencies = [ [project.urls] -Homepage = "https://rattailproject.org" -Repository = "https://forgejo.wuttaproject.org/rattail/rattail-corepos" -Issues = "https://forgejo.wuttaproject.org/rattail/rattail-corepos/issues" -Changelog = "https://forgejo.wuttaproject.org/rattail/rattail-corepos/src/branch/master/CHANGELOG.md" +Homepage = "https://redmine.rattailproject.org/projects/corepos-integration" +Repository = "https://kallithea.rattailproject.org/rattail-project/rattail-corepos" +Issues = "https://redmine.rattailproject.org/projects/corepos-integration/issues" +Changelog = "https://kallithea.rattailproject.org/rattail-project/rattail-corepos/files/master/CHANGELOG.md" [project.scripts] diff --git a/rattail_corepos/config.py b/rattail_corepos/config.py index 376e365..cdb032e 100644 --- a/rattail_corepos/config.py +++ b/rattail_corepos/config.py @@ -26,11 +26,12 @@ Rattail-COREPOS Config Extension import warnings -from wuttjamaican.conf import WuttaConfigExtension from wuttjamaican.db.conf import get_engines +from rattail.config import ConfigExtension -class RattailCOREPOSExtension(WuttaConfigExtension): + +class RattailCOREPOSExtension(ConfigExtension): """ Config extension for Rattail-COREPOS """ diff --git a/rattail_corepos/datasync/rattail.py b/rattail_corepos/datasync/rattail.py index 18ff5dd..5b6e925 100644 --- a/rattail_corepos/datasync/rattail.py +++ b/rattail_corepos/datasync/rattail.py @@ -24,16 +24,11 @@ DataSync for Rattail DB """ -import logging - from sqlalchemy import orm from rattail.datasync import DataSyncImportConsumer -log = logging.getLogger(__name__) - - class FromCOREAPIToRattail(DataSyncImportConsumer): """ Consumer for CORE POS (API) -> Rattail datasync @@ -74,11 +69,6 @@ class FromCOREAPIToRattail(DataSyncImportConsumer): else: # import member data from API, into various Rattail tables member = self.get_host_object(session, change) - if not member: - # TODO: should log.warning() instead but for now i - # need to see this in action and further troubleshoot - log.error("CORE member not found for change: %s", change) - continue self.process_change(session, self.importers['Customer'], host_object=member) shoppers = self.importers['CustomerShopper'].get_shoppers_for_member(member) diff --git a/rattail_corepos/importing/corepos/db.py b/rattail_corepos/importing/corepos/db.py index 59d4b0e..63b6894 100644 --- a/rattail_corepos/importing/corepos/db.py +++ b/rattail_corepos/importing/corepos/db.py @@ -953,17 +953,7 @@ class MemberEquityPaymentImporter(FromCOREPOS, corepos_importing.model.MemberEqu if len(match) == 1: return match[0] - # then try to match on date only, not time - match = [payment for payment in payments - if payment.corepos_transaction_number == stock_purchase.transaction_number - and payment.corepos_transaction_id == stock_purchase.transaction_id - and payment.amount == stock_purchase.amount - and payment.corepos_department_number == stock_purchase.department_number - and self.app.localtime(payment.corepos_datetime, from_utc=True).date() == dt.date()] - if len(match) == 1: - return match[0] - - # nb. avoid date/time for this one + # nb. avoid datetime for this one matches = [payment for payment in payments if payment.corepos_transaction_number == stock_purchase.transaction_number and payment.corepos_transaction_id == stock_purchase.transaction_id @@ -976,9 +966,6 @@ class MemberEquityPaymentImporter(FromCOREPOS, corepos_importing.model.MemberEqu stock_purchase.amount, stock_purchase.datetime) - # TODO: now that we try to match on date above, this logic - # may no longer be necssary/useful? - # so there is one match, but its timestamp may be way off, # so let's also make sure at least date matches payment = matches[0]