Last active
August 29, 2015 14:03
-
-
Save elconde/fe3fe1d7b520c543af4d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| """ | |
| Update the quotation to per 100 unit instead of Pound | |
| Workaround for AR682829 | |
| """ | |
| import acm,ael | |
| import FLogger | |
| logger = FLogger.FLogger(__name__) | |
| POUND = ael.Quotation['Pound'] | |
| AMBA_DL_USERID = 'AMBA_DL' | |
| # Only AMBA DL should be doing this | |
| isAMBADL = ael.user().userid == AMBA_DL_USERID | |
| def doit(e,op): | |
| return \ | |
| isAMBADL and \ | |
| e.record_type == 'Instrument' and \ | |
| op != 'Delete' | |
| def validate_transaction(transactionList): | |
| newList = [] | |
| for e,op in transactionList: | |
| if doit(e,op): | |
| quotation = e.quotation_seqnbr.name | |
| if quotation == 'Pound': | |
| logger.LOG( | |
| 'Instrument %s: Updating quotation to Per 100 Units (was %s)', | |
| e.insid, | |
| quotation | |
| ) | |
| e.quotation_seqnbr = POUND | |
| e.quote_type = 'Other' | |
| newList.append((e,op)) | |
| return newList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment