Friday 8 December 2017

Financial Management Module - General Ledger ( Part - 2 )

If you haven't gone through General Ledger ( Part - 1 ) go back to General Ledger (Part - 1) read it and come back to this blog.

As I said in previous blog,
To start with few scenario's of General Ledger, Let's register some equity into our newly owned company. So, firstly what is equity?

Put simply, equity is ownership.
In the trading world, equity refers to stock.
In the accounting and corporate lending world, equity (or more commonly, shareholders'equity) refers to the amount of capital contributed by the owners or the difference between a company's total assets and its total liabilities.
Equity can be also summarized as net worth.

I will be explaining more about General journals transaction with these 3 scenarios.
Once the transaction is posted the result can be verified in General Ledger (Chart of Accounts).

Scenario 1:

On opening a new company I, the owner thought to put on 10,000$ of equity to be registered into the bank account.

To record this transaction,

Go to general journal

Account type: G/L Account, 
Account No.: Equity

Since its a cash deposit entry of bank account, account needs to be bank account but we shouldn't directly book it through G/L instead we need to process through bank account otherwise it will be out of sink.

We need this particular debit (Equity) to be increased on bank account so that it registers the transaction both on bank a/c card and G/L Account.



A credit of $10,000 is going to be registered on our equity account.
Balancing account which will be $10,000 worth of debit will go into our bank account because our bank account posting group setup it will in turn be registered on our G/L bank account.

Fill the Document no., (can fill by clicking apply automatically in ribbon or filling some desired value in Document no. field).

Post the journal line. (journal lines will be successfully posted).


We can verify the change in transaction in Chart of Accounts as shown in above fig.

We can also verify the update value of balance in bank account card as shown in above fig.


We can also see the transaction represented in Bank account ledger entries.


Scenario 2:

One of the owner wants to give 2 cars to the company, he doesn't want to give any cash for shares, as a part of equity he wants to give 2 of his cars.

Go to chart of accounts

Lets create another account in chart of accounts relating to car transactions(because after this transaction company expects to own 2 cars).
New account Car adding as an asset in balance sheet

A new car account has been created on clicking OK


We need to register the further increase in equity because company has a increase in value it also means that increase in asset because the company now owns these 2 cars.

Enter the desired values in journal lines of General journal and post it.



We can see in the above fig. Equity is credited(-$1000) and Cars account is debited($1000) means, Cars account is now holding a balance of $1000.

Journal balances as a total to zero.


You can verify the transaction of Cars and Equity account balance in chart of accounts as shown in above fig.



Scenario 3:

Our accountant comes and says, we're not allowed to post 2 cars in same G/L Account because one is a small car and other one is a truck. We need to create 2 separate G/L Account and we need to move $1000 worth of asset which is there now in Cars account to 2 new accounts.

Lets create 2 new accounts,
1. Small car
2. Truck

We can rename the current account Cars to Small car and recreate another one. But lets create 2 different account separately for Small car and Truck, this will also give a way to learn 3 legged posting in general journal.

New account Small Cars created
New account Truck created

Now lets do the transaction back in General Journal,

1. We need to move $300 from Cars account to newly created Small Cars account.
2. We need to move $700 from Cars account to newly created Truck account.

To do this, 
Cars has to be credited -$1000 
Small car has to be debited $300 and 
Truck has to be debitted $700.

Enter the desired values in journal lines of General journal and post it.

Fig. below of general journal 3 legged posting transaction explains in details about making this posting.

As shown in the fig. now the value of $1000 from Cars account is split into 2 different account small cars and truck and you can verify the same back in chart of accounts..



Now we're done with General Ledger 1 legged, 2 legged and 3 legged transactions. Hope this blog helps you guys. 

Stay tuned in this blog, will be coming with few other topics of financial management like Receivables, Payables, Fixed assets, Cost Accounting and many other functional modules.

Any questions, drop into my mail id, mail2harikiranbm@gmail.com

Thursday 23 November 2017

Financial Management Module - General Ledger ( Part - 1)

General Journals:

They are used to post information into general ledger and other accounts. I have used cronus canada company as an example in this blog.

fig. 1, General Journals


  • General Journals are also used to post cost allocations and other adjustments to the accounts.
  • Its also used to enter information into recurring journals which are used when the company needs to allocate recurring entry lines in addition,
  • General journals enable users to reverse and correct incorrect entries when necessary.
  • General journals are used to enter data into the general ledger accounts and other accounts such as customers, vendors and banks. 

Journal entry system has 3 layers,
1. Journal templates,
2. Journal Batches
3. Journal Lines


                                          fig. 2 and fig. 3, shows hierarchy of Journals.









Although, all these 3 layers are always present, Only journal lines and batch name will display in a journal window.

You can refer to my another blog regarding Overview of Journal Template, Journal Batch and Journal Lines to know about 3 layers of journals in detail.

Journals are used for different types or groups of entries and can be applied to other application areas such as purchase, sales, cash receipts, payments, intercompany (IC).

fig 4, shows different types of journals


  • Each journal type is setup with its own journal template.
  • Journal template is used to provide the basic journal structure and to specify default information for all batches.


There're several standard general journal templates set up in the application areas, these templates cover the most common routines that're used in the program.

In all journal templates, entries can be posted to the general ledger, customer, vendor and fixed asset accounts.

Some standard templates are automatically setup with the default batch as shown in below fig.

fig. 5, template holding setup as default batch 


  • Journal batches are created based on journal templates.
  • Batches that are created from a specific template have identical structure, default settings and information. These similarities are defaults that can be changed for each journal batch.


Journal batches are frequently used to separate one users entries from another.

For ex.
Accounting manager and the book keeper.


fig 6, accounting manager and book keeper

Accounting manager makes entries and post them later upon approval.
To keep accounting manager entries from becoming mixed with bookkeepers entries separate batches are assigned to the two users.

Journal lines are the entries that must be posted.

Information entered in journal lines includes account no.'s, posting date, amounts, offsetting accounts.
fig 7, information to be entered in different fields of journal lines

The lines entered in journal are temporary and can be changed as long as the journal has not been posted.


Journal lines can be entered in different ways,

For a simple journal - where debit amount equals credit amount, it can be entered on a single journal line with the use of the balance account on that line. Each line is balanced itself.

fig 8, simple journal line
(Balance account no. included for balancing the amount)

For more detailed entries, an account can be entered on each line with an associated transaction amount while leaving the balancing account blank all lines will balance as a group.

fig 9, more detailed entries in journal line
(Balance account no. not included, balancing happens based on amount values in 2 different lines)

I will discuss with some more Live examples of General Journal transactions in my next blog with 3 scenarios, Stayed tuned on this blog.

Any doubts? Drop your questions to my mail id,
mail2harikiranbm@gmail.com

Tuesday 21 November 2017

Stock Management in Microsoft Dynamics NAV 2017

Stock Management 2017:

In NAV you can setup multiple location which allows companies to manage business operations within one database.

Location:
a place that handles physical placement and quantities of items.

Stock keeping unit:
An item or a variant of an item at a specific location.

Managing multiple locations:
At location level on a stock keeping unit card we can add:
1. Replenishment information(restoration of stock to former level)
2. Addresses
3. Financial posting information.


Ex.
Item 70003
Navigate -> Stockkeeping Units

To view transaction of item we go to Item Ledger Entries. .
Item Statistics - Different piece of statistic for this item based on criteria entered.

We can setup unlimited no. of UOM.

UOM: is a definite magnitude of a quantity.

  • It is used as a measurement of same kind of quantity. .
  • A unit of measure is assigned to all inventory items and must be defined before a product can be entered. 
  • Each product will have a stocking unit of measure, sales ordering unit of measure and a purchasing unit of measure.

Unit of measure can also have automatic conversions to other units of measures by way of a conversion factor

Ex. for item 80100 - Printing paper

Base UOM - Box
Sales UOM - Pack
Purch. UOM - PALLET

All the UOM values are inter-related to each other.
Each uom is related to Base UOM on item card through conversion factor.

Item variants - We use this in item card if we've large no. of identical items. (same item, different colour)

Item Cross Reference:
Cross reference can be setup against items. It can be a barcode or a specific code used by vendor or customers.

When the quantity required on the sales order exceeds the quantity i.e. available in inventory, a message will apear for the user that substitute exists for this item, (if any substitutes available).

Item availability can be viewed in numerous ways in item card,

  • By Event 
  • Period Variant
  • Location
  • BOM Level
  • Timeline.

These Item availability i.e. displayed based on different factors actually defines the basis of stock management.

Sunday 19 November 2017

Warehouse management module 2017 Part 2 - Pick an item and ship it out of white warehouse

Pick an item, bring it into shipping bay and then ship it out of white warehouse.

I've selected white warehouse in this blog,

I need to sell an Item 80207-Mouse from our white warehouse which is in bin No. "W-04-0009" and it has to be shipped out of white warehouse.

If you select blue or some other warehouse where bin is not enabled then you just enter quantity,
Qty. to ship.
In ribbons of sales order click on
   post -> ship.

But in our example we've chosen white warehouse which is bin enabled that means,
we should also know the location of inventory apart from location of warehouse.

To do so,

1. create sales order, enter quantity
2Release, (don't close the purchase order)

3. Click the action button Create Whse. Shipment in sales order ribbons.
(on doing this basically it sends instruction to warehouse that, I need to ship 80207-Mouse out of bin "W-04-0009")

4. Click on Create Pick from the ribbons (You can assign a user of your choice or leave it blank)
A warehouse shipment will be released.

5. role-center page of warehouse -> Click on Unassigned Picks - > Choose your pick from the list
which you created recently.

6. In Ribbons of Unassigned picks page -> Autofill Qty. to Handle -> Register Pick

7. Come back to warehouse shipment page, select the shipment which you had recently created in step 3, In ribbons -> Post -> Ship

Verify in items and bin-contents whether our item which was sold recently is updated in Qty. on Hand field.


Warehouse management module 2017 Part 1 - Purchase an item and place it in bin of white warehouse

To purchase an item and place it in white warehouse bin,


I've selected white warehouse in this blog,

I need to purchase Item 80207-Mouse from vendor and it has to be placed in white warehouse.

If you select blue or some other warehouse where bin is not enabled then you just enter quantity,
Qty. to receive.
In ribbons of purchase order click on
   post -> Receive.

But in our example we've chosen white warehouse which is bin enabled that means,
we should also know the location of inventory apart from location of warehouse.

To do so,

1. create purchase order, enter quantity
2. Release, (don't close the purchase order)
3. Click the action button Create Whse. Receipt in purchase order ribbons.
4. Post the receipt.

Now we've created a put-away activity for warehouse.
Ex. Our item is now pulled in the receiving bin no. "W-04-0009".

We've Pulled inventory in receiving bay that's it, but it has not been put away in bin's in/stock(I mean inventory location).

System automatically creates activity to do that by choosing Warehouse put-away from role-center page of warehouse.

5.  role-center page of warehouse -> Click on Warehouse put-away - > In ribbons click Register put-away.

Verify in items and bin-contents whether our purchased item is updated in Qty. on Hand field.


Thursday 18 May 2017

How to use RecordRef, KeyRef and FieldRef - Dynamics NAV 2017

This is the most unanswered question of all time, so I just thought of writing a blog on this.

This blog covers basic understanding of RecordRef, FieldRef and KeyRef in Dynamics NAV 2009 R2 to 2017 versions.
As we all know, RecordRef and FieldRef plays an important role while programming in NAV.

I hope this blog should help for many beginners.

Following are the topics covered in this blog.

1. How and when to use GETTABLE Function and OPEN Function
2. How and when to use RecordRef
3. How and when to use FieldRef
4. How and when to use KeyRef


1. GETTABLE:

 This function gets the table of a Record variable and causes the RecordRef to refer to the same table. Any filters that are applied to the RecordVar are also applied to 
the RecordRefVar.  Another way to select the table to which a RecordRef refers is to use the OPEN Function(RecordRef) and specify a table number in the parameters.

Ex: TableRecRef.GETTABLE(ContactRec);
Here, ContactRec variable gets the contact table using GETTABLE function and causes TableRecRec (a RecordRef variable) to refer to contact table.

OPEN Function:
Causes a RecordRef variable to refer to a table, which is identified by its Table ID
Ex: SearchIn.OPEN(RecRef.NUMBER);
SearchIn is a RecordRef variable which refers directly to a table, now you will be thinking which is the table it is actually trying to open here. Well, for now lets assume RecRef is holding the value of TableRecRef i.e Contact table.
So, in order to open a table through RecRef you should specify ID of the table, if you 've already used GETTABLE in your code then the same variable's ID can be passed here. That's where actually you see the difference of GETTABLE and OPEN Function but having a close look both does a same job. You can either use GETTABLE or OPEN function to create a reference of the table through RecordRef.

2. RecordRef
Let us assume you have created a function called "Search". This Search function will search for the string "fur" in any part  "Search Name" field of "Contact" table, "Customer" table and "Vendor" table.
Contact Table having Search Name field
Customer Table having Search Name filed


Now, All the 3 tables, "contact", "customer" and "vendor" table has the 3rd field name as "Search Name".
So, here comes the meaning of RecordRef. You use a RecordRef object in functions that must apply to more than one table, not to a specific table.
Instead of writing 3 functions, 1 for customer, 1 for contact and 1 for vendor table we can use one common  function which can use one RecordRef variable, which Gets the required table dynamically based on your selection.

3. FieldRef
Let's say you've selected "contact" table and the RecordRef is holding this table.
Now, you need to use a field "Search Name" from this table to search for the string "fur". How do you do that? That's where FieldRef concept comes into picture. This complex data type identifies a field in a table and gives you access to this field.
Suppose, i've created a fieldref variable "SearchFieldNo". I need this variable to refer to "Search Name" Field using. 
"Search Name" field as a field No. 3 in every existing tables.
So, this is how I can create a Field Reference for "Search Name" field.
Ex.:
SearchFieldNo := 3; //SearchFieldNo is a fieldref variable which should refer to Field No. 3 "Search Name".
SearchInFld := SearchIn.FIELD(SearchFieldNo); //SearchIn is a RecordRef variable which holds selective table.

4. KeyRef
We're now done with most of the things, we have now a RecordRef variable which is holding to the "Contact" table and referred to the field "Search Name". Now, if you need to know what is the key the contact table is holding, then you need to use KeyRef. So, KeyRef is used to Identify a key in a table and the fields in this key.

If you need to identify the primary key fields, then use the index 1 to identify it.
Ex.
KeyNo := 1; //Keynumber of which we want to get the name.
Table.OPEN(RecRef1.NUMBER); //Table is a new RecordRef variable, and RecRef1 will be holding contact table.
Key := Table.KEYINDEX(KeyNo); // Create a key reference to the key we want to get the name from.

I guess, those who read this blog might have understood the best use of RecordRef, FieldRef, GetTable function and Open function.

If you've any questions, please drop in a mail.
mail id:  mail2harikiranbm@gmail.com

Monday 10 April 2017

How to add user permission for Add-on specific objects

If you have created a new Add-on objects and now you need to execute these objects in the customer environment(Ex. Page 12103540, Page 12103560).
So, these object id's which are not a part of Dynamics NAV needs a permission to execute or modify or insert in some other workstations.

So, here is the sample code, permissions in the below code are assigned to TableData(you can change it to page or any other object based on your requirement).

Global variables.
Name                            DataType      Subtype            Length
UserRole                          Record Permission Set
Permission                       Record Permission
AllObj                             Record AllObj
User                               Record User
WindowsLogin                  Record User
WindowsAccessControl Record     Access Control

1. Assign the new user Role ID and User Role Name
2. If not user role inserted then sort the record based on object and object id's.
3. Fetch the Permission Role ID(insert,modify,delete,execute) from permission set table and assign it to permission table for the object id's which you need to assign permission.

Example:

UserRole."Role ID" := 'Addon1';
UserRole.Name := 'Required for all user';
IF NOT UserRole.INSERT THEN ;
AllObj.RESET;
AllObj.SETRANGE("Object Type",AllObj."Object Type"::TableData);
AllObj.SETFILTER(
  "Object ID",
  '12103560..12103580');
IF AllObj.FIND('-') THEN
  REPEAT
    Permission."Role ID" := UserRole."Role ID";
    Permission."Object Type" := AllObj."Object Type";
    Permission."Object ID" := AllObj."Object ID";

    Permission."Read Permission" := Permission."Read Permission"::Yes;
    IF AllObj."Object ID" IN [12103540, 12103560] THEN BEGIN
      Permission."Insert Permission" := Permission."Insert Permission"::Yes;
      Permission."Modify Permission" := Permission."Modify Permission"::Yes;
      Permission."Delete Permission" := Permission."Delete Permission"::Yes;
      Permission."Execute Permission" := Permission."Execute Permission"::Yes;
    END ELSE BEGIN
      Permission."Insert Permission" := Permission."Insert Permission"::" ";
      Permission."Modify Permission" := Permission."Modify Permission"::" ";
      Permission."Delete Permission" := Permission."Delete Permission"::" ";
      Permission."Execute Permission" := Permission."Execute Permission"::" ";
    END;
    IF NOT Permission.INSERT THEN ;
  UNTIL AllObj.NEXT = 0;


Wednesday 11 January 2017

How to use code coverage tool (How it differs from debugger)

Code coverage is one of the interesting topic while testing and debugging. It is very useful when you want to test your work.

I can start this explanation with a very good example.

Suppose you have a sound recorder in your mobile, you will go to the app folder, you will open the sound recorder, start the sound recorder, hum a tune and will record it for some time. Once you are done with humming a tune/song. You will stop recording and start listening to the tune/song which you've recorded.

Well, Exactly in the same way even code coverage tool works.
Firstly to open a code coverage tool in RTC(Role Tailored Client) Go to the following path in RTC.

If you are on Company Cronus USA,
Then in the menusuite go to,
  • CRONUS USA, Inc./Departments/Administration/Application Tools/
  • Click on Code Coverage in application tools. 
  • Click on Start button.


Now continue with your actions which you are supposed to do on RTC.
Example: I clicked on release sales order and did some processing of some random action.

Now, when you come back to code coverage and click stop.

It displays where all the flow passed through internally when you clicked on action button. You can just have a quick look at the flow of actions during your test activity.


So where all you see the Coverage% as 100. At those places the code as been hit internally when you clicked on particular action button. However, you cant see the values here directly. This gives a quick flow of code but doesn't give data i.e updating. If you need to know the complete flow internally along with values updating internally then you need to go with Debugger in NAV.

Click on Tools in NAV IDE -> Debugger -> Debug Session
Assign a break point in a code and start debugging each and every lines of code. 

Hope this helps for many beginners :)