def getDataForDeadLine(self): session = loadSession() select = session.query(PaymVouc.c.corporateno, PaymVouc.c.belegdatum, PaymVouc.c.belegid, PaymVouc.c.vunr, PaymVouc.c.valid_until, PaymVouc.c.suppliersettled_at, PaymVoucFroz.c.revision, PaymVoucFroz.c.payed_by_time, PaymVoucFroz.c.payed_by_doc_time, PaymVoucFroz.c.frozen_val, PaymVoucFroz.c.announced_by_doc_time, PaymVoucFroz.c.booked_payed_by_time, PaymVoucFroz.c.booked_charged_by_time, PaymVoucFroz.c.charged_by_doc, ShopData.c.vunr, ShopData.c.objectname)\ .filter(PaymVouc.c.belegid == PaymVoucFroz.c.belegid, PaymVoucFroz.c.revision == 0, ShopData.c.vunr == PaymVouc.c.vunr, and_( func.to_date(PaymVouc.c.belegdatum, 'YYMMDD') >= self.__st_date, func.to_date(PaymVouc.c.belegdatum, 'YYMMDD') <= self.__end_date), PaymVouc.c.corporateno == self.__corporateId if self.__corporateId else '', PaymVouc.c.vunr == self.__supplierId if self.__supplierId else '')\ .distinct() session.close() return select.all()
def getCountForCashConversionChart(self): session = loadSession() count = session.query( PaymVoucFroz.c.revision, PaymVoucFroz.c.charged_by_time, PaymVoucFroz.c.announced_by_time, PaymVoucFroz.c.payed_by_time, PaymVoucFroz.c.announced_by_doc_time, PaymVoucFroz.c.payed_by_doc_time, PaymVoucFroz.c.booked_charged_by_time, PaymVoucFroz.c.booked_payed_by_time, PaymVoucFroz.c.charged_by_netto_sums, PaymVoucFroz.c.frozen_val, PaymVouc.c.belegdatum, PaymVouc.c.belegid, PaymVouc.c.valid_until, PaymVouc.c.primanotaid, PaymVouc.c.vunr, PaymVouc.c.suppliersettled_at, PaymVouc.c.charged_by, ShopData.c.vunr, ShopData.c.objectname)\ .filter(PaymVouc.c.belegid == PaymVoucFroz.c.belegid, PaymVoucFroz.c.revision == 0, ShopData.c.vunr == PaymVouc.c.vunr, and_( func.to_date(PaymVouc.c.belegdatum, 'YYMMDD') >= self.__st_date, func.to_date(PaymVouc.c.belegdatum, 'YYMMDD') <= self.__end_date), PaymVouc.c.corporateno == self.__corporateId if self.__corporateId else '', PaymVouc.c.vunr == self.__supplierId if self.__supplierId else '')\ .distinct()\ .count() session.close() return count
def __init__(self, file_name, csv_file_iterator=None, start_line_to_read=0, delimiter=';'): super(CCsvParserHandlerOrm, self).__init__(file_name, csv_file_iterator, start_line_to_read, delimiter) self._sql_session = loadSession()