/// <summary>
 /// 
 /// constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 public GLAccountEntry(CoreDriver coreDriver
     , MasterDataManagement mdMgmt)
 {
     _coreDriver = coreDriver;
     _mdMgmt = mdMgmt;
     _isSaved = false;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="coreDriver"></param>
        /// <param name="management"></param>
        /// <param name="id"></param>
        /// <param name="descp"></param>
        /// <param name="bankAccount"></param>
        /// <exception cref="ArgumentNullException">Argument is null.</exception>
        /// <exception cref="NoGLAccountGroupException">No such G\L account group exception</exception>
        public GLAccountMasterData(CoreDriver coreDriver,
                MasterDataManagement management, MasterDataIdentity_GLAccount id,
                String descp, MasterDataIdentity bankAccount)
            : base(coreDriver, management, id, descp)
        {
            // check id and get group
            String groupId = id.ToString().Substring(0, 4);
            try
            {
                _group = GLAccountGroup.Parse(groupId);
            }
            catch (GLAccountGroupFormatException)
            {
                throw new NoGLAccountGroupException(groupId);
            }

            if (bankAccount == null)
            {
                _bankAccount = null;
            }
            else
            {
                MasterDataBase bankAccountId = _management.GetMasterData(
                        bankAccount, MasterDataType.BANK_ACCOUNT);
                if (bankAccountId == null)
                {
                    throw new MasterDataIdentityNotDefined(bankAccount,
                            MasterDataType.BANK_ACCOUNT);
                }
                _bankAccount = bankAccountId.GetIdentity();
            }

            // init amount
            _initAmount = new CurrencyAmount();
        }
        /// <summary>
        /// Construct
        /// </summary>
        /// <param name="coreDriver"></param>
        /// <param name="management"></param>
        /// <param name="id"></param>
        /// <param name="descp"></param>
        /// <exception cref="ArgumentNullException">argument is null</exception>
        protected MasterDataBase(CoreDriver coreDriver,
                                 MasterDataManagement management, MasterDataIdentity id, String descp)
        {
            if (id == null)
            {
                throw new ArgumentNullException("Identity");
            }
            if (coreDriver == null)
            {
                throw new ArgumentNullException("CoreDriver");
            }
            if (management == null)
            {
                throw new ArgumentNullException("Management");
            }
            if (descp == null)
            {
                throw new ArgumentNullException("Description");
            }
            _coreDriver = coreDriver;
            _management = management;
            _identity   = id;

            _descp = descp;
        }
        /// <summary>
        /// construct
        /// </summary>
        /// <param name="coreDriver"></param>
        /// <param name="mdMgmt"></param>
        public TransactionDataManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt)
            : base(coreDriver)
        {
            _masterDataMgmt = mdMgmt;
            _list = new Dictionary<MonthIdentity, MonthLedger>();

            _glAccBalCol = new GLAccountBalanceCollection(_coreDriver,
                    _masterDataMgmt);
        }
 public ReportsManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt)
     : base(coreDriver)
 {
     _mdMgmt = mdMgmt;
     indexes = new DocumentIndex[DocumentIndex.INDEX_COUNT];
     indexes[DocumentIndex.ACCOUNT_INDEX] = new DocumentAccountIndex(
             _coreDriver, mdMgmt);
     indexes[DocumentIndex.BUSINESS_INDEX] = new DocumentBusinessIndex(
             _coreDriver, mdMgmt);
 }
        /// <summary>
        /// document index
        /// </summary>
        /// <param name="coreDriver"></param>
        /// <param name="mdMgmt"></param>
        protected DocumentIndex(CoreDriver coreDriver, MasterDataManagement mdMgmt)
        {
            _coreDriver = coreDriver;
            _mdMgmt = mdMgmt;

            _list = new Dictionary<MasterDataIdentity, DocumentIndexItem>();

            _coreDriver.ListenerMgmt.DocumentSavedHandler += documentSaved;
            _coreDriver.ListenerMgmt.DocumentLoadHandler += documentLoad;
            _coreDriver.ListenerMgmt.DocumentReversedHandler += documentReversed;
        }
