Rem Test report

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 25

OBJECT Report 15000002 Remittance Test Report

{
OBJECT-PROPERTIES
{
Date=27-06-12;
Time=15:57:39;
Modified=Yes;
Version List=NAVNO4.00.01,PS11757,NP01;
}
PROPERTIES
{
CaptionML=[ENU=Remittance Test Report;
NOR=Remittering kontrollrapport];
}
DATAITEMS
{
{ PROPERTIES
{
DataItemTable=Table81;
DataItemTableView=SORTING(Journal Template Name,Journal Batch
Name,Remittance Agreement Code,Remittance Type);
DataItemVarName=Transaction;
OnPreDataItem=BEGIN
// Select lines from the journal:
Transaction.SETRANGE("Journal Template
Name",CurrentJnlLine."Journal Template Name");
Transaction.SETRANGE("Journal Batch
Name",CurrentJnlLine."Journal Batch Name");

GenLedgSetup.GET;
StoreJnlFilters.COPY(Transaction); // Store user-set
filters
WriteGroupHeader := TRUE;
TransactionNo := 0;
StoreAgreementCode := '';
END;

OnAfterGetRecord=BEGIN
TransactionNo := TransactionNo + 1;
TransTotal := 0;
Transaction.TESTFIELD("Remittance Account Code");
RemAccount.GET(Transaction."Remittance Account Code");
RemContract.GET(Transaction."Remittance Agreement
Code");

// Data Item Transaction is processing only one record


per Transaction,
// and moves to the last line of the current
transaction:
Transaction.SETRANGE("Remittance Agreement
Code",Transaction."Remittance Agreement Code");
Transaction.SETRANGE("Remittance
Type",Transaction."Remittance Type");
Transaction.SETRANGE("Remittance Account
Code",Transaction."Remittance Account Code");
Transaction.SETRANGE("Posting Date",Transaction."Posting
Date");
Transaction.SETRANGE("Account No.",Transaction."Account
No.");
Transaction.SETRANGE(Urgent,Transaction.Urgent);
Transaction.SETRANGE("Futures Contract
No.",Transaction."Futures Contract No.");
Transaction.SETRANGE("Futures Contract Exch.
Rate",Transaction."Futures Contract Exch. Rate");
Transaction.SETRANGE("Currency
Code",Transaction."Currency Code");
Transaction.SETRANGE("Currency
Factor",Transaction."Currency Factor");
Transaction.SETRANGE("Agreed Exch.
Rate",Transaction."Agreed Exch. Rate");
Transaction.SETRANGE("Agreed With",Transaction."Agreed
With");
// Split into structured (kid or ext. doc. no <> '') and
// structured (recipient ref. 1-3 <> '') payments

// NIOH >>
// IF (Transaction.KID = '') AND (Transaction."External
Document No." = '') THEN
IF (Transaction.KID = '') AND (Transaction."Remittance
Type" = Transaction."Remittance Type"::Domestic) THEN
// NIOH <<

Transaction.SETFILTER("Recipient Ref. 1",'<>%1','')


ELSE
Transaction.SETFILTER("Recipient Ref. 1",'=%1','');

Transaction.FIND('+');

// Reestablish/delete filters on the transaction fields


StoreJnlFilters.COPYFILTER("Remittance Agreement
Code",Transaction."Remittance Agreement Code");
StoreJnlFilters.COPYFILTER("Remittance
Type",Transaction."Remittance Type");
StoreJnlFilters.COPYFILTER("Remittance Account
Code",Transaction."Remittance Account Code");
StoreJnlFilters.COPYFILTER("Posting
Date",Transaction."Posting Date");
StoreJnlFilters.COPYFILTER("Account
No.",Transaction."Account No.");
StoreJnlFilters.COPYFILTER(Urgent,Transaction.Urgent);
StoreJnlFilters.COPYFILTER("Futures Contract
No.",Transaction."Futures Contract No.");
StoreJnlFilters.COPYFILTER("Futures Contract Exch.
Rate",Transaction."Futures Contract Exch. Rate");
StoreJnlFilters.COPYFILTER("Currency
Code",Transaction."Currency Code");
StoreJnlFilters.COPYFILTER("Currency
Factor",Transaction."Currency Factor");
StoreJnlFilters.COPYFILTER("Agreed Exch.
Rate",Transaction."Agreed Exch. Rate");
StoreJnlFilters.COPYFILTER("Agreed
With",Transaction."Agreed With");
StoreJnlFilters.COPYFILTER("Recipient Ref.
1",Transaction."Recipient Ref. 1");

// Locate currency info.


IF Transaction."Currency Code" <> '' THEN BEGIN
Currency.GET(Transaction."Currency Code");
IF Currency."EMU Currency" THEN
CurrExchRateText := Text000
ELSE
CurrExchRateText := Text001;
CurrencyCodeShow := Transaction."Currency Code";
CurrExchrateShow := ROUND(Transaction."Amount (LCY)" /
Transaction.Amount * 100,0.00001);
END ELSE BEGIN
// Show currency code as specified in General ledger
setup
CurrencyCodeShow := GenLedgSetup."LCY Code";
CurrExchRateText := '';
END;

// Page-break if new rem. account is written:


IF (StoreAgreementCode <> '') AND (StoreAgreementCode <>
Transaction."Remittance Account Code") THEN
CurrReport.NEWPAGE;
StoreAgreementCode := RemAccount.Code;
END;

ReqFilterFields=Account Type,Account No.;


GroupTotalFields=Remittance Agreement Code;
}
SECTIONS
{
{ PROPERTIES
{
SectionType=Header;
PrintOnEveryPage=Yes;
SectionWidth=18150;
SectionHeight=2538;
}
CONTROLS
{
{ 6 ;TextBox ;15900;846 ;2250 ;423 ;HorzAlign=Right;
SourceExpr=USERID }
{ 36 ;TextBox ;3150 ;1269 ;1500 ;423 ;SourceExpr="Journal
Template Name" }
{ 37 ;Label ;0 ;1269 ;3000 ;423 ;ParentControl=36 }
{ 3 ;TextBox ;0 ;423 ;7500 ;423 ;SourceExpr=COMPANYNAME }
{ 4 ;TextBox ;17700;423 ;450 ;423 ;CaptionML=[ENU=Page;
NOR=Side];

SourceExpr=CurrReport.PAGENO }
{ 5 ;Label ;16950;423 ;750 ;423 ;ParentControl=4 }
{ 1 ;Label ;0 ;0 ;7500 ;423 ;FontSize=8;
FontBold=Yes;
CaptionML=[ENU=Remittance
Test Report;
NOR=Remittering
kontrollrapport] }
{ 2 ;TextBox ;15000;0 ;3150 ;423 ;HorzAlign=Right;

SourceExpr=FORMAT(TODAY,0,4) }
{ 39 ;TextBox ;3150 ;1692 ;1500 ;423 ;SourceExpr="Journal Batch
Name" }
{ 38 ;Label ;0 ;1692 ;3000 ;423 ;ParentControl=39 }
}
}
{ PROPERTIES
{
SectionType=Header;
SectionWidth=18150;
SectionHeight=1692;
}
CONTROLS
{
{ 61 ;TextBox ;3150 ;423 ;1500 ;423 ;HorzAlign=Left;
FontBold=Yes;
CaptionML=[ENU=Remittance
account;

NOR=Remitteringskonto];
SourceExpr=RemAccount.Code
}
{ 62 ;Label ;0 ;423 ;3000 ;423 ;ParentControl=61;
FontBold=Yes;
MultiLine=Yes }
{ 42 ;TextBox ;4800 ;423 ;3600 ;423 ;HorzAlign=Left;
FontBold=Yes;

SourceExpr=RemAccount.Description }
{ 73 ;TextBox ;3150 ;846 ;2100 ;423 ;HorzAlign=Left;
FontBold=Yes;
CaptionML=[ENU=Bank
account no.;

NOR=Bankkontonr.];

SourceExpr=RemAccount."Bank Account No." }


{ 74 ;Label ;0 ;846 ;3000 ;423 ;ParentControl=73;
FontBold=Yes;
MultiLine=Yes }
{ 44 ;TextBox ;4800 ;0 ;3600 ;423 ;HorzAlign=Left;
FontBold=Yes;

SourceExpr=RemContract.Description }
{ 45 ;TextBox ;3150 ;0 ;1500 ;423 ;HorzAlign=Left;
FontBold=Yes;
CaptionML=[ENU=Remittance
agreement;

NOR=Remitteringsavtale];

SourceExpr=RemContract.Code }
{ 79 ;Label ;0 ;0 ;3000 ;423 ;ParentControl=45;
FontBold=Yes;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Header;
PrintOnEveryPage=Yes;
SectionWidth=18150;
SectionHeight=1269;
}
CONTROLS
{
{ 11 ;Label ;13500;0 ;1800 ;846 ;ParentControl=25;
HorzAlign=Right;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 16 ;Label ;5250 ;0 ;1500 ;846 ;ParentControl=30;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 17 ;Label ;3600 ;0 ;1500 ;846 ;ParentControl=31;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 18 ;Label ;1950 ;0 ;1500 ;846 ;ParentControl=33;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 20 ;Label ;1500 ;0 ;300 ;846 ;ParentControl=34;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 21 ;Label ;0 ;0 ;1350 ;846 ;ParentControl=35;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 69 ;Label ;16350;0 ;1800 ;846 ;ParentControl=68;
HorzAlign=Right;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 15 ;Label ;6900 ;0 ;6450 ;846 ;ParentControl=29;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
}
}
}
}
{ PROPERTIES
{
DataItemIndent=1;
DataItemTable=Table81;
DataItemTableView=SORTING(Journal Template Name,Journal Batch
Name,Remittance Agreement Code,Remittance Type);
OnPreDataItem=BEGIN
ErrorCounter := 0;
TransLineCounter := 0;
UnstructuredPaym := FALSE;

// Group together all payments within the transaction


// If the payments are not structured, then the max. no. of
payments within transaction is 8.
// In case of structured payments, max. no. of payments
within transaction is 999.
"Gen. Journal Line".SETRANGE("Journal Template
Name",Transaction."Journal Template Name");
"Gen. Journal Line".SETRANGE("Journal Batch
Name",Transaction."Journal Batch Name");
"Gen. Journal Line".SETRANGE("Remittance
Type",Transaction."Remittance Type");
"Gen. Journal Line".SETRANGE("Remittance Account
Code",Transaction."Remittance Account Code");
"Gen. Journal Line".SETRANGE("Posting
Date",Transaction."Posting Date");
"Gen. Journal Line".SETRANGE("Account
No.",Transaction."Account No.");
"Gen. Journal Line".SETRANGE(Urgent,Transaction.Urgent);
"Gen. Journal Line".SETRANGE("Futures Contract
No.",Transaction."Futures Contract No.");
"Gen. Journal Line".SETRANGE("Futures Contract Exch.
Rate",Transaction."Futures Contract Exch. Rate");
"Gen. Journal Line".SETRANGE("Currency
Code",Transaction."Currency Code");
"Gen. Journal Line".SETRANGE("Currency
Factor",Transaction."Currency Factor");
"Gen. Journal Line".SETRANGE("Agreed Exch.
Rate",Transaction."Agreed Exch. Rate");
"Gen. Journal Line".SETRANGE("Agreed
With",Transaction."Agreed With");
IF Transaction."Recipient Ref. 1" <> '' THEN BEGIN
"Gen. Journal Line".SETFILTER("Recipient Ref. 1",'<>
%1','');
UnstructuredPaym := TRUE;
END ELSE
"Gen. Journal Line".SETFILTER("Recipient Ref. 1",'=
%1','');

NumberOfPayments := "Gen. Journal Line".COUNT;


END;

OnAfterGetRecord=BEGIN
TransLineCounter := TransLineCounter + 1;
TransTotal := TransTotal + "Gen. Journal Line".Amount;
TotalAmountLCY := TotalAmountLCY + "Gen. Journal
Line"."Amount (LCY)";

AccountName := '';
CASE "Gen. Journal Line"."Account Type" OF
"Gen. Journal Line"."Account Type"::"G/L Account":
BEGIN
IF GenLedgAccount.GET("Account No.") THEN
AccountName := GenLedgAccount.Name;
END;
"Gen. Journal Line"."Account Type"::Customer: BEGIN
IF Customer.GET("Account No.") THEN
AccountName := Customer.Name;
END;
"Gen. Journal Line"."Account Type"::Vendor: BEGIN
IF Vendor.GET("Account No.") THEN
AccountName := Vendor.Name;
END;
"Gen. Journal Line"."Account Type"::"Bank Account":
BEGIN
IF BankAccount.GET("Account No.") THEN
AccountName := BankAccount.Name;
END;
END;

LineCheck("Gen. Journal Line");


SettleAccount(
RemAccount."Bank Account No.","Gen. Journal
Line"."Currency Code","Gen. Journal Line".Amount,
"Gen. Journal Line"."Amount (LCY)");

// Transaction is done. Check:


IF (NumberOfPayments = TransLineCounter) OR
(UnstructuredPaym AND ((TransLineCounter MOD 8) = 0))
OR ((TransLineCounter MOD 999) = 0) THEN
WriteGroupFooter := TRUE;
END;

OnPostDataItem=BEGIN
TransactionCheck("Gen. Journal Line");
END;

TotalFields=Amount,Amount (LCY);
}
SECTIONS
{
{ PROPERTIES
{
SectionType=Header;
SectionWidth=18150;
SectionHeight=846;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(WriteGroupHeader);
END;

}
CONTROLS
{
{ 43 ;TextBox ;0 ;0 ;18150;423 ;LeaderDots=Yes;
SourceExpr='' }
{ 64 ;TextBox ;2700 ;423 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr=TransactionNo }
{ 65 ;Label ;0 ;423 ;2550 ;423 ;ParentControl=64;
FontBold=No;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Header;
SectionWidth=18150;
SectionHeight=1692;
OnPreSection=BEGIN
IF (("Remittance Type" = "Remittance Type"::Domestic)
AND WriteGroupHeader) THEN
WriteGroupHeader := FALSE
ELSE
CurrReport.SHOWOUTPUT(FALSE);
END;

}
CONTROLS
{
{ 57 ;TextBox ;2700 ;423 ;1500 ;423 ;FontBold=No;
SourceExpr="Posting
Date" }
{ 58 ;Label ;0 ;423 ;2550 ;423 ;ParentControl=57;
FontBold=No;
MultiLine=Yes }
{ 59 ;TextBox ;2700 ;0 ;1500 ;423 ;FontBold=No;
CaptionML=[ENU=Vendor no.;

NOR=Leverand�rnr.];
SourceExpr="Account No." }
{ 60 ;Label ;0 ;0 ;2550 ;423 ;ParentControl=59;
FontBold=No;
MultiLine=Yes }
{ 75 ;TextBox ;8850 ;0 ;1500 ;423 ;FontBold=No;
CaptionML=[ENU=Domestic
payments;

NOR=Innenlandske betalinger];
SourceExpr="Remittance
Type" = "Remittance Type"::Domestic }
{ 76 ;Label ;6150 ;0 ;2550 ;423 ;ParentControl=75;
FontBold=No;
MultiLine=Yes }
{ 82 ;TextBox ;2700 ;846 ;3150 ;423 ;HorzAlign=Left;
FontBold=No;
CaptionML=[ENU=Recicpient
bank account no.;
NOR=Mottaker
bankkontonr.];

SourceExpr=Vendor."Recipient Bank Account No." }


{ 83 ;Label ;0 ;846 ;2550 ;423 ;ParentControl=82;
FontBold=No;
MultiLine=Yes }
{ 1000001;TextBox ;8850 ;423 ;1500 ;423 ;FontBold=No;
CaptionML=[ENU=Structured
payments;

NOR=Strukturerte betalinger];
SourceExpr=NOT
UnstructuredPaym }
{ 1000002;Label ;6150 ;423 ;2550 ;423 ;ParentControl=1000001;
FontBold=No;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Header;
SectionWidth=18150;
SectionHeight=2115;
OnPreSection=BEGIN
IF (("Remittance Type" = "Remittance Type"::Foreign) AND
WriteGroupHeader) THEN
WriteGroupHeader := FALSE
ELSE
CurrReport.SHOWOUTPUT(FALSE);
END;

}
CONTROLS
{
{ 50 ;TextBox ;14100;423 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr="Agreed With" }
{ 51 ;Label ;11400;423 ;2550 ;423 ;ParentControl=50;
FontBold=No;
MultiLine=Yes }
{ 46 ;TextBox ;8850 ;846 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr=Urgent }
{ 47 ;Label ;6150 ;846 ;2550 ;423 ;ParentControl=46;
FontBold=No;
MultiLine=Yes }
{ 9 ;TextBox ;2700 ;423 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr="Posting
Date" }
{ 22 ;Label ;0 ;423 ;2550 ;423 ;ParentControl=9;
FontBold=No;
MultiLine=Yes }
{ 40 ;TextBox ;8850 ;0 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
CaptionML=[ENU=Currency
code;

NOR=Valutakode];

SourceExpr=CurrencyCodeShow }
{ 41 ;Label ;6150 ;0 ;2550 ;423 ;ParentControl=40;
FontBold=No;
MultiLine=Yes;
CaptionML=[ENU=Currency
code;
NOR=Valutakode]
}
{ 48 ;TextBox ;14100;0 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr="Agreed Exch.
Rate" }
{ 49 ;Label ;11400;0 ;2550 ;423 ;ParentControl=48;
FontBold=No;
MultiLine=Yes }
{ 8 ;TextBox ;2700 ;0 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
CaptionML=[ENU=Vendor no.;

NOR=Leverand�rnr.];
SourceExpr="Account No." }
{ 23 ;Label ;0 ;0 ;2550 ;423 ;ParentControl=8;
FontBold=No;
MultiLine=Yes }
{ 52 ;TextBox ;14100;846 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr="Futures
Contract No." }
{ 53 ;Label ;11400;846 ;2550 ;423 ;ParentControl=52;
FontBold=No;
MultiLine=Yes }
{ 54 ;TextBox ;14100;1269 ;1500 ;423 ;HorzAlign=Left;
FontBold=No;
SourceExpr="Futures
Contract Exch. Rate" }
{ 55 ;Label ;11400;1269 ;2550 ;423 ;ParentControl=54;
FontBold=No;
MultiLine=Yes }
{ 32 ;TextBox ;8850 ;423 ;2250 ;423 ;HorzAlign=Left;
FontBold=No;
CaptionML=[ENU=Currency
exchange rate;

NOR=Valutakurs];
DecimalPlaces=5:5;
BlankZero=Yes;

SourceExpr=CurrExchrateShow }
{ 78 ;TextBox ;6150 ;423 ;2550 ;423 ;HorzAlign=Left;
FontBold=No;

SourceExpr=CurrExchRateText }
{ 80 ;TextBox ;2700 ;846 ;3150 ;423 ;HorzAlign=Left;
FontBold=No;
CaptionML=[ENU=Recipient
bank account no.;
NOR=Mottaker
bankkontonr.];

SourceExpr=Vendor."Recipient Bank Account No." }


{ 81 ;Label ;0 ;846 ;2550 ;423 ;ParentControl=80;
FontBold=No;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=423;
OnPreSection=BEGIN
WriteGroupHeader := TRUE;
WriteGroupFooter := TRUE;
END;

}
CONTROLS
{
{ 24 ;TextBox ;15450;0 ;750 ;423 ;SourceExpr="Currency Code"
}
{ 25 ;TextBox ;13500;0 ;1800 ;423 ;SourceExpr=Amount }
{ 29 ;TextBox ;6900 ;0 ;6450 ;423 ;SourceExpr=Description }
{ 30 ;TextBox ;5250 ;0 ;1500 ;423 ;CaptionML=[ENU=Name;
NOR=Navn];
SourceExpr=AccountName }
{ 31 ;TextBox ;3600 ;0 ;1500 ;423 ;SourceExpr="Account No." }
{ 33 ;TextBox ;1950 ;0 ;1500 ;423 ;SourceExpr="Document
No." }
{ 34 ;TextBox ;1500 ;0 ;300 ;423 ;CaptionML=[ENU=Document
type;

NOR=Bilagstype];
SourceExpr="Document Type"
}
{ 35 ;TextBox ;0 ;0 ;1350 ;423 ;CaptionML=[ENU=Posting
date;
NOR=Bokf.dato];
SourceExpr="Posting
Date" }
{ 68 ;TextBox ;16350;0 ;1800 ;423 ;SourceExpr="Amount
(LCY)" }
}
}
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=2115;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(ShowPaymentInfo AND ("Remittance
Type" = "Remittance Type"::Domestic));
END;

}
CONTROLS
{
{ 84 ;TextBox ;14250;1269 ;1950 ;423 ;HorzAlign=Left;
SourceExpr="Remittance
Account Code" }
{ 86 ;TextBox ;14250;0 ;3000 ;423 ;HorzAlign=Left;
SourceExpr="BOLS Text
Code" }
{ 87 ;Label ;11400;0 ;2700 ;423 ;ParentControl=86;
MultiLine=Yes }
{ 88 ;TextBox ;14250;423 ;1650 ;423 ;HorzAlign=Left;
SourceExpr="Payment Type
Code Inland" }
{ 89 ;Label ;11400;423 ;2700 ;423 ;ParentControl=88;
MultiLine=Yes }
{ 90 ;TextBox ;3450 ;1269 ;3450 ;423 ;HorzAlign=Left;
SourceExpr=KID }
{ 91 ;Label ;1500 ;1269 ;1800 ;423 ;ParentControl=90;
MultiLine=Yes }
{ 92 ;TextBox ;3450 ;0 ;4500 ;423 ;HorzAlign=Left;
SourceExpr="Recipient Ref.
1" }
{ 93 ;Label ;1500 ;0 ;1800 ;423 ;ParentControl=92;
MultiLine=Yes }
{ 94 ;TextBox ;3450 ;423 ;4500 ;423 ;HorzAlign=Left;
SourceExpr="Recipient Ref.
2" }
{ 95 ;Label ;1500 ;423 ;1800 ;423 ;ParentControl=94;
MultiLine=Yes }
{ 96 ;TextBox ;3450 ;846 ;4500 ;423 ;HorzAlign=Left;
SourceExpr="Recipient Ref.
3" }
{ 97 ;Label ;1500 ;846 ;1800 ;423 ;ParentControl=96;
MultiLine=Yes }
{ 85 ;Label ;11400;1269 ;2700 ;423 ;ParentControl=84;
MultiLine=Yes }
{ 108 ;TextBox ;14250;846 ;1950 ;423 ;HorzAlign=Left;
CaptionML=[ENU=Agreement
code;
NOR=Avtale
kode];

SourceExpr=RemContract.Code }
{ 109 ;Label ;11400;846 ;2700 ;423 ;ParentControl=108;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=2115;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(ShowPaymentInfo AND ("Remittance
Type" = "Remittance Type"::Foreign));
END;

}
CONTROLS
{
{ 98 ;TextBox ;5250 ;1269 ;600 ;423 ;HorzAlign=Left;
SourceExpr=Check }
{ 99 ;Label ;1500 ;1269 ;3600 ;423 ;ParentControl=98;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 100 ;TextBox ;5250 ;0 ;4500 ;423 ;HorzAlign=Left;
SourceExpr="Recipient Ref.
Abroad" }
{ 101 ;Label ;1500 ;0 ;3600 ;423 ;ParentControl=100;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 102 ;TextBox ;5250 ;846 ;2550 ;423 ;HorzAlign=Left;
SourceExpr="Payment Type
Code Abroad" }
{ 103 ;Label ;1500 ;846 ;3600 ;423 ;ParentControl=102;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 104 ;TextBox ;5250 ;423 ;5850 ;423 ;HorzAlign=Left;
SourceExpr="Specification
(Norges Bank)" }
{ 105 ;Label ;1500 ;423 ;3600 ;423 ;ParentControl=104;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 106 ;TextBox ;14250;423 ;1950 ;423 ;HorzAlign=Left;
SourceExpr="Remittance
Account Code" }
{ 107 ;Label ;11400;423 ;2700 ;423 ;ParentControl=106;
MultiLine=Yes }
{ 110 ;TextBox ;14250;0 ;1950 ;423 ;HorzAlign=Left;
CaptionML=[ENU=Agreement
code;
NOR=Avtale
kode];

SourceExpr=RemContract.Code }
{ 111 ;Label ;11400;0 ;2700 ;423 ;ParentControl=110;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Footer;
SectionWidth=18150;
SectionHeight=423;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(WriteGroupFooter);
WriteGroupFooter := FALSE;
END;

}
CONTROLS
{
{ 56 ;TextBox ;13500;0 ;1800 ;423 ;FontBold=Yes;
SourceExpr=Amount }
{ 63 ;TextBox ;15450;0 ;750 ;423 ;FontBold=Yes;
SourceExpr="Currency Code"
}
{ 70 ;TextBox ;16350;0 ;1800 ;423 ;FontBold=Yes;
SourceExpr="Amount
(LCY)" }
}
}
}
}
{ PROPERTIES
{
DataItemIndent=2;
DataItemTable=Table2000000026;
DataItemTableView=SORTING(Number)
WHERE(Number=FILTER(1..));
DataItemVarName=DimensionLoop;
OnPreDataItem=BEGIN
IF NOT ShowDim THEN
CurrReport.BREAK;
JnlLineDim.SETRANGE("Table ID",DATABASE::"Gen. Journal
Line");
JnlLineDim.SETRANGE("Journal Template Name","Gen. Journal
Line"."Journal Template Name");
JnlLineDim.SETRANGE("Journal Batch Name","Gen. Journal
Line"."Journal Batch Name");
JnlLineDim.SETRANGE("Journal Line No.","Gen. Journal
Line"."Line No.");
END;

OnAfterGetRecord=BEGIN
IF Number = 1 THEN BEGIN
IF NOT JnlLineDim.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',JnlLineDim."Dimension Code",JnlLineDim."Dimension Value Code")
ELSE
DimText :=
STRSUBSTNO(
'%1; %2 - %3',DimText,JnlLineDim."Dimension
Code",JnlLineDim."Dimension Value Code");
IF STRLEN(DimText) > MAXSTRLEN(OldDimText) THEN BEGIN
DimText := OldDimText;
Continue := TRUE;
EXIT;
END;
UNTIL (JnlLineDim.NEXT = 0);
END;

}
SECTIONS
{
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=423;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(Number = 1);
END;

}
CONTROLS
{
{ 1000000000;Label ;0 ;0 ;3000 ;423 ;CaptionML=[ENU=Dimensions;

NOR=Dimensjoner] }
{ 1000000001;TextBox;3150 ;0 ;15000;423 ;SourceExpr=DimText }
}
}
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=423;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(Number > 1);
END;

}
CONTROLS
{
{ 1000000002;TextBox;3150 ;0 ;15000;423 ;SourceExpr=DimText }
}
}
}
}
{ PROPERTIES
{
DataItemIndent=2;
DataItemTable=Table2000000026;
DataItemTableView=SORTING(Number);
DataItemVarName=ErrorLoopPayment;
OnPreDataItem=BEGIN
SETRANGE(Number,1,ErrorCounter);
END;

OnPostDataItem=BEGIN
ErrorCounter := 0;
END;

}
SECTIONS
{
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=423;
}
CONTROLS
{
{ 10 ;TextBox ;0 ;0 ;18150;423 ;CaptionML=[ENU=Warning!;
NOR=Advarsel!];

SourceExpr=ErrorText[Number] }
}
}
}
}
{ PROPERTIES
{
DataItemIndent=1;
DataItemTable=Table2000000026;
DataItemTableView=SORTING(Number);
DataItemVarName=ErrorLoopTransaction;
OnPreDataItem=BEGIN
SETRANGE(Number,1,ErrorCounter);
END;

OnPostDataItem=BEGIN
ErrorCounter := 0;
END;

}
SECTIONS
{
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=423;
}
CONTROLS
{
{ 67 ;TextBox ;0 ;0 ;18150;423 ;CaptionML=[ENU=Warning!;
NOR=Advarsel!];

SourceExpr=ErrorText[Number] }
}
}
{ PROPERTIES
{
SectionType=Footer;
SectionWidth=18150;
SectionHeight=423;
}
CONTROLS
{
}
}
}
}
{ PROPERTIES
{
DataItemTable=Table2000000026;
DataItemTableView=SORTING(Number);
MaxIteration=1;
DataItemVarName=ReportTotal;
}
SECTIONS
{
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=846;
}
CONTROLS
{
{ 71 ;TextBox ;16350;423 ;1800 ;423 ;FontBold=Yes;
CaptionML=[ENU=Total
amount (LCY);
NOR=I alt
(NOK)];

SourceExpr=TotalAmountLCY }
{ 72 ;Label ;13500;423 ;2700 ;423 ;ParentControl=71;
FontBold=Yes;
MultiLine=Yes }
}
}
}
}
{ PROPERTIES
{
DataItemTable=Table2000000026;
DataItemTableView=SORTING(Number);
DataItemVarName=Settlementloop;
OnPreDataItem=BEGIN
SETRANGE(Number,1,SettleCounter);
END;

OnPostDataItem=BEGIN
SettleCounter := 0;
END;

}
SECTIONS
{
{ PROPERTIES
{
SectionType=Header;
SectionWidth=18150;
SectionHeight=1692;
}
CONTROLS
{
{ 12 ;Label ;0 ;0 ;4500 ;423 ;FontBold=Yes;
CaptionML=[ENU=Settlement;
NOR=Avstemning]
}
{ 13 ;Label ;0 ;423 ;2400 ;846 ;ParentControl=77;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 14 ;Label ;5400 ;423 ;1800 ;846 ;ParentControl=27;
HorzAlign=Right;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 19 ;Label ;2550 ;423 ;1800 ;846 ;ParentControl=28;
HorzAlign=Right;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
}
}
{ PROPERTIES
{
SectionType=Body;
SectionWidth=18150;
SectionHeight=423;
}
CONTROLS
{
{ 28 ;TextBox ;2550 ;0 ;1800 ;423 ;CaptionML=[ENU=Net change;
NOR=Bevegelse];

SourceExpr=SettleNetChange[Number] }
{ 77 ;TextBox ;0 ;0 ;2400 ;423 ;CaptionML=[ENU=Bank
account no.;

NOR=Bankkontonr.];

SourceExpr=SettleBankAccountNo[Number] }
{ 26 ;TextBox ;4500 ;0 ;750 ;423 ;CaptionML=[ENU=Net change;
NOR=Bevegelse];
SourceExpr=SettleCurrencyCode[Number] }
{ 27 ;TextBox ;5400 ;0 ;1800 ;423 ;CaptionML=[ENU=Net change
(LCY);
NOR=Bevegelse
(NOK)];

SourceExpr=SettleNetChangeLCY[Number] }
}
}
}
}
}
REQUESTFORM
{
PROPERTIES
{
Width=3850;
Height=1100;
SaveValues=Yes;
}
CONTROLS
{
{ 1 ;CheckBox ;3410 ;0 ;440 ;440 ;ShowCaption=No;
CaptionML=[ENU=Show payment
info;
NOR=Vis
betalingsinformasjon];
SourceExpr=ShowPaymentInfo }
{ 2 ;Label ;0 ;0 ;3300 ;440 ;ParentControl=1 }
{ 1000000000;CheckBox;3410;660 ;440 ;440 ;ShowCaption=No;
CaptionML=[ENU=Show Dimensions;
NOR=Vis dimensjoner];
SourceExpr=ShowDim }
{ 1000000001;Label ;0 ;660 ;3300 ;440 ;ParentControl=1000000000 }
}
}
REQUESTPAGE
{
PROPERTIES
{
SaveValues=Yes;
}
CONTROLS
{
{ 1900000001;0;Container;
ContainerType=ContentArea }

{ 1900000002;1;Group ;
CaptionML=ENU=Options }

{ 1 ;2 ;Field ;
CaptionML=[ENU=Show payment info;
NOR=Vis betalingsinformasjon];
SourceExpr=ShowPaymentInfo }

{ 1000000000;2;Field ;
CaptionML=[ENU=Show Dimensions;
NOR=Vis dimensjoner];
SourceExpr=ShowDim }

}
}
CODE
{
VAR
Text000@1000000036 : TextConst 'ENU="Currency exch. rate (to LCY)
";NOR="Valutakurs (mot NOK) "';
Text001@1000000037 : TextConst 'ENU=Currency exchange rate;NOR=Valutakurs';
Text002@1000000038 : TextConst 'ENU=Both Recipient ref. and KID/External
Document No. are filled in. They can not be used both at the same
time.;NOR=Mottakerref. og KID/Fakturanr. er begge fyllt ut. Mottakerref. kan ikke
brukes sammen med KID eller fakturanr.';
Text003@1000000039 : TextConst 'ENU=There are no messages for beneficiary.
You have to fill in Recipient ref., External Document No., or KID.;NOR=Det er ingen
melding til betalingsmottaker. Mottakerref., fakturanr. eller KID m� fylles ut.';
Text004@1000000040 : TextConst 'ENU=Currency payments are not used for
payments inland. Use Amount (LCY) for payments.;NOR=Betaling i valuta er ikke mulig
med innlandske betalinger. Bel�pet i NOK benyttes ved betaling.';
Text005@1000000041 : TextConst 'ENU=Field %1 is filled in, but can not be use
for payments inland.;NOR=Feltet %1 er fyllt ut, men kan ikke brukes ved
innenlandske betalinger.';
Text006@1000000042 : TextConst 'ENU=LCY;NOR=NOK';
Text007@1000000043 : TextConst 'ENU=Curency code LCY is
specified.;NOR=Valutakoden NOK er angitt.';
Text008@1000000044 : TextConst 'ENU=This is the local currency code,
specified with <blank>.;NOR=Dette er den lokale valutakoden som skal angis med
<blank>.';
Text009@1000000045 : TextConst 'ENU=Field %1 is filled in, but can not be
used for payments abroad.;NOR=Feltet %1 er fyllt ut, men kan ikke brukes ved
utenlandske betalinger.';
Text010@1000000046 : TextConst 'ENU=%1 should be %2. Only the vendors are
remitted.;NOR=%1 skal v�re %2. Kun leverand�rer kan remitteres.';
Text011@1000000047 : TextConst 'ENU=Field %1 is not in use for remittance and
should be left empty.;NOR=Feltet %1 brukes ikke ved remittering og m� ikke fylles
ut.';
Text012@1000000048 : TextConst 'ENU=Field %1 is filled in in settlement
return, and should be left empty now.;NOR=Feltet %1 settes automatisk ved
avregningsretur og m� ikke fylles ut n�.';
Text013@1000000049 : TextConst 'ENU=%1 should be left empty when "paying"
credit memo/debit entry.;NOR=%1 skal v�re blank ved "betaling" av kreditnota/debet
post.';
Text014@1000000050 : TextConst 'ENU=Due date and cash discount date are both
the same saturday/sunday;NOR=Betalingsdato og kontantrabattdato ligger p� samme
l�rdag/s�ndag.';
Text015@1000000051 : TextConst 'ENU=Payment is not due before monday, when
the cash discount date is exceeded.;NOR=Betaling skjer tidligst mandag og
kontantrabattdato vil derfor bli overskredet.';
Text016@1000000052 : TextConst 'ENU=Credit memo offset can not be made in
arrear;NOR=Motregning av kreditnota kan ikke skje tilbake i tiden';
Text017@1000000053 : TextConst 'ENU=and should not come before %1.;NOR=og m�
ikke ligge f�r %1.';
Text018@1000000054 : TextConst 'ENU=Transaction amount can not be
negative;NOR=Transaksjonsbel�p m� ikke v�re negativt.';
Text019@1000000055 : TextConst 'ENU=+12M-1D;NOR=+12M-1D';
Text020@1000000056 : TextConst 'ENU=12 months;NOR=12 m�neder';
Text021@1000000057 : TextConst 'ENU=+13M-1D;NOR=+13M-1D';
Text022@1000000058 : TextConst 'ENU=13 months;NOR=13 m�neder';
Text023@1000000059 : TextConst 'ENU=Payment must be made within %1, and
should not be due after %2.;NOR=Betaling kan skje maksimalt %1 frem i tiden og m�
ikke ligge etter %2.';
Text024@1000000060 : TextConst 'ENU=-12M;NOR=-12M';
Text025@1000000061 : TextConst 'ENU=Payment must be made up to one year in
arrear, and should not be due before %1.;NOR=Betaling kan skje maksimalt et �r
tilbake i tiden og m� ikke ligge f�r %1.';
Text026@1000000062 : TextConst 'ENU=Warning!;NOR=Advarsel!';
Text027@1000000063 : TextConst 'ENU=Note:;NOR=Bemerkning:';
Text028@1000000064 : TextConst 'ENU=<other accounts>;NOR=<other accounts>';
RemContract@1000000000 : Record 15000000;
RemAccount@1000000001 : Record 15000003;
GenLedgAccount@1000000002 : Record 15;
Customer@1000000003 : Record 18;
Vendor@1000000004 : Record 23;
BankAccount@1000000005 : Record 270;
CurrentJnlLine@1000000006 : Record 81;
StoreJnlFilters@1000000007 : Record 81;
Currency@1000000008 : Record 4;
GenLedgSetup@1000000009 : Record 98;
JnlLineDim@1000000033 : Record 356;
RemTools@1000000010 : Codeunit 15000002;
ErrorCounter@1000000011 : Integer;
ErrorText@1000000012 : ARRAY [50] OF Text[250];
AccountName@1000000013 : Text[50];
WriteGroupHeader@1000000014 : Boolean;
WriteGroupFooter@1000000015 : Boolean;
TransactionNo@1000000016 : Integer;
StoreAgreementCode@1000000017 : Code[10];
TransLineCounter@1000000018 : Integer;
NumberOfPayments@1000000019 : Integer;
TotalAmountLCY@1000000020 : Decimal;
TransTotal@1000000021 : Decimal;
SettleCounter@1000000022 : Integer;
SettleNetChange@1000000023 : ARRAY [20] OF Decimal;
SettleNetChangeLCY@1000000024 : ARRAY [20] OF Decimal;
SettleBankAccountNo@1000000025 : ARRAY [20] OF Code[20];
SettleCurrencyCode@1000000026 : ARRAY [20] OF Code[10];
CurrExchRateText@1000000027 : Text[50];
CurrExchrateShow@1000000028 : Decimal;
CurrencyCodeShow@1000000029 : Code[10];
ShowPaymentInfo@1000000030 : Boolean;
ShowDim@1000000031 : Boolean;
DimText@1000000032 : Text[120];
OldDimText@1000000035 : Text[75];
Continue@1000000034 : Boolean;
Text029@1000000 : TextConst 'ENU=Bank name and adr. should be blank if the
swift adr. is filled out. Filling out these fileds might be charged with the
fee.;NOR=Det skal ikke ligge noen informasjon i feltene for Banknavn/adresse.
Informasjon i disse feltene kan medf�re gebyr.';
Text030@1000001 : TextConst 'ENU=Swift adress should always be filled out and
must be filled out for payments within EU.;NOR=Swift adresse b�r alltid fylles ut
og skal fylles ut for betalinger innen EU.';
Text031@1000003 : TextConst 'ENU=Recipients bank country code is mandatory if
the swift adress is not used.;NOR=Mottakers bank landkode m� fylles ut hvis ikke
swift adresse benyttes';
Text032@1000004 : TextConst 'ENU=Bank Code is used only if IBAN is not used,
and recipient country is one of the following countries:
''AU'',''CA'',''IE'',''GB'',''CH'',''ZA'',''DE'',''US'',''AT'';NOR=Bankkoden kan
ikke brukes sammen med IBAN. I tillegg m� mottakers landkode v�re en av f�lgende:
''AU'',''CA'',''IE'',''GB'',''CH'',''ZA'',''DE'',''US'',''AT''';
Text033@1000005 : TextConst 'ENU=Field %1 is mandatory for payments
abroad;NOR=Feltet %1 m� fylles ut ved utenlandske betalinger';
UnstructuredPaym@1000002 : Boolean;

PROCEDURE SetJournal@1(GenJnlLine@1000000000 : Record 81);


BEGIN
CurrentJnlLine := GenJnlLine;
END;

LOCAL PROCEDURE LineCheck@2(GenJnlLine@1000000000 : Record 81);


VAR
VendEntry@1000000001 : Record 25;
PaymentDay@1000000002 : Record 2000000007;
CashDiscountDay@1000000003 : Record 2000000007;
BEGIN
RemAccount.GET(GenJnlLine."Remittance Account Code");
IF GenJnlLine."Applies-to Doc. No." = '' THEN
VendEntry.INIT
ELSE
RemTools.SearchEntry(GenJnlLine,VendEntry);

// Make sure the user doesn't confuse inland and abroad, + misc. control:
IF RemAccount.Type = RemAccount.Type::Domestic THEN BEGIN
// If KID or External Doc. No. is in use, the recipient ref. should be left
empty:

// NIOH >>
// IF ((GenJnlLine.KID <> '') OR (GenJnlLine."External Document No." <>
'')) AND
IF (GenJnlLine.KID <> '') AND
// NIOH <<

((GenJnlLine."Recipient Ref. 1" <> '') OR


(GenJnlLine."Recipient Ref. 2" <> '') OR
(GenJnlLine."Recipient Ref. 3" <> ''))
THEN
AdditionError(
STRSUBSTNO(Text002,
GenJnlLine.FIELDCAPTION(KID)),TRUE);
// Both KID and recipient ref. are empty, and there is no message for
vendor:
IF (GenJnlLine.KID = '') AND
(GenJnlLine."External Document No." = '') AND
(GenJnlLine."Recipient Ref. 1" = '') AND
(GenJnlLine."Recipient Ref. 2" = '') AND
(GenJnlLine."Recipient Ref. 3" = '')
THEN
AdditionError(
STRSUBSTNO(Text003,
GenJnlLine.FIELDCAPTION("Recipient Ref. 1")),TRUE);
IF GenJnlLine."Currency Code" <> '' THEN
AdditionError(
STRSUBSTNO(Text004),
FALSE);
IF GenJnlLine.Urgent THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION(Urgent)),FALSE);
IF GenJnlLine."Agreed Exch. Rate" <> 0 THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Agreed Exch. Rate")),FALSE);
IF GenJnlLine."Agreed With" <> '' THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Agreed With")),FALSE);
IF GenJnlLine."Futures Contract No." <> '' THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Futures Contract No.")),FALSE);
IF GenJnlLine."Futures Contract Exch. Rate" <> 0 THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Futures Contract Exch. Rate")),FALSE);
IF GenJnlLine.Check <> 0 THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION(Check)),FALSE);
IF GenJnlLine."Recipient Ref. Abroad" <> '' THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Recipient Ref. Abroad")),FALSE);
IF GenJnlLine."Payment Type Code Abroad" <> '' THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Payment Type Code Abroad")),FALSE);
IF GenJnlLine."Specification (Norges Bank)" <> '' THEN
AdditionError(
STRSUBSTNO(Text005,
GenJnlLine.FIELDCAPTION("Specification (Norges Bank)")),FALSE);
END ELSE BEGIN
IF GenJnlLine."Currency Code" = Text006 THEN
AdditionError(
STRSUBSTNO(Text007 +
Text008,
GenJnlLine."Currency Code"),TRUE);
IF GenJnlLine."BOLS Text Code" <> 0 THEN
AdditionError(
STRSUBSTNO(Text009,
GenJnlLine.FIELDCAPTION("BOLS Text Code")),FALSE);
IF GenJnlLine."Payment Type Code Inland" <> '' THEN
AdditionError(
STRSUBSTNO(Text009,
GenJnlLine.FIELDCAPTION("Payment Type Code Inland")),FALSE);
IF GenJnlLine."Recipient Ref. 1" <> '' THEN
AdditionError(
STRSUBSTNO(Text009,
GenJnlLine.FIELDCAPTION("Recipient Ref. 1")),FALSE);
IF GenJnlLine."Recipient Ref. 2" <> '' THEN
AdditionError(
STRSUBSTNO(Text009,
GenJnlLine.FIELDCAPTION("Recipient Ref. 2")),FALSE);
IF GenJnlLine."Recipient Ref. 3" <> '' THEN
AdditionError(
STRSUBSTNO(Text009,
GenJnlLine.FIELDCAPTION("Recipient Ref. 3")),FALSE);
IF Vendor.GET(GenJnlLine."Account No.") THEN;
IF (Vendor."Bank Name" <> '') AND (Vendor."Bank Adress 1" <> '') AND
(Vendor.SWIFT <> '') THEN
AdditionError(Text029,FALSE);
Currency.GET(GenJnlLine."Currency Code");
IF (Currency."EMU Currency") AND (Vendor.SWIFT = '') THEN
AdditionError(Text030,FALSE);
IF (Vendor."Country Code" = '') THEN
AdditionError(
STRSUBSTNO(Text033,
Vendor.FIELDCAPTION("Country Code")),FALSE);
IF (Vendor."Recipient Bank Country Code" = '') AND (Vendor.SWIFT = '') THEN
AdditionError(Text031,FALSE);
IF (Vendor."Recipient Bank Account No." <> '') AND
(COPYSTR(Vendor."Recipient Bank Account No.",1,2) <>
COPYSTR(Vendor."Recipient Bank Country Code",1,2)) THEN

// NP01 >>
// IF NOT (Vendor."Recipient Bank Country Code" IN
['AU','CA','IE','GB','CH','ZA','DE','US','AT']) THEN
IF NOT (Vendor."Recipient Bank Country Code" IN
['AU','CA','IE','GB','CH','ZA','DE','US','AT','SG','CN']) THEN
// NP01 <<

AdditionError(Text032,FALSE);
IF GenJnlLine."Payment Type Code Abroad" = '' THEN
AdditionError(
STRSUBSTNO(Text033,
GenJnlLine.FIELDCAPTION("Payment Type Code Abroad")),FALSE);
IF GenJnlLine."Specification (Norges Bank)" = '' THEN
AdditionError(
STRSUBSTNO(Text033,
GenJnlLine.FIELDCAPTION("Specification (Norges Bank)")),FALSE);
END;

IF GenJnlLine."Account Type" <> GenJnlLine."Account Type"::Vendor THEN


AdditionError(
STRSUBSTNO(Text010,
GenJnlLine.FIELDCAPTION("Account Type"),GenJnlLine."Account Type"),TRUE);
IF GenJnlLine."Bal. Account No." <> '' THEN
AdditionError(
STRSUBSTNO(Text011,
GenJnlLine.FIELDCAPTION("Bal. Account No.")),TRUE);
IF GenJnlLine."Document No." <> '' THEN
AdditionError(
STRSUBSTNO(Text012,
GenJnlLine.FIELDCAPTION("Document No.")),TRUE);
IF (GenJnlLine.Amount < 0) AND (GenJnlLine."Document Type" <> 0) THEN
AdditionError(
STRSUBSTNO(Text013,
GenJnlLine.FIELDCAPTION("Document Type")),TRUE);
// Both payment and cash discount are due on the same saturday/sunday
IF (PaymentDay.GET(PaymentDay."Period Type"::Date,GenJnlLine."Posting Date"))
AND
(CashDiscountDay.GET(CashDiscountDay."Period Type"::Date,VendEntry."Pmt.
Discount Date"))
THEN
IF (PaymentDay."Period No." IN [6,7]) AND
(CashDiscountDay."Period No." IN [6,7]) AND
((VendEntry."Pmt. Discount Date" - GenJnlLine."Posting Date") IN [0,1])
THEN
AdditionError(
STRSUBSTNO(Text014 +
Text015),FALSE);
// Postbanken control: Credit memo - date should not be prior to today:
IF RemContract."Payment System" = RemContract."Payment System"::Postbanken
THEN
IF (GenJnlLine."Posting Date" < TODAY) AND (GenJnlLine.Amount < 0) THEN
AdditionError(
STRSUBSTNO(Text016 +
Text017,TODAY),TRUE);
END;

LOCAL PROCEDURE TransactionCheck@4(GenJnlLine@1000000000 : Record 81);


VAR
MaxDate@1000000001 : Date;
MessageText@1000000002 : Text[100];
BEGIN
IF TransTotal <= 0 THEN
AdditionError(Text018,TRUE);

// Payment made up to 12/13 mths. in advance


IF RemContract."Payment System" = RemContract."Payment System"::BBS THEN
BEGIN
MaxDate := CALCDATE(Text019,TODAY);
MessageText := Text020;
END ELSE BEGIN
MaxDate := CALCDATE(Text021,TODAY);
MessageText := Text022;
END;
IF GenJnlLine."Posting Date" > MaxDate THEN
AdditionError(
STRSUBSTNO(Text023,MessageText,MaxDate),TRUE);

// Payment made up to 1 year in arrear:


MaxDate := CALCDATE(Text024, TODAY);
IF GenJnlLine."Posting Date" < MaxDate THEN
AdditionError(
STRSUBSTNO(Text025,MaxDate),TRUE);
END;

LOCAL PROCEDURE AdditionError@3(Text@1000000000 : Text[250];Fatal@1000000001 :


Boolean);
BEGIN
// Fatal=True: Fatal error, export of payments is aborted.
// Fatal=False: Error (not fatal), processing continues.
ErrorCounter := ErrorCounter + 1;
IF Fatal THEN
ErrorText[ErrorCounter] := Text026 + Text
ELSE
ErrorText[ErrorCounter] := Text027 + Text;
END;

LOCAL PROCEDURE SettleAccount@8(BankAccountNo@1000000000 :


Code[20];CurrencyCode@1000000001 : Code[10];SettleAmount@1000000002 :
Decimal;SettleAmountLCY@1000000003 : Decimal);
VAR
i@1000000004 : Integer;
BEGIN
IF BankAccountNo <> '' THEN BEGIN
i := 1;
WHILE
(i < SettleCounter) AND
((SettleBankAccountNo[i] <> BankAccountNo) OR (SettleCurrencyCode[i] <>
CurrencyCode))
DO
i := i + 1;
IF (SettleBankAccountNo[i] = BankAccountNo) AND (SettleCurrencyCode[i] =
CurrencyCode) THEN BEGIN
SettleNetChange[i] := SettleNetChange[i] + SettleAmount;
SettleNetChangeLCY[SettleCounter] := SettleNetChangeLCY[SettleCounter] +
SettleAmountLCY;
END ELSE
IF SettleCounter < ARRAYLEN(SettleBankAccountNo) THEN BEGIN
SettleCounter := SettleCounter + 1;
SettleBankAccountNo[SettleCounter] := BankAccountNo;
SettleCurrencyCode[SettleCounter] := CurrencyCode;
SettleNetChange[SettleCounter] := SettleNetChange[SettleCounter] +
SettleAmount;
SettleNetChangeLCY[SettleCounter] := SettleNetChangeLCY[SettleCounter]
+ SettleAmountLCY;
END ELSE BEGIN
SettleBankAccountNo[SettleCounter] := Text028;
SettleCurrencyCode[SettleCounter] := Text006;
SettleNetChange[SettleCounter] := SettleNetChange[SettleCounter] +
SettleAmountLCY;
SettleNetChangeLCY[SettleCounter] := SettleNetChangeLCY[SettleCounter]
+ SettleAmountLCY;
END;
END;
END;

BEGIN
{
MBS Navision NO - Remittance
NP01 NIOH 27.06.2012: Lagt til 'SG' og 'CN' over "mulige remitteringsland"
}
END.
}
RDLDATA
{
}
}

You might also like