Changeset - 8e197f347fed
[Not reviewed]
0 4 1
Lance Edgar (lance) - 3 years ago 2021-10-06 17:22:09
lance@edbob.org
Add `PendingCustomer` model, for sake of new custorder workflow
5 files changed with 171 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rattail/db/alembic/versions/5a256a77e6d0_add_pending_customer_table.py
Show inline comments
 
new file 100644
 
# -*- coding: utf-8; -*-
 
"""add pending_customer table
 

	
 
Revision ID: 5a256a77e6d0
 
Revises: 51f7773bb07a
 
Create Date: 2021-10-06 16:35:39.749555
 

	
 
"""
 

	
 
from __future__ import unicode_literals, absolute_import
 

	
 
# revision identifiers, used by Alembic.
 
revision = '5a256a77e6d0'
 
down_revision = u'51f7773bb07a'
 
branch_labels = None
 
depends_on = None
 

	
 
from alembic import op
 
import sqlalchemy as sa
 
import rattail.db.types
 

	
 

	
 

	
 
def upgrade():
 

	
 
    # pending_customer
 
    op.create_table('pending_customer',
 
                    sa.Column('uuid', sa.String(length=32), nullable=False),
 
                    sa.Column('user_uuid', sa.String(length=32), nullable=False),
 
                    sa.Column('created', sa.DateTime(), nullable=False),
 
                    sa.Column('id', sa.String(length=20), nullable=True),
 
                    sa.Column('first_name', sa.String(length=50), nullable=True),
 
                    sa.Column('middle_name', sa.String(length=50), nullable=True),
 
                    sa.Column('last_name', sa.String(length=50), nullable=True),
 
                    sa.Column('display_name', sa.String(length=100), nullable=True),
 
                    sa.Column('phone_number', sa.String(length=20), nullable=True),
 
                    sa.Column('phone_type', sa.String(length=15), nullable=True),
 
                    sa.Column('email_address', sa.String(length=255), nullable=True),
 
                    sa.Column('email_type', sa.String(length=15), nullable=True),
 
                    sa.Column('address_street', sa.String(length=100), nullable=True),
 
                    sa.Column('address_street2', sa.String(length=100), nullable=True),
 
                    sa.Column('address_city', sa.String(length=60), nullable=True),
 
                    sa.Column('address_state', sa.String(length=2), nullable=True),
 
                    sa.Column('address_zipcode', sa.String(length=10), nullable=True),
 
                    sa.Column('address_type', sa.String(length=15), nullable=True),
 
                    sa.Column('status_code', sa.Integer(), nullable=True),
 
                    sa.ForeignKeyConstraint(['user_uuid'], [u'user.uuid'], name=u'pending_customer_fk_user'),
 
                    sa.PrimaryKeyConstraint('uuid')
 
    )
 

	
 
    # batch_custorder
 
    op.add_column(u'batch_custorder', sa.Column('pending_customer_uuid', sa.String(length=32), nullable=True))
 
    op.create_foreign_key(u'batch_custorder_fk_pending_customer', 'batch_custorder', 'pending_customer', ['pending_customer_uuid'], ['uuid'])
 

	
 
    # custorder
 
    op.add_column(u'custorder', sa.Column('pending_customer_uuid', sa.String(length=32), nullable=True))
 
    op.create_foreign_key(u'custorder_fk_pending_customer', 'custorder', 'pending_customer', ['pending_customer_uuid'], ['uuid'])
 

	
 

	
 
def downgrade():
 

	
 
    # custorder
 
    op.drop_constraint(u'custorder_fk_pending_customer', 'custorder', type_='foreignkey')
 
    op.drop_column(u'custorder', 'pending_customer_uuid')
 

	
 
    # batch_custorder
 
    op.drop_constraint(u'batch_custorder_fk_pending_customer', 'batch_custorder', type_='foreignkey')
 
    op.drop_column(u'batch_custorder', 'pending_customer_uuid')
 

	
 
    # pending_customer
 
    op.drop_table('pending_customer')
