Beispiel #1
0
class routing_line(Base):
    """  """
    __tablename__ = 'RT010130'
    __table_args__ = (ForeignKeyConstraint(
        ['ROUTINGNAME_I', 'ITEMNMBR'],
        ['RT010001.ROUTINGNAME_I', 'RT010001.ITEMNMBR']), {})

    name = Column('ROUTINGNAME_I', StripString(31), primary_key=True)
    item = Column('ITEMNMBR', StripString(31), primary_key=True)
    routeseq = Column('RTSEQNUM_I', StripString(11), primary_key=True)
    routedesc = Column('RTSEQDES_I', StripString(101), nullable=False)
    wcid = Column('WCID_I', StripString(11), nullable=False)
    noteidx = Column('NOTEINDX',
                     Numeric(19, 5),
                     nullable=False,
                     default=get_next_note_index)

    def __init__(self, name, item, routeseq, routedesc, wcid, **kwargs):
        self.name = name
        self.item = item
        self.routeseq = routeseq
        self.routedesc = routedesc
        self.wcid = wcid

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #2
0
class MOP_Order_Activity(Base):
    """ Manufacture Order Activity """
    __tablename__ = 'MOP10213'

    mo = Column('MANUFACTUREORDER_I',
                StripString(31),
                ForeignKey('WO010032.MANUFACTUREORDER_I'),
                primary_key=True)
    linenum = Column('LNSEQNBR', Numeric(19, 5), primary_key=True, default=1)
    status = Column('MANUFACTUREORDERST_I', Integer, nullable=False, default=1)
    activity = Column('MO_ACTIVITY_REASON_I',
                      Integer,
                      nullable=False,
                      default=47)
    changeddate = Column('CHANGEDATE_I',
                         DateTime,
                         nullable=False,
                         default=gp_cur_date)
    changedtime = Column('TIME_I',
                         DateTime,
                         nullable=False,
                         default=gp_cur_time)
    uid = Column('USERID', StripString(15), nullable=False, default='sa')
    picknum = Column('PICKNUMBER', StripString(17), nullable=False, default='')
    doctype = Column('DOCTYPE', Integer, nullable=False, default=0)

    def __init__(self, mo, **kwargs):
        self.mo = mo

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #3
0
class IV_Lot_MSTR(Base):
    """ Item Lot Number Master """
    __tablename__ = 'IV00300'

    item = Column('ITEMNMBR', StripString(31), ForeignKey('IV00101'), primary_key=True)
    location = Column('LOCNCODE', StripString(11), primary_key=True)
    received = Column('DATERECD', DateTime, primary_key=True, default=gp_cur_date)
    dateseq = Column('DTSEQNUM', Integer, primary_key=True, autoincrement=False)
    qtytype = Column('QTYTYPE', Integer, primary_key=True, autoincrement=False, default=1)
    lot = Column('LOTNUMBR', StripString(21), nullable=False)
    cost = Column('UNITCOST', Numeric(19,5), nullable=False)
    qtyreceived = Column('QTYRECVD', Numeric(19,5), nullable=False)
    qtyallocated = Column('ATYALLOC', Numeric(19,5), nullable=False, default=0)
    qtysold = Column('QTYSOLD', Numeric(19,5), nullable=False, default=0)

    def __init__(self, item, location, dateseq, lot, cost, qtyreceived, **kwargs):
        self.item = item
        self.location = location
        self.dateseq = dateseq
        self.lot = lot
        self.cost = cost
        self.qtyreceived = qtyreceived

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass

    def _available(self):
        return self.qtyreceived - (self.qtyallocated >= 0 and self.qtyallocated or 0) - self.qtysold
    available = property(_available)
