Sunday, March 20, 2011
Close Inventory AX
2. Nếu đã recalculation cho tất cả các tháng trong năm rồi thì không thể closing theo từng tháng được nữa. Mà chúng ta phải closing ngày cuối cùng của năm thôi (VD: 31/12/2010).
Và nhớ khi chọn : Specification là : Item Group.
Monday, March 14, 2011
Closing and Adjustment Inventory management Axapta(AX)
Five Steps to Complete Your Microsoft Dynamics AX Inventory Close for 2009, and Prepare for 2010
I recently provided guidance for handling the inventory close process using Microsoft Dynamics AX. In this followup article, I provide five steps for completing the year-end 2009 inventory close in such a way that you prepare your organization for handling the same process more efficiently in 2010.1. Prepare to run the inventory close.
Before you perform the inventory close, the following tasks are recommended:
--Make sure that the inventory model assigned to the item on the Inventory model tab of the Inventory model groups form is accurate. Inventory close will settle transactions to each other based on the current inventory valuation method assigned to the item.
--View or print the Open quantity report by clicking Inventory management > Periodic > Closing and adjustment > Close procedure > 1. Check open quantities. This report will print a list of inventory transactions that will remain open after the inventory close is performed.
For example, you have an item that includes the following transactions:
- Inventory physical receipt for a quantity of 10
- Inventory financial issue for a quantity of 3
In this case, the report will show an open quantity of 3, since this financial issue cannot be settled to any transactions. The Open quantity report also includes a Show receipts option that lets you view all the physical receipts posted for an item and all the open quantities that will remain after an inventory close for the date specified.
--Print or view the Investigation of cost price for receipts report by clicking Inventory management > Periodic > Closing and adjustment > 2. Check cost prices. This report allows you to enter a maximum deviation percentage. Items that appear on this report will be only those exceeding the maximum deviation percentage. The deviation is based on the item cost price, item or median cost price, or median.
2. Complete the inventory closeInventory close will settle issue transactions to receipt transactions based on the inventory model you have selected in the item's inventory model group setup. You also have to choose the general ledger updated to reflect the adjustments created.
To close the inventory:
--Inventory management > Periodic > Closing and adjustment > Close procedure> Close
To open the Close inventory form.
--In the Close inventory up to field, type or select the end date up to which you want to close inventory.
--Select the Run recalculation after closing check box if you want to run a recalculation up to the current date after the closing has completed.
--Set any other options you want to choose for this inventory close.
--Click OK.
After inventory close has completed, the results will be reported in the Closing and adjustment form.
Steps that are performed by the Inventory Close routine:
When you run the Close routine, Microsoft Dynamics AX performs the following steps:
--Checks whether any Recalculations were run after the date that you choose for your Close. Microsoft Dynamics AX will cancel any of those later Recalculations before the Close can start.
--Puts all the items that are to be processed into a queue. These items are stored in the InventCostListtable.
Note: While a Close or Recalculation is processing, you can click Calculation/Calculation List from the Close & adjustment form to view the data in the InventCostList table. This shows which items are still to be processed by the Close or Recalculation process.
--Process each item from that queue sequentially. Microsoft Dynamics AX performs the following for each item:
- Settles individual receipts and issues against one another for the item according to the Inventory Model Group such as FIFO, Weighted Average.
- Makes any required cost adjustments to the issue that was settled based on the cost of the receipt(s) against which the issue was settled.
- Updates the inventory transactions to show the settlement and cost adjustment data.
- Writes the settlement data into the Inventory Settlement table. The data will include records that show explicitly which Receipt(s) were settled to each Issue in addition to any cost adjustment that is made to the Issue that is settled.
--As soon as all possible transactions are processed for that item, Microsoft Dynamics AX looks for any transactions that are fully settled, and then updates those transactions to "Closed"
--As soon as all the items are processed, the settlement records that were created are read and sorted by General Ledger Account. Then, Microsoft Dynamics AX summarizes all the cost adjustments that were made, and a General Ledger Journal is created and posted.
--If you select the Run recalculation after closing check box in the Close dialog box, a Recalculation will be run for all items up to today's date.
3. Handle the Inventory Recalculation Process
The recalculation process matches inventory receipts and issues for the transactions that are not financially matched through inventory dimensions in order to determine the real value of the on-hand inventory.
To recalculate the inventory, follow these steps:
-- Click Inventory management > Periodic > Closing and adjustment > Recalculation to open the Recalculation form.
-- If you want to select specific items or item groups to be recalculated, click Select. Your selection displays in the Items field group.
-- In the Recalculate inventory up to field, type or select a date up to which you want the inventory to be recalculated.
-- Fill in the remaining fields as required.
-- Click OK to start the recalculation.
The Inventory Recalculation routine performs a similar job to the Inventory Close routine. However, there are a few differences. When you run the Recalculation routine, Microsoft Dynamics AX performs the following steps:
--Checks whether any Recalculations were run after the date that you choose to run your Recalculation up to. Microsoft Dynamics AX will cancel any of those later Recalculations found before your Recalculation routine can start.
--Puts all the items that are to be processed into a queue, and then store the queue in the InventCostList table.
--Process each item from that queue sequentially. Microsoft Dynamics AX performs the following for each item:
- Makes a "virtual" settlement between individual receipts and issues for the item according to the Inventory Model Group such as FIFO, Weighted Average. This is a "virtual" settlement because it occurs in the Recalculation's calculations. However, the detailed settlement data that shows the explicit matching of each issue to the various receipts is not stored in the InventSettlement table. The only data that is stored is the cost adjustment that is made to the issue.
- Makes any required cost adjustments to the issue that was settled based on the cost of the receipt(s) against which the issue was settled.
- Writes a single settlement record for any cost adjustment that is made for that Issue into the Inventory Settlement table.
--As soon as all the items are processed, the cost adjustment settlement records that were created are read, sorted by General Ledger Account, and summarized and posted in a General Ledger Journal.
--Along with recalculation, you can also perform the following functions from the same window:
- Cancel later Recalculations. This process indicates that any existing recalculations dated after the close inventory up to or recalculate inventory up to date will be automatically cancelled or reversed before you continue with the closing or recalculation.
- Recalculate inventory up to. The system date will be proposed by default. You can change this date, but only to a date after the latest closing.
- You can also pause and resume the recalculation.
4. Distinguish between recalculate and close.
--Inventory recalculation results in adjustments that match inventory receipts to issues. Unlike inventory close, it will not make a settlement and close a transaction.
--The same parameter settings are available for inventory recalculation as for inventory close, but inventory recalculation can be performed on a subset of inventory items. Inventory close must be performed on all inventory items.
--Since inventory recalculation can be run on a subset of items, and because inventory recalculation will not make an adjustment for less than the throughput amount, it is not as accurate as an inventory close and should not be relied on to replace inventory close.
5. Determine if cancellation required.
The latest closing, recalculation, on-hand or transaction adjustment made can be cancelled. This may be necessary if, for accountancy purposes, you need to make transactions in the inventory in a closed period. The closing is canceled, but it can still be viewed on the overview tab of the closing and adjustment.
Only cancellation of the last closing made is allowed. Because closings are in effect up to a particular date, if closings are canceled in periods between two other closings, there would be gaps in the closing.
Reverse completed recalculation:
In some cases, you may need to reverse a completed inventory recalculation, returning adjustments to the state they held before adjustments were made.
Reverse a completed closing:
In some cases, you may need to reverse a completed inventory close, returning settlements to the state they held before adjustments were made. When you reverse a completed inventory close, inventory is also reopened to allow for posting in the valid period.
Leveraging the inventory close process to your ongoing advantage:
-- Going forward in 2010, run inventory closes on a monthly basis in order to make the Fiscal year process simple on the year end.
-- Try to record inventory data sequentially i.e. Receipts followed by issues date-wise
-- Inventory close is the first step in the fiscal year close process, so try to do it ASAP
-- You can still record transactions for the next year even if annual inventory close has not been run.
-- Finally, and perhaps most obviously, year-end inventory values should be accurate.Thursday, November 25, 2010
Workflow là gì?
Định nghĩa đơn giản nhất của workflow: là các định nghĩa của các qui trình đã chuẩn hóa. Và khi mình viết các module cho từng công việc, workflow là 1 chuỗi công việc phải làm. Thường thì các công ty nước ngoài hoặc các doanh nghiệp lớn mới có được sự ổn định trong các quy trình làm việc, nên workflow của họ thường là 1 dòng chảy thống nhất, ví dụ: A –> B –> C –> D. Tuy nhiên ở các doanh nghiệp Việt Nam, sự ổn định trong dòng chảy đó thường là hiếm, nên nhiều khi các ERP có workflow phải thường là workflow động. VD, tại một thời điểm X thì workflow của phòng SX là A –> B –> C –> D, tuy nhiên có thể tại thời điểm Y thì workflow đó được thay đổi là: B –> A –> C –> D, và … Tuy nhiên để rộng đường tìm hiểu workflow, tôi xin mượn ý kiến của 1 bài viết mà tôi đã có dịp đọc được trên mạng (hình như là của PAT). Theo bài viết đó thì workflow trong một ERP thể hiện ở các yếu tố căn bản sau :
1. Các quy trình và khả năng xử lý công việc theo trình tự công việc. Ví dụ trình tự công việc cho việc mua hàng trong hệ thống ERP minh hoạ như sau : Các bộ phận có nhu cầu mua hàng xây dựng yêu cầu mua hàng POP (Purchase order Proposal) -> phòng mua hàng -> Nhân viên phụ trách mua ứng với từng loại hình xem xét -> Đề nghị mua hàng của bộ phận mua hàng -> phê duyệt của lãnh đạo phòng -> đề nghị báo giá hoặc đấu thầu -> đánh giá nhà cung cấp -> lựa chọn NCC-> lập đơn hàng chính thức PO -> nhận khẳng định cung ứng từ NCC -> theo dõi nhận hàng -> nhận hóa đơn từ NCC -> chuyển hoá đơn đến kế toán thanh toán….
2. Khả năng xem xét trình tự công việc và phê duyệt công việc trên hệ thống . Lúc này việc hoạch định phân quyền cho từng bước xử lý công việc của mỗi một quy trình phải nghiêm ngặt để đảm bảo tính đúng đắn của thông tin và truy cứu trách nhiệm sau này.
3. Giống như ví dụ workflow động mà tôi nêu trên, cái này được thực thi qua hệ thống tham số quy trình nghiệp vụ và khả năng ánh xạ tham số vào thiết lập quy trình nghiệp vụ (mapping). Đây cũng là một chỉ tiêu rất quan trọng để đánh giá khả năng của một ERP. Một vài ví dụ trong hệ thống tham số mà mình đã thiết lập. DN vừa có một Khách hàng mới. Do thời gian ban đầu muốn có những ưu đãi DN có thể quyết định không tính phạt chậm trả cho thanh toán trễ cũng như vẫn cho phép xuất hàng khi tổng công nợ + doanh thu lớn hơn tín dụng (tất nhiên là trong một phạm vi nào đó) lúc này các tham số phạt chậm trả bằng “No”, giao hàng có giá trị “Yes”. Một thời gian sau DN có thể thay đổi quy trình này bằng tham số phạt chậm trả bằng “Yes”, giao hàng có giá trị “No” hệ thống sẽ tự động tính phạt lãi suất chậm trả ứng với từng lần thanh toán chậm và khi khách hàng mua vượt quá tín dụng hệ thống sẽ bắt buộc phải phê duyệt lệnh xuất hàng này từ lãnh đạo.
Nói chung đây là một ví dụ về tham số và còn rất nhiều tham số khác
khongianit
Sunday, November 14, 2010
Reducing the Size of your Database in SQL Server 2005/SP2
An exciting new feature in SQL Server 2005/SP2 is Vardecimal Storage Format. This storage format lets you reduce the size of your table significantly if the table has one of more columns of type decimal or numeric without requiring any changes to your application.
Up until now, the decimal and numeric types are stored as fixed length data in SQL Server. Both of these types are functionally equivalent and have a format of (p, s) where p is the precision (number of decimal digits) and s is the scale representing number of digits after the decimal. Depending on the precision (it can be declared in the range from 1 to 38), the decimal value can take anywhere from 5 bytes to 17 bytes. This can bloat the size of the table, especially when you have small decimal values for a column declared with high precision requirement. This issue is similar to char (17) vs. varchar(17). In this case, if most of your character data is 1 or 2 characters long but the max value is 17 characters long, you can reduce the size of the table by declaring the column to be of type varchar(17) instead of char(17).
The new vardecimal storage format stores the decimal/numeric values in a variable length storage format. It provides efficient storage of decimal/numeric data by eliminating the leading/trailing zeros and only storing the minimum required bytes. Using this format, you can get significant space savings (depending on your data distribution) in the space required to store decimal/numeric data. You can enable vardecimal storage format at a table level.
In our in-house testing, we have seen significant reduction in the size of the FACT table(s) that has large number of decimal columns. FACT tables are typically the largest table in a Data Warehouse. Here are some the numbers from our testing.
Best case reduction in the size of the table |
57% |
69% |
51% |
In my next post http://blogs.msdn.com/sqlserverstorageengine/archive/2006/11/13/estimating-the-space-savings-with-vardecimal-storage-format.aspx , I will describe when and how to enable Vardecimal storage format on one or more tables in your database.
Thursday, October 7, 2010
Using Dynamics 'AX .NET Business Connector' to access Dynamics AX 4.0 from .NET world
So, this is a really interesting integration aspect between AX and .NET apps. We want to access AX business logic (or data, transactions, etc.) from the .NET world. :-)
Requirements
Before starting to develop anything, we need to install several required components:
In my case, I’ve got a single development machine where I have installed everything. I mean:
- SQL Server 2005
- Dynamics AX 4.0
- AX .NET Business Connector
- Visual Studio 2005 (for .NET development)
- We could also install ‘Windows SharePoint Services’ and the ‘AX Enterprise Portal’. It also uses .NET Business Connector for accessing AX, but in this case, we are just talking about .NET and AX. I’ll maybe post about ‘AX Enterprise Portal’ and Windows SharePoint Services in another posting. J
So!, the AX .NET Business Connector allows accessing Microsoft Dynamics AX from our own .NET applications as though they were a native Microsoft Dynamics AX client. So any .NET app or even ASP.NET web-app could access AX business components using this connector. For instance, as I already said, the ‘AX Enterprise Portal’ (based on Windows SharePoint Services and .NET) uses .NET Business Connector to access AX business logic.
BTW, internally, all these integration technologies interact with Dynamics AX through Application Object Server (AOS), which is kind of the ‘Business Components Application Tier’ within AX architecture itself.
AX .NET Business Connector installation and configuration
Before installing Business Connector, the following must be available in the domain:
- A core Microsoft Dynamics AX installation. This installation can be completed at the same time as the Business Connector installation, or it can be done prior to this installation.
- Active Directory configured in native mode.
By default, it uses Windows authentication security (AD), so it can be also integrated with AX Enterprise Portal (based on Windows SharePoint Services, which also uses Windows security). This security authentication type is important to have it into account when accessing from our own .NET apps.
We also need a Windows domain account to act as the Business Connector Proxy. So we need to configure the Business Connector if our application requires "act-on-behalf-of" functionality for external users or users that are at times unable to connect to our application.
So, for instance, I created an account within Windows Active Directory, called MyDomain\bcproxy. That account is going to be my ‘proxy account’.
Remember to assign a password to the user, select the Password does not expire option and select the No interactive logon rights option.
(Optional) Adding the proxy account to the IIS local Windows group.
For Web applications, we must add the Business Connector proxy account to the IIS local Windows group. If you are using Windows SharePoint Services, you must also add the account to the Windows SharePoint local Windows group.
1. Open the Computer Management application (Start > Administrative Tools > Computer Management).
2. Expand the Groups folder under Local Users and Groups.
3. Add the Business Connector proxy account to the following groups:
- IIS_WPG (IIS Worker Process Group)
- STS_WPG (STS Worker Process Group), if running Windows SharePoint Services
(Optional) Configure the IIS application pool
For Web applications, you must associate the Business Connector proxy account to the appropriate application pool identity.
Installation of ‘.NET Business Connector’ setup-app.
So now we are ready to install ‘.NET Business Connector’ from normal AX setup.exe DVD, but we have to select that we want to install it. ;-)
The setup’s steps and quite normal, almost just the ‘next, next’ stuff.
Configure the Business Connector Proxy User
The last step is to configure the Business Connector Proxy User within AX configuration:
1. Start Microsoft Dynamics AX (Start > All Programs > Microsoft Dynamics > Microsoft Dynamics AX 4.0 Client).
2. Open the Business Connector Proxy dialog box: Administration > Setup > Security > Business Connector Proxy.
3. In the Alias box, enter the alias. In the Network domain box, enter the domain of the user and then close the dialog box.
Implementing a sample AX class to consume it
So now we’re starting one of the fun tasks!!
We are going to implement a basic X++ class with a simple method. Just for testing.
So, within Dynamics AX client, open the AOT (Application Objects Tree):
Then, let’s create a new simple class, like the following:
So, I’ve created a very simple method called ‘Salute()’, which accepts a single string parameter (a name) and then it responds with a salutation. It is very simple, just a testing method for accessing AX from .NET world. J. Here is the Salute() method code:
X++ Code:
client server public static str Salute(str name)
{
str salute = "Cheers " + name + "! from AX!";
;
return salute;
}
Great!, very simple!. An if you are used to C# or C++, X++ it is quite similar!.
So now, we could test this method calling it from an AX JOB. But, we’re directly to execute it calling it from .NET (developing with Visual Studio 2005) through the ‘AX .NET Business Connector’.
Ok, I’ve created a simple WinForms application project called NetBcWinFormsTest. Take into account that this is just for testing. If it were a real application (.NET WinForms client as presentation layer), may be we’ll use a Web-Service or WCF-Service in between (for remote calls).
So, here we can see VS.2005 with our simple WinForms proyect, and a single Windows form with a button:
So now, we have to add a reference to the ‘AX .NET Business Connector’ .NET assembly, which is the ‘Microsoft.Dynamics.BusinessConnectorNet.dll’.
We have to add it using the ‘Add ReferenceàBrowse’ option, selecting the physical .dll situated on:
C:\Program Files\Microsoft Dynamics AX\40\Client\Bin\Microsoft.Dynamics.BusinessConnectorNet.dll
Ok, now we are ready for programming some C# code (or VB.Net code, of course).
Let’s double click on our simple button, and add the following code:
A ‘using’ sentence (just like a shortcut for our C# code):
| using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
using Bcn = Microsoft.Dynamics.BusinessConnectorNet;
namespace NetBcWinFormsTest { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void btnAccessAX_Click(object sender, EventArgs e) { // Create a BCN object Bcn.Axapta axp; axp = new Bcn.Axapta(); try { // In this case there’s no need for credentials, it is taken from Winforms execution // because this is just a sample testing application. // but if it were an ASP.NET app, we should provide specific credentials. axp.Logon(null, null, null, null); } catch (Exception excepn) { MessageBox.Show(excepn.ToString()); return; } //Calling the X++ static Method!!. string salutation; salutation = (string)axp.CallStaticClassMethod( "CdltllDemoBcnClass", // The class name. "Salute", // method's name. "CESAR"); // Parameters. MessageBox.Show(salutation);
axp.Logoff(); // } } } |
Take a look to the selected code and read all the C# comments within that code.
Note that we are instancing a standard BCN object using the class (Microsoft.Dynamics.BusinessConnectorNet.Axapta), and then, when calling the ‘CallStaticClassMethod()’ method, we have to provide all the X++ class and method information.
So!, the resulting execution in our .NET App is the following…:
Not a very impressive graphics interface, but we are getting that result from within Dynamics AX business logic!! J.
Next step is getting real data from AX tables and AX business classes.
Getting AX real Data (Updated - November 28th 2007)
So, now, we're going to add a new functionality to our little .NET program. In this case, we are going to invoke AX classes to get real AX data. For instance, we're going to get data about Vendors.
Then, we add another simple button to our .NET form, and also a DataGridView where we'll show that data. It would look like the following:
Then, we add the following code to be triggered from our second button:
A ‘using’ sentence (just like a shortcut for our C# code):
|
private void btnAxDataAccess_Click(object sender, EventArgs e) {
} // Create an ADO.NET DataTable ‘on the fly’ public DataTable CreateVendorDataTable() {
} |
So, what we are doing is using the AxaptaRecord class to select and get all the records from AX data. Keep in mind one important thing. Unlike ADO.NET, which is connectionless oriented, AX data access classes are connection-oriented. I mean, once you have selected what you want, you have to loop over it in a connected environment. In this case, what I am doing is looping through all the records and creating an ADO.NET DataTable 'on the fly' (could be within a DataSet). After having a DataTable or DataSet we could return it to any other .NET assembly or, as in this case, we just make a DataBinding with our GridView, so we show all the records.
Or course, in a real Application and depending of data volume, we should filter data based on kind of 'data pages' or 'data windows', so we won't fill a single DataTable with all the AX table data.
So, if we execute it, we'll get all that AX data!.
Magic between .NET and Dynamics AX?. :-)
Sunday, September 26, 2010
reverse settlement account
Thursday, September 9, 2010
How to Upload Opening Balance for Bank in Microsoft Dynamics AX 2009
This article provides you the steps to upload bank opening balance in Dynamics AX 2009.
Bank opening balance scenario: Normally, a bank has un-reconciled transactions at end of the any period. Hence, when a company needs to upload bank opening balance, all reconciled transactions balance is updated as one transaction and all un-reconciled transactions as individual entries. For example, a company receives their bank statement dated 31st December and shows an ending credit balance of $100,950, of which $950 is the sum of un-reconciled transactions while $100,000 has been reconciled. Section 1: Setup Journal, Bank and Ledger accounts for bank. (NOTE: Follow this section only if Journal, bank, and ledger accounts are not created otherwise go to section 2) Section 2: Enter reconciled balance for the bank. Follow the steps below to update the reconciled balance. Note: Step 2.7, ledger account for bank is selected to ensure that balance gets nullified in chart of accounts. So, when user enters the trial balance, user doesn’t need to worry about bank ledger accounts. Section 3: Enter un-reconciled transactions for the bank. Follow the steps below to enter all un-reconciled transactions. 2.1. Date = date for Opening balance (as an example 01-Jan-2009) 2.6.1. Payment reference = document details Use below table to simulate and get an opening balance as highlight above. Account type Account Transaction text Debit Credit Bank transaction type Payment reference Bank USDBANK un-reconciled bank transactions as at 01-Jan-2009 350 01 Doc 1 Bank USDBANK un-reconciled bank transactions as at 01-Jan-2009 1200 01 Doc 2 Bank USDBANK un-reconciled bank transactions as at 01-Jan-2009 150 01 Doc 3 Bank USDBANK un-reconciled bank transactions as at 01-Jan-2009 700 01 Doc 4 Bank USDBANK un-reconciled bank transactions as at 01-Jan-2009 1000 05 CHQ 1 Bank USDBANK un-reconciled bank transactions as at 01-Jan-2009 450 05 CHQ 2 Ledger 111111 Opening transactions balance 950 Section 4: Reconciled opening balance ‘reconciled’ transaction. We have $100,000 entered as bank reconciled opening balance. Hence, we need to reconcile it. Follow the steps below to complete the process. Upon completion, only those unreconciled open transaction will appear as un-reconciled transactions. Section 5: Settle and close the temporary bank account. Section 6: Verify all balances and bank transactions on posting of trial balance. NOTE: It is assumed that trial balance has been entered.
------------------------------------
-----------
-----------
2.1. Date = date for opening balance
2.2. Account type = Bank
2.3. Account no. = ‘USDBANK’
2.4. Transaction text = appropriate text (‘Reconciled opening balance for the year 2009)
2.5. Credit = 100,000
2.6. Offset A/c type = ‘Ledger’
2.7. Account no. = 111110 (Ledger a/c code for bank)
-----------
2.2. Account type = Bank
2.3. Account no. = ‘USDBANK’
2.4. Transaction text = ‘un-reconciled bank transactions as at 01-Jan-2009’ (as an example)
2.5. Debit amount = transaction amount.
2.6. Go to the payment tab, and enter values in following fields
2.6.2. Bank transaction type = Cheque or deposit etc. from available types.
-----------
-----------
-----------
(Source Micorsoft Dynamics AX 2009)