SACC
[ class tree: SACC ] [ index: SACC ] [ all elements ]

Class: SACCJournal

Source Location: /class/class.sacc.base.php

Class Overview

CDMBaseObject
   |
   --SACCJournal

Class to hold a journal entry


Author(s):

Version:

  • 1

Methods



Class Details

[line 483]
Class to hold a journal entry

This is probably the most important object in SACC! It is the primary method for making entries in the accounts system. The following example illustrates its use:

  1. require_once SACC_PATH."/include/functions.php";
  2. $org_id = 1; //set to your organisation id
  3. $purpose = "Testing";
  4. $journal = SACCInitJournal($org_id, null, $purpose) //create a new journal
  5. // a series of calls to appendEntry sets up the account entries
  6. // void appendEntry( int $ac_id, string $ref, int $dr, int $cr)
  7. $journal->appendEntry(2,"Ref description",11750,0); //DR bank account
  8. $journal->appendEntry(6,"Ref description",0,10000); //CR Sales account
  9. $journal->appendEntry(12,"Ref description",0,1750); //CR VAT In account
  10. if (!SACCSaveJournal($journal)) { //oops an error
  11. print (strval(SACCGetErrNo()." - ".SACCGetErrMsg());
  12. }




Tags:

version:  1


[ Top ]


Class Methods


constructor SACCJournal [line 490]

SACCJournal SACCJournal( )

Constructor

The following variables are declared for retrieval via ->getVar()

  1. $this->initVar('id',XOBJ_DTYPE_INT,0,TRUE); //journal id
  2. $this->initVar('org_id',XOBJ_DTYPE_INT,0,TRUE); //organisation id
  3. $this->initVar('jrn_dt',XOBJ_DTYPE_TXTBOX,0,FALSE); //journal date
  4. $this->initVar('jrn_prps',XOBJ_DTYPE_TXTBOX,0,FALSE); //journal purpose
  5. $a = array();
  6. $this->initVar('acc_entry',XOBJ_DTYPE_OTHER,$a,FALSE); //account entries




[ Top ]

method appendEntry [line 512]

void appendEntry( int $ac_id, string $ref, int $dr, int $cr)

Add an accounting entry to the journal

There should never be a case when both the debit and credit amounts are non zero. See SACC Help documentation for further details on the handling of monetary values.




Parameters:

int   $ac_id   Account ID
string   $ref   Entry reference
int   $dr   Debit amount
int   $cr   Credit amount

[ Top ]


Documentation generated on Thu, 23 Feb 2006 13:06:02 +0000 by phpDocumentor 1.3.0RC3