rattail/db/model/__init__.py
Show inline comments
 
# -*- coding: utf-8; -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2021 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
#  Rattail is free software: you can redistribute it and/or modify it under the
 
#  terms of the GNU General Public License as published by the Free Software
 
#  Foundation, either version 3 of the License, or (at your option) any later
 
#  version.
 
#
 
#  Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
 
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
#  details.
 
#
 
#  You should have received a copy of the GNU General Public License along with
 
#  Rattail.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
################################################################################
 
"""
 
Rattail data models
 
"""
 

	
 
from __future__ import unicode_literals, absolute_import
 

	
 
from .core import Base, ModelBase, uuid_column, getset_factory, GPCType, Setting, Change, Note
 
from .contact import PhoneNumber, EmailAddress, MailingAddress
 

	
 
from .people import (Person, PersonNote,
 
                     PersonPhoneNumber, PersonEmailAddress, PersonMailingAddress,
 
                     MergePeopleRequest)
 
from .users import Role, Permission, User, UserRole, UserEvent
 
from .stores import Store, StorePhoneNumber, StoreEmailAddress
 
from .customers import (Customer, CustomerPhoneNumber, CustomerEmailAddress, CustomerMailingAddress,
 
                        CustomerGroup, CustomerGroupAssignment, CustomerPerson, CustomerNote)
 
from .customers import (Customer,
 
                        CustomerPhoneNumber,
 
                        CustomerEmailAddress,
 
                        CustomerMailingAddress,
 
                        CustomerGroup,
 
                        CustomerGroupAssignment,
 
                        CustomerPerson,
 
                        CustomerNote,
 
                        PendingCustomer)
 
from .members import Member, MemberPhoneNumber, MemberEmailAddress, MemberMailingAddress
 

	
 
from .org import Department, Subdepartment, Category, Family, ReportCode, DepositLink
 
from .employees import (Employee, EmployeePhoneNumber, EmployeeEmailAddress,
 
                        EmployeeStore, EmployeeDepartment, EmployeeHistory)
 
from .shifts import ScheduledShift, WorkedShift
 

	
 
from .vendors import Vendor, VendorPhoneNumber, VendorEmailAddress, VendorContact
 
from .products import (UnitOfMeasure, Brand, Tax, Product, ProductImage, ProductCode,
 
                       ProductCost, ProductFutureCost, ProductPrice,
 
                       ProductInventory, ProductStoreInfo, ProductVolatile,
 
                       InventoryAdjustmentReason)
 
from .ifps import IFPS_PLU
 
from .purchase import (PurchaseBase, PurchaseItemBase, PurchaseCreditBase,
 
                       Purchase, PurchaseItem, PurchaseCredit)
 

	
 
from .custorders import (CustomerOrderBase, CustomerOrderItemBase,
 
                         CustomerOrder, CustomerOrderItem,
 
                         CustomerOrderItemEvent, CustomerOrderItemNote)
 

	
 
from .messages import Message, MessageRecipient
 

	
 
from .datasync import DataSyncChange
 
from .labels import LabelProfile
 
from .bouncer import EmailAttempt, EmailBounce
 
from .tempmon import TempmonClient, TempmonProbe, TempmonReading
 
from .upgrades import Upgrade, UpgradeRequirement
 

	
 
from .exports import ExportMixin
 
from .reports import ReportOutput
 
from .batch import BatchMixin, BaseFileBatchMixin, FileBatchMixin, BatchRowMixin, ProductBatchRowMixin
 
from .batch.dynamic import DynamicBatchMixin, ImporterBatch
 
from .batch.handheld import HandheldBatch, HandheldBatchRow
 
from .batch.inventory import InventoryBatch, InventoryBatchRow
 
from .batch.labels import LabelBatch, LabelBatchRow
 
from .batch.newproduct import NewProductBatch, NewProductBatchRow
 
from .batch.delproduct import DeleteProductBatch, DeleteProductBatchRow
 
from .batch.pricing import PricingBatch, PricingBatchRow
 
from .batch.product import ProductBatch, ProductBatchRow
 
from .batch.purchase import PurchaseBatch, PurchaseBatchRow, PurchaseBatchRowClaim, PurchaseBatchCredit
 
from .batch.custorder import CustomerOrderBatch, CustomerOrderBatchRow
 
from .batch.vendorcatalog import (VendorCatalogBatch, VendorCatalogBatchRow,
 
                                  # TODO: deprecate / remove these
 
                                  VendorCatalog, VendorCatalogRow)
 
from .batch.vendorinvoice import (VendorInvoiceBatch, VendorInvoiceBatchRow,
 
                                  # TODO: deprecate / remove these
 
                                  VendorInvoice, VendorInvoiceRow)
rattail/db/model/customers.py
Show inline comments
 
# -*- coding: utf-8; -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2021 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
#  Rattail is free software: you can redistribute it and/or modify it under the
 
#  terms of the GNU General Public License as published by the Free Software
 
#  Foundation, either version 3 of the License, or (at your option) any later
 
#  version.
 
#
 
#  Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
 
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
#  details.
 
#
 
#  You should have received a copy of the GNU General Public License along with
 
#  Rattail.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
################################################################################
 
"""
 
Data Models for Customers
 
"""
 

	
 
from __future__ import unicode_literals, absolute_import
 

	
 
import datetime
 

	
 
import six
 
import sqlalchemy as sa
 
from sqlalchemy import orm
 
from sqlalchemy.ext.associationproxy import association_proxy
 
from sqlalchemy.ext.orderinglist import ordering_list
 

	
 
from rattail.db.model import Base, uuid_column, getset_factory
 
from rattail.db.model import PhoneNumber, EmailAddress, MailingAddress, Person, Note
 
from rattail.db.model import (Base, uuid_column, getset_factory,
 
                              PhoneNumber, EmailAddress, MailingAddress,
 
                              Person, Note, User)
 
from .contact import ContactMixin
 

	
 

	
 
class Customer(ContactMixin, Base):
 
    """
 
    Represents a customer account.
 

	
 
    Customer accounts may consist of more than one person, in some cases.
 
    """
 
    __tablename__ = 'customer'
 
    __versioned__ = {}
 

	
 
    uuid = uuid_column()
 

	
 
    id = sa.Column(sa.String(length=20), nullable=True, doc="""
 
    String ID for the customer, if known/relevant.  This may or may not
 
    correspond to the :attr:`number`, depending on your system.
 
    """)
 

	
 
    number = sa.Column(sa.Integer(), nullable=True, doc="""
 
    Customer number, if known/relevant.  This may or may not correspond to the
 
    :attr:`id`, depending on your system.
 
    """)
 

	
 
    name = sa.Column(sa.String(length=255))
 
    email_preference = sa.Column(sa.Integer())
 

	
 
    wholesale = sa.Column(sa.Boolean(), nullable=True, doc="""
 
    Flag indicating whether the customer is a "wholesale" account - whatever
 
    that happens to mean for your business logic.
 
    """)
 

	
 
    active_in_pos = sa.Column(sa.Boolean(), nullable=True, doc="""
 
    Whether or not the customer account should be "active" within the POS
 
    system, if applicable.  Whether/how this field is populated and/or
 
    leveraged are up to your system.
 
    """)
 

	
 
    active_in_pos_sticky = sa.Column(sa.Boolean(), nullable=False, default=False, doc="""
 
    Whether or not the customer account should *always* be "active" within the
 
    POS system.  This field may be useful if :attr:`active_in_pos` gets set
 
    dynamically.
 
    """)
 

	
 
    invalid_address = sa.Column(sa.Boolean(), nullable=True, doc="""
 
    Flag indicating the customer's mailing address(es) on file are invalid.
 
    """)
 

	
 
