def test_nullifyTax(): oracle = Oracle() dic = { 'tax_code': '123456789012', 'tax_nbr': '000000100', 'oper_staff_id': 13, 'remark': '作废' } print nullifyTax(oracle, dic) oracle.commit()
return s.get_next_tax() def updatePool(s): update_dic = {'state':s.state, 'state_date':'/sysdate', 'payment_id':s.payment_id, 'sys_type':s.sys_type, 'reprint_flag':s.reprint_flag} where_dic = {'staff_id':s.staff_id, 'tax_code':s.tax_code, 'tax_nbr':s.tax_nbr, 'state':'instance'} table_name = 'pool' update(s.oracle, table_name, update_dic, where_dic, need_lock = True) where_dic['state'] = s.state add_info = {'oper_staff_id':s.staff_id, 'oper':s.state, 'oper_date':'/sysdate'} insertLog(s.oracle, table_name, where_dic, add_info) def get_next_tax(s): result = getTax(s.oracle, s.staff_id) if(result == None): return {'tax_code':'-1', 'tax_nbr':'-1'} return result def useTax(oracle, **args): use_tax = UseTax(oracle, **args) return use_tax.useTax() def test_useTax(oracle): dic = getTax(oracle, 22) dic['staff_id'] = '22' dic['payment_id'] = '123456' dic['sys_type'] = 'H' print useTax(oracle, **dic) if __name__ == '__main__': oracle = Oracle() test_useTax(oracle) oracle.commit()
'hold') def collectTax(oracle, **args): '''发票收回 oper_staff_id distri_id tax_begin_nbr tax_end_nbr ''' collect_tax = CollectTax(oracle, **args) collect_tax.collectTax() def allCollect(oracle, distri_id, oper_staff_id): '''全部回收''' update_dic = {'state':'out','state_date':'/sysdate'} where_dic = {'distri_id':distri_id} update(oracle, 'distri', update_dic, where_dic) insertDistriLog(oracle = oracle, distri_id = distri_id, oper_staff_id = oper_staff_id, oper = 'be collect',state = 'out') new_distri_id = getNextVal(oracle) insertDistriAsSplit(oracle, new_distri_id = new_distri_id, distri_id = distri_id, staff_id = oper_staff_id) insertDistriLog(oracle = oracle, distri_id = new_distri_id, oper_staff_id = oper_staff_id, oper = 'collect',state = 'hold') def test_collectTax(oracle): collectTax(oracle, distri_id = 999, oper_staff_id = 22, tax_begin_nbr = '001', tax_end_nbr = '100') if __name__ == "__main__": from oracle import Oracle oracle_test = Oracle() test_collectTax(oracle_test) oracle_test.commit()
def insertBillItemList(self): '''insert table bill_item_list''' bill_item = [] for i in self.bill_item_list: dic = { 'invoice_id': self.invoice_seq_id, 'region': 'BillItemList', 'content': i, 'sort': self.bill_item_list.index(i) } bill_item.append(dic) insert(self.oracle, 'hand_invoice_detail', bill_item, len(bill_item)) def testHandPrint(oracle): dic = getTax(oracle, 22) dic['staff_id'] = '22' dic['Amountlower'] = '50' dic['BillItemList'] = ['装机费', '就是要收你钱费'] dic['Amountupper'] = '人民币(大写) 贰拾壹元零壹分' print handPrint(oracle, **dic) if __name__ == "__main__": test_oracle = Oracle() testHandPrint(test_oracle) test_oracle.commit()
def testAddBbs(): oracle = Oracle() dic = {"bbs_content": "我汗"} addBbs(oracle, dic) oracle.commit()
def test_rollTax(): oracle = Oracle() roll(oracle, tax_code = '1234567', tax_nbr = '100204', oper_staff_id = 22) oracle.commit()
def test_nullifyDistri(): oracle = Oracle() dic = {'distri_id': '1105', 'oper_staff_id': 71, 'remark': '作废'} print nullifyDistri(oracle, **dic) oracle.commit()