コード例 #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 final I_C_TaxDeclarationLine createTaxDeclarationLine(
      final I_C_Invoice invoice, final I_C_InvoiceTax invoiceTax) {
    final I_C_TaxDeclarationLine taxDeclarationLine = newTaxDeclarationLine();

    taxDeclarationLine.setAD_Org_ID(invoice.getAD_Org_ID());
    taxDeclarationLine.setIsManual(false);
    //
    taxDeclarationLine.setC_Invoice(invoice);
    taxDeclarationLine.setIsSOTrx(invoice.isSOTrx());
    taxDeclarationLine.setC_BPartner_ID(invoice.getC_BPartner_ID());
    taxDeclarationLine.setC_Currency_ID(invoice.getC_Currency_ID());
    taxDeclarationLine.setDateAcct(invoice.getDateAcct());
    taxDeclarationLine.setC_DocType_ID(invoice.getC_DocType_ID());
    taxDeclarationLine.setDocumentNo(invoice.getDocumentNo());
    //
    taxDeclarationLine.setC_Tax_ID(invoiceTax.getC_Tax_ID());
    taxDeclarationLine.setTaxBaseAmt(invoiceTax.getTaxBaseAmt());
    taxDeclarationLine.setTaxAmt(invoiceTax.getTaxAmt());

    save(taxDeclarationLine);

    return taxDeclarationLine;
  }