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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 14.10.2014, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
kurthatlevik: Dynamics AX 2012 R3: Global recommended retail price
Источник: http://kurthatlevik.wordpress.com/20...-retail-price/
==============

Maintaining retail prices in a multi company and franchise scenario can be a challenge in Dynamics AX 2012 R3. Let say we have a retailer with stores in many countries. We often also see owner structures that makes us model the retail chain with many companies.

I’m currently in an implementation to an international retailer present in 22 countries, and it keeps growing every day. To model this we need to create one Dynamics AX company per country and per partner.

The ability to maintain and control prices in such a scenario is a challenge, because prices is a property of a released item. (PriceDiscTable)

So we decided to create very small customization so that we could keep track of prices and item barcodes on the product instead of the released product level.



By doing this, the product managers have one screen where they can create and maintain product prices. The prices can be specified per currency, country and company/partner. But this is not just a simple table, but a two-way frontend for populating the standard AX price tables.

We therefore have a shared table:


The code for publishing prices into standard AX, using the price journal posting looks like this:

void publishProductRetailPrices(){ #Admin #Zebra DataArea dataArea; PriceDiscTable priceDiscTable; PriceDiscAdmTable priceDiscAdmTable; PriceDiscAdmTrans priceDiscAdmTrans; PriceDiscAdmCheckPost priceDiscAdmCheckPost; InventDimId inventDimId; Ledger ledger; CompanyInfo legalEntity; LogisticsAddressCountryRegionId countryRegionId; #define.ImportPriceDiscJournalName("Prices") PriceDiscAdmName priceDiscAdmName; ttsbegin; while select Id from dataArea where dataArea.Id != #DATCompany { changecompany(dataArea.Id) { legalEntity = CompanyInfo::find(); ledger = Ledger::findByLegalEntity(legalEntity.RecId); countryRegionId = CompanyInfo::find().postalAddress().CountryRegionId; this.createOrUpdatePriceGroup(); if (this.RefCompanyId == dataArea.Id || this.CountryRegionId == countryRegionId || (this.RefCompanyId == "" && this.CountryRegionId == "" && this.CurrencyCode == ledger.AccountingCurrency)) { if (InventTable::exist(this.ProductNumber)) { priceDiscAdmName = this.findOrCreatePriceDiscAdmName(#ImportPriceDiscJournalName,"@SYS342509"); priceDiscAdmTable.clear(); priceDiscAdmTable.JournalName = priceDiscAdmName.JournalName; priceDiscAdmTable.Name = priceDiscAdmName.Name; priceDiscAdmTable.insert(); priceDiscAdmTrans.clear(); priceDiscAdmTrans.initValue(); inventDimId = InventDim::findOrCreateBlank().InventDimId; while select firstonly priceDiscTable where priceDiscTable.Relation == PriceType::PriceSales && priceDiscTable.ItemCode == TableGroupAll::Table && priceDiscTable.ItemRelation == this.ProductNumber && priceDiscTable.AccountCode == TableGroupAll::GroupId && priceDiscTable.AccountRelation == #RRP && priceDiscTable.Currency == this.CurrencyCode && priceDiscTable.InventDimId == inventDimId && priceDiscTable.PriceUnit == this.PriceUnit { priceDiscAdmTrans.initFromPriceDiscTable(priceDiscTable); } priceDiscAdmTrans.Relation = PriceType::PriceSales; priceDiscAdmTrans.ItemCode = TableGroupAll::Table; priceDiscAdmTrans.ItemRelation = this.ProductNumber; priceDiscAdmTrans.AccountCode = TableGroupAll::GroupId; priceDiscAdmTrans.AccountRelation = #RRP; priceDiscAdmTrans.Currency = this.CurrencyCode; priceDiscAdmTrans.InventDimId = inventDimId; priceDiscAdmTrans.PriceUnit = this.PriceUnit; priceDiscAdmTrans.JournalNum = priceDiscAdmTable.JournalNum; priceDiscAdmTrans.QuantityAmountFrom = 0; priceDiscAdmTrans.Amount = this.Amount; priceDiscAdmTrans.UnitId = InventTable::find(this.ProductNumber).salesUnitId(); priceDiscAdmTrans.SearchAgain = NoYes::Yes; priceDiscAdmTrans.insert(); if(priceDiscAdmTable.RecId) { priceDiscAdmCheckPost = new PriceDiscAdmCheckPost(false); priceDiscAdmCheckPost.initJournalNum(priceDiscAdmTable.JournalNum); priceDiscAdmCheckPost.run(); infolog.clear(); } } } } } ttscommit;}


Источник: http://kurthatlevik.wordpress.com/20...-retail-price/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
DAX: Microsoft Dynamics AX 2012 R3: a preview Blog bot DAX Blogs 0 05.11.2013 15:11
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
dynamics-community.at: Dynamics AX 2012 Trainings Blog bot DAX auf Deutsch 0 19.06.2012 18:11
Dynamics AX Sustained Engineering: Servicing of Dynamics AX 2012 and Dynamics AX 2012 Feature Pack Blog bot DAX Blogs 0 08.05.2012 23:12
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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