Subversion Repositories SmartDukaan

Rev

Rev 6615 | Rev 6939 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6615 Rev 6643
Line 151... Line 151...
151
    awb = Awb.get_by(awb_number = awb_number, provider_id = provider_id)
151
    awb = Awb.get_by(awb_number = awb_number, provider_id = provider_id)
152
    query = AwbUpdate.query.filter_by(awb = awb)
152
    query = AwbUpdate.query.filter_by(awb = awb)
153
    info = query.all()
153
    info = query.all()
154
    return info
154
    return info
155
 
155
 
-
 
156
def store_shipment_info(update):
-
 
157
    updates = AwbUpdate.query.filter_by(providerId = update.providerId, awbNumber  = update.awbNumber, location = update.location, date = to_py_date(update.date), status = update.status, description = update.description).all()
-
 
158
    if not updates:
-
 
159
        dupdate = AwbUpdate()
-
 
160
        dupdate.providerId = update.providerId
-
 
161
        dupdate.awbNumber  = update.awbNumber
-
 
162
        dupdate.location = update.location
-
 
163
        dupdate.date = to_py_date(update.date)
-
 
164
        dupdate.status = update.status
-
 
165
        dupdate.description = update.description
-
 
166
        session.commit()
-
 
167
        
156
def get_holidays(start_date, end_date):
168
def get_holidays(start_date, end_date):
157
    query = PublicHolidays.query
169
    query = PublicHolidays.query
158
    if start_date != -1:
170
    if start_date != -1:
159
        query = query.filter(PublicHolidays.date >= to_py_date(start_date))
171
        query = query.filter(PublicHolidays.date >= to_py_date(start_date))
160
    if end_date != -1:
172
    if end_date != -1: