Ejemplo n.º 1
0
    static internal AccountTransaction CreateCredit(FinancialAccount account, FinancialConcept financialConcept, Organization organization,
                                                    DateTime transactionDate, decimal amount, decimal taxes, string summary, string notes,
                                                    int referenceId) {
      AccountTransaction transaction = new AccountTransaction(account, financialConcept);
      transaction.organization = organization;
      transaction.transactionDate = transactionDate;
      transaction.amount = amount;
      transaction.taxes = taxes;
      transaction.credit = amount;
      transaction.debit = 0m;
      transaction.summary = summary;
      transaction.notes = notes;
      transaction.referenceId = referenceId;

      return transaction;
    }
Ejemplo n.º 2
0
    public void Delete() {
      if (!CanDelete()) {
        return;
      }

      AccountTransaction[] transactions = new AccountTransaction[collectTotalItemsTable.Rows.Count];
      for (int i = 0; i < collectTotalItemsTable.Rows.Count; i++) {
        transactions[i] = BaseObject.ParseDataRow<AccountTransaction>(collectTotalItemsTable.Rows[i]);
      }
      using (DataWriterContext context = DataWriter.CreateContext("DeleteCollectTotal")) {
        ITransaction transaction = context.BeginTransaction();
        for (int i = 0; i < transactions.Length; i++) {
          //context.Add(transactions[i].Delete(this));
        }
        this.status = "X";
        context.Add(CollectData.SetCollectTotalStatus(this.Id, "X"));
        context.Update();
        transaction.Commit();
      }
    }
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;
    }