AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.04.2012, 08:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: AX for Retail: Two Bug Fixes for the Blank Operation “Sell Item”
Источник: http://blogs.msdn.com/b/axsupport/ar...sell-item.aspx
==============

[Note:  This article pertains to the Blank Operation in AX for Retail 2009.  While writing this, I discovered that there are additional issues with the similar functionality in the 2012 version of the plug-in.  I will update the article when those issues have been tracked down.]

As I mentioned in my previous article about the Blank Operation, there are a couple issues with the support classes provided with the blank operation.  Specifically, there are two bugs in ItemSale.cs.

The ItemSale.cs file contains the ItemSale() class.  This class provides a quick way to add items to the transaction via code.  To call the class you would use code similar to the following:



            ItemSale itemSale = new ItemSale();
           
itemSale.SellItem(ref posTransaction, "F-100006", 2);


Fix 1:

The first issue happens if you are adding an item to a brand new transaction using this method.  When creating a new transaction, a “blank” customer needs to be added otherwise the tax engine will not calculate taxes properly.  Add the bolded lines of code to correct the issue:



                posTransaction = new RetailTransaction […]


               
// initialize with empty/blank customer
                LSRetailPosis.Transaction.Customer customer = CustomerSystem.GetEmptyCustomer();
               
((RetailTransaction)posTransaction).Customer = customer;
               
((RetailTransaction)posTransaction).InvoicedCustomer = customer;
                
                
               
TransactionSystem transSystem = new TransactionSystem(posTransaction);
               
transSystem.LoadTransactionStatus();


Fix 2:

The second problem is due to the way that the BarCode object gets initialized which could cause an unhandled exception downstream.  The simple fix here is to comment out the two lines of code that initialize the object and always send a null value instead:



            // Creating a barcode info object with the item ID
            //BarcodeInfo barCodeInfo = new BarcodeInfo();
            //barCodeInfo.BarcodeId = itemID;

           
BarcodeInfo barCodeInfo = null;
If you plan on programmatically adding items to the transaction using this method, these two fixes should help you out.




Источник: http://blogs.msdn.com/b/axsupport/ar...sell-item.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: AX for Retail: The Blank Operation Explained Blog bot DAX Blogs 0 12.02.2012 22:13
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
Вопрос про Demand Planner slava09 DAX: Функционал 4 25.09.2006 11:43

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:10.