public GoodsInInventoryBase(Guid transactionId, string accountCode) { this.fIsRelatedStrategy = false; this.fAccountCode = accountCode; this.fTransactionId = transactionId; this.fFinancialTransactionData = new ETL_GoodsInInventoryTransaction(); this.fFinancialTransformData = new ETL_GoodsInInventoryTransformData(); }
public GoodsInInventoryBase() { this.fIsRelatedStrategy = false; this.fAccountCode = string.Empty; this.fTransactionId = Guid.Empty; this.fFinancialTransactionData = new ETL_GoodsInInventoryTransaction(); this.fFinancialTransformData = new ETL_GoodsInInventoryTransformData(); }
protected void LoadTransaction(Session session, ETL_GoodsInInventoryTransformData data) { try { foreach (ETL_GoodsInInventoryDetail detail in data.ETL_DetailList) { CreateGoodsInInventoryDetail(session, detail, data.MainAccountCode); } } catch (Exception) { return; } }
protected void LoadTransaction(Session session, ETL_GoodsInInventoryTransformData transportData) { }
protected ETL_GoodsInInventoryTransformData TransformTransaction ( Session session, ETL_GoodsInInventoryTransaction transaction, string AccountCode) { Util util = new Util(); ETL_GoodsInInventoryTransformData result = new ETL_GoodsInInventoryTransformData(); Account account = util.GetXpoObjectByFieldName <Account, string>(session, "Code", AccountCode, BinaryOperatorType.Equal); if (account == null) { return(null); } if (transaction == null) { return(null); } ETL_GoodsInInventoryTransaction etlTransaction = transaction; string subMainAccount = string.Empty; List <ETL_GoodsInInventoryDetail> detail = new List <ETL_GoodsInInventoryDetail>(); try { ETLAccountingBO accountingBO = new ETLAccountingBO(); FinancialLiabilityBO liabilityBO = new FinancialLiabilityBO(); List <ETL_GeneralJournal> JournalListJoined = JoinJournal(session, etlTransaction.GeneralJournalList); List <ETL_GeneralJournal> FinishJournalList = liabilityBO.ClearJournalList(session, JournalListJoined, account.AccountId); foreach (ETL_GeneralJournal journal in etlTransaction.GeneralJournalList) { ETL_GoodsInInventoryDetail temp = new ETL_GoodsInInventoryDetail(); temp.AccountCode = string.Empty; temp.CorrespondAccountCode = string.Empty; if (accountingBO.IsRelateAccount(session, account.AccountId, journal.AccountId)) { temp.AccountCode = subMainAccount = session.GetObjectByKey <Account>(journal.AccountId).Code; } else { temp.CorrespondAccountCode = session.GetObjectByKey <Account>(journal.AccountId).Code; } temp.CurrencyCode = session.GetObjectByKey <Currency>(journal.CurrencyId).Code; temp.IsBalanceForward = etlTransaction.IsBalanceForward; temp.IssueDate = etlTransaction.IssuedDate; temp.OwnerOrgId = etlTransaction.OwnerOrgId; temp.TransactionId = etlTransaction.TransactionId; temp.Credit = (decimal)journal.Credit; temp.Debit = (decimal)journal.Debit; temp.ArtifactId = transaction.ArtifactId; if (etlTransaction.Price > 0) { temp.Quantity = temp.Debit == 0 ? (double)temp.Credit / (double)etlTransaction.Price : (double)temp.Debit / (double)etlTransaction.Price; } else { temp.Quantity = 0; } detail.Add(temp); } result.MainAccountCode = subMainAccount; result.ETL_DetailList = detail; } catch (Exception) { return(null); } return(result); }