コード例 #1
0
def getPayments(var, rese=None):
    if rese == None: rese = getReseName(var)
    assert rese != None
    pli = util.RESOP(var).getResAddPaymentList(rese)
    R = util.RESFORM(var)
    pli.addAll(R.findElem(rese).getResDetail())
    return pli
コード例 #2
0
def searchForRooms(var, dfrom, dto):
    R = util.RESOP(var)
    q = createResQueryElem(None, dfrom, dto)
    l = R.searchReservation(q)
    res = []
    for r in l:
        res.append(r.getRoomName())
    return res
コード例 #3
0
def getReservForDay(var, room, day):
    R = util.RESOP(var)
    #   room = var["JDATELINE_LINE"]
    #   day = var["JDATELINE_DATE"]
    query = cutil.createArrayList()
    q = createResQueryElem(room, day, day)
    query.add(q)
    res = R.queryReservation(query)
    return res
コード例 #4
0
def checkReseAvailibity(var, list, avail, resday, resroomname):
    """ Validate reservation
  Args:
    var
    list : List of reservations
    avail : If not none field with 'available' information
    resday : Field with reservation day
    resroomname : Field with room name to reserve
  Returns: 
    None Reservation OK
    (date,roomname) Not valid and position of error
  """

    # check if reservation not doubled
    b = sets.Set()
    for p in list:
        dat = p[resday]
        roomname = p[resroomname]
        if (dat, roomname) in b:
            _setDuplicatedReservation(var, dat, roomname)
            return (dat, roomname)
        b.add((dat, roomname))

    RES = util.RESOP(var)
    query = cutil.createArrayList()
    for p in list:
        dat = p[resday]
        roomname = p[resroomname]
        if avail != None and not p[avail]:
            setAlreadyReservedNotAvailable(var)
            return (dat, roomname)
        qelem = createResQueryElem(roomname, dat, dat)
        query.add(qelem)
    rList = RES.queryReservation(query)
    # analize if other reservation
    resename = getReseName(var)
    alreadyres = len(rList)
    dat = None
    roomname = None
    if resename:
        alreadyres = 0
        for r in rList:
            if r.getResId() != resename:
                dat = r.getResDate()
                roomname = r.getRoomName()
                alreadyres = alreadyres + 1
    if alreadyres:
        setAlreadyReserved(var)
        return (dat, roomname)
    return None
コード例 #5
0
def _buildXMLForServices(var, name, resename, payername, pli):
    ma = {}
    r = util.RESFORM(var).findElem(resename)
    nog = len(util.RESOP(var).getResGuestList(resename))
    li = rutil.getPayments(var, resename)
    _XbuildHeaderXML(var, ma, nog, r, payername)
    sum = rutil.countTotalForServices(var, pli, li)
    ma["doctype"] = "I"
    if name == None: ma["docid"] = resename
    else: ma["docid"] = name

    ma["total"] = sum

    B = _BI(pli, var)
    B.scan(li)
    ma["grossvalue"] = B.grossvalue

    return (ma, B.seq)
コード例 #6
0
def afterCheckIn(var):
    if var["JUPDIALOG_BUTTON"] == "makecheckin":
        util.RESOP(var).changeStatusToStay(getReseName(var))
        refreshPanel(var)
        var["JCLOSE_DIALOG"] = True