Sales Report

Hex
Member Posts: 6
I need a report, showing Quantity Invoiced pr Inventory Posting Group and Gen. Bus. Posting Group from the Customer.
This report should show this grouped by Inventory Posting Group, and you should be able to filter on the Gen. Bus. Posting Group from the customer.
There should be a total for each Inventory Posting Group.
Any help would be appreciated.
This report should show this grouped by Inventory Posting Group, and you should be able to filter on the Gen. Bus. Posting Group from the customer.
There should be a total for each Inventory Posting Group.
Any help would be appreciated.
Who the hell is General Failure, and why is he reading my disk?
0
Comments
-
It was easier to make a little example than explaining it:
OBJECT Report 99999 Total Per Inv/Gen Bus.Pst.Grp. { OBJECT-PROPERTIES { Date=09/08/05; Time=16:17:19; Modified=Yes; Version List=; } PROPERTIES { } DATAITEMS { { PROPERTIES { DataItemTable=Table250; OnAfterGetRecord=BEGIN tmpGenBusinessPostingGroup := "Gen. Business Posting Group"; tmpGenBusinessPostingGroup.INSERT(FALSE); END; OnPostDataItem=BEGIN SearchSalesInvoiceLines(); END; } SECTIONS { } } { PROPERTIES { DataItemTable=Table2000000026; DataItemTableView=SORTING(Number); DataItemVarName=InvGroup; OnPreDataItem=BEGIN tmpInv.RESET; RESET; SETRANGE(Number,1,tmpInv.COUNT); END; OnAfterGetRecord=BEGIN IF Number = 1 THEN tmpInv.FIND('-') ELSE tmpInv.NEXT; END; } SECTIONS { { PROPERTIES { SectionType=Header; PrintOnEveryPage=Yes; SectionWidth=12000; SectionHeight=1269; } CONTROLS { { 1000000001;Label ;0 ;0 ;1500 ;846 ;ParentControl=1000000000; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 1000000003;Label ;3300 ;0 ;1500 ;846 ;ParentControl=1000000002; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 1000000006;Label ;1650 ;0 ;1500 ;846 ;ParentControl=1000000005; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } } } { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=1269; } CONTROLS { { 1000000002;TextBox;3300 ;423 ;1500 ;423 ;CaptionML=ENU=Quantity; SourceExpr=tmpInv.Quantity } { 1000000000;TextBox;0 ;423 ;1500 ;423 ;CaptionML=ENU=Inventory Posting Group; SourceExpr=tmpInv."Journal Template Name" } { 1000000008;Label ;1650 ;423 ;1500 ;423 ;CaptionML=ENU=Total } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table2000000026; DataItemTableView=SORTING(Number); DataItemVarName=BusGroup; OnPreDataItem=BEGIN tmpInvGen.RESET; tmpInvGen.SETRANGE("Journal Template Name",tmpInv."Journal Template Name"); RESET; SETRANGE(Number,1,tmpInvGen.COUNT); END; OnAfterGetRecord=BEGIN IF Number = 1 THEN tmpInvGen.FIND('-') ELSE tmpInvGen.NEXT; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=423; } CONTROLS { { 1000000004;TextBox;3300 ;0 ;1500 ;423 ;CaptionML=ENU=Inventory Posting Group; SourceExpr=tmpInvGen.Quantity } { 1000000005;TextBox;1650 ;0 ;1500 ;423 ;CaptionML=ENU=Gen. Bus. Posting Group; SourceExpr=tmpInvGen."Journal Batch Name" } } } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { VAR recItem@1000000003 : Record 27; recSalesInvoiceLine@1000000001 : Record 113; tmpGenBusinessPostingGroup@1000000002 : TEMPORARY Record 250; tmpInv@1000000004 : TEMPORARY Record 83; tmpInvGen@1000000000 : TEMPORARY Record 83; PROCEDURE SearchSalesInvoiceLines@1000000006(); BEGIN // make a total per "Inventory Posting Group" and "Gen. Bus. Posting Group" in table tmpInvGen recSalesInvoiceLine.RESET; recSalesInvoiceLine.SETRANGE(Type,recSalesInvoiceLine.Type::Item); IF recSalesInvoiceLine.FIND('-') THEN REPEAT IF tmpGenBusinessPostingGroup.GET(recSalesInvoiceLine."Gen. Bus. Posting Group") THEN BEGIN recItem.GET(recSalesInvoiceLine."No."); IF NOT tmpInvGen.GET(recItem."Inventory Posting Group",recSalesInvoiceLine."Gen. Bus. Posting Group",0) THEN BEGIN // create primary key with "Inventory Posting Group" and "Gen. Bus. Posting Group" CLEAR(tmpInvGen); tmpInvGen."Journal Template Name" := recItem."Inventory Posting Group"; tmpInvGen."Journal Batch Name" := recSalesInvoiceLine."Gen. Bus. Posting Group"; tmpInvGen."Line No." := 0; tmpInvGen.INSERT(FALSE); END; tmpInvGen.Quantity += recSalesInvoiceLine."Quantity (Base)"; tmpInvGen.MODIFY(FALSE); IF NOT tmpInv.GET(recItem."Inventory Posting Group",'',0) THEN BEGIN // create primary key with "Inventory Posting Group" CLEAR(tmpInv); tmpInv."Journal Template Name" := recItem."Inventory Posting Group"; tmpInv."Journal Batch Name" := ''; tmpInv."Line No." := 0; tmpInv.INSERT(FALSE); END; tmpInv.Quantity += recSalesInvoiceLine."Quantity (Base)"; tmpInv.MODIFY(FALSE); END; UNTIL recSalesInvoiceLine.NEXT = 0; END; BEGIN END. } }
PS "General Failure" is the writers name of Bill Gates and you can gues why he is reading your disk... :twisted:Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
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