@@ -313,48 +316,111 @@ class CustomerPerson(Base):
 
        sa.ForeignKeyConstraint(['person_uuid'], ['person.uuid'], name='customer_x_person_fk_person'),
 
        sa.Index('customer_x_person_ix_customer', 'customer_uuid'),
 
        sa.Index('customer_x_person_ix_person', 'person_uuid'),
 
    )
 
    __versioned__ = {}
 

	
 
    uuid = uuid_column()
 
    customer_uuid = sa.Column(sa.String(length=32), nullable=False)
 
    person_uuid = sa.Column(sa.String(length=32), nullable=False)
 
    ordinal = sa.Column(sa.Integer(), nullable=False)
 

	
 
    customer = orm.relationship(Customer, back_populates='_people')
 

	
 
    person = orm.relationship(Person)
 

	
 

	
 
Customer._people = orm.relationship(
 
    CustomerPerson, back_populates='customer',
 
    primaryjoin=CustomerPerson.customer_uuid == Customer.uuid,
 
    collection_class=ordering_list('ordinal', count_from=1),
 
    order_by=CustomerPerson.ordinal,
 
    cascade='save-update, merge, delete, delete-orphan')
 

	
 
Customer.people = association_proxy(
 
    '_people', 'person',
 
    getset_factory=getset_factory,
 
    creator=lambda p: CustomerPerson(person=p))
 

	
 
Customer._person = orm.relationship(
 
    CustomerPerson,
 
    primaryjoin=sa.and_(
 
        CustomerPerson.customer_uuid == Customer.uuid,
 
        CustomerPerson.ordinal == 1),
 
    uselist=False,
 
    viewonly=True)
 

	
 
Customer.person = association_proxy(
 
    '_person', 'person',
 
    getset_factory=getset_factory)
 

	
 
Person._customers = orm.relationship(
 
    CustomerPerson,
 
    primaryjoin=CustomerPerson.person_uuid == Person.uuid,
 
    viewonly=True)
 

	
 
Person.customers = association_proxy('_customers', 'customer',
 
                                     getset_factory=getset_factory,
 
                                     creator=lambda c: CustomerPerson(customer=c))
 

	
 

	
 
class PendingCustomer(Base):
 
    """
 
    A "pending" customer record, used for new customer entry workflow.
 
    """
 
    __tablename__ = 'pending_customer'
 
    __table_args__ = (
 
        sa.ForeignKeyConstraint(['user_uuid'], ['user.uuid'], name='pending_customer_fk_user'),
 
    )
 

	
 
    uuid = uuid_column()
 

	
 
    user_uuid = sa.Column(sa.String(length=32), nullable=False)
 
    user = orm.relationship(
 
        User,
 
        doc="""
 
        Referencef to the :class:`~rattail:rattail.db.model.User` who
 
        first entered the record.
 
        """)
 

	
 
    created = sa.Column(sa.DateTime(), nullable=False, default=datetime.datetime.utcnow, doc="""
 
    Timestamp when the record was first created.
 
    """)
 

	
 
    # Customer fields
 
    id = sa.Column(sa.String(length=20), nullable=True)
 

	
 
    # Person fields
 
    first_name = sa.Column(sa.String(length=50), nullable=True)
 
    middle_name = sa.Column(sa.String(length=50), nullable=True)
 
    last_name = sa.Column(sa.String(length=50), nullable=True)
 
    display_name = sa.Column(sa.String(length=100), nullable=True)
 

	
 
    # Phone fields
 
    phone_number = sa.Column(sa.String(length=20), nullable=True)
 
    phone_type = sa.Column(sa.String(length=15), nullable=True)
 

	
 
    # Email fields
 
    email_address = sa.Column(sa.String(length=255), nullable=True)
 
    email_type = sa.Column(sa.String(length=15), nullable=True)
 

	
 
    # Address fields
 
    address_street = sa.Column(sa.String(length=100), nullable=True)
 
    address_street2 = sa.Column(sa.String(length=100), nullable=True)
 
    address_city = sa.Column(sa.String(length=60), nullable=True)
 
    address_state = sa.Column(sa.String(length=2), nullable=True)
 
    address_zipcode = sa.Column(sa.String(length=10), nullable=True)
 
    address_type = sa.Column(sa.String(length=15), nullable=True)
 

	
 
    # workflow fields
 
    status_code = sa.Column(sa.Integer(), nullable=True, doc="""
 
    Status indicator for the new customer record.
 
    """)
 

	
 
    def __str__(self):
 
        if six.PY2:
 
            return (self.display_name or "").encode('utf_8')
 
        return self.display_name or ""
 

	
 
    if six.PY2:
 
        def __unicode__(self):
 
            return self.display_name or ""
