示例#1
0
    def get_row(self):
        session = self.request.session
        if session['logged']<>1:
           return HTTPFound(location='/logout') 

        request = self.request
        fields = request.matchdict
        frm = osPbb.frm_split(fields['f'])
        if frm:
            datas=osDOP.row2dict(osDOP.get_by_form(frm))
            
        if datas:
            data2=osDOPBumi.row2dict(osDOPBumi.get_by_kode(datas))
            datas.update(data2)
            data2=osDSP.row2dict(osDSP.get_by_kode(datas['subjek_pajak_id']))
            datas.update(data2)
            datas['found'] = 1
        else:
            datas['found'] = 0
        row=osDOP.frm_max(frm)
        
        if row:
            datas['frm_max']=row[0]
        else:    
            datas['frm_max']=''.join((frm['tahun'],frm['bundle'],'000'))
        if abs(float(row[0])-float(osPbb.frm_join(frm)))>1:
            datas['frm_fail']=1
        else:
            datas['frm_fail']=0
        return datas
示例#2
0
    def get_row(self):
        session = self.request.session
        request = self.request
        fields = request.matchdict
        frm = osPbb.frm_split(fields['f'])
        if frm:
            datas=osDOP.row2dict(osDOP.get_by_form(frm))

        if 'n' in fields:
            nop = osPbb.frm_split(fields['n'])
            if not datas and nop:
                datas=osDOP.row2dict(osDOP.get_by_kode(nop))
            
        if datas:
            data2=osDOPBumi.row2dict(osDOPBumi.get_by_kode(datas))
            datas.update(data2)
            data2=osDSP.row2dict(osDSP.get_by_kode(datas['subjek_pajak_id']))
            datas.update(data2)
            datas['found'] = 1
        else:
            datas=osSpop.BlankRow()
            datas['found'] = 0
            
        row=osDOP.frm_max(frm)
        print row[0]
        if row:
            datas['frm_max']=row[0]
        else:    
            datas['frm_max']=''.join((frm['tahun'],frm['bundle'],'000'))
        if abs(float(datas['frm_max'])-float(osPbb.frm_join(frm)))>1:
            datas['frm_fail']=1
        else:
            datas['frm_fail']=0
        return datas
示例#3
0
 def get_by_form(cls,frm):
     return DBSession.query(cls).filter( 
             cls.no_formulir_lspop==osPbb.frm_join(frm)
             ).first()     
示例#4
0
 def frm_max(cls,kode):
     frm=osPbb.frm_join(kode)
     return DBSession.query(
               func.max(cls.no_formulir_spop).label("frm_max")).filter(
                   cls.no_formulir_spop.like(''.join((frm[0:7],'%')))).first()
示例#5
0
 def frm_max(cls, kode):
     frm = osPbb.frm_join(kode)
     return DBSession.query(
         func.max(cls.no_formulir_spop).label("frm_max")).filter(
             cls.no_formulir_spop.like(''.join((frm[0:7], '%')))).first()