def setup(self): self.io.step("Connectant a l'erp") self.Orm = lazyOOOP() self.io.success("Connectat") self.pol_obj = self.Orm.GiscedataPolissa self.fact_obj = self.Orm.GiscedataFacturacioFactura self.pool_obj = self.Orm.GiscedataLecturesLecturaPool create_date = self.get_last_polissa_create_date() self.io.info("Ăšltima polissa creada a data : {}", create_date) self.result.last_polissa_created = create_date self.result.today = today
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from validacio_eines import ( es_cefaco, validar_canvis, buscar_errors_lot_ids, copiar_lectures, lazyOOOP, ) O = lazyOOOP() #Objectes pol_obj = O.GiscedataPolissa clot_obj = O.GiscedataFacturacioContracte_lot comp_obj = O.GiscedataLecturesComptador lect_fact_obj = O.GiscedataLecturesLectura lect_pool_obj = O.GiscedataLecturesLecturaPool fact_obj = O.GiscedataFacturacioFactura cups_obj = O.GiscedataCupsPs #constants: dif_maxima = 55 #Inicicialitzadors lectures_copiades = [] lectures_massa_diferencia = [] sense_lectura_ref = [] sense_gir = [] sense_comptador = [] errors = []
import re import base64 from consolemsg import step, success, warn from validacio_eines import lazyOOOP from gestionatr.defs import TENEN_AUTOCONSUM from gestionatr.input.messages.F1 import CODIS_AUTOCONSUM found = {} tag = 'ConceptoRepercutible' tag_head = '<' + tag + '>' tag_tail = '</' + tag + '>' tag_head_len = len(tag_head) tag_tail_len = len(tag_tail) Obj = lazyOOOP() pol_obj = Obj.GiscedataPolissa f1_obj = Obj.GiscedataFacturacioImportacioLinia pol_ids = pol_obj.search([('autoconsumo', 'in', TENEN_AUTOCONSUM)]) for count, pol_id in enumerate(pol_ids): pol = pol_obj.browse(pol_id) last_pool = "No." if pol.comptadors and pol.comptadors[0].pool_lectures: last_pool = pol.comptadors[0].pool_lectures[0].name success( "({}/{}) Polissa amb autoconsum {} , data ultima lectura facturada {} "
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from validacio_eines import lazyOOOP from consolemsg import step, success from yamlns import namespace as ns from datetime import datetime import StringIO import csv how_many = 5000 csv_filename = 'out.csv' Op = lazyOOOP() success("Connected") i_obj = Op.GiscedataFacturacioImportacio li_obj = Op.GiscedataFacturacioImportacioLinia lil_obj = Op.GiscedataFacturacioImportacioLiniaLectures all_dates = {} step("Getting the ids") i_ids = i_obj.search([], limit=how_many) step("Reading the data") i_datas = i_obj.read(i_ids, ['data_carrega', 'num_xml', 'name']) success("Searching across {} imports:", len(i_ids)) for count, i_data in enumerate(i_datas): imp = ns(i_data) imp.day_carrega = imp.data_carrega[:10]