rattail/db/model/custorders.py
Show inline comments
 
# -*- coding: utf-8; -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2021 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
#  Rattail is free software: you can redistribute it and/or modify it under the
 
#  terms of the GNU General Public License as published by the Free Software
 
#  Foundation, either version 3 of the License, or (at your option) any later
 
#  version.
 
#
 
#  Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
 
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
#  details.
 
#
 
#  You should have received a copy of the GNU General Public License along with
 
#  Rattail.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
################################################################################
 
"""
 
Data Models for Customer Orders
 
"""
 

	
 
from __future__ import unicode_literals, absolute_import
 

	
 
import datetime
 

	
 
import six
 
import sqlalchemy as sa
 
from sqlalchemy import orm
 
from sqlalchemy.ext.orderinglist import ordering_list
 
from sqlalchemy.ext.declarative import declared_attr
 

	
 
from rattail.db.model import Base, uuid_column
 
from rattail.db.model import Store, Customer, Person, Product, User, Note
 
from rattail.db.model import Store, Customer, PendingCustomer, Person, Product, User, Note
 
from rattail.db.types import GPCType
 

	
 

	
 
class CustomerOrderBase(object):
 
    """
 
    Base class for customer orders; defines common fields.
 
    """
 

	
 
    @declared_attr
 
    def __table_args__(cls):
 
        return cls.__customer_order_table_args__()
 

	
 
    @classmethod
 
    def __customer_order_table_args__(cls):
 
        table_name = cls.__tablename__
 
        return (
 
            sa.ForeignKeyConstraint(['store_uuid'], ['store.uuid'],
 
                                    name='{}_fk_store'.format(table_name)),
 
            sa.ForeignKeyConstraint(['customer_uuid'], ['customer.uuid'],
 
                                    name='{}_fk_customer'.format(table_name)),
 
            sa.ForeignKeyConstraint(['person_uuid'], ['person.uuid'],
 
                                    name='{}_fk_person'.format(table_name)),
 
            sa.ForeignKeyConstraint(['pending_customer_uuid'], ['pending_customer.uuid'],
 
                                    name='{}_fk_pending_customer'.format(table_name)),
 
        )
 

	
 
    store_uuid = sa.Column(sa.String(length=32), nullable=True)
 

	
 
    @declared_attr
 
    def store(cls):
 
        return orm.relationship(
 
            Store,
 
            doc="""
 
            Reference to the store to which the order applies.
 
            """)
 

	
 
    customer_uuid = sa.Column(sa.String(length=32), nullable=True)
 

	
 
    @declared_attr
 
    def customer(cls):
 
        return orm.relationship(
 
            Customer,
 
            doc="""
 
            Reference to the customer account for which the order exists.
 
            """)
 

	
 
    person_uuid = sa.Column(sa.String(length=32), nullable=True)
 

	
 
    @declared_attr
 
    def person(cls):
 
        return orm.relationship(
 
            Person,
 
            doc="""
 
            Reference to the person to whom the order applies.
 
            """)
 

	
 
    pending_customer_uuid = sa.Column(sa.String(length=32), nullable=True)
 

	
 
    @declared_attr
 
    def pending_customer(cls):
 
        return orm.relationship(
 
            PendingCustomer,
 
            doc="""
 
            Reference to the *pending* customer account for the order,
 
            if applicable.
 
            """)
 

	
 
    phone_number = sa.Column(sa.String(length=20), nullable=True, doc="""
 
    Customer contact phone number for sake of this order.
 
    """)
 

	
 
    email_address = sa.Column(sa.String(length=255), nullable=True, doc="""
 
    Customer contact email address for sake of this order.
 
    """)
 

	
 
    total_price = sa.Column(sa.Numeric(precision=10, scale=3), nullable=True, doc="""
 
    Full price (not including tax etc.) for all items on the order.
 
    """)
 

	
 

	
 
