internal CRPosting(CRTransaction transaction, InstrumentType instrumentType, CRDocument document, decimal amount) { this.transaction = transaction; this.instrumentType = instrumentType; this.instrumentId = -1; this.document = document; this.instrumentAmount = amount; if (this.transaction.TransactionType.UniqueCode.StartsWith("Input.")) { this.inputAmount = amount; } else { this.outputAmount = amount; } }
static public CRDocument CreateCheck(FinancialInstitution institution, string checksAccount, string checkNumber, Contact issuedBy, Contact issuedTo, DateTime issueDate, DateTime dueDate, decimal amount, string notes) { CRDocument document = new CRDocument(InstrumentType.Parse("check")); document.Institution = institution; document.AccountNumber = checksAccount; document.DocumentNumber = checkNumber; document.IssuedBy = issuedBy; document.IssuedTo = issuedTo; document.IssueDate = issueDate; document.DueDate = dueDate; document.Amount = amount; document.Notes = notes; return document; }
static public CRDocument CreateBankCardSlip(InstrumentType instrumentType, FinancialInstitution institution, string bankCardAccount, string voucherNumber, Contact issuedBy, DateTime issueDate, DateTime dueDate, decimal amount, string notes) { CRDocument document = new CRDocument(instrumentType); document.Institution = institution; document.AccountNumber = bankCardAccount; document.DocumentNumber = voucherNumber; document.IssuedBy = issuedBy; document.IssuedTo = CashRegister.MyCashRegister().Organization; document.IssueDate = issueDate; document.DueDate = dueDate; document.Amount = amount; document.Notes = notes; document.Status = TreasuryItemStatus.Pending; return document; }
public CRPosting AppendPosting(InstrumentType instrumentType, CRDocument document, decimal amount) { CRPosting posting = new CRPosting(this, instrumentType, document, amount); this.Postings.Add(posting); return posting; }
static public CRDocument CreateBankDepositSlip(InstrumentType instrumentType, int accountId, string reference, Contact issuedBy, DateTime dueDate, decimal amount, string notes) { CRDocument document = new CRDocument(instrumentType); if (accountId == 1) { document.Institution = FinancialInstitution.Parse(51); document.AccountNumber = "0482079690"; } else if (accountId == 2) { document.Institution = FinancialInstitution.Parse(57); document.AccountNumber = "12381918"; } document.DocumentNumber = reference; document.IssuedBy = issuedBy; document.IssuedTo = CashRegister.MyCashRegister().Organization; document.DueDate = dueDate; document.Amount = amount; document.Notes = notes; document.Status = TreasuryItemStatus.Pending; return document; }
protected override void OnLoadObjectData(DataRow row) { this.transaction = CRTransaction.Parse((int) row["TransactionId"]); this.instrumentType = InstrumentType.Parse((int) row["InstrumentTypeId"]); this.instrumentId = (int) row["InstrumentId"]; this.document = CRDocument.Parse((int) row["DocumentId"]); this.currency = Currency.Parse((int) row["CurrencyId"]); this.instrumentAmount = (decimal) row["CurrencyAmount"]; this.inputAmount = (decimal) row["InputAmount"]; this.outputAmount = (decimal) row["OutputAmount"]; this.status = (TreasuryItemStatus) Convert.ToChar(row["PostingStatus"]); }
public CRDocument CreateDocument(InstrumentType instrumentType) { this.document = new CRDocument(instrumentType); return this.Document; }