local procedure PostExpense()
var
NoMgmt: Codeunit NoSeriesManagement;
GLSetup: Record /General Ledger Setup/;
begin
GenJnlLine.Init();
GenJnlLine./Journal Template Name/ := 'GÉNÉRAL';
GenJnlBatch.SetRange(/Journal Template Name/, GenJnlLine./Journal Template Name/);
if GenJnlBatch.FindFirst() then
GenJnlLine./Journal Batch Name/ := GenJnlBatch.Name;
GenJnlLine./Line No./ := GenJnlLine.GetNewLineNo(GenJnlLine./Journal Template Name/, GenJnlLine./Journal Batch Name/);
GenJnlLine./Posting Date/ := ExpenseHeader./Posting Date/;
GenJnlLine./Document Date/ := ExpenseHeader./Document Date/;
GenJnlLine./Document Type/ := GenJnlLine./document type/::/ /;
GenJnlLine./Document No./ := ExpenseHeader./No./;
GenJnlLine./Account Type/ := GenJnlLine./account type/::Employee;
GenJnlLine.Validate(/Account No./, ExpenseHeader./Ressource No./);
ExpenseHeader.CalcFields(Amount);
GenJnlLine.Validate(/Credit Amount/, ExpenseHeader.Amount);
GenJnlLine./System-Created Entry/ := false;
GenJnlLine.Correction := false;
GenJnlLine./Source Code/ := SrcCode;
GenJnlLine./Shortcut Dimension 1 Code/ := ExpenseHeader./Shortcut Dimension 1 Code/;
GenJnlLine./Shortcut Dimension 2 Code/ := ExpenseHeader./Shortcut Dimension 2 Code/;
GenJnlPostLine.RunWithCheck(GenJnlLine);
GenJnlLine.Insert();
end;