@six.python_2_unicode_compatible
 
class CustomerOrder(CustomerOrderBase, Base):
 
    """
 
    Represents an order placed by the customer.
 
    """
 
    __tablename__ = 'custorder'
 

	
 
    @declared_attr
 
    def __table_args__(cls):
 
        return cls.__customer_order_table_args__() + (
 
            sa.ForeignKeyConstraint(['created_by_uuid'], ['user.uuid'],
 
                                    name='custorder_fk_created_by'),
 
        )
 

	
 
    uuid = uuid_column()
 

	
 
    id = sa.Column(sa.Integer(), doc="""
 
    Numeric, auto-increment ID for the order.
 
    """)
 

	
 
    created = sa.Column(sa.DateTime(), nullable=False, default=datetime.datetime.utcnow, doc="""
 
    Date and time when the order/batch was first created.
 
    """)
 

	
 
    created_by_uuid = sa.Column(sa.String(length=32), nullable=True)
 
    created_by = orm.relationship(
 
        User,
 
        doc="""
 
        Reference to the user who initially created the order/batch.
 
        """)
 

	
 
    status_code = sa.Column(sa.Integer(), nullable=False)
 

	
 
    items = orm.relationship(
 
        'CustomerOrderItem',
rattail/enum.py
Show inline comments
 
@@ -187,96 +187,105 @@ EMAIL_PREFERENCE = {
 

	
 

	
 
HANDHELD_DEVICE_TYPE_MOTOROLA           = 'motorola'
 
HANDHELD_DEVICE_TYPE_PALMOS             = 'palmos'
 

	
 
HANDHELD_DEVICE_TYPE = {
 
    HANDHELD_DEVICE_TYPE_MOTOROLA       : "Motorola",
 
    HANDHELD_DEVICE_TYPE_PALMOS         : "PalmOS",
 
}
 

	
 

	
 
IMPORTER_BATCH_ROW_STATUS_NOCHANGE      = 0
 
IMPORTER_BATCH_ROW_STATUS_CREATE        = 1
 
IMPORTER_BATCH_ROW_STATUS_UPDATE        = 2
 
IMPORTER_BATCH_ROW_STATUS_DELETE        = 3
 

	
 
IMPORTER_BATCH_ROW_STATUS = {
 
    IMPORTER_BATCH_ROW_STATUS_NOCHANGE  : "no change",
 
    IMPORTER_BATCH_ROW_STATUS_CREATE    : "create",
 
    IMPORTER_BATCH_ROW_STATUS_UPDATE    : "update",
 
    IMPORTER_BATCH_ROW_STATUS_DELETE    : "delete",
 
}
 

	
 

	
 
INVENTORY_MODE_REPLACE          = 1
 
INVENTORY_MODE_REPLACE_ADJUST   = 2
 
INVENTORY_MODE_ADJUST           = 3
 
INVENTORY_MODE_ZERO_ALL         = 4
 
INVENTORY_MODE_VARIANCE         = 5
 

	
 
INVENTORY_MODE = {
 
    INVENTORY_MODE_REPLACE              : "Replace only",
 
    INVENTORY_MODE_REPLACE_ADJUST       : "Replace then adjust",
 
    INVENTORY_MODE_ADJUST               : "Adjust only",
 
    INVENTORY_MODE_ZERO_ALL             : "Zero all",
 
    INVENTORY_MODE_VARIANCE             : "Variance Correction",
 
}
 

	
 

	
 
MESSAGE_STATUS_INBOX            = 1
 
MESSAGE_STATUS_ARCHIVE          = 2
 

	
 
MESSAGE_STATUS = {
 
    MESSAGE_STATUS_INBOX        : "Inbox",
 
    MESSAGE_STATUS_ARCHIVE      : "Archive",
 
}
 

	
 

	
 
PENDING_CUSTOMER_STATUS_PENDING         = 1
 
PENDING_CUSTOMER_STATUS_READY           = 2
 

	
 
PENDING_CUSTOMER_STATUS = OrderedDict([
 
    (PENDING_CUSTOMER_STATUS_PENDING,           "pending"),
 
    (PENDING_CUSTOMER_STATUS_READY,             "ready"),
 
])
 

	
 

	
 
PHONE_TYPE_HOME                 = 'home'
 
PHONE_TYPE_MOBILE               = 'mobile'
 
PHONE_TYPE_OTHER                = 'other'
 

	
 
PHONE_TYPE = {
 
    PHONE_TYPE_HOME             : "Home",
 
    PHONE_TYPE_MOBILE           : "Mobile",
 
    PHONE_TYPE_OTHER            : "Other",
 
    }
 

	
 

	
 
PRICE_TYPE_REGULAR              = 0
 
PRICE_TYPE_TPR                  = 1
 
PRICE_TYPE_SALE                 = 2
 
PRICE_TYPE_MANAGER_SPECIAL      = 3
 
PRICE_TYPE_ALTERNATE            = 4
 
PRICE_TYPE_FREQUENT_SHOPPER     = 5
 
PRICE_TYPE_MFR_SUGGESTED        = 901
 

	
 
PRICE_TYPE = {
 
    PRICE_TYPE_REGULAR          : "Regular Price",
 
    PRICE_TYPE_TPR              : "TPR",
 
    PRICE_TYPE_SALE             : "Sale",
 
    PRICE_TYPE_MANAGER_SPECIAL  : "Manager Special",
 
    PRICE_TYPE_ALTERNATE        : "Alternate Price",
 
    PRICE_TYPE_FREQUENT_SHOPPER : "Frequent Shopper",
 
    PRICE_TYPE_MFR_SUGGESTED    : "Manufacturer's Suggested",
 
    }
 

	
 

	
 
PURCHASE_BATCH_MODE_ORDERING            = 10
 
PURCHASE_BATCH_MODE_RECEIVING           = 20
 
PURCHASE_BATCH_MODE_COSTING             = 30
 

	
 
PURCHASE_BATCH_MODE = {
 
    PURCHASE_BATCH_MODE_ORDERING        : "ordering",
 
    PURCHASE_BATCH_MODE_RECEIVING       : "receiving",
 
    PURCHASE_BATCH_MODE_COSTING         : "invoicing",
 
}
 

	
 

	
 
PURCHASE_CREDIT_STATUS_NEW              = 10
 
PURCHASE_CREDIT_STATUS_SUBMITTED        = 20
 
PURCHASE_CREDIT_STATUS_SATISFIED        = 30
 
PURCHASE_CREDIT_STATUS_NONCREDITABLE    = 40
 

	
 
PURCHASE_CREDIT_STATUS = {
 
    PURCHASE_CREDIT_STATUS_NEW          : "new",
0 comments (0 inline, 0 general)