Beispiel #4
0
class IV_TRX_HIST_LINE_DTL(Base):
    """ Inventory Transaction Detail History """
    __tablename__ = 'IV30301'

    doctype = Column('DOCTYPE', Integer, primary_key=True, autoincrement=False)
    docnum = Column('DOCNUMBR', StripString(21), primary_key=True)
    seq = Column('LNSEQNBR', Numeric(19,5), primary_key=True)
    detailseq = Column('DTLSEQNM', Integer, primary_key=True, autoincrement=False)
    qtytype = Column('QTYTYPE', Integer, nullable=False, default=1)
    rctnum = Column('RCPTNMBR', StripString(21), nullable=False)
    qty = Column('RCPTQTY', Numeric(19,5), nullable=False)
    extcost = Column('RCPTEXCT', Numeric(19,5), nullable=False)

    def __init__(self, doctype, docnum, seq, detailseq, rctnum, qty, extcost, **kwargs):
        self.doctype = doctype
        self.docnum = docnum
        self.seq = seq
        self.detailseq = detailseq
        self.rctnum = rctnum
        self.qty = qty
        self.extcost = extcost

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #5
0
class IV_TRX_HIST_Batch(Base):
    """ Inventory Transaction Batch History """
    __tablename__ = 'IV30100'

    trxsrc = Column('TRXSORCE', StripString(13), primary_key=True)
    batchsrc = Column('BCHSOURC', StripString(15), nullable=False)
    batch = Column('BACHNUMB', StripString(15), nullable=False)
    batch_comment = Column('BCHCOMNT', StripString(61), nullable=False, default='')
    batch_freq = Column('BACHFREQ', Integer, nullable=False, default=1)
    posteddate = Column('POSTEDDT', DateTime, nullable=False)
    hist_removed = Column('HISTRMVD', Integer, nullable=False)
    batch_total = Column('BCHTOTAL', Numeric(19,5), nullable=False)
    control_total = Column('CNTRLTOT', Numeric(19,5), nullable=False)
    control_trx_count = Column('CNTRLTRX', Integer, nullable=False)
    numtrans = Column('NUMOFTRX', Integer, nullable=False)

    def __init__(self, trxsrc, batchsrc, batch, posteddate, hist_removed, batch_total, control_total, control_trx_count, numtrans, **kwargs):
        self.trxsrc = trxsrc
        self.batchsrc = batchsrc
        self.batch = batch
        self.posteddate = posteddate
        self.hist_removed = hist_removed
        self.batch_total = batch_total
        self.control_total = control_total
        self.control_trx_count = control_trx_count
        self.numtrans = numtrans

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #6
0
class MOP_PickDoc_MSTR(Base):
    """  """
    __tablename__ = 'MOP1200'

    picknum = Column('PICKNUMBER', StripString(17), primary_key=True)
    trxtype = Column('TRX_TYPE', Integer, nullable=False, default=1)
    uid = Column('USERID', StripString(15), nullable=False, default='sa')
    changedate = Column('CHANGEDATE_I',
                        DateTime,
                        nullable=False,
                        default=gp_cur_time)
    docdate = Column('DOCDATE', DateTime, nullable=False, default=gp_cur_time)
    posteddate = Column('POSTEDDT',
                        DateTime,
                        nullable=False,
                        default=gp_cur_date)
    posted = Column('POSTED', Boolean, nullable=False, default=False)

    def __init__(self, picknum, **kwargs):
        self.picknum = picknum

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #7
0
class MOP_Picklist_Site_QTYS(Base):
    """  """
    __tablename__ = 'MOP1400'
    __table_args__ = (ForeignKeyConstraint(
        ['MANUFACTUREORDER_I', 'PICKLISTSEQ', 'LOCNCODE'],
        ['PK010033.MANUFACTUREORDER_I', 'PK010033.SEQ_I', 'PK010033.LOCNCODE'
         ]), {})

    mo = Column('MANUFACTUREORDER_I', StripString(31), primary_key=True)
    seq = Column('PICKLISTSEQ', Integer, primary_key=True, autoincrement=False)
    location = Column('LOCNCODE', StripString(11), primary_key=True)
    item = Column('ITEMNMBR', StripString(31), nullable=False)
    qtyissued = Column('QTY_ISSUED_I',
                       Numeric(19, 5),
                       nullable=False,
                       default=0)
    qtyallocated = Column('ATYALLOC',
                          Numeric(19, 5),
                          nullable=False,
                          default=0)
    numscrapped = Column('NUMBERSCRAPPED_I',
                         Numeric(19, 5),
                         nullable=False,
                         default=0.0)
    issuependingqty = Column('PENDING_ISSUE_QTY_I',
                             Numeric(19, 5),
                             nullable=False,
                             default=0.0)
    revissuependingqty = Column('PENDING_REV_ISS_QTY_I',
                                Numeric(19, 5),
                                nullable=False,
                                default=0.0)
    scrappendingqty = Column('PENDING_SCRAP_QTY_I',
                             Numeric(19, 5),
                             nullable=False,
                             default=0.0)
    revscrappendingqty = Column('PENDING_REV_SCRAP_QTY_I',
                                Numeric(19, 5),
                                nullable=False,
                                default=0.0)

    def __init__(self, mo, seq, location, item, **kwargs):
        self.mo = mo
        self.seq = seq
        self.location = location
        self.item = item

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #8
0
class PM_Vendor_MSTR(Base):
    """ PM Vendor Master File """
    __tablename__ = 'PM00200'

    vendid = Column('VENDORID', StripString(15), primary_key=True)
    shipmethod = Column('SHIPMTHD', StripString(15), nullable=False)

    def __init__(self, vendid, shipmethod, **kwargs):
        self.vendid = vendid
        self.shipmethod = shipmethod

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #9
0
class MOP_Routing_Line(Base):
    """  """
    __tablename__ = 'WR010130'

    mo = Column('MANUFACTUREORDER_I',
                StripString(31),
                ForeignKey('WO010032.MANUFACTUREORDER_I'),
                primary_key=True)
    routeseq = Column('RTSEQNUM_I', StripString(11), primary_key=True)
    seqtype = Column('RTSEQTYPE_I', Integer, nullable=False, default=1)
    startdate = Column('SCHEDULESTARTDATE_I',
                       DateTime,
                       nullable=False,
                       default=gp_cur_date)
    finishdate = Column('SCHEDULEFINISHDATE_I',
                        DateTime,
                        nullable=False,
                        default=gp_cur_date)
    wc = Column('WCID_I', StripString(11), nullable=False)
    desc = Column('RTSEQDES_I', StripString(11), nullable=False)
    uid = Column('USERID', StripString(15), nullable=False, default='sa')
    createddate = Column('CREATDDT',
                         DateTime,
                         nullable=False,
                         default=gp_cur_date)
    createdtime = Column('CREATETIME_I',
                         DateTime,
                         nullable=False,
                         default=gp_cur_time)
    mostartqty = Column('WIPOPPERMOSTARTQTY',
                        Integer,
                        nullable=False,
                        default=1)
    noteidx = Column('NOTEINDX',
                     Numeric(19, 5),
                     nullable=False,
                     default=get_next_note_index)

    def __init__(self, mo, routeseq, wc, **kwargs):
        self.mo = mo
        self.routeseq = routeseq
        self.wc = wc
        self.desc = self.wc

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #10
0
class MOP_Order_MSTR(Base):
    """ Manufacture Order Master """
    __tablename__ = 'WO010032'

    mo = Column('MANUFACTUREORDER_I', StripString(31), primary_key=True)
    desc = Column('DSCRIPTN', StripString(31), nullable=False, default='')
    status = Column('MANUFACTUREORDERST_I', Integer, nullable=False, default=1)
    fgitem = Column('ITEMNMBR', StripString(31), nullable=False, default='')
    routing = Column('ROUTINGNAME_I',
                     StripString(31),
                     nullable=False,
                     default='')
    endqty = Column('ENDQTY_I', Numeric(19, 5), nullable=False, default=1)
    startqty = Column('STARTQTY_I', Numeric(19, 5), nullable=False, default=1)
    startdate = Column('STRTDATE',
                       DateTime,
                       nullable=False,
                       default=gp_cur_date)
    starttime = Column('STARTTIME_I',
                       DateTime,
                       nullable=False,
                       default=gp_cur_time)
    enddate = Column('ENDDATE', DateTime, nullable=False, default=gp_cur_time)
    fromsite = Column('DRAWFROMSITE_I',
                      StripString(11),
                      nullable=False,
                      default='PCSF')
    uid = Column('USERID', StripString(15), nullable=False, default='sa')
    schedmethod = Column('SCHEDULEMETHOD_I',
                         Integer,
                         nullable=False,
                         default=1)
    schedpref = Column('SCHEDULINGPREFEREN_I',
                       StripString(21),
                       nullable=False,
                       default='DEFAULT')
    tosite = Column('POSTTOSITE_I',
                    StripString(11),
                    nullable=False,
                    default='PCSF')
    priority = Column('MANUFACTUREORDPRI_I',
                      Integer,
                      nullable=False,
                      default=2)
    outsourced = Column('OUTSOURCED_I', Integer, nullable=False, default=1)
    bomcat = Column('BOMCAT_I', Integer, nullable=False, default=1)
    noteidx = Column('NOTEINDX',
                     Numeric(19, 5),
                     nullable=False,
                     default=get_next_note_index)

    def __init__(self, mo, **kwargs):
        self.mo = mo

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #11
0
class IV_Location_SETP(Base):
    """ Site Setup """
    __tablename__ = 'IV40700'

    location = Column('LOCNCODE', StripString(11), primary_key=True)
    desc = Column('LOCNDSCR', StripString(31), nullable=False)
    noteidx = Column('NOTEINDX', Numeric(19,5), nullable=False, default=get_next_note_index)

    def __init__(self, location, desc, **kwargs):
        self.location = location
        self.desc = desc

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #12
0
class POP_ReceiptHist(Base):
    """ Purchasing Receipt History """
    __tablename__ = 'POP30300'

    rctnum = Column('POPRCTNM', StripString(17), primary_key=True)
    receiptdate = Column('receiptdate', DateTime, nullable=False)
    batchnum = Column('BACHNUMB', StripString(15), nullable=False)
    vendid = Column('VENDORID', StripString(15), nullable=False)
    vendname = Column('VENDNAME', StripString(65), nullable=False)
    venddocnum = Column('VNDDOCNM', StripString(21), nullable=False)
    created = Column('CREATDDT', DateTime, nullable=False, default=gp_cur_date)
    modified = Column('MODIFDT', DateTime, nullable=False, default=gp_cur_date)
    currency = Column('CURNCYID',
                      StripString(15),
                      nullable=False,
                      default=get_currency)
    shipmethod = Column('SHIPMTHD', StripString(15), nullable=False)

    def __init__(self, rctnum, receiptdate, batchnum, vendid, vendname,
                 venddocnum, **kwargs):
        self.rctnum = rctnum
        self.receiptdate = receiptdate
        self.batchnum = batchnum
        self.vendid = vendid
        self.vendname = vendname
        self.venddocnum = venddocnum
        self.shipmethod = get_vendor_ship_method(self.vendid)

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #13
0
class IV_UofM_SETP_HDR(Base):
    """ Inventory U of M Schedule Setup """
    __tablename__ = 'IV40201'

    schedule = Column('UOMSCHDL', StripString(11), primary_key=True)
    desc = Column('UMSCHDSC', StripString(31), nullable=False)
    noteidx = Column('NOTEINDX', Numeric(19,5), nullable=False, default=get_next_note_index)
    uom = Column('BASEUOFM', StripString(9), nullable=False)
    dec_places_qtys = Column('UMDPQTYS', Integer, nullable=False, default=1)

    def __init__(self, schedule, desc, uom, **kwargs):
        self.schedule = schedule
        self.desc = desc
        self.uom = uom

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #14
0
class WC_HDR(Base):
    """ Work Center Header File """
    __tablename__ = 'WC010931'

    wc = Column('WCID_I',
                StripString(11),
                ForeignKey('WC010015.WCID_I'),
                primary_key=True)
    desc = Column('WCDESC_I', StripString(31), nullable=False)
    outsourced = Column('OUTSOURCED_I', Integer, nullable=False, default=1)

    def __init__(self, wc, **kwargs):
        self.wc = wc
        self.desc = wc

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #15
0
class IV_Item_MSTR_QTYS(Base):
    """ Item Quantity Master """
    __tablename__ = 'IV00102'

    item = Column('ITEMNMBR', StripString(31), ForeignKey('IV00101'), primary_key=True)
    location = Column('LOCNCODE', StripString(11), primary_key=True)
    recordtype = Column('RCRDTYPE', Integer, primary_key=True, autoincrement=False, default=2)
    bin = Column('BINNMBR', StripString(21), nullable=False, default='')
    qtyonhand = Column('QTYONHND', Numeric(19,5), nullable=False, default=0)
    qtyallocated = Column('ATYALLOC', Numeric(19,5), nullable=False, default=0)
    qtysold = Column('QTYSOLD', Numeric(19,5), nullable=False, default=0)
    landed_cost_id = Column('Landed_Cost_Group_ID', StripString(15), nullable=False, default='')
    orderpolicy = Column('ORDERPOLICY', Integer, nullable=False, default=1)
    numdays = Column('NMBROFDYS', Integer, nullable=False, default=1)
    ordermultiple = Column('ORDERMULTIPLE', Numeric(19,5), nullable=False, default=1.0)
    replenishmethod = Column('REPLENISHMENTMETHOD', Integer, nullable=False, default=3)
    includeplanning = Column('INCLDDINPLNNNG', Integer, nullable=False, default=1)
    forcast_consumption_period = Column('FRCSTCNSMPTNPRD', Integer, nullable=False, default=3)
    replenishlevel = Column('ReplenishmentLevel', Integer, nullable=False, default=1)
    ordermethod = Column('POPOrderMethod', Integer, nullable=False, default=1)
    vendorselection = Column('POPVendorSelection', Integer, nullable=False, default=1)
    pricingselection = Column('POPPricingSelection', Integer, nullable=False, default=1)
    includeallocations = Column('IncludeAllocations', Integer, nullable=False, default=1)
    includebackorders = Column('IncludeBackorders', Integer, nullable=False, default=1)
    includerequisitions = Column('IncludeRequisitions', Integer, nullable=False, default=1)
    pick_ticket_option = Column('PICKTICKETITEMOPT', Integer, nullable=False, default=3)
    mrpmovein = Column('INCLDMRPMOVEIN', Integer, nullable=False, default=1)
    mrpmoveout = Column('INCLDMRPMOVEOUT', Integer, nullable=False, default=1)
    mrpcancel = Column('INCLDMRPCANCEL', Integer, nullable=False, default=1)

    def __init__(self, item, location, **kwargs):
        self.item = item
        self.location = location

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass

    def _available(self):
        return self.qtyonhand - (self.qtyallocated >= 0 and self.qtyallocated or 0) - self.qtysold
    available = property(_available)