Beispiel #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <exception cref="ArgumentNullException">Argument is null</exception>
 protected MasterDataFactoryBase(CoreDriver coreDriver,
                                 MasterDataManagement management)
 {
     if (coreDriver == null ||
         management == null)
     {
         throw new ArgumentNullException();
     }
     _coreDriver       = coreDriver;
     _management       = management;
     _list             = new Dictionary <MasterDataIdentity, MasterDataBase>();
     _containDirtyData = false;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <exception cref="ArgumentNullException">Argument is null</exception>
 protected MasterDataFactoryBase(CoreDriver coreDriver,
         MasterDataManagement management)
 {
     if (coreDriver == null
         || management == null)
     {
         throw new ArgumentNullException();
     }
     _coreDriver = coreDriver;
     _management = management;
     _list = new Dictionary<MasterDataIdentity, MasterDataBase>();
     _containDirtyData = false;
 }
        public VendorEntry(CoreDriver coreDriver, MasterDataManagement mdMgmt)
        {
            _coreDriver = coreDriver;
            _mdMgmt = mdMgmt;
            _text = "";

            _recAcc = null;
            _glAccount = null;
            _vendor = null;
            _amount = new CurrencyAmount();
            _businessArea = null;

            _doc = null;
        }
        internal GLAccountBalanceCollection(CoreDriver coreDriver,
                MasterDataManagement mdMgmt)
        {
            _coreDriver = coreDriver;
            _mdMgmt = mdMgmt;

            _items = new Dictionary<MasterDataIdentity_GLAccount, GLAccountBalanceItem>();

            _coreDriver.ListenerMgmt.DocumentSavedHandler += documentSaved;
            _coreDriver.ListenerMgmt.DocumentLoadHandler += documentLoad;
            _coreDriver.ListenerMgmt.MasterDataLoadHandler += masterDataLoad;
            _coreDriver.ListenerMgmt.MasterDataCreatedHandler += masterDataCreated;
            _coreDriver.ListenerMgmt.DocumentReversedHandler += documentReversed;
            _coreDriver.ListenerMgmt.GLAccountInitAmountChangedHandler += glAccountInitAmountChanged;
        }
        /// <summary>
        /// Construct
        /// </summary>
        /// <param name="coreDriver">Core Driver</param>
        /// <param name="management">Matadata management</param>
        /// <param name="id"></param>
        /// <param name="descp"></param>
        /// <param name="accNumber"></param>
        /// <param name="bankKey"></param>
        /// <param name="type"></param>
        /// <exception cref="ArgumentNullException">Arguments null</exception>
        /// <exception cref="MasterDataIdentityNotDefined">Master data identity is not defined.</exception>
        public BankAccountMasterData(CoreDriver coreDriver, MasterDataManagement management,
                MasterDataIdentity id, String descp, BankAccountNumber accNumber,
                MasterDataIdentity bankKey, BankAccountType type)
            : base(coreDriver, management, id, descp)
        {
            _accNumber = accNumber;
            _bankAccType = type;

            MasterDataBase bankKeyId = management.GetMasterData(bankKey,
                    MasterDataType.BANK_KEY);
            if (bankKeyId == null)
            {
                throw new MasterDataIdentityNotDefined(bankKey,
                        MasterDataType.BANK_KEY);
            }
            _bankKey = bankKeyId.GetIdentity();
        }
        /// <summary>
        /// Construct
        /// </summary>
        /// <param name="coreDriver">Core Driver</param>
        /// <param name="management">Matadata management</param>
        /// <param name="id"></param>
        /// <param name="descp"></param>
        /// <param name="accNumber"></param>
        /// <param name="bankKey"></param>
        /// <param name="type"></param>
        /// <exception cref="ArgumentNullException">Arguments null</exception>
        /// <exception cref="MasterDataIdentityNotDefined">Master data identity is not defined.</exception>
        public BankAccountMasterData(CoreDriver coreDriver, MasterDataManagement management,
                                     MasterDataIdentity id, String descp, BankAccountNumber accNumber,
                                     MasterDataIdentity bankKey, BankAccountType type)
            : base(coreDriver, management, id, descp)
        {
            _accNumber   = accNumber;
            _bankAccType = type;

            MasterDataBase bankKeyId = management.GetMasterData(bankKey,
                                                                MasterDataType.BANK_KEY);

            if (bankKeyId == null)
            {
                throw new MasterDataIdentityNotDefined(bankKey,
                                                       MasterDataType.BANK_KEY);
            }
            _bankKey = bankKeyId.GetIdentity();
        }
        /// <summary>
        /// set bank key
        /// </summary>
        /// <param name="bankKey"></param>
        /// <exception cref="ArgumentNullException">Arguments null</exception>
        /// <exception cref="MasterDataIdentityNotDefined">Master data identity is not defined.</exception>
        public void SetBankKey(MasterDataIdentity bankKey)
        {
            if (bankKey == null)
            {
                throw new ArgumentNullException("Bank Key");
            }

            MasterDataManagement management = this._management;
            MasterDataBase       bankKeyId  = management.GetMasterData(bankKey,
                                                                       MasterDataType.BANK_KEY);

            if (bankKeyId == null)
            {
                throw new MasterDataIdentityNotDefined(bankKey,
                                                       MasterDataType.BANK_KEY);
            }

            this.SetDirtyData();
            _bankKey = bankKeyId.GetIdentity();
        }
Beispiel #14
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="coreDriver"></param>
        /// <param name="management"></param>
        /// <param name="id"></param>
        /// <param name="descp"></param>
        /// <param name="bankAccount"></param>
        /// <exception cref="ArgumentNullException">Argument is null.</exception>
        /// <exception cref="NoGLAccountGroupException">No such G\L account group exception</exception>
        public GLAccountMasterData(CoreDriver coreDriver,
                                   MasterDataManagement management, MasterDataIdentity_GLAccount id,
                                   String descp, MasterDataIdentity bankAccount)
            : base(coreDriver, management, id, descp)
        {
            // check id and get group
            String groupId = id.ToString().Substring(0, 4);

            try
            {
                _group = GLAccountGroup.Parse(groupId);
            }
            catch (GLAccountGroupFormatException)
            {
                throw new NoGLAccountGroupException(groupId);
            }

            if (bankAccount == null)
            {
                _bankAccount = null;
            }
            else
            {
                MasterDataBase bankAccountId = _management.GetMasterData(
                    bankAccount, MasterDataType.BANK_ACCOUNT);
                if (bankAccountId == null)
                {
                    throw new MasterDataIdentityNotDefined(bankAccount,
                                                           MasterDataType.BANK_ACCOUNT);
                }
                _bankAccount = bankAccountId.GetIdentity();
            }

            // init amount
            _initAmount = new CurrencyAmount();
        }
 internal DocumentAccountIndex(CoreDriver coreDriver, MasterDataManagement mdMgmt)
     : base(coreDriver, mdMgmt)
 {
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <exception cref="ArgumentNullException">Argument is null</exception>
 public GLAccountMasterDataFactory(CoreDriver coreDriver,
         MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
Beispiel #17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 public BusinessAreaMasterDataFactory(CoreDriver coreDriver,
                                      MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
        /// <summary>
        /// pasrse document to customer entry
        /// </summary>
        /// <param name="head"></param>
        /// <returns>return null, when cannot parse</returns>
        public static CustomerEntry parse(HeadEntity head, MasterDataManagement mdMgmt)
        {
            // check
            if (head.DocType != DocumentType.CUSTOMER_INVOICE)
            {
                return null;
            }
            List<ItemEntity> items = head.Items;
            if (items.Count != 2)
            {
                return null;
            }
            // credit item
            ItemEntity creditItem = items[0];
            if (creditItem.AccType != AccountType.GL_ACCOUNT)
            {
                return null;
            }
            ItemEntity debitItem = items[1];
            if (debitItem.AccType != AccountType.CUSTOMER)
            {
                return null;
            }

            CustomerEntry entry = new CustomerEntry(head._coreDriver
                , head._coreDriver.MdMgmt);
            entry._glAccount = creditItem.GLAccount;
            entry._recAcc = debitItem.GLAccount;
            entry._customer = debitItem.Customer;
            entry._date = head.PstDate;
            entry._amount = creditItem.Amount;
            if (creditItem.CdIndicator == CreditDebitIndicator.DEBIT)
            {
                // reverse
                entry._amount.Negate();
            }
            entry._text = head.DocText;
            entry._isSaved = true;
            entry._doc = head;

            return entry;
        }
        public CoreDriver()
        {
            _infos = new List<DebugInformation>();

            _listenerManagement = new ListenersManagement();
            // _listenerManagement.addCloseLedgerListener(_closeLedgerListener);

            // managements
            _managements = new Dictionary<String, AbstractManagement>();

            MasterDataManagement mdMgmt = new MasterDataManagement(this);
            _managements.Add(MASTERDATA, mdMgmt);


            _managements.Add(TRANDATA, new TransactionDataManagement(this, mdMgmt));
            _managements.Add(REPORTDATA, new ReportsManagement(this, mdMgmt));
            _managements.Add(TEMPLATE, new EntryTemplatesManagement(this, mdMgmt));

            _startMonthId = null;

            _isInitialized = false;
            _language = Language.SimpleChinese;
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <exception cref="ArgumentNullException"></exception>
 public CustomerMasterDataFactory(CoreDriver coreDriver,
     MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
Beispiel #21
0
 /// <summary>
 /// Construct
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 public BankAccountMasterDataFactory(CoreDriver coreDriver,
                                     MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="mdMgmt"></param>
 public EntryTemplatesManagement(CoreDriver coreDriver, MasterDataManagement mdMgmt)
     : base(coreDriver)
 {
     _list = new Dictionary<int, EntryTemplate>();
     _mdMgmt = mdMgmt;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver">Core Driver</param>
 /// <param name="management">Master data management</param>
 /// <exception cref="ArgumentNullException"></exception>
 public VendorMasterDataFactory(CoreDriver coreDriver,
     MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver">Core Driver</param>
 /// <param name="management">Master data management</param>
 /// <exception cref="ArgumentNullException"></exception>
 public VendorMasterDataFactory(CoreDriver coreDriver,
                                MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 public CustomerEntry(CoreDriver coreDriver, MasterDataManagement mdMgmt)
 {
     _coreDriver = coreDriver;
     _mdMgmt = mdMgmt;
 }
Beispiel #26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <param name="id"></param>
 /// <param name="descp"></param>
 /// <exception cref="ArgumentNullException">argument is null</exception>
 public GLAccountMasterData(CoreDriver coreDriver,
                            MasterDataManagement management, MasterDataIdentity_GLAccount id,
                            String descp)
     : this(coreDriver, management, id, descp, null)
 {
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 public BusinessAreaMasterDataFactory(CoreDriver coreDriver,
         MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <param name="id"></param>
 /// <param name="descp"></param>
 /// <exception cref="ArgumentNullException">argument is null</exception>
 public GLAccountMasterData(CoreDriver coreDriver,
         MasterDataManagement management, MasterDataIdentity_GLAccount id,
         String descp)
     : this(coreDriver, management, id, descp, null)
 {
 }
 internal DocumentBusinessIndex(CoreDriver coreDriver,
         MasterDataManagement mdMgmt)
     : base(coreDriver, mdMgmt)
 {
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <exception cref="ArgumentNullException">Argument is null</exception>
 public BankKeyMasterDataFactory(CoreDriver coreDriver,
     MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <param name="id"></param>
 /// <param name="descp"></param>
 /// <param name="level"></param>
 /// <exception cref="ArgumentNullException">argument is null</exception>
 public BusinessAreaMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id,
         String descp, CriticalLevel level)
     : base(coreDriver, management, id, descp)
 {
     _criticalLevel = level;
 }
 /// <summary>
 /// Construct
 /// </summary>
 /// <param name="coreDriver">Core Driver</param>
 /// <param name="management">Master Data management</param>
 /// <param name="id">Identity</param>
 /// <param name="descp">Description</param>
 /// <exception cref="ArgumentNullException">Arguments null</exception>
 public BankKeyMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id,
     String descp)
     : base(coreDriver, management, id, descp)
 {
 }
Beispiel #33
0
 /// <summary>
 /// Construct
 /// </summary>
 /// <param name="coreDriver">Core Driver</param>
 /// <param name="management">Master Data management</param>
 /// <param name="id">Identity</param>
 /// <param name="descp">Description</param>
 /// <exception cref="ArgumentNullException">Arguments null</exception>
 public BankKeyMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id,
                          String descp)
     : base(coreDriver, management, id, descp)
 {
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <exception cref="ArgumentNullException"></exception>
 public CustomerMasterDataFactory(CoreDriver coreDriver,
                                  MasterDataManagement management)
     : base(coreDriver, management)
 {
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="coreDriver"></param>
 /// <param name="management"></param>
 /// <param name="id"></param>
 /// <param name="descp"></param>
 /// <param name="level"></param>
 /// <exception cref="ArgumentNullException">argument is null</exception>
 public BusinessAreaMasterData(CoreDriver coreDriver, MasterDataManagement management, MasterDataIdentity id,
                               String descp, CriticalLevel level)
     : base(coreDriver, management, id, descp)
 {
     _criticalLevel = level;
 }