Пример #1
0
        private static FinancialAccountRows RowsNotInVatReport(FinancialAccount account, DateTime endDateTime)
        {
            Organization organization = account.Organization;
            SwarmDb      dbRead       = SwarmDb.GetDatabaseForReading();

            FinancialAccountRows rowsIntermediate =
                FinancialAccountRows.FromArray(
                    SwarmDb.GetDatabaseForReading().GetAccountRowsNotInVatReport(account.Identity, endDateTime));

            FinancialAccountRows rowsFinal = new FinancialAccountRows();

            foreach (FinancialAccountRow row in rowsIntermediate)
            {
                // Check if this row _closes_ an _existing_ VAT report, in which case it should _not_ be included

                int vatReportOpenId  = dbRead.GetVatReportIdFromCloseTransaction(row.FinancialTransactionId);
                int vatReportCloseId = dbRead.GetVatReportIdFromOpenTransaction(row.FinancialTransactionId);
                if (vatReportOpenId == 0 && vatReportCloseId == 0)
                {
                    // This particular transaction doesn't close an existing VAT report
                    rowsFinal.Add(row);
                }
            }

            return(rowsFinal);
        }
Пример #2
0
 public FinancialAccountRows GetRowsFar(DateTime start, DateTime end)  // selects lowerbound < x <= upperbound
 {
     BasicFinancialAccountRow[] basicRows = SwarmDb.GetDatabaseForReading()
                                            .GetFinancialAccountRows(Identity, start, end, true);
     return(FinancialAccountRows.FromArray(basicRows));
 }
Пример #3
0
 public FinancialAccountRows GetRows(DateTime start, DateTime end)
 {
     BasicFinancialAccountRow[] basicRows = SwarmDb.GetDatabaseForReading()
                                            .GetFinancialAccountRows(Identity, start, end, false);
     return(FinancialAccountRows.FromArray(basicRows));
 }
Пример #4
0
 public FinancialAccountRows GetLastRows(int rowCount)
 {
     BasicFinancialAccountRow[] basicRows = SwarmDb.GetDatabaseForReading()
                                            .GetLastFinancialAccountRows(Identity, rowCount);
     return(FinancialAccountRows.FromArray(basicRows));
 }