yes i modified the code:
1) For the Cheque no and Cheque date was not coming in gen journal line
2) Gen Journal Line Document no was getting replaced with Cheque No
3) Check ledger entry the Document no was getting replaced with Cheque No
1) For the Cheque no and Cheque date was not coming in gen journal line
2) Gen Journal Line Document no was getting replaced with Cheque No
3) Check ledger entry the Document no was getting replaced with Cheque No
{ This code was before
IF NOT TestPrint THEN BEGIN
IF UseCheckNo <> GenJnlLine."Document No." THEN BEGIN
GenJnlLine3.RESET;
GenJnlLine3.SETCURRENTKEY("Journal Template Name","Journal Batch Name","Posting Date","Document No.");
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3.SETRANGE("Posting Date",GenJnlLine."Posting Date");
GenJnlLine3.SETRANGE("Document No.",UseCheckNo);
IF GenJnlLine3.FIND('-') THEN
GenJnlLine3.FIELDERROR("Document No.",STRSUBSTNO(Text013,UseCheckNo));
END;
IF ApplyMethod <> ApplyMethod::MoreLinesOneEntry THEN BEGIN
GenJnlLine3 := GenJnlLine;
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.MODIFY;
END ELSE BEGIN
IF GenJnlLine2.FIND('-') THEN BEGIN
HighestLineNo := GenJnlLine2."Line No.";
REPEAT
IF GenJnlLine2."Line No." > HighestLineNo THEN
HighestLineNo := GenJnlLine2."Line No.";
GenJnlLine3 := GenJnlLine2;
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Bal. Account No." := '';
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::" ";
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.VALIDATE(Amount);
GenJnlLine3.MODIFY;
UNTIL GenJnlLine2.NEXT = 0;
END;
COMMIT;
CLEAR(CheckManagement);
This code was before }
//this code is updated
IF NOT TestPrint THEN BEGIN
IF UseCheckNo <> GenJnlLine."Document No." THEN BEGIN
GenJnlLine3.RESET;
GenJnlLine3.SETCURRENTKEY("Journal Template Name","Journal Batch Name","Posting Date","Document No.");
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3.SETRANGE("Posting Date",GenJnlLine."Posting Date");
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3.SETRANGE("Document No.",UseCheckNo);
IF GenJnlLine3.FIND('-') THEN
GenJnlLine3.FIELDERROR("Document No.",STRSUBSTNO(Text013,UseCheckNo));
END ELSE BEGIN
GenJnlLine3.SETRANGE("Cheque No.",UseCheckNo);
IF GenJnlLine3.FIND('-') THEN
GenJnlLine3.FIELDERROR("Cheque No.",STRSUBSTNO(Text013,UseCheckNo));
END;
END;
IF ApplyMethod <> ApplyMethod::MoreLinesOneEntry THEN BEGIN
GenJnlLine3 := GenJnlLine;
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" = 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END ELSE BEGIN
GenJnlLine3."Cheque No." := UseCheckNo;
GenJnlLine3."Cheque Date" := WORKDATE;
IF GenJnlLine."Cheque Date" = 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.MODIFY;
END ELSE BEGIN
IF GenJnlLine2.FIND('-') THEN BEGIN
HighestLineNo := GenJnlLine2."Line No.";
REPEAT
IF GenJnlLine2."Line No." > HighestLineNo THEN
HighestLineNo := GenJnlLine2."Line No.";
GenJnlLine3 := GenJnlLine2;
IF NOT GLSetup."Activate Cheque No." THEN
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Bal. Account No." := '';
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::" ";
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END ELSE BEGIN
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.VALIDATE(Amount);
GenJnlLine3.MODIFY;
UNTIL GenJnlLine2.NEXT = 0;
END;
GenJnlLine3.RESET;
GenJnlLine3 := GenJnlLine;
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3."Line No." := HighestLineNo;
IF GenJnlLine3.NEXT = 0 THEN
GenJnlLine3."Line No." := HighestLineNo + 10000
ELSE BEGIN
WHILE GenJnlLine3."Line No." = HighestLineNo + 1 DO BEGIN
HighestLineNo := GenJnlLine3."Line No.";
IF GenJnlLine3.NEXT = 0 THEN
GenJnlLine3."Line No." := HighestLineNo + 20000;
END;
GenJnlLine3."Line No." := (GenJnlLine3."Line No." + HighestLineNo) DIV 2;
END;
GenJnlLine3.INIT;
GenJnlLine3.VALIDATE("Posting Date",GenJnlLine."Posting Date");
GenJnlLine3."Document Type" := GenJnlLine."Document Type";
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END ELSE BEGIN
GenJnlLine3."Document No." := GenJnlLine."Document No.";
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END;
GenJnlLine3."Account Type" := GenJnlLine3."Account Type"::"Bank Account";
GenJnlLine3.VALIDATE("Account No.",BankAcc2."No.");
IF BalancingType <> BalancingType::"G/L Account" THEN
GenJnlLine3.Description := STRSUBSTNO(Text014,SELECTSTR(BalancingType + 1,Text062),BalancingNo);
GenJnlLine3.VALIDATE(Amount,-TotalLineAmount);
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::"Computer Check";
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3."Source Code" := GenJnlLine."Source Code";
GenJnlLine3."Reason Code" := GenJnlLine."Reason Code";
GenJnlLine3."Allow Zero-Amount Posting" := TRUE;
GenJnlLine3."Shortcut Dimension 1 Code" := GenJnlLine."Shortcut Dimension 1 Code";
GenJnlLine3."Shortcut Dimension 2 Code" := GenJnlLine."Shortcut Dimension 2 Code";
GenJnlLine3.INSERT;
END;
END;
Comments
Check whether Cheque Date field has value or not in Gen. Journal Line
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
value
on report section my textbox contains:GenJnlLine."Cheque Date"
Stivan D'souza
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
but the user is with Nav 4.0
Stivan D'souza
Still I have not found GenJnlLine."Cheque Date" in any section :shock:
Are you sure you have not added/modified this?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Stivan D'souza
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
1) For the Cheque no and Cheque date was not coming in gen journal line
2) Gen Journal Line Document no was getting replaced with Cheque No
3) Check ledger entry the Document no was getting replaced with Cheque No
Stivan D'souza
how can we tell why it is not printing and
](*,)
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
{ This code was before
IF NOT TestPrint THEN BEGIN
IF UseCheckNo <> GenJnlLine."Document No." THEN BEGIN
GenJnlLine3.RESET;
GenJnlLine3.SETCURRENTKEY("Journal Template Name","Journal Batch Name","Posting Date","Document No.");
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3.SETRANGE("Posting Date",GenJnlLine."Posting Date");
GenJnlLine3.SETRANGE("Document No.",UseCheckNo);
IF GenJnlLine3.FIND('-') THEN
GenJnlLine3.FIELDERROR("Document No.",STRSUBSTNO(Text013,UseCheckNo));
END;
IF ApplyMethod <> ApplyMethod::MoreLinesOneEntry THEN BEGIN
GenJnlLine3 := GenJnlLine;
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.MODIFY;
END ELSE BEGIN
IF GenJnlLine2.FIND('-') THEN BEGIN
HighestLineNo := GenJnlLine2."Line No.";
REPEAT
IF GenJnlLine2."Line No." > HighestLineNo THEN
HighestLineNo := GenJnlLine2."Line No.";
GenJnlLine3 := GenJnlLine2;
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Bal. Account No." := '';
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::" ";
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.VALIDATE(Amount);
GenJnlLine3.MODIFY;
UNTIL GenJnlLine2.NEXT = 0;
END;
GenJnlLine3.RESET;
GenJnlLine3 := GenJnlLine;
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3."Line No." := HighestLineNo;
IF GenJnlLine3.NEXT = 0 THEN
GenJnlLine3."Line No." := HighestLineNo + 10000
ELSE BEGIN
WHILE GenJnlLine3."Line No." = HighestLineNo + 1 DO BEGIN
HighestLineNo := GenJnlLine3."Line No.";
IF GenJnlLine3.NEXT = 0 THEN
GenJnlLine3."Line No." := HighestLineNo + 20000;
END;
GenJnlLine3."Line No." := (GenJnlLine3."Line No." + HighestLineNo) DIV 2;
END;
GenJnlLine3.INIT;
GenJnlLine3.VALIDATE("Posting Date",GenJnlLine."Posting Date");
GenJnlLine3."Document Type" := GenJnlLine."Document Type";
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Account Type" := GenJnlLine3."Account Type"::"Bank Account";
GenJnlLine3.VALIDATE("Account No.",BankAcc2."No.");
IF BalancingType <> BalancingType::"G/L Account" THEN
GenJnlLine3.Description := STRSUBSTNO(Text014,SELECTSTR(BalancingType + 1,Text062),BalancingNo);
GenJnlLine3.VALIDATE(Amount,-TotalLineAmount);
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::"Computer Check";
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3."Source Code" := GenJnlLine."Source Code";
GenJnlLine3."Reason Code" := GenJnlLine."Reason Code";
GenJnlLine3."Allow Zero-Amount Posting" := TRUE;
GenJnlLine3.INSERT;
END;
END;
BankAcc2."Last Check No." := UseCheckNo;
BankAcc2.MODIFY;
COMMIT;
CLEAR(CheckManagement);
This code was before }
//this code is updated
IF NOT TestPrint THEN BEGIN
IF UseCheckNo <> GenJnlLine."Document No." THEN BEGIN
GenJnlLine3.RESET;
GenJnlLine3.SETCURRENTKEY("Journal Template Name","Journal Batch Name","Posting Date","Document No.");
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3.SETRANGE("Posting Date",GenJnlLine."Posting Date");
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3.SETRANGE("Document No.",UseCheckNo);
IF GenJnlLine3.FIND('-') THEN
GenJnlLine3.FIELDERROR("Document No.",STRSUBSTNO(Text013,UseCheckNo));
END ELSE BEGIN
GenJnlLine3.SETRANGE("Cheque No.",UseCheckNo);
IF GenJnlLine3.FIND('-') THEN
GenJnlLine3.FIELDERROR("Cheque No.",STRSUBSTNO(Text013,UseCheckNo));
END;
END;
IF ApplyMethod <> ApplyMethod::MoreLinesOneEntry THEN BEGIN
GenJnlLine3 := GenJnlLine;
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" = 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END ELSE BEGIN
GenJnlLine3."Cheque No." := UseCheckNo;
GenJnlLine3."Cheque Date" := WORKDATE;
IF GenJnlLine."Cheque Date" = 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.MODIFY;
END ELSE BEGIN
IF GenJnlLine2.FIND('-') THEN BEGIN
HighestLineNo := GenJnlLine2."Line No.";
REPEAT
IF GenJnlLine2."Line No." > HighestLineNo THEN
HighestLineNo := GenJnlLine2."Line No.";
GenJnlLine3 := GenJnlLine2;
IF NOT GLSetup."Activate Cheque No." THEN
GenJnlLine3.TESTFIELD("Posting No. Series",'');
GenJnlLine3."Bal. Account No." := '';
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::" ";
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END ELSE BEGIN
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END;
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3.VALIDATE(Amount);
GenJnlLine3.MODIFY;
UNTIL GenJnlLine2.NEXT = 0;
END;
GenJnlLine3.RESET;
GenJnlLine3 := GenJnlLine;
GenJnlLine3.SETRANGE("Journal Template Name",GenJnlLine."Journal Template Name");
GenJnlLine3.SETRANGE("Journal Batch Name",GenJnlLine."Journal Batch Name");
GenJnlLine3."Line No." := HighestLineNo;
IF GenJnlLine3.NEXT = 0 THEN
GenJnlLine3."Line No." := HighestLineNo + 10000
ELSE BEGIN
WHILE GenJnlLine3."Line No." = HighestLineNo + 1 DO BEGIN
HighestLineNo := GenJnlLine3."Line No.";
IF GenJnlLine3.NEXT = 0 THEN
GenJnlLine3."Line No." := HighestLineNo + 20000;
END;
GenJnlLine3."Line No." := (GenJnlLine3."Line No." + HighestLineNo) DIV 2;
END;
GenJnlLine3.INIT;
GenJnlLine3.VALIDATE("Posting Date",GenJnlLine."Posting Date");
GenJnlLine3."Document Type" := GenJnlLine."Document Type";
IF NOT GLSetup."Activate Cheque No." THEN BEGIN
GenJnlLine3."Document No." := UseCheckNo;
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END ELSE BEGIN
GenJnlLine3."Document No." := GenJnlLine."Document No.";
GenJnlLine3."Cheque No." := UseCheckNo;
IF GenJnlLine."Cheque Date" <> 0D THEN
GenJnlLine3."Cheque Date" := GenJnlLine."Cheque Date"
ELSE
GenJnlLine3."Cheque Date" := GenJnlLine."Posting Date";
END;
GenJnlLine3."Account Type" := GenJnlLine3."Account Type"::"Bank Account";
GenJnlLine3.VALIDATE("Account No.",BankAcc2."No.");
IF BalancingType <> BalancingType::"G/L Account" THEN
GenJnlLine3.Description := STRSUBSTNO(Text014,SELECTSTR(BalancingType + 1,Text062),BalancingNo);
GenJnlLine3.VALIDATE(Amount,-TotalLineAmount);
GenJnlLine3."Bank Payment Type" := GenJnlLine3."Bank Payment Type"::"Computer Check";
GenJnlLine3."Check Printed" := TRUE;
GenJnlLine3."Source Code" := GenJnlLine."Source Code";
GenJnlLine3."Reason Code" := GenJnlLine."Reason Code";
GenJnlLine3."Allow Zero-Amount Posting" := TRUE;
GenJnlLine3."Shortcut Dimension 1 Code" := GenJnlLine."Shortcut Dimension 1 Code";
GenJnlLine3."Shortcut Dimension 2 Code" := GenJnlLine."Shortcut Dimension 2 Code";
GenJnlLine3.INSERT;
END;
END;
BankAcc2."Last Check No." := UseCheckNo;
BankAcc2.MODIFY;
CLEAR(CheckManagement);
Stivan D'souza