Subversion Repositories SmartDukaan

Rev

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

Rev 7370 Rev 7371
Line 5277... Line 5277...
5277
        return bin(0)
5277
        return bin(0)
5278
    
5278
    
5279
    return pdfFile
5279
    return pdfFile
5280
 
5280
 
5281
def add_frc(circle, operatorId, denomination, maxDiscount):
5281
def add_frc(circle, operatorId, denomination, maxDiscount):
5282
    frc = FRC.query.filter(FRC.circleId == circle).filter(FRC.operatorId == operatorId).filter(FRC.denomination == denomination).first();
5282
    frc = FRC.query.filter(FRC.circleId == circle).filter(FRC.operatorId == operatorId).filter(FRC.denomination == denomination).first()
5283
    if frc:
5283
    if frc:
5284
        frc.maxDiscount = maxDiscount
5284
        frc.maxDiscount = maxDiscount
5285
    else:
5285
    else:
5286
        frc = FRC()
5286
        frc = FRC()
5287
        frc.circleId = circle
5287
        frc.circleId = circle
Line 5289... Line 5289...
5289
        frc.maxDiscount = maxDiscount
5289
        frc.maxDiscount = maxDiscount
5290
        frc.operatorId = operatorId
5290
        frc.operatorId = operatorId
5291
    session.commit()
5291
    session.commit()
5292
    return True 
5292
    return True 
5293
 
5293
 
-
 
5294
def add_series(circle, operatorId, series):
-
 
5295
    operatorSeriesObject = OperatorSeries.query.filter(OperatorSeries.series == series).first()
-
 
5296
    if operatorSeriesObject:
-
 
5297
        circleName = TelecomCircle.get_by(id = operatorSeriesObject.circleId).name
-
 
5298
        operatorName = ServiceProvider.get_by(id = operatorSeriesObject.operatorId).name
-
 
5299
        return "Series already exists for : " + operatorName + " in circle : " + circleName
-
 
5300
    else :
-
 
5301
        operatorSeriesObject = OperatorSeries()
-
 
5302
        operatorSeriesObject.series = series
-
 
5303
        operatorSeriesObject.circleId = circle
-
 
5304
        operatorSeriesObject.operatorId = operatorId
-
 
5305
        session.commit()
-
 
5306
        return "Successfully saved"
-
 
5307
 
5294
if __name__ == '__main__':
5308
if __name__ == '__main__':
5295
    print 'helllo'
5309
    print 'helllo'
5296
5310