Beispiel #16
0
class IV_Lot_Attribute(Base):
    """ Item Lot Attribute Master """
    __tablename__ = 'IV00301'

    item = Column('ITEMNMBR', StripString(31), primary_key=True)
    lot = Column('LOTNUMBR', StripString(21), primary_key=True)
    attr1 = Column('LOTATRB1', StripString(11), nullable=False, default='')
    attr2 = Column('LOTATRB2', StripString(11), nullable=False, default='')
    attr3 = Column('LOTATRB3', StripString(11), nullable=False, default='')
    attr4 = Column('LOTATRB4', DateTime, nullable=False, default=gp_epoch_start)
    attr5 = Column('LOTATRB5', DateTime, nullable=False, default=gp_epoch_start)

    def __init__(self, item, lot, **kwargs):
        self.item = item
        self.lot = lot

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #17
0
class routing_mstr(Base):
    """  """
    __tablename__ = 'RT010001'

    item = Column('ITEMNMBR', StripString(31), primary_key=True)
    name = Column('ROUTINGNAME_I', StripString(31), primary_key=True)
    routeprimary = Column('RTPRIMARY_I', Integer, nullable=False, default=1)
    routestatus = Column('RTSTATUSDDL_I', Integer, nullable=False, default=4)
    noteidx = Column('NOTeINDX',
                     Numeric(19, 5),
                     nullable=False,
                     default=get_next_note_index)

    def __init__(self, item, name, **kwargs):
        self.item = item
        self.name = name

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #18
0
class SOP_LINE_WORK(Base):
    """ Sales Transaction Amounts Work """
    __tablename__ = 'SOP10200'

    soptype = Column('SOPTYPE', Integer, primary_key=True, default=1)
    sopnum = Column('SOPNUMBE', StripString(21), primary_key=True)
    lineitemseq = Column('LNITMSEQ', Integer, primary_key=True, default=Ordinal(0))
    componentseq = Column('CMPNTSEQ', Integer, primary_key=True, default=0)
    item = Column('ITEMNMBR', StripString(31), ForeignKey('IV00101.ITEMNMBR'), nullable=False)
    location = Column('LOCNCODE', StripString(11), nullable=False, default='PCSF')
    qty = Column('QUANTITY', Numeric(19,5), nullable=False, default=0)
    qtyallocated = Column('ATYALLOC', Numeric(19,5), nullable=False, default=0)

    def __init__(self, sopnum, item, **kwargs):
        self.sopnum = sopnum
        self.item = item

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #19
0
class MC_SETP(Base):
    """ Multicurrency Setup """
    __tablename__ = 'MC40000'

    currency = Column('FUNLCURR', StripString(15), primary_key=True)

    def __init__(self, currency, **kwargs):
        self.currency = currency

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #20
0
class BOM_Revision(Base):
    """  """
    __tablename__ = 'BM010415'

    item = Column('ITEMNMBR', StripString(31), primary_key=True)
    cat = Column('BOMCAT_I',
                 Integer,
                 primary_key=True,
                 autoincrement=False,
                 default=1)
    name = Column('BOMNAME_I', StripString(15), primary_key=True, default='')
    revlevel = Column('REVISIONLEVEL_I',
                      StripString(51),
                      nullable=False,
                      default='1')
    backflush = Column('BACKFLUSHITEM_I', Integer, nullable=False, default=0)
    type = Column('BOMTYPE_I', Integer, nullable=False, default=1)
    phantominventory = Column('Net_Phanton_Inventory',
                              Integer,
                              nullable=False,
                              default=0)
    changed = Column('CHANGEDATE_I', DateTime, nullable=False)
    changedby = Column('CHANGEBY_I',
                       StripString(15),
                       nullable=False,
                       default='sa')
    noteidx = Column('MFGNOTEINDEX3_I',
                     Numeric(19, 5),
                     nullable=False,
                     default=Decimal(0))

    def __init__(self, item, changed, **kwargs):
        self.item = item
        self.changed = changed

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #21
0
class SOP_Serial_Lot_WORK_HIST(Base):
    """ Sales Serial/Lot Work and History """
    __tablename__ = 'SOP10201'
    __table_args__ = (ForeignKeyConstraint(['SOPTYPE',
                                            'SOPNUMBE',
                                            'LNITMSEQ',
                                            'CMPNTSEQ',
                                            'ITEMNMBR'],
                                           ['SOP10200.SOPTYPE',
                                            'SOP10200.SOPNUMBE',
                                            'SOP10200.LNITMSEQ',
                                            'SOP10200.CMPNTSEQ',
                                            'SOP10200.ITEMNMBR']), {})

    soptype = Column('SOPTYPE', Integer, primary_key=True, default=1)
    sopnum = Column('SOPNUMBE', StripString(21), primary_key=True)
    lineitemseq = Column('LNITMSEQ', Integer, primary_key=True, default=Ordinal(0))
    componentseq = Column('CMPNTSEQ', Integer, primary_key=True, default=0)
    qtytype = Column('QTYTYPE', Integer, primary_key=True, default=1)
    lotseq = Column('SLTSQNUM', Integer, primary_key=True, default=Ordinal(0))
    received = Column('DATERECD', DateTime, primary_key=True, default=gp_cur_date)
    dateseq = Column('DTSEQNUM', Integer, primary_key=True, autoincrement=False, default=Decimal(1))
    lot = Column('SERLTNUM', StripString(21), nullable=False)
    qty = Column('SERLTQTY', Numeric(19,5), nullable=False, default=0)
    item = Column('ITEMNMBR', StripString(31), ForeignKey('IV00101.ITEMNMBR'), nullable=False)
    posted = Column('POSTED', Integer, nullable=False, default=0)


    def __init__(self, sopnum, item, lot, **kwargs):
        self.sopnum = sopnum
        self.item = item
        self.lot = lot

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #22
0
class IV_TRX_HIST_HDR(Base):
    """ Inventory Transaction History """
    __tablename__ = 'IV30200'
    __table_args__ = (ForeignKeyConstraint(['IVDOCTYP',
                                            'DOCNUMBR',
                                            'SRCRFRNCNMBR',],
                                           ['WO010302.IVDOCTYP',
                                            'WO010302.IVDOCNBR',
                                            'WO010302.MANUFACTUREORDER_I']), {})


    trxsrc = Column('TRXSORCE', StripString(13), primary_key=True)
    doctype = Column('IVDOCTYP', Integer, primary_key=True, autoincrement=False, default=1)
    docnum = Column('DOCNUMBR', StripString(21), primary_key=True)
    docdate = Column('DOCDATE', DateTime, nullable=False)
    batchsrc = Column('BCHSOURC', StripString(15), nullable=False)
    batchnum = Column('BACHNUMB', StripString(15), nullable=False)
    noteidx = Column('NOTEINDX', Numeric(19,5), nullable=False, default=get_next_note_index)
    gl_post_date = Column('GLPOSTDT', DateTime, nullable=False)
    source_ref = Column('SRCRFRNCNMBR', StripString(31), nullable=False)
    source_indicator = Column('SOURCEINDICATOR', Integer, nullable=False)

    def __init__(self, trxsrc, docnum, docdate, batchsrc, batchnum, gl_post_date, source_ref, source_indicator, **kwargs):
        self.trxsrc = trxsrc
        self.docnum = docnum
        self.docdate = docdate
        self.batchsrc = batchsrc
        self.batchnum = batchnum
        self.gl_post_date = gl_post_date
        self.source_ref = source_ref
        self.source_indicator = source_indicator

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #23
0
class MOP_Picklist_Seq_MSTR(Base):
    """ Picklist Sequence Master """
    __tablename__ = 'PK01200'

    mo = Column('MANUFACTUREORDER_I',
                StripString(31),
                ForeignKey('WO010032.MANUFACTUREORDER_I'),
                primary_key=True)
    pciklistseq = Column('PICKLISTSEQ', Integer, nullable=False, default=1)

    def __init__(self, mo, **kwargs):
        self.mo = mo

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #24
0
class IV_Item_ENG(Base):
    """ Item Engineering File """
    __tablename__ = 'IVR10015'

    item = Column('ITEMNMBT', StripString(32), primary_key=True)
    status = Column('ITEMSTATUS_I', Integer, nullable=False, default=1)
    makebuycode = Column('MAKEBUYCODE_I', Integer, nullable=False, default=1)
    effective_date = Column('EFFECTIVEDATE_I', DateTime, nullable=False)

    def __init__(self, item, **kwargs):
        self.item = item
        self.effective_date = datetime.now().date()

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #25
0
class MOP_PickDoc_Line(Base):
    """  """
    __tablename__ = 'MOP1210'

    picknum = Column('PICKNUMBER', StripString(17), primary_key=True)
    linenum = Column('PICKDOCLINENUM',
                     Integer,
                     primary_key=True,
                     autoincrement=False)
    mo = Column('MANUFACTUREORDER_I', StripString(31), nullable=False)
    posnum = Column('POSITION_NUMBER', Integer, nullable=False)
    item = Column('ITEMNMBR', StripString(31), nullable=False)
    picklistseq = Column('PICKLISTSEQ', Integer, nullable=False)
    pickqty = Column('TRXQTY', Numeric(19, 5), nullable=False)
    uom = Column('UOFM', StripString(9), nullable=False)
    tosite = Column('TO_SITE_I', StripString(11), nullable=False)
    location = Column('FROM_SITE_I',
                      StripString(11),
                      nullable=False,
                      default='PCSF')
    uomqty = Column('QTYBSUOM', Numeric(19, 5), nullable=False, default=1)
    item_tracking = Column('ITMTRKOP', Integer, nullable=False, default=3)
    qtyallocated = Column('ATYALLOC', Numeric(19, 5), nullable=False)
    qtyselected = Column('QTYSLCTD', Numeric(19, 5), nullable=False)
    qtyissued = Column('QTY_ISSUED_I', Numeric(19, 5), nullable=False)
    mrpamt = Column('MRPAMOUNT_I', Numeric(19, 5), nullable=False)
    reqdate = Column('REQDATE', DateTime, nullable=False, default=gp_cur_date)
    pickdate = Column('DATEPICKED',
                      DateTime,
                      nullable=False,
                      default=gp_cur_date)
    trxtype = Column('TRX_TYPE', Integer, nullable=False, default=1)

    def __init__(self, picknum, linenum, mo, posnum, item, picklistseq,
                 pickqty, uom, tosite, qtyallocated, **kwargs):
        self.picknum = picknum
        self.linenum = linenum
        self.mo = mo
        self.posnum = posnum
        self.item = item
        self.picklistseq = picklistseq
        self.pickqty = pickqty
        self.uom = uom
        self.tosite = tosite
        self.qtyallocated = qtyallocated
        self.qtyselected = self.qtyallocated
        self.qtyissued = self.qtyallocated
        self.mrpamt = self.qtyallocated

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #26
0
class WC_MSTR(Base):
    """ Work Center Master File """
    __tablename__ = 'WC010015'

    wc = Column('WCID_I', StripString(11), primary_key=True)
    effective_date = Column('EFFECTIVEDATE_I',
                            DateTime,
                            primary_key=True,
                            default=gp_cur_date)
    noteidx = Column('NOTEINDX',
                     Numeric(19, 5),
                     nullable=False,
                     default=get_next_note_index)

    def __init__(self, wc, **kwargs):
        self.wc = wc

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #27
0
class IV_TRX_HIST_Serial_Lot(Base):
    """ Item Serial and Lot Number History """
    __tablename__ = 'IV30400'
    __table_args__ = (ForeignKeyConstraint(['TRXSORCE',
                                            'IVDOCTYP',
                                            'DOCNUMBR',
                                            'LNSEQNBR',],
                                           ['IV30300.TRXSORCE',
                                            'IV30300.DOCTYPE',
                                            'IV30300.DOCNUMBR',
                                            'IV30300.LNSEQNBR']), {})

    trxsrc = Column('TRXSORCE', StripString(13), primary_key=True)
    doctype = Column('IVDOCTYP', Integer, primary_key=True, autoincrement=False, default=1)
    docnum = Column('DOCNUMBR', StripString(21), primary_key=True)
    seq = Column('LNSEQNBR', Numeric(19,5), primary_key=True)
    lotseq = Column('SLTSQNUM', Integer, primary_key=True, autoincrement=False)
    lot = Column('SERLTNUM', StripString(21), nullable=False)
    qty = Column('SERLTQTY', Numeric(19,5), nullable=False)
    from_bin = Column('FROMBIN', StripString(15), nullable=False)
    to_bin = Column('TOBIN', StripString(15), nullable=False)
    item = Column('ITEMNMBR', StripString(31), nullable=False)
    mfgdate = Column('MFGDATE', DateTime, nullable=False)
    expiration = Column('EXPNDATE', DateTime, nullable=False)

    def __init__(self, trxsrc, docnum, seq, lotseq, lot, qty, from_bin, to_bin, item, mfgdate, expiration, **kwargs):
        self.trxsrc = trxsrc
        self.docnum = docnum
        self.seq = seq
        self.lotseq = lotseq
        self.lot = lot
        self.qty = qty
        self.from_bin = from_bin
        self.to_bin = to_bin
        self.item = item
        self.mfgdate = mfgdate
        self.expiration = expiration

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #28
0
class IV_Item_MSTR(Base):
    """ Item Master """
    __tablename__ = 'IV00101'

    item = Column('ITEMNMBR', StripString(31), primary_key=True)
    itemdesc = Column('ITEMDESC', StripString(101), nullable=False)
    shortname = Column('ITMSHNAM', StripString(15), nullable=False)
    itemtype = Column('ITEMTYPE', Integer, nullable=False, default=1)
    stdcost = Column('STNDCOST', Numeric(19,5), nullable=False)
    curcost = Column('CURRCOST', Numeric(19,5), nullable=False)
    dec_places_qtys = Column('DECPLQTY', Integer, nullable=False, default=1)
    dec_places_curr = Column('DECPLCUR', Integer, nullable=False, default=3)
    itemtracking = Column('ITMTRKOP', Integer, nullable=False, default=3)
    itemclass = Column('ITMCLSCD', StripString(11), nullable=False, default='MAIN')
    uofmschedule = Column('UOMSCHDL', StripString(11), nullable=False, default='EACH')
    alternate1 = Column('ALTITEM1', StripString(31), nullable=False, default='')
    alternate2 = Column('ALTITEM2', StripString(31), nullable=False, default='')
    usercategory1 = Column('USCATVLS_1', StripString(11), nullable=False, default='')
    usercategory2 = Column('USCATVLS_2', StripString(11), nullable=False, default='')
    usercategory3 = Column('USCATVLS_3', StripString(11), nullable=False, default='')
    usercategory4 = Column('USCATVLS_4', StripString(11), nullable=False, default='')
    usercategory5 = Column('USCATVLS_5', StripString(11), nullable=False, default='')
    usercategory6 = Column('USCATVLS_6', StripString(11), nullable=False, default='')
    location = Column('LOCNCODE', StripString(11), nullable=False)
    invactindx = Column('IVIVINDX', Integer, nullable=False, default=147)

    def __init__(self, item, itemdesc, shortname, stdcost, location, **kwargs):
        self.item = item
        self.itemdesc = itemdesc
        self.shortname = shortname
        self.stdcost = stdcost
        self.curcost = self.stdcost
        self.location = location

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #29
0
class IV_TRX_HIST_LINE(Base):
    """ Inventory Transaction Amounts History """
    __tablename__ = 'IV30300'
    __table_args__ = (ForeignKeyConstraint(['TRXSORCE',
                                            'DOCTYPE',
                                            'DOCNUMBR'],
                                           ['IV30200.TRXSORCE',
                                            'IV30200.IVDOCTYP',
                                            'IV30200.DOCNUMBR']),
                      ForeignKeyConstraint(['DOCNUMBR',
                                            'DOCTYPE',
                                            'LNSEQNBR',
                                            'ITEMNMBR'],
                                           ['WO010302.IVDOCNBR',
                                            'WO010302.IVDOCTYP',
                                            'WO010302.LNSEQNBR',
                                            'WO010302.ITEMNMBR']), {})

    trxsrc = Column('TRXSORCE', StripString(13), nullable=False)
    doctype = Column('DOCTYPE', Integer, primary_key=True, autoincrement=False)
    docnum = Column('DOCNUMBR', StripString(21), primary_key=True)
    seq = Column('LNSEQNBR', Numeric(19,5), primary_key=True)
    docdate = Column('DOCDATE', DateTime, nullable=False)
    hist_module = Column('HSTMODUL', StripString(3), nullable=False)
    customer = Column('CUSTNMBR', StripString(15), nullable=False)
    item = Column('ITEMNMBR', StripString(31), nullable=False)
    uom = Column('UOFM', StripString(19), nullable=False)
    trxqty = Column('TRXQTY', Numeric(19,5), nullable=False)
    unitcost = Column('UNITCOST', Numeric(19,5), nullable=False)
    extcost = Column('EXTDCOST', Numeric(19,5), nullable=False)
    trxlocation = Column('TRXLOCTN', StripString(11), nullable=False)
    trx_to_location = Column('TRNSTLOC', StripString(11), nullable=False)
    trx_from_qty_type = Column('TRFQTYTY', Integer, nullable=False, default=1)
    trx_to_qty_type = Column('TRTQTYTY', Integer, nullable=False, default=3)
    invidx = Column('IVIVINDX', Integer, nullable=False)
    invoffset = Column('IVIVOFIX', Integer, nullable=False)
    dec_places_curr = Column('DECPLCUR', Integer, nullable=False, default=3)
    dec_places_qtys = Column('DECPLQTY', Integer, nullable=False, default=1)
    qtybsuom = Column('QTYBSUOM', Numeric(19,5), nullable=False)

    def __init__(self, trxsrc, doctype, docnum, seq, docdate, hist_module, customer, item, uom, trxqty, unitcost, extcost, trxlocation, trx_to_location, invidx, invoffset, qtybsuom, **kwargs):
        self.trxsrc = trxsrc
        self.doctype = doctype
        self.docnum = docnum
        self.seq = seq
        self.docdate = docdate
        self.hist_module = hist_module
        self.customer = customer
        self.item = item
        self.uom = uom
        self.trxqty = trxqty
        self.unitcost = unitcost
        self.extcost = extcost
        self.trxlocation = trxlocation
        self.trx_to_location = trx_to_location
        self.invidx = invidx
        self.invoffset = invoffset
        self.qtybsuom = qtybsuom

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass
Beispiel #30
0
class MOP_Item_MSTR(Base):
    """ Picklist File """
    __tablename__ = 'PK010033'

    mo = Column('MANUFACTUREORDER_I',
                StripString(31),
                ForeignKey('WO010032.MANUFACTUREORDER_I'),
                primary_key=True)
    seq = Column('SEQ_I', Integer, primary_key=True, autoincrement=False)
    fgitem = Column('PPN_I', StripString(31), primary_key=True, default='')
    item = Column('ITEMNMBR',
                  StripString(31),
                  ForeignKey('IV00101.ITEMNMBR'),
                  primary_key=True)
    status = Column('MANUFACTUREORDERST_I', Integer, nullable=False, default=1)
    posnum = Column('POSITION_NUMBER', Integer, nullable=False, default=0)
    routing = Column('ROUTINGNAME_I', StripString(31), nullable=False)
    mrpamt = Column('MRPAMOUNT_I', Numeric(19, 5), nullable=False)
    reqqty = Column('SUGGESTEDQTY_I', Numeric(19, 5), nullable=False)
    qtyissued = Column('QTY_ISSUED_I',
                       Numeric(19, 5),
                       nullable=False,
                       default=Decimal(0))
    qtyallocated = Column('ATYALLOC',
                          Numeric(19, 5),
                          nullable=False,
                          default=Decimal(0))
    wc = Column('WCID_I', StripString(11), nullable=False)
    routeseq = Column('RTSEQNUM_I', StripString(11), nullable=False)
    location = Column('LOCNCODE',
                      StripString(11),
                      nullable=False,
                      default='PCSF')
    changedate = Column('CHANGEDATE_I',
                        DateTime,
                        nullable=False,
                        default=gp_cur_date)
    uid = Column('USERID', StripString(15), nullable=False, default='sa')
    qtyallowed = Column('QTY_ALLOWED_I', Numeric(19, 5), nullable=False)
    reqdate = Column('REQDATE', DateTime, nullable=False, default=gp_cur_date)
    uom = Column('UOFM', StripString(9), nullable=False, default='Each')
    qtybsuom = Column('QTYBSUOM', Numeric(19, 5), nullable=False, default=1)
    bomseq = Column('BOMSEQ_I', Integer, nullable=False)
    bomcat = Column('BOMCAT_I', Integer, nullable=False, default=1)
    posnum2 = Column('POSITION_NUMBER2', Integer, nullable=False)
    isallocated = Column('ALLOCATED_I', Integer, nullable=False, default=0)
    allocateuid = Column('ALLOCATEUID_I',
                         StripString(15),
                         nullable=False,
                         default='sa')
    allocatedate = Column('ALLOCATEDATEI',
                          DateTime,
                          nullable=False,
                          default=gp_cur_date)
    allocatetime = Column('ALLOCATETIMEI',
                          DateTime,
                          nullable=False,
                          default=gp_cur_time)

    def __init__(self, mo, seq, item, routing, reqqty, wc, routeseq, **kwargs):
        self.mo = mo
        self.seq = seq
        self.item = item
        self.routing = routing
        self.mrpamt = self.reqqty
        self.reqqty = reqqty
        self.wc = wc
        self.routeseq = routeseq
        self.qtyallowed = self.reqqty
        self.bomseq = self.seq
        self.posnum2 = self.seq

        for k, v in kwargs.items():
            setattr(self, k, v)

        pass