def tender_enquiryPeriod(self): end_date = calculate_tender_business_date(self.tenderPeriod.endDate, -QUESTIONS_STAND_STILL, self) clarifications_until = calculate_clarif_business_date(end_date, ENQUIRY_STAND_STILL_TIME, self, True) return EnquiryPeriod( dict( startDate=self.tenderPeriod.startDate, endDate=end_date, invalidationDate=self.enquiryPeriod and self.enquiryPeriod.invalidationDate, clarificationsUntil=clarifications_until, ) )
def __call__(self, obj, *args, **kwargs): configurator = getAdapter(obj, IContentConfigurator) enquiry_period_class = obj._fields["enquiryPeriod"] end_date = calculate_tender_business_date( obj.tenderPeriod.endDate, -configurator.questions_stand_still, obj) clarifications_until = calculate_clarif_business_date( end_date, configurator.enquiry_stand_still, obj, True) return enquiry_period_class( dict( startDate=obj.tenderPeriod.startDate, endDate=end_date, invalidationDate=obj.enquiryPeriod and obj.enquiryPeriod.invalidationDate, clarificationsUntil=clarifications_until, ))
def tender_init_handler(event): """ initialization handler for openeu tenders """ tender = event.tender end_date = calculate_tender_business_date(tender.tenderPeriod.endDate, -QUESTIONS_STAND_STILL, tender) clarifications_until = calculate_clarif_business_date(end_date, ENQUIRY_STAND_STILL_TIME, tender, True) tender.enquiryPeriod = EnquiryPeriod( dict( startDate=tender.tenderPeriod.startDate, endDate=end_date, invalidationDate=tender.enquiryPeriod and tender.enquiryPeriod.invalidationDate, clarificationsUntil=clarifications_until, ) ) now = get_now() tender.date = now if tender.lots: for lot in tender.lots: lot.date = now
def tender_init_handler(event): """ initialization handler for closeFrameworkAgreementUA tenders """ tender = event.tender config = getAdapter(tender, IContentConfigurator) end_date = calculate_tender_business_date(tender.tenderPeriod.endDate, -config.questions_stand_still, tender) clarifications_until = calculate_clarif_business_date(end_date, config.enquiry_stand_still, tender, True) tender.enquiryPeriod = EnquiryPeriod( dict( startDate=tender.tenderPeriod.startDate, endDate=end_date, invalidationDate=tender.enquiryPeriod and tender.enquiryPeriod.invalidationDate, clarificationsUntil=clarifications_until, ) ) now = get_now() tender.date = now if tender.lots: for lot in tender.lots: lot.date = now