Options

sales invoice line, groupfooter

Adriaan2kAdriaan2k Member Posts: 159
edited 2007-08-02 in NAV Dutch speaking only
goedemorgen. Ik loop weer tegen iets bijzonders aan in een report: wij hebben een specifiek report voor de verkoopfaktuur. Hierop staan de (resource)regels die worden opgehaald vanuit de projecten. Als ik de section sales invoice line, zichtbaar houdt, dan zie ik keurig alle geboekte regels per resource.

Ik wil echter een totaal per resource tonen dmv een groupfooter en dan de sectie sales invoice line niet tonen. Dit geeft een veel overzichtelijkere faktuur. Echter mijn groupfooter wordt in het geheel niet getoond. De property GroupTotalFields in het data-item Sales Invoice Line staat op no.

Wie kan mij hierbij helpen met een oplossing ? welke verdere gegevens zijn er evt. nodig ?
mvg Adriaan

Comments

  • Options
    MaximusMaximus Member Posts: 105
    Hoi Adriaan,

    Heb je de property TotalFields ook gevuld? Kun je even aangeven hoe je report in elkaar zit? Welke dataitems gebruik je en hoe zijn ze met elkaar gelinkt? Zet ook even de properties van de dataitems erbij aub.

    Groeten, Max
  • Options
    Adriaan2kAdriaan2k Member Posts: 159
    edited 2007-08-02
    Maximus wrote:
    Hoi Adriaan,

    Heb je de property TotalFields ook gevuld? Kun je even aangeven hoe je report in elkaar zit? Welke dataitems gebruik je en hoe zijn ze met elkaar gelinkt? Zet ook even de properties van de dataitems erbij aub.

    Groeten, Max

    Dag Max,

    het veld Totalfields is gevuld met het veld 'Line Amount'. Als ik in een report een grouptotal toevoeg dan zie ik deze altijd. Nu zitten er een aantal dataitems van het type 'integer' bij waarin de inhoud van de (kop)velden wordt bepaald. Het is een aanpassing op een bestaand report met C/al code daarin. Ik zie echter niet waarom wel de sectie body 'sales invoice line' wordt weergegeven maar niet de grouptotal sectie.

    ik zal proberen hieronder de code weer te geven (schrik niet):
    Sales Invoice Line - OnPreDataItem()
    
    VATAmountLine.DELETEALL;
    SalesShipmentBuffer.RESET;
    SalesShipmentBuffer.DELETEALL;
    FirstValueEntryNo := 0;
    MoreLines := FIND('+');
    WHILE MoreLines AND (Description = '') AND ("No." = '') AND (Quantity = 0) AND (Amount = 0) DO
      MoreLines := NEXT(-1) <> 0;
    IF NOT MoreLines THEN
      CurrReport.BREAK;
    SETRANGE("Line No.",0,"Line No.");
    CurrReport.CREATETOTALS("Line Amount",Amount,"Amount Including VAT","Inv. Discount Amount");
    
    Sales Invoice Line - OnAfterGetRecord()
    IF gRecShipment.GET("Sales Invoice Line"."Shipment No.") THEN
    
    
    PostedShipmentDate := 0D;
    IF Quantity <> 0 THEN
      PostedShipmentDate := FindPostedShipmentDate;
    
    IF (Type = Type::"G/L Account") AND (NOT ShowInternalInfo) THEN
      "No." := '';
    
    mvg Adriaan
  • Options
    MaximusMaximus Member Posts: 105
    edited 2007-08-02
    Hoi Adriaan,

    een aantal dingen in de code vallen me op. Allereerst de CurrReport.BREAK die ervoor kan zorgen dat het verwerken van het Dataitem Sales Invoice Line kan worden afgebroken en weer verder gegaan wordt met het bovenliggende Dataitem. Er worden dan ook geen sections gegenereerd voor Sales Invoice Line. Heb je dit als eens gedebugged?
    Van welk bestaand report is dit een kopie? Van de standaard Navisionfactuur R206?
    Kun je het report exporteren als txtfob en die posten als reply? Ik moet even weten hoe de dataitems gelinked zijn en hoe de properties ingesteld zijn.
  • Options
    Adriaan2kAdriaan2k Member Posts: 159
    Maximus wrote:
    Hoi Adriaan,

    een aantal dingen in de code vallen me op. Allereerst de CurrReport.BREAK die ervoor kan zorgen dat het verwerken van het Dataitem SalesLine kan worden afgebroken en weer verder gegaan wordt met het bovenliggende Dataitem. Er worden dan ook geen sections gegenereerd voor Sales Line. Heb je dit als eens gedebugged?
    Van welk bestaand report is dit een kopie?
    Ik kan uit de code niet halen wat het probleem zou kunnen zijn. Kun je het report exporteren als txtfob en die posten als reply? Ik moet even weten hoe de dataitems gelinked zijn en hoe de properties ingesteld zijn.

    Dag Max,

    ik zit er net weer tegenaan te lopen...ik kom er niet uit. Het originele report is de standaard faktuur in de database. Ik heb aan de code niets gewijzigd, alleen de sectie grouptotal toegevoegd. Ik ga even proberen het fob als txt bestand te exporteren. Moet ik het dan hier posten? het zal wel een enorme lap tekst worden dan. ps. je bent nog laat bezig :)
    mvg Adriaan
  • Options
    Adriaan2kAdriaan2k Member Posts: 159
    hier komt het txt fob. Ik weet niet of dit te posten is, het is enorm groot:
    OBJECT Report 50007 verkoopfaktuur
    {
      OBJECT-PROPERTIES
      {
        Date=02-08-07;
        Time=14:02:13;
        Modified=Yes;
        Version List=NAVW14.00.01;
      }
      PROPERTIES
      {
        Permissions=TableData 7190=rimd;
        CaptionML=[ENU=Sales - Invoice;
                   NLD=Verkoop - Factuur];
        OnInitReport=BEGIN
                       GLSetup.GET;
                       CompanyInfo.GET;
                       SalesSetup.GET;
    
                       CASE SalesSetup."Logo Position on Documents" OF
                         SalesSetup."Logo Position on Documents"::"No Logo":;
                         SalesSetup."Logo Position on Documents"::Left:
                           BEGIN
                             CompanyInfo.CALCFIELDS(Picture);
                           END;
                         SalesSetup."Logo Position on Documents"::Center:
                           BEGIN
                             CompanyInfo1.GET;
                             CompanyInfo1.CALCFIELDS(Picture);
                           END;
                         SalesSetup."Logo Position on Documents"::Right:
                           BEGIN
                             CompanyInfo2.GET;
                             CompanyInfo2.CALCFIELDS(Picture);
                           END;
                       END;
                     END;
    
        OnPreReport=BEGIN
                      IF NOT CurrReport.USEREQUESTFORM THEN
                        InitLogInteraction;
                    END;
    
        HorzGrid=210;
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table112;
            DataItemTableView=SORTING(No.);
            NewPagePerRecord=Yes;
            ReqFilterHeadingML=[ENU=Posted Sales Invoice;
                                NLD=Geboekte verkoopfactuur];
            OnAfterGetRecord=BEGIN
                               CurrReport.LANGUAGE := Language.GetLanguageID("Language Code");
    
                               IF RespCenter.GET("Responsibility Center") THEN BEGIN
                                 FormatAddr.RespCenter(CompanyAddr,RespCenter);
                                 CompanyInfo."Phone No." := RespCenter."Phone No.";
                                 CompanyInfo."Fax No." := RespCenter."Fax No.";
                               END ELSE BEGIN
                                 FormatAddr.Company(CompanyAddr,CompanyInfo);
                               END;
    
                               PostedDocDim1.SETRANGE("Table ID",DATABASE::"Sales Invoice Header");
                               PostedDocDim1.SETRANGE("Document No.","Sales Invoice Header"."No.");
    
                               IF "Order No." = '' THEN
                                 OrderNoText := ''
                               ELSE
                                 OrderNoText := FIELDCAPTION("Order No.");
                               IF "Salesperson Code" = '' THEN BEGIN
                                 SalesPurchPerson.INIT;
                                 SalesPersonText := '';
                               END ELSE BEGIN
                                 SalesPurchPerson.GET("Salesperson Code");
                                 SalesPersonText := Text000;
                               END;
                               IF "Your Reference" = '' THEN
                                 ReferenceText := ''
                               ELSE
                                 ReferenceText := FIELDCAPTION("Your Reference");
                               IF "VAT Registration No." = '' THEN
                                 VATNoText := ''
                               ELSE
                                 VATNoText := FIELDCAPTION("VAT Registration No.");
                               IF "Currency Code" = '' THEN BEGIN
                                 GLSetup.TESTFIELD("LCY Code");
                                 TotalText := STRSUBSTNO(Text001,GLSetup."LCY Code");
                                 TotalInclVATText := STRSUBSTNO(Text002,GLSetup."LCY Code");
                                 TotalExclVATText := STRSUBSTNO(Text006,GLSetup."LCY Code");
                               END ELSE BEGIN
                                 TotalText := STRSUBSTNO(Text001,"Currency Code");
                                 TotalInclVATText := STRSUBSTNO(Text002,"Currency Code");
                                 TotalExclVATText := STRSUBSTNO(Text006,"Currency Code");
                               END;
                               FormatAddr.SalesInvBillTo(CustAddr,"Sales Invoice Header");
                               Cust.GET("Bill-to Customer No.");
    
                               IF "Payment Terms Code" = '' THEN
                                 PaymentTerms.INIT
                               ELSE
                                 PaymentTerms.GET("Payment Terms Code");
                               IF "Shipment Method Code" = '' THEN
                                 ShipmentMethod.INIT
                               ELSE
                                 ShipmentMethod.GET("Shipment Method Code");
    
                               FormatAddr.SalesInvShipTo(ShipToAddr,"Sales Invoice Header");
                               ShowShippingAddr := "Sell-to Customer No." <> "Bill-to Customer No.";
                               FOR i := 1 TO ARRAYLEN(ShipToAddr) DO
                                 IF ShipToAddr[i] <> CustAddr[i] THEN
                                   ShowShippingAddr := TRUE;
    
                               IF LogInteraction THEN
                                 IF NOT CurrReport.PREVIEW THEN BEGIN
                                   IF "Bill-to Contact No." <> '' THEN
                                     SegManagement.LogDocument(
                                       4,"No.",0,0,DATABASE::Contact,"Bill-to Contact No.","Salesperson Code",
                                       "Campaign No.","Posting Description",'')
                                   ELSE
                                     SegManagement.LogDocument(
                                       4,"No.",0,0,DATABASE::Customer,"Bill-to Customer No.","Salesperson Code",
                                       "Campaign No.","Posting Description",'');
                                 END;
                             END;
    
            ReqFilterFields=No.,Sell-to Customer No.,No. Printed;
          }
          SECTIONS
          {
          }
           }
        { PROPERTIES
          {
            DataItemIndent=1;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number);
            NewPagePerRecord=Yes;
            DataItemVarName=CopyLoop;
            OnPreDataItem=BEGIN
                            NoOfLoops := ABS(NoOfCopies) + Cust."Invoice Copies" + 1;
                            IF NoOfLoops <= 0 THEN
                              NoOfLoops := 1;
                            CopyText := '';
                            SETRANGE(Number,1,NoOfLoops);
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number > 1 THEN
                                 CopyText := Text003;
                               CurrReport.PAGENO := 1;
                             END;
    
            OnPostDataItem=BEGIN
                             IF NOT CurrReport.PREVIEW THEN
                               SalesInvCountPrinted.RUN("Sales Invoice Header");
                           END;
    
          }
          SECTIONS
          {
          }
           }
        { PROPERTIES
          {
            DataItemIndent=2;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=CONST(1));
            DataItemVarName=PageLoop;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18060;
                SectionHeight=8883;
              }
              CONTROLS
              {
                { 1   ;TextBox      ;11550;5499 ;6300 ;846  ;FontSize=18;
                                                             FontBold=Yes;
                                                             SourceExpr=STRSUBSTNO(Text004,CopyText) }
                { 2   ;TextBox      ;11550;6345 ;1680 ;423  ;FontSize=9;
                                                             SourceExpr=STRSUBSTNO(Text005,FORMAT(CurrReport.PAGENO)) }
                { 4   ;TextBox      ;0    ;2961 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[1] }
                { 6   ;TextBox      ;0    ;3384 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[2] }
                { 8   ;TextBox      ;0    ;3807 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[3] }
                { 10  ;TextBox      ;0    ;4230 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[4] }
                { 12  ;TextBox      ;0    ;4653 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[5] }
                { 15  ;TextBox      ;0    ;5076 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[6] }
                { 16  ;Label        ;11550;3384 ;2100 ;423  ;ParentControl=17;
                                                             FontSize=9;
                                                             CaptionML=NLD=KvK }
                { 17  ;TextBox      ;13860;3384 ;4200 ;423  ;FontSize=9;
                                                             CaptionML=NLD=KvK;
                                                             SourceExpr=CompanyInfo."Registration No." }
                { 22  ;Label        ;11550;2961 ;2100 ;423  ;ParentControl=23;
                                                             FontSize=9 }
                { 23  ;TextBox      ;13860;2961 ;4200 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Bank;
                                                                        NLD=Bank];
                                                             SourceExpr=CompanyInfo."Bank Name" }
                { 27  ;TextBox      ;2730 ;7614 ;4200 ;423  ;HorzAlign=Left;
                                                             FontSize=10;
                                                             SourceExpr="Sales Invoice Header"."No." }
                { 28  ;TextBox      ;9030 ;7614 ;1890 ;423  ;HorzAlign=Left;
                                                             FontSize=10;
                                                             SourceExpr="Sales Invoice Header"."Posting Date" }
                { 35  ;Label        ;0    ;7614 ;2730 ;423  ;FontSize=10;
                                                             CaptionML=[ENU=Invoice No.;
                                                                        NLD="Factuurnummer: "] }
                { 3   ;TextBox      ;0    ;5499 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[7] }
                { 48  ;TextBox      ;0    ;5922 ;6300 ;423  ;FontSize=10;
                                                             SourceExpr=CustAddr[8] }
                { 53  ;Label        ;7770 ;7614 ;1260 ;423  ;ParentControl=28;
                                                             FontSize=10;
                                                             CaptionML=NLD="Datum: " }
                { 1000000009;Shape  ;0    ;7191 ;18060;423  ;ShapeStyle=HorzLine }
                { 1000000010;Shape  ;0    ;8037 ;18060;423  ;ShapeStyle=HorzLine }
                { 1000000001;Label  ;12180;7614 ;2520 ;423  ;FontName=<Tahoma>;
                                                             FontSize=10;
                                                             CaptionML=NLD="Projectnummer: " }
                { 1000000002;TextBox;8190 ;4653 ;2310 ;423  ;Visible=No;
                                                             HorzAlign=Right;
                                                             FontSize=10;
                                                             SourceExpr="Sales Invoice Header"."Your Reference" }
                { 1000000005;TextBox;14700;7614 ;2100 ;423  ;FontName=<Tahoma>;
                                                             FontSize=10;
                                                             SourceExpr="Sales Invoice Header"."Job No." }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=3;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=FILTER(1..));
            DataItemVarName=DimensionLoop1;
            OnPreDataItem=BEGIN
                            IF NOT ShowInternalInfo THEN
                              CurrReport.BREAK;
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number = 1 THEN BEGIN
                                 IF NOT PostedDocDim1.FIND('-') THEN
                                   CurrReport.BREAK;
                               END ELSE
                                 IF NOT Continue THEN
                                   CurrReport.BREAK;
    
                               CLEAR(DimText);
                               Continue := FALSE;
                               REPEAT
                                 OldDimText := DimText;
                                 IF DimText = '' THEN
                                   DimText := STRSUBSTNO(
                                     '%1 %2',PostedDocDim1."Dimension Code",PostedDocDim1."Dimension Value Code")
                                 ELSE
                                   DimText :=
                                     STRSUBSTNO(
                                       '%1, %2 %3',DimText,
                                       PostedDocDim1."Dimension Code",PostedDocDim1."Dimension Value Code");
                                 IF STRLEN(DimText) > MAXSTRLEN(OldDimText) THEN BEGIN
                                   DimText := OldDimText;
                                   Continue := TRUE;
                                   EXIT;
                                 END;
                               UNTIL (PostedDocDim1.NEXT = 0);
                             END;
    
            DataItemLinkReference=Sales Invoice Header;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(Number = 1);
                             END;
    
              }
              CONTROLS
              {
                { 91  ;TextBox      ;3360 ;0    ;14700;423  ;FontSize=9;
                                                             SourceExpr=DimText }
                { 93  ;Label        ;0    ;0    ;3150 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Header Dimensions;
                                                                        NLD=Kopdimensies] }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(Number > 1);
                             END;
    
              }
              CONTROLS
              {
                { 98  ;TextBox      ;3360 ;0    ;14700;423  ;FontSize=9;
                                                             SourceExpr=DimText }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=3;
            DataItemTable=Table113;
            DataItemTableView=SORTING(Document No.,Line No.);
            OnPreDataItem=BEGIN
    
                            VATAmountLine.DELETEALL;
                            SalesShipmentBuffer.RESET;
                            SalesShipmentBuffer.DELETEALL;
                            FirstValueEntryNo := 0;
                            MoreLines := FIND('+');
                            WHILE MoreLines AND (Description = '') AND ("No." = '') AND (Quantity = 0) AND (Amount = 0) DO
                              MoreLines := NEXT(-1) <> 0;
                            IF NOT MoreLines THEN
                              CurrReport.BREAK;
                            SETRANGE("Line No.",0,"Line No.");
                            CurrReport.CREATETOTALS("Line Amount",Amount,"Amount Including VAT","Inv. Discount Amount");
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF gRecShipment.GET("Sales Invoice Line"."Shipment No.") THEN
    
    
                               PostedShipmentDate := 0D;
                               IF Quantity <> 0 THEN
                                 PostedShipmentDate := FindPostedShipmentDate;
    
                               IF (Type = Type::"G/L Account") AND (NOT ShowInternalInfo) THEN
                                 "No." := '';
    
                               VATAmountLine.INIT;
                               VATAmountLine."VAT Identifier" := "VAT Identifier";
                               VATAmountLine."VAT Calculation Type" := "VAT Calculation Type";
                               VATAmountLine."Tax Group Code" := "Tax Group Code";
                               VATAmountLine."VAT %" := "VAT %";
                               VATAmountLine."VAT Base" := Amount;
                               VATAmountLine."Amount Including VAT" := "Amount Including VAT";
                               VATAmountLine."Line Amount" := "Line Amount";
                               IF "Allow Invoice Disc." THEN
                                 VATAmountLine."Inv. Disc. Base Amount" := "Line Amount";
                               VATAmountLine."Invoice Discount Amount" := "Inv. Discount Amount";
                               VATAmountLine.InsertLine;
                             END;
    
            TotalFields=Line Amount;
            GroupTotalFields=No.;
            DataItemLinkReference=Sales Invoice Header;
            DataItemLink=Document No.=FIELD(No.);
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Header;
                PrintOnEveryPage=Yes;
                SectionWidth=18060;
                SectionHeight=1269;
              }
              CONTROLS
              {
                { 42  ;Label        ;0    ;0    ;4620 ;846  ;ParentControl=65;
                                                             VertAlign=Bottom;
                                                             FontSize=10;
                                                             FontBold=Yes;
                                                             MultiLine=Yes }
                { 47  ;Label        ;14910;0    ;2100 ;846  ;ParentControl=70;
                                                             HorzAlign=Right;
                                                             VertAlign=Bottom;
                                                             FontSize=10;
                                                             FontBold=Yes;
                                                             MultiLine=Yes;
                                                             CaptionML=[ENU=Amount;
                                                                        NLD=Bedrag in °] }
              }
               }
            { PROPERTIES
              {
                SectionType=TransHeader;
                SectionWidth=18060;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 55  ;Label        ;10080;0    ;2940 ;423  ;ParentControl=56;
                                                             FontSize=9;
                                                             LeaderDots=Yes;
                                                             CaptionML=[ENU=Continued;
                                                                        NLD=Transport] }
                { 56  ;TextBox      ;14490;0    ;2520 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Continued;
                                                                        NLD=Transport];
                                                             SourceExpr="Line Amount";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=423;
                OnPreSection=BEGIN
                               //CurrReport.SHOWOUTPUT(Type = 0);
                               //f4u.ns
                               CurrReport.SHOWOUTPUT(FALSE);
                               //f4u.ne
                             END;
    
              }
              CONTROLS
              {
                { 57  ;TextBox      ;2310 ;0    ;13020;423  ;FontSize=9;
                                                             SourceExpr=Description }
              }
               }
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=846;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(Type > 0);
                             END;
    
              }
              CONTROLS
              {
                { 65  ;TextBox      ;0    ;0    ;11340;423  ;FontSize=10;
                                                             SourceExpr=Description }
                { 70  ;TextBox      ;14910;0    ;2100 ;423  ;FontSize=10;
                                                             CaptionML=[ENU=Amount;
                                                                        NLD=Bedrag];
                                                             BlankZero=Yes;
                                                             SourceExpr=["Line Amount" ];
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
              }
               }
            { PROPERTIES
              {
                SectionType=GroupFooter;
                SectionWidth=18060;
                SectionHeight=846;
              }
              CONTROLS
              {
                { 1000000006;TextBox;0    ;0    ;11340;423  ;FontSize=10;
                                                             SourceExpr=Description }
                { 1000000007;TextBox;14910;0    ;2100 ;423  ;FontSize=10;
                                                             CaptionML=[ENU=Amount;
                                                                        NLD=Bedrag];
                                                             BlankZero=Yes;
                                                             SourceExpr=["Line Amount" ];
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
              }
               }
            { PROPERTIES
              {
                SectionType=TransFooter;
                SectionWidth=18060;
                SectionHeight=846;
              }
              CONTROLS
              {
                { 85  ;Label        ;10080;423  ;2310 ;423  ;ParentControl=86;
                                                             FontSize=9;
                                                             LeaderDots=Yes;
                                                             CaptionML=[ENU=Continued;
                                                                        NLD=Transport] }
                { 86  ;TextBox      ;14280;423  ;2730 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Continued;
                                                                        NLD=Transport];
                                                             SourceExpr="Line Amount";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18060;
                SectionHeight=0;
              }
              CONTROLS
              {
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18060;
                SectionHeight=846;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT("Inv. Discount Amount" <> 0);
                             END;
    
              }
              CONTROLS
              {
                { 87  ;Label        ;10080;423  ;4200 ;423  ;ParentControl=88;
                                                             FontSize=9 }
                { 88  ;TextBox      ;14490;423  ;2520 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Inv. Discount Amount;
                                                                        NLD=Factuurkorting];
                                                             SourceExpr=-"Inv. Discount Amount";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 89  ;Label        ;10080;0    ;4200 ;423  ;ParentControl=99;
                                                             FontSize=9;
                                                             FontBold=Yes;
                                                             CaptionML=[ENU=Subtotal;
                                                                        NLD=Subtotaal] }
                { 99  ;TextBox      ;14490;0    ;2520 ;423  ;FontSize=9;
                                                             FontBold=Yes;
                                                             CaptionML=[ENU=Subtotal;
                                                                        NLD=Subtotaal];
                                                             SourceExpr="Line Amount";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Header"."Currency Code" }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18060;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT("Amount Including VAT" = Amount);
                             END;
    
              }
              CONTROLS
              {
                { 73  ;TextBox      ;10080;0    ;4200 ;423  ;FontSize=9;
                                                             FontBold=Yes;
                                                             SourceExpr=TotalText }
                { 74  ;TextBox      ;14490;0    ;2520 ;423  ;FontSize=9;
                                                             FontBold=Yes;
                                                             SourceExpr=Amount;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18060;
                SectionHeight=1269;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(
                                 (NOT "Sales Invoice Header"."Prices Including VAT") AND ("Amount Including VAT" <> Amount));
                             END;
    
              }
              CONTROLS
              {
                { 90  ;TextBox      ;14490;0    ;2520 ;423  ;FontSize=10;
                                                             FontBold=Yes;
                                                             SourceExpr=Amount;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 92  ;TextBox      ;14490;423  ;2520 ;423  ;FontSize=10;
                                                             SourceExpr="Amount Including VAT" - Amount;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 94  ;TextBox      ;14490;846  ;2520 ;423  ;FontSize=10;
                                                             FontBold=Yes;
                                                             SourceExpr="Amount Including VAT";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 79  ;TextBox      ;10080;423  ;4200 ;423  ;FontSize=10;
                                                             SourceExpr=VATAmountLine.VATAmountText }
                { 80  ;TextBox      ;10080;0    ;4200 ;423  ;FontSize=10;
                                                             FontBold=Yes;
                                                             SourceExpr=TotalExclVATText }
                { 81  ;TextBox      ;10080;846  ;4200 ;423  ;FontSize=10;
                                                             FontBold=Yes;
                                                             SourceExpr=TotalInclVATText }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18060;
                SectionHeight=423;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(
                                 "Sales Invoice Header"."Prices Including VAT" AND
                                 ("Amount Including VAT" <> Amount) AND
                                 ("Sales Invoice Header"."VAT Base Discount %" <> 0));
                             END;
    
              }
              CONTROLS
              {
                { 84  ;Label        ;10080;0    ;4200 ;423  ;ParentControl=143;
                                                             FontSize=9 }
                { 143 ;TextBox      ;14490;0    ;2520 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Payment Discount on VAT;
                                                                        NLD=Contantkorting op BTW];
                                                             SourceExpr=-("Line Amount" - "Inv. Discount Amount" - "Amount Including VAT");
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Header"."Currency Code" }
              }
               }
            { PROPERTIES
              {
                SectionType=Footer;
                SectionWidth=18060;
                SectionHeight=2115;
                OnPreSection=BEGIN
                               CurrReport.SHOWOUTPUT(
                                 "Sales Invoice Header"."Prices Including VAT" AND ("Amount Including VAT" <> Amount));
                             END;
    
              }
              CONTROLS
              {
                { 60  ;TextBox      ;10080;0    ;4200 ;423  ;FontSize=9;
                                                             FontBold=Yes;
                                                             SourceExpr=TotalInclVATText }
                { 61  ;TextBox      ;10080;846  ;4200 ;423  ;FontSize=9;
                                                             SourceExpr=VATAmountLine.VATAmountText }
                { 62  ;TextBox      ;14490;846  ;2520 ;423  ;FontSize=9;
                                                             SourceExpr="Amount Including VAT" - Amount;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 63  ;TextBox      ;14490;1269 ;2520 ;423  ;FontSize=9;
                                                             SourceExpr=Amount;
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 71  ;TextBox      ;14490;0    ;2520 ;423  ;FontSize=9;
                                                             FontBold=Yes;
                                                             SourceExpr="Amount Including VAT";
                                                             AutoFormatType=1;
                                                             AutoFormatExpr="Sales Invoice Line".GetCurrencyCode }
                { 72  ;TextBox      ;10080;1269 ;4200 ;423  ;FontSize=9;
                                                             SourceExpr=TotalExclVATText }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=4;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number);
            DataItemVarName=Sales Shipment Buffer;
            OnPreDataItem=BEGIN
                            SalesShipmentBuffer.SETRANGE("Document No.","Sales Invoice Line"."Document No.");
                            SalesShipmentBuffer.SETRANGE("Line No.","Sales Invoice Line"."Line No.");
    
                            SETRANGE(Number,1,SalesShipmentBuffer.COUNT);
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number = 1 THEN
                                 SalesShipmentBuffer.FIND('-')
                               ELSE
                                 SalesShipmentBuffer.NEXT;
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 144 ;TextBox      ;6930 ;0    ;1470 ;423  ;FontSize=9;
                                                             SourceExpr=SalesShipmentBuffer."Posting Date" }
                { 146 ;TextBox      ;8610 ;0    ;1470 ;423  ;FontSize=9;
                                                             DecimalPlaces=0:5;
                                                             SourceExpr=SalesShipmentBuffer.Quantity }
                { 145 ;Label        ;2310 ;0    ;4410 ;423  ;VertAlign=Bottom;
                                                             FontSize=9;
                                                             FontBold=No;
                                                             MultiLine=Yes;
                                                             CaptionML=[ENU=Shipment;
                                                                        NLD=Verzending] }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=4;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=FILTER(1..));
            DataItemVarName=DimensionLoop2;
            OnPreDataItem=BEGIN
                            IF NOT ShowInternalInfo THEN
                              CurrReport.BREAK;
    
                            PostedDocDim2.SETRANGE("Table ID",DATABASE::"Sales Invoice Line");
                            PostedDocDim2.SETRANGE("Document No.","Sales Invoice Line"."Document No.");
                            PostedDocDim2.SETRANGE("Line No.","Sales Invoice Line"."Line No.");
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF Number = 1 THEN BEGIN
                                 IF NOT PostedDocDim2.FIND('-') THEN
                                   CurrReport.BREAK;
                               END ELSE
                                 IF NOT Continue THEN
                                   CurrReport.BREAK;
    
                               CLEAR(DimText);
                               Continue := FALSE;
                               REPEAT
                                 OldDimText := DimText;
                                 IF DimText = '' THEN
                                   DimText := STRSUBSTNO(
                                     '%1 %2',PostedDocDim2."Dimension Code",PostedDocDim2."Dimension Value Code")
                                 ELSE
                                   DimText :=
                                     STRSUBSTNO(
                                       '%1, %2 %3',DimText,
                                       PostedDocDim2."Dimension Code",PostedDocDim2."Dimension Value Code");
                                 IF STRLEN(DimText) > MAXSTRLEN(OldDimText) THEN BEGIN
                                   DimText := OldDimText;
                                   Continue := TRUE;
                                   EXIT;
                                 END;
                               UNTIL (PostedDocDim2.NEXT = 0);
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 82  ;TextBox      ;3360 ;0    ;14700;423  ;FontSize=9;
                                                             SourceExpr=DimText }
                { 83  ;Label        ;0    ;0    ;3150 ;423  ;FontSize=9;
                                                             CaptionML=[ENU=Line Dimensions;
                                                                        NLD=Regeldimensies] }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=3;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number);
            DataItemVarName=VATCounter;
            OnPreDataItem=BEGIN
                            IF VATAmountLine.GetTotalVATAmount = 0 THEN
                              CurrReport.BREAK;
                            SETRANGE(Number,1,VATAmountLine.COUNT);
                            CurrReport.CREATETOTALS(
                              VATAmountLine."Line Amount",VATAmountLine."Inv. Disc. Base Amount",
                              VATAmountLine."Invoice Discount Amount",VATAmountLine."VAT Base",VATAmountLine."VAT Amount");
                          END;
    
            OnAfterGetRecord=BEGIN
                               VATAmountLine.GetLine(Number);
                             END;
    
          }
          SECTIONS
          {
          }
           }
        { PROPERTIES
          {
            DataItemIndent=3;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=CONST(1));
            DataItemVarName=Total;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18060;
                SectionHeight=3807;
              }
              CONTROLS
              {
                { 1000000000;Label  ;0    ;2538 ;18060;423  ;FontSize=10;
                                                             LeaderDots=No;
                                                             CaptionML=NLD=Graag het factuurnummer vermelden bij uw betaling. }
                { 1000000003;Label  ;0    ;1269 ;18060;423  ;FontSize=10;
                                                             LeaderDots=No;
                                                             CaptionML=NLD=Wij verzoeken u vriendelijk het bovenstaand bedrag binnen de aangegeven termijn te voldoen op }
                { 1000000004;Label  ;0    ;1692 ;18060;423  ;FontName=<Tahoma>;
                                                             FontSize=10;
                                                             CaptionML=NLD=bankrekening xxx}
                { 1000000008;Shape  ;0    ;423  ;18060;423  ;ShapeStyle=HorzLine }
                { 1000000023;TextBox;3150 ;846  ;11550;423  ;FontSize=10;
                                                             CaptionML=[ENU=Payment Terms;
                                                                        NLD=Betalingscondities];
                                                             SourceExpr=PaymentTerms.Description }
                { 1000000022;Label  ;0    ;846  ;2940 ;423  ;ParentControl=1000000023;
                                                             FontSize=10;
                                                             CaptionML=NLD="Betalingsconditie: " }
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemIndent=3;
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number)
                              WHERE(Number=CONST(1));
            DataItemVarName=Total2;
            OnPreDataItem=BEGIN
                            IF NOT ShowShippingAddr THEN
                              CurrReport.BREAK;
                          END;
    
          }
          SECTIONS
          {
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=5060;
          Height=1540;
          SaveValues=Yes;
          OnOpenForm=BEGIN
                       InitLogInteraction;
                       RequestOptionsForm.LogInteraction.ENABLED(LogInteraction);
                     END;
    
        }
        CONTROLS
        {
          { 1   ;TextBox      ;3410 ;0    ;1650 ;440  ;CaptionML=[ENU=No. of Copies;
                                                                  NLD=Aantal exemplaren];
                                                       SourceExpr=NoOfCopies }
          { 21  ;Label        ;0    ;0    ;3300 ;440  ;ParentControl=1 }
          { 2   ;CheckBox     ;3410 ;550  ;440  ;440  ;ShowCaption=No;
                                                       CaptionML=[ENU=Show Internal Information;
                                                                  NLD=Interne informatie weergeven];
                                                       SourceExpr=ShowInternalInfo }
          { 3   ;Label        ;0    ;550  ;3300 ;440  ;ParentControl=2 }
          { 4   ;CheckBox     ;3410 ;1100 ;440  ;440  ;Name=LogInteraction;
                                                       ShowCaption=No;
                                                       CaptionML=[ENU=Log Interaction;
                                                                  NLD=Interactie registreren];
                                                       SourceExpr=LogInteraction }
          { 5   ;Label        ;0    ;1100 ;3300 ;440  ;ParentControl=4 }
        }
      }
      CODE
      {
        VAR
          Text000@1000 : TextConst 'ENU=Salesperson;NLD=Verkoper';
          Text001@1001 : TextConst 'ENU=Total %1;NLD=Totaal %1';
          Text002@1002 : TextConst 'ENU=Total %1 Incl. VAT;NLD=Totaal %1 incl. BTW';
          Text003@1003 : TextConst 'ENU=COPY;NLD=KOPIE';
          Text004@1004 : TextConst 'ENU=Sales - Invoice %1;NLD=FACTUUR %1';
          Text005@1005 : TextConst 'ENU=Page %1;NLD=Pagina %1';
          Text006@1006 : TextConst 'ENU=Total %1 Excl. VAT;NLD=Totaal %1 excl. BTW';
          GLSetup@1007 : Record 98;
          ShipmentMethod@1008 : Record 10;
          PaymentTerms@1009 : Record 3;
          SalesPurchPerson@1010 : Record 13;
          CompanyInfo@1011 : Record 79;
          CompanyInfo1@1045 : Record 79;
          CompanyInfo2@1046 : Record 79;
          SalesSetup@1048 : Record 311;
          Cust@1012 : Record 18;
          VATAmountLine@1013 : TEMPORARY Record 290;
          PostedDocDim1@1014 : Record 359;
          PostedDocDim2@1015 : Record 359;
          RespCenter@1016 : Record 5714;
          Language@1017 : Record 8;
          SalesInvCountPrinted@1018 : Codeunit 315;
          FormatAddr@1019 : Codeunit 365;
          SegManagement@1020 : Codeunit 5051;
          SalesShipmentBuffer@1050 : TEMPORARY Record 7190;
          PostedShipmentDate@1044 : Date;
          CustAddr@1021 : ARRAY [8] OF Text[50];
          ShipToAddr@1022 : ARRAY [8] OF Text[50];
          CompanyAddr@1023 : ARRAY [8] OF Text[50];
          OrderNoText@1024 : Text[30];
          SalesPersonText@1025 : Text[30];
          VATNoText@1026 : Text[30];
          ReferenceText@1027 : Text[30];
          TotalText@1028 : Text[50];
          TotalExclVATText@1029 : Text[50];
          TotalInclVATText@1030 : Text[50];
          MoreLines@1031 : Boolean;
          NoOfCopies@1032 : Integer;
          NoOfLoops@1033 : Integer;
          CopyText@1034 : Text[30];
          ShowShippingAddr@1035 : Boolean;
          i@1036 : Integer;
          NextEntryNo@1043 : Integer;
          FirstValueEntryNo@1042 : Integer;
          DimText@1037 : Text[120];
          OldDimText@1038 : Text[75];
          ShowInternalInfo@1039 : Boolean;
          Continue@1040 : Boolean;
          LogInteraction@1041 : Boolean;
          gTxt002@1000000000 : TextConst 'ENU=%1, %2';
          gTxt003@1000000001 : TextConst 'NLD=%1 / %2';
          gRecShipment@1000000002 : Record 110;
    
        PROCEDURE InitLogInteraction@1();
        BEGIN
          LogInteraction := SegManagement.FindInteractTmplCode(4) <> '';
        END;
    
        PROCEDURE FindPostedShipmentDate@6() : Date;
        VAR
          SalesShipmentHeader@1000 : Record 110;
          SalesShipmentBuffer2@1001 : TEMPORARY Record 7190;
        BEGIN
          NextEntryNo := 1;
          IF "Sales Invoice Line"."Shipment No." <> '' THEN
            IF SalesShipmentHeader.GET("Sales Invoice Line"."Shipment No.") THEN
              EXIT(SalesShipmentHeader."Posting Date");
    
          IF "Sales Invoice Header"."Order No."='' THEN
            EXIT("Sales Invoice Header"."Posting Date");
    
          CASE "Sales Invoice Line".Type OF
            "Sales Invoice Line".Type::Item:
              GenerateBufferFromValueEntry("Sales Invoice Line");
            "Sales Invoice Line".Type::"G/L Account","Sales Invoice Line".Type::Resource,
            "Sales Invoice Line".Type::"Charge (Item)","Sales Invoice Line".Type::"Fixed Asset":
               GenerateBufferFromShipment("Sales Invoice Line");
            "Sales Invoice Line".Type::" ":
                EXIT(0D);
          END;
    
          SalesShipmentBuffer.RESET;
          SalesShipmentBuffer.SETRANGE("Document No.","Sales Invoice Line"."Document No.");
          SalesShipmentBuffer.SETRANGE("Line No." ,"Sales Invoice Line"."Line No.");
          IF SalesShipmentBuffer.FIND('-') THEN BEGIN
            SalesShipmentBuffer2 := SalesShipmentBuffer;
              IF SalesShipmentBuffer.NEXT = 0 THEN BEGIN
                SalesShipmentBuffer.GET(
                  SalesShipmentBuffer2."Document No.",SalesShipmentBuffer2."Line No.",SalesShipmentBuffer2."Entry No.");
                SalesShipmentBuffer.DELETE;
                EXIT(SalesShipmentBuffer2."Posting Date");;
              END ;
             SalesShipmentBuffer.CALCSUMS(Quantity);
             IF SalesShipmentBuffer.Quantity <> "Sales Invoice Line".Quantity THEN BEGIN
               SalesShipmentBuffer.DELETEALL;
               EXIT("Sales Invoice Header"."Posting Date");
             END;
          END ELSE
            EXIT("Sales Invoice Header"."Posting Date");
        END;
    
        PROCEDURE GenerateBufferFromValueEntry@2(SalesInvoiceLine2@1002 : Record 113);
        VAR
          ValueEntry@1000 : Record 5802;
          ItemLedgerEntry@1001 : Record 32;
          TotalQuantity@1003 : Decimal;
          Quantity@1004 : Decimal;
        BEGIN
          TotalQuantity := SalesInvoiceLine2."Quantity (Base)";
          ValueEntry.SETCURRENTKEY("Document No.","Posting Date");
          ValueEntry.SETRANGE("Document No.",SalesInvoiceLine2."Document No.");
          ValueEntry.SETRANGE("Posting Date","Sales Invoice Header"."Posting Date");
          ValueEntry.SETRANGE("Item Charge No.",'');
          ValueEntry.SETFILTER("Entry No.",'%1..',FirstValueEntryNo);
          IF ValueEntry.FIND('-') THEN
            REPEAT
              IF ItemLedgerEntry.GET(ValueEntry."Item Ledger Entry No.") THEN BEGIN
                IF SalesInvoiceLine2."Qty. per Unit of Measure" <> 0 THEN
                  Quantity := ValueEntry."Invoiced Quantity" / SalesInvoiceLine2."Qty. per Unit of Measure"
                ELSE
                  Quantity := ValueEntry."Invoiced Quantity";
                AddBufferEntry(
                  SalesInvoiceLine2,
                  -Quantity,
                  ItemLedgerEntry."Posting Date");
                TotalQuantity := TotalQuantity + ValueEntry."Invoiced Quantity";
              END;
              FirstValueEntryNo := ValueEntry."Entry No." + 1;
            UNTIL (ValueEntry.NEXT = 0) OR (TotalQuantity = 0);
        END;
    
        PROCEDURE GenerateBufferFromShipment@8(SalesInvoiceLine@1000 : Record 113);
        VAR
          SalesInvoiceHeader@1001 : Record 112;
          SalesInvoiceLine2@1002 : Record 113;
          SalesShipmentHeader@1006 : Record 110;
          SalesShipmentLine@1004 : Record 111;
          TotalQuantity@1003 : Decimal;
          Quantity@1005 : Decimal;
        BEGIN
          TotalQuantity := 0;
          SalesInvoiceHeader.SETCURRENTKEY("Order No.");
          SalesInvoiceHeader.SETFILTER("No.",'..%1',"Sales Invoice Header"."No.");
          SalesInvoiceHeader.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
          IF SalesInvoiceHeader.FIND('-') THEN
            REPEAT
              SalesInvoiceLine2.SETRANGE("Document No.",SalesInvoiceHeader."No.");
              SalesInvoiceLine2.SETRANGE("Line No.",SalesInvoiceLine."Line No.");
              SalesInvoiceLine2.SETRANGE(Type,SalesInvoiceLine.Type);
              SalesInvoiceLine2.SETRANGE("No.",SalesInvoiceLine."No.");
              SalesInvoiceLine2.SETRANGE("Unit of Measure Code",SalesInvoiceLine."Unit of Measure Code");
              IF SalesInvoiceLine2.FIND('-') THEN
                REPEAT
                  TotalQuantity := TotalQuantity + SalesInvoiceLine2.Quantity;
                UNTIL SalesInvoiceLine2.NEXT = 0;
            UNTIL SalesInvoiceHeader.NEXT = 0;
    
          SalesShipmentLine.SETCURRENTKEY("Order No.","Order Line No.");
          SalesShipmentLine.SETRANGE("Order No.","Sales Invoice Header"."Order No.");
          SalesShipmentLine.SETRANGE("Order Line No.",SalesInvoiceLine."Line No.");
          SalesShipmentLine.SETRANGE("Line No.",SalesInvoiceLine."Line No.");
          SalesShipmentLine.SETRANGE(Type,SalesInvoiceLine.Type);
          SalesShipmentLine.SETRANGE("No.",SalesInvoiceLine."No.");
          SalesShipmentLine.SETRANGE("Unit of Measure Code",SalesInvoiceLine."Unit of Measure Code");
          SalesShipmentLine.SETFILTER(Quantity,'<>%1',0);
    
          IF SalesShipmentLine.FIND('-') THEN
            REPEAT
              IF "Sales Invoice Header"."Get Shipment Used" THEN
                CorrectShipment(SalesShipmentLine);
              IF ABS(SalesShipmentLine.Quantity) <= ABS(TotalQuantity - SalesInvoiceLine.Quantity) THEN
                TotalQuantity := TotalQuantity - SalesShipmentLine.Quantity
              ELSE BEGIN
                IF ABS(SalesShipmentLine.Quantity)  > ABS(TotalQuantity) THEN
                  SalesShipmentLine.Quantity := TotalQuantity;
                Quantity :=
                  SalesShipmentLine.Quantity - (TotalQuantity - SalesInvoiceLine.Quantity);
    
                TotalQuantity := TotalQuantity - SalesShipmentLine.Quantity;
                SalesInvoiceLine.Quantity := SalesInvoiceLine.Quantity - Quantity;
    
                IF SalesShipmentHeader.GET(SalesShipmentLine."Document No.") THEN
                  BEGIN
                    AddBufferEntry(
                      SalesInvoiceLine,
                      Quantity,
                      SalesShipmentHeader."Posting Date");
                  END;
              END;
            UNTIL (SalesShipmentLine.NEXT = 0) OR (TotalQuantity = 0);
        END;
    
        PROCEDURE CorrectShipment@7(VAR SalesShipmentLine@1001 : Record 111);
        VAR
          SalesInvoiceLine@1000 : Record 113;
        BEGIN
          SalesInvoiceLine.SETCURRENTKEY("Shipment No.","Shipment Line No.");
          SalesInvoiceLine.SETRANGE("Shipment No.",SalesShipmentLine."Document No.");
          SalesInvoiceLine.SETRANGE("Shipment Line No.",SalesShipmentLine."Line No.");
          IF SalesInvoiceLine.FIND('-') THEN
             REPEAT
                SalesShipmentLine.Quantity := SalesShipmentLine.Quantity - SalesInvoiceLine.Quantity;
             UNTIL SalesInvoiceLine.NEXT = 0;
        END;
    
        PROCEDURE AddBufferEntry@3(SalesInvoiceLine@1001 : Record 113;QtyOnShipment@1002 : Decimal;PostingDate@1003 : Date);
        BEGIN
          SalesShipmentBuffer.SETRANGE("Document No.",SalesInvoiceLine."Document No.");
          SalesShipmentBuffer.SETRANGE("Line No.",SalesInvoiceLine."Line No.");
          SalesShipmentBuffer.SETRANGE("Posting Date",PostingDate);
          IF SalesShipmentBuffer.FIND('-') THEN BEGIN
            SalesShipmentBuffer.Quantity := SalesShipmentBuffer.Quantity + QtyOnShipment;
            SalesShipmentBuffer.MODIFY;
            EXIT;
          END;
    
          WITH SalesShipmentBuffer DO BEGIN
            "Document No." := SalesInvoiceLine."Document No.";
            "Line No." := SalesInvoiceLine."Line No.";
            "Entry No." := NextEntryNo;
            Type := SalesInvoiceLine.Type;
            "No." := SalesInvoiceLine."No.";
            Quantity := QtyOnShipment;
           "Posting Date" := PostingDate;
            INSERT;
            NextEntryNo := NextEntryNo + 1
          END;
        END;
    
        BEGIN
        END.
      }
    
    
    mvg Adriaan
  • Options
    MaximusMaximus Member Posts: 105
    Hoi Adriaan,

    het is idd laat, maar dan ben ik vaak productiever dan overdag :wink: Ik weet wat er mis is. Je hebt als GroupTotalFields No. ingegeven. Dit is goed, maar het werkt alleen als er een sleutel actief is waar dit veld ook in zit.
    Je moet het volgende doen:
    - Op T113 Sales Invoice Line een nieuwe sleutel toevoegen met alleen het veld No. erin;
    - In het Report DataItem Sales Invoice Line verander je de property DataItemTableView in het volgende: SORTING(No.).
    Je zal zien dat de GroupFooter dan wel wordt afgedrukt.

    Groeten, Max
  • Options
    Adriaan2kAdriaan2k Member Posts: 159
    Maximus wrote:
    Hoi Adriaan,

    het is idd laat, maar dan ben ik vaak productiever dan overdag :wink: Ik weet wat er mis is. Je hebt als GroupTotalFields No. ingegeven. Dit is goed, maar het werkt alleen als er een sleutel actief is waar dit veld ook in zit.
    Je moet het volgende doen:
    - Op T113 Sales Invoice Line een nieuwe sleutel toevoegen met alleen het veld No. erin;
    - In het Report DataItem Sales Invoice Line verander je de property DataItemTableView in het volgende: SORTING(No.).
    Je zal zien dat de GroupFooter dan wel wordt afgedrukt.

    Groeten, Max

    ik heb ook zitten kijken naar de sleutel, maar kon daar niets vreemd aan zien ](*,) . Is het ook mogelijk die sleutel toe te voegen aan de huidige gebruikte sleutel ? dat ga ik anders wel even proberen. Ik ben je zeer dankbaar voor je hulp =D>
    mvg Adriaan
  • Options
    MaximusMaximus Member Posts: 105
    Hoi Adriaan,

    ik zou de bestaande sleutel NOOIT aanpassen omdat dit de primaire sleutel is van T113. Je gaat dan dingen op andere plekken omver gooien en dit gaat ongetwijfeld problemen opleveren. Beter is om een nieuwe sleutel aan te maken. Succes!
Sign In or Register to comment.