-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AR account activity model to carepoint cph
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015-TODAY LasLabs Inc. | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
|
||
from carepoint import Carepoint | ||
from sqlalchemy import (Column, | ||
Integer, | ||
Numeric, | ||
ForeignKey, | ||
DateTime, | ||
String, | ||
) | ||
|
||
|
||
class AccountActivity(Carepoint.BASE): | ||
__tablename__ = 'CsSArActivity' | ||
__dbname__ = 'cph' | ||
|
||
id = Column(Integer, primary_key=True) | ||
acct_id = Column( | ||
Integer, | ||
ForeignKey('cp_acct.ID'), | ||
) | ||
order_id = Column( | ||
Integer, | ||
ForeignKey('CsOm.order_id'), | ||
) | ||
pat_id = Column( | ||
Integer, | ||
ForeignKey('cppat.pat_id'), | ||
) | ||
rxdisp_id = Column( | ||
Integer, | ||
ForeignKey('cprx_disp.rxdisp_id'), | ||
) | ||
org_id = Column(Integer) | ||
orig_org_id = Column(Integer) | ||
item_id = Column( | ||
Integer, | ||
ForeignKey('item.item_id'), | ||
) | ||
descr = Column(String) | ||
refno = Column(String) | ||
ct_id = Column(Integer) | ||
code_num = Column(Integer) | ||
amt = Column(Numeric) | ||
reason_cn = Column(Integer) | ||
rpt_cat = Column(Integer) | ||
qty = Column(Numeric) | ||
tax = Column(Numeric) | ||
nonrx_order_line_id = Column(Integer) | ||
store_id = Column( | ||
Integer, | ||
ForeignKey('csstore.store_id'), | ||
) | ||
batch_id = Column(Integer) | ||
batch_no = Column(String) | ||
add_user_id = Column( | ||
Integer, | ||
ForeignKey('csuser.user_id'), | ||
) | ||
add_date = Column(DateTime) | ||
chg_user_id = Column( | ||
Integer, | ||
ForeignKey('csuser.user_id'), | ||
) | ||
chg_date = Column(DateTime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015-TODAY LasLabs Inc. | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
|
||
import unittest | ||
from sqlalchemy.schema import Table | ||
from carepoint.tests.db.db import DatabaseTest | ||
from carepoint.models.cph.account_activity import AccountActivity | ||
|
||
|
||
class TestModelsCphAccountActivity(DatabaseTest): | ||
|
||
def test_table_initialization(self, ): | ||
self.assertIsInstance(AccountActivity.__table__, Table) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |