Applying entries without having to click on apply entries

sulav.thapaliya@agile.com.np
Member Posts: 8
Presenting my query on a case below:
I have Global dimension 1 Code as "Product Segment Code" whose dimension values are as for ex: X,Y, Z, also I have a Customer A which deals with me regarding every products. Invoicing for different product segments is done separately even if it is for the same customer.
I have the following transactions with A
• Sales of Rs. 50000 of product X
• Sales of Rs. 30000 of Product Y
• Sales of Rs 20000 of Product Z
The customer pays me Rs. 20000 for Product Z, and the payment method for Customer A has been set to Apply to oldest. In the Cash receipt Journal line, I select the Product segment code as Z without going ahead in Apply Entries action. But when running the ageing report Rs. 20000 is seen to applied to Product X even if we have chosen Product Z on Journal line. As customer is set at Apply to oldest it applies to the customer oldest Invoice.
So, I need a solution over the above problem, how could I make the payment apply on the particular product segment selected(oldest) on journal line entered not the customer oldest Invoice irrespective of all the product segments.
I have Global dimension 1 Code as "Product Segment Code" whose dimension values are as for ex: X,Y, Z, also I have a Customer A which deals with me regarding every products. Invoicing for different product segments is done separately even if it is for the same customer.
I have the following transactions with A
• Sales of Rs. 50000 of product X
• Sales of Rs. 30000 of Product Y
• Sales of Rs 20000 of Product Z
The customer pays me Rs. 20000 for Product Z, and the payment method for Customer A has been set to Apply to oldest. In the Cash receipt Journal line, I select the Product segment code as Z without going ahead in Apply Entries action. But when running the ageing report Rs. 20000 is seen to applied to Product X even if we have chosen Product Z on Journal line. As customer is set at Apply to oldest it applies to the customer oldest Invoice.
So, I need a solution over the above problem, how could I make the payment apply on the particular product segment selected(oldest) on journal line entered not the customer oldest Invoice irrespective of all the product segments.
0
Best Answer
-
You need to make a change in the ApplyCustLedgEntry function in codeunit 12 so that it only applies to customer ledger entries with the same global dimension 1 value. I.e. change the code as follows...
OLD CODEIF Cust."Application Method" = Cust."Application Method"::"Apply to Oldest" THEN OldCustLedgEntry.SETFILTER("Posting Date",'..%1',GenJnlLine."Posting Date");
NEW CODEIF Cust."Application Method" = Cust."Application Method"::"Apply to Oldest" THEN BEGIN OldCustLedgEntry.SETFILTER("Posting Date",'..%1',GenJnlLine."Posting Date"); OldCustLedgEntry.SETRANGE("Global Dimension 1 Code",GenJnlLine."Shortcut Dimension 1 Code"); END;
5
Answers
-
You need to make a change in the ApplyCustLedgEntry function in codeunit 12 so that it only applies to customer ledger entries with the same global dimension 1 value. I.e. change the code as follows...
OLD CODEIF Cust."Application Method" = Cust."Application Method"::"Apply to Oldest" THEN OldCustLedgEntry.SETFILTER("Posting Date",'..%1',GenJnlLine."Posting Date");
NEW CODEIF Cust."Application Method" = Cust."Application Method"::"Apply to Oldest" THEN BEGIN OldCustLedgEntry.SETFILTER("Posting Date",'..%1',GenJnlLine."Posting Date"); OldCustLedgEntry.SETRANGE("Global Dimension 1 Code",GenJnlLine."Shortcut Dimension 1 Code"); END;
5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions