Ejemplo n.º 1
0
 public CRTransaction(CRTransactionType transactionType,
                      BaseObject reference, DateTime transactionDate,
                      DateTime dueDate, decimal inputAmount, decimal outputAmount,
                      string summary, string notes) {
   this.transactionType = transactionType;
   this.baseInstrumentType = InstrumentType.Empty;
   this.cashRegister = CashRegister.MyCashRegister();
   this.referenceId = reference.Id;
   this.transactionDate = transactionDate;
   this.dueDate = dueDate;
   this.currencyAmount = inputAmount + outputAmount;
   this.inputAmount = inputAmount;
   this.outputAmount = outputAmount;
   this.summary = summary;
   this.notes = notes;
 }
Ejemplo n.º 2
0
 public CRTransaction(CRTransactionType transactionType, CashRegister cashier) {
   this.transactionType = transactionType;
   this.cashRegister = cashier;
 }
Ejemplo n.º 3
0
    static internal AccountTransaction CreateDebit(FinancialAccount account, FinancialConcept financialConcept,
                                                   Contact collector, CashRegister cashRegister, DateTime transactionDate,
                                                   decimal amount, decimal taxes, string summary, string notes, int referenceId) {
      AccountTransaction transaction = new AccountTransaction(account, financialConcept);
      transaction.appliedToId = -1;
      transaction.transactionDate = transactionDate;
      transaction.collectedBy = collector;
      transaction.organization = cashRegister.Organization;

      transaction.amount = amount;
      transaction.taxes = taxes;
      transaction.credit = 0m;
      transaction.debit = amount;
      transaction.notes = notes;
      transaction.summary = summary;
      transaction.referenceId = referenceId;

      return transaction;
    }
Ejemplo n.º 4
0
 protected override void OnLoadObjectData(DataRow row) {
   this.cashRegister = CashRegister.Parse(Organization.Parse((int) row["OrganizationId"]),
                                          Contact.Parse((int) row["CashierId"]));
   this.transactionType = CRTransactionType.Parse((int) row["TransactionTypeId"]);
   this.collector = Contact.Parse((int) row["CollectorId"]);
   this.referenceId = (int) row["ReferenceId"];
   this.referenceTag = (string) row["ReferenceTag"];
   this.financialAccountId = (int) row["FinancialAccountId"];
   this.authorizationId = (int) row["AuthorizationId"];
   this.baseInstrumentType = InstrumentType.Parse((int) row["BaseInstrumentTypeId"]);
   this.transactionDate = (DateTime) row["TransactionDate"];
   this.dueDate = (DateTime) row["DueDate"];
   this.currency = Currency.Parse((int) row["CurrencyId"]);
   this.currencyAmount = (decimal) row["CurrencyAmount"];
   this.inputAmount = (decimal) row["InputAmount"];
   this.outputAmount = (decimal) row["OutputAmount"];
   this.summary = (string) row["Summary"];
   this.notes = (string) row["Notes"];
   this.keywords = (string) row["TransactionKeywords"];
   this.postedBy = Contact.Parse((int) row["PostedById"]);
   this.postingTime = (DateTime) row["PostingTime"];
   this.canceledBy = Contact.Parse((int) row["CanceledById"]);
   this.cancelationTime = (DateTime) row["CancelationTime"];
   this.status = (TreasuryItemStatus) Convert.ToChar(row["TransactionStatus"]);
 }
Ejemplo n.º 5
0
    public AccountTransaction CreateConcept(FinancialConcept concept, CashRegister cashRegister, DateTime transactionDate,
                                            decimal amount, string summary, string notes, int referenceId) {
      AccountTransaction transaction = null;
      if (concept.AppliesToCredit) {
        transaction = AccountTransaction.CreateCredit(this, concept, cashRegister.Organization, transactionDate,
                                                      amount, (amount - (amount / 1.16m)), summary, notes, referenceId);
      } else if (concept.AppliesToDebit) {
        transaction = AccountTransaction.CreateDebit(this, concept, Person.Empty, cashRegister, transactionDate,
                                                     amount, (amount - (amount / 1.16m)), summary, notes, referenceId);
      }
      transaction.Save();

      return transaction;
    }