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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.01.2015, 01:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
emeadaxsupport: AX for Retail 2012: Customizing the Comments in the Product Grid for Enterprise POS
Источник: http://blogs.msdn.com/b/axsupport/ar...prise-pos.aspx
==============

The Product Receipt Grid in Enterprise POS (EPOS) has always shown additional lines of information under the main item line.  For instance, if you change item quantities, add an item that has a discount, or add comments to a line item, you will see lines like this in the grid:



Note that the comments shown on the screen aren’t necessarily the same as would print on the receipt handed to the customer – they are shown on screen as temporary information to the operator (the customer will also see the grid if you are using a dual display).

In previous versions of EPOS, the information on these lines could not be modified or suppressed.  A recent hotfix added functionality to the CustomField plug-in to allow access to those lines.  This article will show you how easy it is to modify or even suppress the information that is displayed in the grid.  Note: for general information about the CustomField plug-in, see my previous article about custom fields.

Before you can customize the line information you need to make sure you have the following hotfix installed:

  • AX for Retail 2012 (Feature Pack):  KB 2976896 (6.0.1108.7037)
  • AX for Retail 2012 R2:  KB 2978483 (6.2.1000.8330)
  • AX for Retail 2012 R3: KB 2978483 (6.3.164.3592)
  • AX for Retail 2012 R3 CU8:  No hotfix necessary, included in initial release
If you have the correct hotfix installed you will see the new PopulateItemReceiptPreviewText method in the POS Plug-ins\Services\CustomField\CustomField.cs file:

/// /// Returns the ItemReceipt Preview Text. /// /// The preview Comments. /// The pos transaction. /// The sale line item. /// List[comments] public IDictionary<span style="color: rgb(51, 51, 153); font-weight: bold;"string/span, span style="color: rgb(51, 51, 153); font-weight: bold;"string/span> PopulateItemReceiptPreviewText(IDictionary<span style="color: rgb(51, 51, 153); font-weight: bold;"string/span, span style="color: rgb(51, 51, 153); font-weight: bold;"string/span> previewComments, IPosTransaction posTransaction, ISaleLineItem saleLineItem)
This method gets called every time the product grid refreshes with information.  EPOS will automatically populate the information about discounts, quantity, etc. into the previewComments parameter.  This is a simple dictionary that you can then view and edit before it gets shown on the screen.  For example, if you set a breakpoint at the end of the method, this is what the dictionary looks like for the first line from the screenshot above:



For the first line the Dimension and Discount keys are empty strings, but the Quantity key has the string value "\r\n2 x Youth Accessory Combo Set @ 69.99"

The second item (Adult Helmet Accessory Combo Set) doesn’t have a Quantity key but it has a Discount string value:



The third item… well, the third item doesn’t have any strings stored in the dictionary:



This is because the actual line comment (which is always manually entered) is deemed important enough to always be displayed so it isn’t accessible in previewComments.  It can be manipulated in the saleLineItem but there are better places to do that than in this method.

The values that can be manipulated are these:

const string itemPreviewTextDiscountField = "Discount"; const string itemPreviewTextQuantityField = "Quantity"; const string itemPreviewTextPriceOverriddenField = "PriceOverridden"; const string itemPreviewTextDimensionField = "Dimension"; const string itemPreviewTextSalesPersonField = "SalesPerson"; const string itemPreviewTextSerialIdField = "SerialId";
To stop any of them from being shown on the screen simply set the value of that string to String.Empty:

previewComments[itemPreviewTextQuantityField] = string.Empty; previewComments[itemPreviewTextDiscountField] = string.Empty;
You can also manipulate the existing string (append text, prepend text, search and replace using regex, etc.) or simply replace the string altogether with your own string.  A good example would be use the PartnerData from either the line or transaction itself:

previewComments[itemPreviewTextDiscountField] = "Your discount is " + saleLine.PartnerData.CustomPercentDiscountField.Tostring() + " Percent.";
 

A few notes on this new customization opportunity:
  • Make sure to make your code changes outside of the #if DEBUG section in the method.
 
  • The lines (keys) are always shown in this order:  Product Comment, Quantity, Price Overridden, Dimension, Discount, SalesPerson, SerialID.  It is not possible to change the order that they are displayed but you could be clever in what string is in each key (i.e., there’s nothing stopping you from putting information about discounts into the Quantity key and vice versa).
 
  • Some of the keys in the dictionary may have multiple lines of information.  For example, there may be more than one discount.  These keys will have a Environment.Newline (\r\n) separating each item.  You may also use this technique in your custom code.
 
  • This feature introduced a minor display-only bug:  a spurious linefeed will sometimes show on the screen before any of these lines.  You can see this in the first two items on the first screenshot above.  A hotfix has been released for R3 EPOS:  KB 3027988 (6.3.1000.1096).


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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: AX for Retail 2012-R3: Customer would like to pay for Sales Orders in Retail POS that were created in Dynamics AX Blog bot DAX Blogs 0 22.11.2014 01:19
emeadaxsupport: AX for Retail 2012 R2: Run-down on Log Files Blog bot DAX Blogs 0 21.06.2013 08:11
emeadaxsupport: AX for Retail 2012 R2: Adding a Custom User Control to the POS Blog bot DAX Blogs 0 27.02.2013 07:14
emeadaxsupport: AX for Retail 2012: Customizing the Transaction Service Blog bot DAX Blogs 0 19.04.2012 01:14
emeadaxsupport: AX 2012 Retail POS installation issue Blog bot DAX Blogs 0 26.02.2012 11:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:30.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.