Este artigo aplica-se para o Microsoft Dynamics NAV para a região do idioma português (pt).
Sintomas
Quando registar um diário de cobranças com a factura e um título de rejeição ao mesmo tempo na versão portuguesa do Microsoft Dynamics NAV 2009, todos os movimentos de contabilidade registados são registados utilizando a conta de contas a pagar rejeitar. No entanto, a conta de Cobranças deve ser utilizada para a factura e a conta de facturas rejeitadas deve ser utilizada para o documento rejeitado. Este problema ocorre nos seguintes produtos:
-
A versão portuguesa do Microsoft Dynamics NAV 2009 R2
-
A versão portuguesa do Microsoft Dynamics NAV 2009 Service Pack 1
Resolução
Informações sobre correção
Agora tem uma correcção suportada disponível na Microsoft. Contudo, destina-se apenas a corrigir o problema descrito neste artigo. Aplique-a apenas em sistemas que tenham este problema específico. Esta correcção poderá ser submetida a testes adicionais. Por conseguinte, se não estiver a ser gravemente afectado por este problema, recomendamos que aguarde o próximo service pack do Microsoft Dynamics NAV 2009 ou a próxima versão do Microsoft Dynamics NAV que contenha esta correcção.
Nota Em casos especiais, os custos normalmente inerentes para suporte chamadas poderão ser anuladas se um técnico de suporte técnico do Microsoft Dynamics e produtos relacionados determina que uma actualização específica resolverá o problema. Os custos de normais do suporte serão aplicados a questões de suporte adicionais e problemas que não se enquadrem na atualização específica em questão.
Informações de instalação
A Microsoft fornece exemplos de programação apenas a título ilustrativo, sem garantia expressa ou implícita. Isto inclui, mas não está limitado a, garantias implícitas de comercialização ou adequação a um fim específico. Este artigo pressupõe que está familiarizado com a linguagem de programação que está a ser demonstrada e com as ferramentas que são utilizadas para criar e depurar procedimentos. Técnicos de suporte da Microsoft podem ajudar a explicar a funcionalidade de um determinado procedimento. No entanto, não modificarão estes exemplos para proporcionarem funcionalidades adicionais nem criarão procedimentos adaptados às necessidades específicas do utilizador.
Nota Antes de instalar esta correcção, certifique-se de que todos os utilizadores de cliente do Microsoft Navision são registados no sistema. Isto inclui os utilizadores de clientes do Microsoft Navision Application Server (NAS). Deve ser o único usuário do cliente que tem sessão iniciada quando implementar esta correcção.
Para implementar esta correcção, tem de ter uma licença de desenvolvedor.
Recomendamos que a conta de utilizador na janela Logins do Windows ou na janela Logins de base de dados seja atribuída a ID de função "SUPER". Se a conta de utilizador não é possível atribuir o ID de função "SUPER", tem de verificar que a conta de utilizador tem as seguintes permissões:
-
A permissão Modificar para o objecto que estará a alterar.
-
A permissão executar para o objecto 5210 de ID de objecto de sistema e para o objecto 9015 de ID de objecto de sistema .
Nota Não tem de ter direitos para os arquivos de dados, excepto se tiver de efectuar a reparação de dados.
Alterações de código
Nota Sempre o código de ensaio corrige num ambiente controlado antes de aplicar as correcções para os computadores de produção.
Para resolver este problema, altere o código no diário de Gr.-linha colocar codeunit (12). Para tal, siga estes passos:
-
Adicione a seguinte variável global:
TempRejCustLedgEntry@1100047 : TEMPORARY Record 21;
-
Altere o código na função PostCust da seguinte forma:
Código existente 1... DiscRiskFactAmountLCY := 0;
DiscUnriskFactAmountLCY := 0;
CollFactAmountLCY := 0;
//--------
IF Cust."No." <> "Account No." THEN
Cust.GET("Account No.");
Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE);
IF "Posting Group" = '' THEN BEGIN
...Código de substituição 1
... DiscRiskFactAmountLCY := 0;
DiscUnriskFactAmountLCY := 0;
CollFactAmountLCY := 0;
//--------
// Add the following lines.
TempRejCustLedgEntry.RESET;
TempRejCustLedgEntry.DELETEALL;
// End of the lines.
IF Cust."No." <> "Account No." THEN
Cust.GET("Account No.");
Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE);
IF "Posting Group" = '' THEN BEGIN
...Código existente 2
... END;
// Post the application
ApplyCustLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
// Delete the following lines.
IF GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" " THEN
GenJnlLine."Applies-to Doc. Type" := AppliesToDocType;
// End of the lines.
IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
IF "Document Type" = "Document Type"::Bill THEN BEGIN
DocPost.CreateReceivableDoc(GenJnlLine,CVLedgEntryBuf);
CustLedgEntry."Document Situation" := CustLedgEntry."Document Situation"::Cartera;
...Código de substituição 2
... END;
// Post the application
ApplyCustLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
// Add the following lines.
IF ("Applies-to ID" = '') AND ("Applies-to Doc. Type" = "Applies-to Doc. Type"::" ") THEN
"Applies-to Doc. Type" := AppliesToDocType;
// End of the lines.
IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
IF "Document Type" = "Document Type"::Bill THEN BEGIN
DocPost.CreateReceivableDoc(GenJnlLine,CVLedgEntryBuf);
CustLedgEntry."Document Situation" := CustLedgEntry."Document Situation"::Cartera;
... -
Altere o código na função PostVend da seguinte forma:
Código existente... // Post the application
ApplyVendLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,
GLSetup."Appln. Rounding Precision");
// Delete the following lines.
IF GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" " THEN
GenJnlLine."Applies-to Doc. Type" := AppliesToDocType;
// End of the lines.
IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
IF "Document Type" = "Document Type"::Bill THEN BEGIN
DocPost.CreatePayableDoc(GenJnlLine,CVLedgEntryBuf);
VendLedgEntry."Document Situation" := VendLedgEntry."Document Situation"::Cartera;
...Código de substituição
... // Post the application
ApplyVendLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,
GLSetup."Appln. Rounding Precision");
// Add the following lines.
IF ("Applies-to ID" = '') AND ("Applies-to Doc. Type" = "Applies-to Doc. Type"::" ") THEN
"Applies-to Doc. Type" := AppliesToDocType;
// End of the lines.
IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
IF "Document Type" = "Document Type"::Bill THEN BEGIN
DocPost.CreatePayableDoc(GenJnlLine,CVLedgEntryBuf);
VendLedgEntry."Document Situation" := VendLedgEntry."Document Situation"::Cartera;
... -
Altere o código na função ApplyCustLedgEntry da seguinte forma:
Código existente... OldCustLedgEntry."Document Situation"::"Closed Documents",
OldCustLedgEntry."Document Situation"::"Closed BG/PO"]) THEN
FromClosedDoc := TRUE
ELSE
FromClosedDoc := FALSE;
DocPost.UpdateReceivableDoc(
OldCustLedgEntry,GenJnlLine,AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY,
DocAmountLCY,RejDocAmountLCY,DiscDocAmountLCY,CollDocAmountLCY,
DiscRiskFactAmountLCY,DiscUnriskFactAmountLCY,CollFactAmountLCY);
END;
...Código de substituição
... OldCustLedgEntry."Document Situation"::"Closed Documents",
OldCustLedgEntry."Document Situation"::"Closed BG/PO"]) THEN
FromClosedDoc := TRUE
ELSE
FromClosedDoc := FALSE;
// Add the following lines.
IF OldCustLedgEntry."Document Status" = OldCustLedgEntry."Document Status"::Rejected THEN BEGIN
TempRejCustLedgEntry := OldCustLedgEntry;
TempRejCustLedgEntry."Remaining Amount (LCY) stats." := AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY;
TempRejCustLedgEntry.INSERT;
END;
// End of the lines.
DocPost.UpdateReceivableDoc(
OldCustLedgEntry,GenJnlLine,AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY,
DocAmountLCY,RejDocAmountLCY,DiscDocAmountLCY,CollDocAmountLCY,
DiscRiskFactAmountLCY,DiscUnriskFactAmountLCY,CollFactAmountLCY);
END;
... -
Altere o código na função PostDtldCustLedgEntries da seguinte forma:
Código existente... AccNo := CustPostingGr."Bills Account";
END ELSE BEGIN
CustPostingGr.TESTFIELD("Receivables Account");
AccNo := CustPostingGr."Receivables Account";
END;
// Delete the following lines.
IF DiscDocAmountLCY <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Discted. Bills Acc.");
AccNo := CustPostingGr."Discted. Bills Acc.";
END;
IF CollDocAmountLCY <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Bills on Collection Acc.");
AccNo := CustPostingGr."Bills on Collection Acc.";
END;
IF RejDocAmountLCY <> 0 THEN BEGIN
CASE GenJnlLine."Applies-to Doc. Type" OF
GenJnlLine."Applies-to Doc. Type"::Bill:
BEGIN
CustPostingGr.TESTFIELD("Rejected Bills Acc.");
AccNo := CustPostingGr."Rejected Bills Acc.";
END;
GenJnlLine."Applies-to Doc. Type"::Invoice:
BEGIN
CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
AccNo := CustPostingGr."Rejected Factoring Acc.";
END;
ELSE
IF (GenJnlLine."Document Type" IN [GenJnlLine."Document Type"::"Credit Memo",GenJnlLine."Document Type"::Payment]) AND
(OldCVLedgEntryBuf4."Applies-to ID" <> '') THEN BEGIN
CASE OldCVLedgEntryBuf4."Document Type" OF
OldCVLedgEntryBuf4."Document Type"::Bill:
BEGIN
CustPostingGr.TESTFIELD("Receivables Account");
AccNo := CustPostingGr."Receivables Account";
END;
OldCVLedgEntryBuf4."Document Type"::Invoice:
BEGIN
CustPostingGr.TESTFIELD("Receivables Account");
AccNo := CustPostingGr."Receivables Account";
END;
END;
END;
END;
END;
IF (DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) THEN BEGIN
CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
AccNo := CustPostingGr."Factoring for Discount Acc.";
END;
IF CollFactAmountLCY <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Factoring for Collection Acc.");
AccNo := CustPostingGr."Factoring for Collection Acc.";
END;
// End of the lines.
ReceivableAccAmtLCY :=
TotalAmountLCY -
(DocAmountLCY + DiscDocAmountLCY +
CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
...Código de substituição
... AccNo := CustPostingGr."Bills Account";
END ELSE BEGIN
CustPostingGr.TESTFIELD("Receivables Account");
AccNo := CustPostingGr."Receivables Account";
END;
ReceivableAccAmtLCY :=
TotalAmountLCY -
(DocAmountLCY + DiscDocAmountLCY +
CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
... -
Altere o código na função PostReceivableDocs da seguinte forma:
Código existente... GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
IF RejDocAmountLCY <> 0 THEN BEGIN
// Delete the following lines.
CASE GenJnlLine."Applies-to Doc. Type" OF
GenJnlLine."Applies-to Doc. Type"::Bill:
BEGIN
CustPostingGr.TESTFIELD("Rejected Bills Acc.");
InitGLEntry(CustPostingGr."Rejected Bills Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
GenJnlLine."Applies-to Doc. Type"::Invoice:
BEGIN
CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
InitGLEntry(CustPostingGr."Rejected Factoring Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
ELSE
IF (GenJnlLine."Document Type" IN [GenJnlLine."Document Type"::"Credit Memo",GenJnlLine."Document Type"::Payment]) AND
(OldCVLedgEntryBuf4."Applies-to ID" <> '') THEN BEGIN
CASE OldCVLedgEntryBuf4."Document Type" OF
OldCVLedgEntryBuf4."Document Type"::Bill:
BEGIN
CustPostingGr.TESTFIELD("Rejected Bills Acc.");
InitGLEntry(CustPostingGr."Rejected Bills Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
OldCVLedgEntryBuf4."Document Type"::Invoice:
BEGIN
CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
InitGLEntry(CustPostingGr."Rejected Factoring Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE
);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
END;
END;
// End of the lines.
END;
END;
IF DiscRiskFactAmountLCY <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
InitGLEntry(CustPostingGr."Factoring for Discount Acc.",
...Código de substituição
... GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
IF RejDocAmountLCY <> 0 THEN BEGIN
// Add the following lines.
WITH TempRejCustLedgEntry DO BEGIN
RESET;
SETCURRENTKEY("Customer No.","Document Type","Document Situation","Document Status");
SETRANGE("Document Type","Document Type"::Bill);
CALCSUMS("Remaining Amount (LCY) stats.");
IF "Remaining Amount (LCY) stats." <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Rejected Bills Acc.");
InitGLEntry(
CustPostingGr."Rejected Bills Acc.","Remaining Amount (LCY) stats.",
DocAmtCalcAddCurrency("Remaining Amount (LCY) stats."),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
SETRANGE("Document Type","Document Type"::Invoice);
CALCSUMS("Remaining Amount (LCY) stats.");
IF "Remaining Amount (LCY) stats." <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
InitGLEntry(
CustPostingGr."Rejected Factoring Acc.","Remaining Amount (LCY) stats.",
DocAmtCalcAddCurrency("Remaining Amount (LCY) stats."),TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
InsertGLEntry(TRUE);
END;
// End of the lines.
END;
END;
IF DiscRiskFactAmountLCY <> 0 THEN BEGIN
CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
InitGLEntry(CustPostingGr."Factoring for Discount Acc.",
...
Pré-requisitos
Tem de ter um dos seguintes produtos instalado para aplicar esta correcção:
-
A versão portuguesa do Microsoft Dynamics NAV 2009 R2
-
A versão portuguesa do Microsoft Dynamics NAV 2009 Service Pack 1
Informações de remoção
Não é possível remover esta correcção.
Estado
A Microsoft confirmou que este é um problema nos produtos da Microsoft listados na secção "Aplica-se a".
Nota Este é um artigo "Publicação rápida" criado diretamente a partir da organização de suporte da Microsoft. As informações contidas neste documento são fornecidas como-se em resposta a questões emergentes. Como resultado da urgência na sua disponibilização, os materiais podem incluir erros tipográficos e podem ser revistos em qualquer altura sem aviso prévio. Para outras considerações, consulte os Termos de utilização .