⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 technicaldocs.sgml

📁 Sequoia ERP是一个真正的企业级开源ERP解决方案。它提供的模块包括:电子商务应用(e-commerce), POS系统(point of sales),知识管理,存货与仓库管理
💻 SGML
📖 第 1 页 / 共 3 页
字号:
<?xml version='1.0'?><!-- * Copyright (C) 2006  Open Source Strategies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA--><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3b2/docbookx.dtd"><book>  <title>Accounting/GL Technical Documentation</title>  <chapter>    <title>Introduction</title>    <para>This document contains information on the technical     implementation of the accounting/GL component. It describes the     entities and services used to impelement features in the User     Docs.</para>  </chapter>  <chapter>    <title>Creating Accounting Transactions</title>    <section>      <title>Introduction</title>      <para>This section describes the key business transactions and       how accounting transactions are created for them.</para>    </section>    <section>      <title>Manual Accounting Transactions</title>      <para>The simplest accounting transactions are created manually.       This is done with the createGlJournalEntry service, which takes       in debitGlAccountId, creditGlAccountId, amount, and optional       fields from AcctgTrans and AcctgTransEntry entities. It calls the       createAcctgTrans and createAcctgTransEntry services to create the       accounting transactions. The result is an acctgTransId of the       master AcctgTrans created. At this point, all AcctgTransEntry       records are created with acctgTransEntryTypeId of _NA_ (the only       type available.)</para>    </section>    <section>      <title>Helper Classes and Services</title>      <para>        createAcctgTransAndEntries is a helper service. It takes a List         of acctgTransEntry values and:        <orderedlist>          <listitem>            <para>If any acctgTransEntry record has a negative amount,             it changes the amount to positive and flips the             debitCreditFlag from &quot;D&quot; to &quot;C&quot; or             &quot;C&quot; to &quot;D&quot;.</para>          </listitem>          <listitem><para>If an entry does not have a reconciled status,            its sets it to a default of "not reconciled."</para></listitem>          <listitem>            <para>It checks that the sum of all debit amounts equals             the sum of all credit amounts. If these sums do not equal,             it aborts with an error message.</para>          </listitem>          <listitem>            <para>It creates an AcctgTrans around the List of             acctgTransEntry values using the createAcctgTrans             service.</para>          </listitem>          <listitem>            <para>It creates an AcctgTransEntry based on each             acctgTransEntry value and the AcctgTrans created.</para>          </listitem>        </orderedlist>      </para>      <para>UtilAccounting is a class which isolates tasks such as      determining whether an account is an asset, liability, or equity,      income, revenue, or expense, debit or credt account and whether      a payment is a disbursement or receipt.  It uses recursion      to trace up a parent types.</para>    </section>    <section>      <title>Invoices</title>      <para>        Invoices are posted to the accounting transactions using the         <code>postInvoiceToGl</code>         service, which works for both SALES_INVOICE and         PURCHASE_INVOICE types. The only parameter is invoiceId. The         service does the following:        <orderedlist>          <listitem>            <para>organizationPartyId is the partyId of the internal             organization (ie, our company) in the transaction. This is             the partyId from InvoiceRole, where roleTypeId is             &quot;BILL_FROM_VENDOR&quot; for SALES_INVOICEs and             &quot;BILL_TO_CUSTOMER&quot; for PURCHASE_INVOICEs.</para>          </listitem>          <listitem>            <para>partyId is for the external party of the transaction             (ie, our customer or vendor.) This is the partyId from             InvoiceRole as well, but where roleTypeId is             &quot;BILL_TO_CUSTOMER&quot; for SALES_INVOICEs and             &quot;BILL_FROM_VENDOR&quot; for PURCHASE_INVOICEs.  One            exception is if the invoice has a taxAuthPartyId, in which            case the taxAuthPartyId is the partyId of the transaction entry.</para>          </listitem>          <listitem>            <para>each line item of the invoice (ie, each InvoiceItem             value) is posted to the invoice on a GL account. The             default debitCreditFlag is &quot;C&quot; for SALES_INVOICEs             and &quot;D&quot; for PURCHASE_INVOICEs.</para>          </listitem>          <listitem>            <para>if the currencyUomId of the InvoiceItem does not             equal the baseCurrencyUomId of PartyAcctgPreference for             organizationPartyId, the convertUom service is used to             conver the amount of the InvoiceItem to an amount in the             baseCurrencyUomId of the PartyAcctgPreference.</para>          </listitem>          <listitem>            <para>              for each invoice item, the GL account is determined in               the following sequence:              <orderedlist>                <listitem>                  <para>InvoiceItem&apos;s overrideGlAccount                   field</para>                </listitem>                <listitem>                  <para>If the InvoiceItem is for a product, look for                   the product&apos;s ProductGlAccount of                   &quot;SALES&quot; type for SALES_INVOICEs and                   &quot;UNINVOICED_SHIP_RCPT&quot; type for                   PURCHASE_INVOICEs.</para>                </listitem>                <listitem>                   <para>If it is a purchase invoice and there is a                    difference between invoice amount and the original                   purchase order price, record the difference as a debit                   to the PURCHASE_PRICE_VAR account.</para>                </listitem>                <listitem>                  <para>from the invoiceItemTypeId, the                   InvoiceItemTypeGlAccount for this organization</para>                </listitem>                <listitem>                  <para>from the invoiceItemTypeId, the                   defaultGlAccount in InvoiceItem entity.</para>                </listitem>              </orderedlist>            </para>          </listitem>          <listitem>            <para>              if the invoice is a SALES invoice, then:              <orderedlist>                <listitem>                  <para>call the getInvoiceItemCOGS service with                   parameter organizationPartyId, invoiceId,                   invoiceItemSeqId (from the invoice) and use the                   result COGS parameter as the value of COGS.</para>                </listitem>                <listitem>                  <para>use <code>getProductOrgGlAccount</code> to get                   GL account of the &quot;COGS&quot; type. This is the                   debit GL account.</para>                </listitem>                <listitem>                  <para>use <code>getProductOrgGlAccount</code> to get                   GL account of the &quot;INVENTORY&quot; type. This is                   the credit GL account.</para>                </listitem>                <listitem>                  <para>debit the COGS GL account and credit the                   INVENTORY GL account in the amount from COGS                   above.</para>                </listitem>              </orderedlist>            </para>          </listitem>          <listitem>            <para>actual posting is performed with             createAcctgTransAndEntries service (see above.)</para>          </listitem>        </orderedlist>      </para>      <para>The service <code>getProductOrgGlAccount</code> takes       parameters productId, productGlAccountTypeId,       organizationPartyId, glAccountTypeId (&quot;SALES&quot;,       &quot;INVENTORY&quot;, &quot;COGS&quot;), returns a glAccountId.       It looks first in ProductGlAccount (based on productId,       productGlAccountTypeId) and then in GlAccountTypeDefault (based       on organizationPartyId and glAccountTypeId.)</para>      <para>The service <code>getInvoiceItemCOGS</code> takes       parameters organizationPartyId, invoiceId, invoiceItemSeqId and       returns a double called &quot;COGS.&quot; It checks the       PartyAcctgPreference for organizationPartyId and finds out what       the organization&apos;s COGS preference is (LIFO, FIFO, Average       Cost.) If it is &quot;Average Cost&quot; then it calls       <code>getProductAverageCost</code> with the organizationPartyId,       productId from InvoiceItem (from invoiceId and invoiceItemSeqId)       and returns the value of &quot;averageCost&quot; as COGS.       <emphasis>LIFO and FIFO are not implemented yet.</emphasis></para>      <para>The service <code>getProductAverageCost</code> takes       parameters organizationPartyId and productId and returns a double       called &quot;averageCost&quot;, which is the current average cost       of the product for this organization. It does it by looking up       the ProductAverageCost entity.</para>    </section>    <section>      <title>Payments</title>      <para>Imagine receiving a check from your customer and depositing       it to your company&apos;s checking account. What has happened       here? You have reduced the Accounts Receivables account and       increased the Cash account&apos;s value. This is typical of       payment transactions--two GL accounts are involved, one specific       to this payment (ie, the checking account) and one which offsets 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -