CLONE - HDTN-195522 - unable to distribute ticket for foreign currency

Issue No: IC-3598
Created 3/21/2017 2:04:45 AM
Type Bug
Priority Blocker
Status Closed
Resolution Fixed
Fixed Version 17.1
Description This issue relates to i21 Help Desk ticket. Click the link below to go to Help Desk ticket.   [HDTN-195522 - unable to distribute ticket |http://helpdesk.irely.com/iRelyi21live/i21/#/HD/Ticket/?ticket=HDTN-195522]           See helpdesk ticket for details. Database is Thompsons 99     # The shipment is for Beans but the error is for corn discount!. Have to find out why? # Contract is in USD. But scale created IR in CAD. It should create in USD. # Scale has grain discounts. But IR does not have Grain Discounts.   !http://jira.irelyserver.com../HelpDesk/redactorUpload/1b1714e3-a7c3-47ba-8192-9ab5281f0d0e.png!   !http://jira.irelyserver.com../HelpDesk/redactorUpload/0fdc2477-8dcd-49e1-874a-2262a382be6f.png!   *STEPS O REPLICATE:*   1. From System Manager > Company Configuration, set the Functional and Reporting Currency to 'CAD'.   !pastedImage_d72812_2.png! 2. Set the Vendor/ Customer default currency to 'USD'.   3. From Ticket Management > Discounts > Discount Schedule, set the Currency to 'USD' same with Discount Table.   4. From Ticket Management > click New.   5. Select Load In Type   6. Select Vendor with USD default Currency (Ex. Adept)   7. Select an Item   8. Enter Gross and Tare Weight.   9. Enter Discount Reading.   10. Click Distribute toolbar button.   *ISSUE:*   Unable to distribute ticket. Forex Rate message related to multi-currency is displaying.   !pastedImage_d72812_3.png!   Note: This is the same case when distributing Load Out Ticket.   *ACCEPTANCE:*   1. Should be able to distribute ticket.   If Functional and Reporting Currency from Company Configuration does not match with the Vendor default currency, then it should still distribute ticket and pass the Vendor/ Customer default Currency to IR/IS.   If Functional and Reporting Currency from Company Configuration has currency setup but the Vendor/ Customer has no default currency, then it should still distribute ticket and pass the default Currency from Company Configuration to IR/IS.     [~emerson.versoza] ,   As per our discussion, here is the hierarchy for retrieving the currency, forex rate type, and exchange rate:   1. CONTRACT - get contract currency (intCurrencyId) - get contract rate type. (forex rate type, intForexRateTypeId) - get contract exchange rate. (forex rate, dblForexRate) 2. ENTITY (VENDOR/CUSTOMER) - If contract currency is blank, get the vendor/customer currency id. 3. SM - If currency is blank (from #1 and #2 above), get currency from Company Configuration > System Manager > Details > Functional Currency. 4. Pass currency id, rate type, and exchange rate to IC sp. 4. IC sp: - if currency id is blank, use functional currency. - If rate type is blank/null, use default rate type from Company Configuration > System Manager > Multi-Currency > Default Rate Types > Inventory - If exchange rate is null, get the exchange from System Manager sp.