コード例 #1
0
  private final I_C_TaxDeclarationLine createTaxDeclarationLine(
      final I_GL_JournalLine glJournalLine) {
    final String summary = journalLineBL.getDocumentNo(glJournalLine);

    final I_C_TaxDeclarationLine taxDeclarationLine = newTaxDeclarationLine();

    taxDeclarationLine.setAD_Org_ID(glJournalLine.getAD_Org_ID());
    taxDeclarationLine.setIsManual(false);
    //
    taxDeclarationLine.setGL_JournalLine(glJournalLine);
    taxDeclarationLine.setC_Currency_ID(glJournalLine.getC_Currency_ID());
    taxDeclarationLine.setDateAcct(glJournalLine.getDateAcct());
    taxDeclarationLine.setC_DocType_ID(glJournalLine.getGL_Journal().getC_DocType_ID());
    taxDeclarationLine.setDocumentNo(summary);
    //

    final ITaxAccountable taxAccountable = journalLineBL.asTaxAccountable(glJournalLine);
    // NOTE: Tax on sales transactions is booked on CR, tax on purchase transactions is booked on DR
    final boolean isSOTrx = taxAccountable.isAccountSignCR();
    taxDeclarationLine.setIsSOTrx(isSOTrx);
    taxDeclarationLine.setC_Tax_ID(taxAccountable.getC_Tax_ID());
    taxDeclarationLine.setTaxBaseAmt(taxAccountable.getTaxBaseAmt());
    taxDeclarationLine.setTaxAmt(taxAccountable.getTaxAmt());

    save(taxDeclarationLine);

    return taxDeclarationLine;
  }
コード例 #2
0
  private boolean addGLJournalLine0(final I_GL_JournalLine glJournalLine) {
    final List<I_Fact_Acct> factAcctRecords =
        factAcctDAO.retrieveForDocumentLine(
            I_GL_Journal.Table_Name, glJournalLine.getGL_Journal_ID(), glJournalLine);

    //
    // Skip not posted GL Journal Lines, but warn the user
    if (factAcctRecords.isEmpty()) {
      final String summary = journalLineBL.getDocumentNo(glJournalLine);
      loggable.addLog("@Error@: @I_GL_JournalLine_ID@ @Posted@=@N@: " + summary);
      return false;
    }

    final I_C_TaxDeclarationLine taxDeclarationLine = createTaxDeclarationLine(glJournalLine);
    createTaxDeclarationAccts(taxDeclarationLine, factAcctRecords.iterator());

    return true;
  }