예제 #1
0
class PositionSchema(MappingSchema):
    db = sqlite()
    categories = db.getAllCategories()
    categories = [(cat, cat) for (cat, comment) in categories]
    allItems = db.getAllItems()
    optgroups = defaultdict(lambda: [],{})
    for (itemid, name, category, comment) in allItems:
        optgroups[category].append((itemid, name))
    items = [widget.OptGroup(category, *values) for category, values in sorted(optgroups.items())]
    quantity = SchemaNode(
                Integer(),
                default=1
    )
    item_id  = SchemaNode(
                String(),
                widget=widget.SelectWidget(values=items),
                description = 'Item'
                )
    category = SchemaNode(
                String(),
                widget=widget.SelectWidget(values=categories),
                        description = 'Name der Kategorie'
                )
    price    = SchemaNode(
                Decimal(),
                widget=widget.MoneyInputWidget()
                )
    ean   = SchemaNode(String(),
                        missing='',
                        description = 'EAN')
    tags     = SchemaNode(String(),
                missing='',
                description = 'tags'
                )
    name = 'position'

    def update(self):
        allItems = self.db.getAllItems()
        optgroups = defaultdict(lambda: [],{})
        for (itemid, name, category, comment) in allItems:
            optgroups[category].append((itemid, name))
        items = [widget.OptGroup(category, *values) for category, values in sorted(optgroups.items())]
        self['item_id'].widget = widget.SelectWidget(values=items)
        categories = self.db.getAllCategories()
        categories = [(cat, cat) for (cat, comment) in categories]
        self['category'].widget = widget.SelectWidget(values=categories)
예제 #2
0
class AddSchema(colander.Schema):
    moneywidget = widget.MoneyInputWidget(
            size=20, options={'allowZero':True,
                              'precision':0
                              })
            
    #unit_id = colander.SchemaNode(
    #                colander.Integer(),
    #                widget=deferred_unit,
    #                title="OPD"
                    #title="SKPD"
    #                )
    unit_id = colander.SchemaNode(
                  colander.Integer(),
                  widget=widget.HiddenWidget(),
                  oid="unit_id",
                  title="OPD",
                  )
    unit_nm = colander.SchemaNode(
                  colander.String(),
                  title="OPD",
                  oid="unit_nm"
                  )
    kode   = colander.SchemaNode(
                    colander.String(),
                    title="Kode STS",
                    missing = colander.drop,
                    )
                    
    nama   = colander.SchemaNode(
                    colander.String(),
                    title="Uraian"
                    )
    tgl_sts = colander.SchemaNode(
                    colander.Date(),
                    )
    jumlah = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    )
예제 #3
0
class AddSchema(colander.Schema):
    moneywidget = widget.MoneyInputWidget(size=20,
                                          options={
                                              'allowZero': True,
                                              'precision': 0
                                          })

    unit_id = colander.SchemaNode(
        colander.Integer(),
        widget=widget.HiddenWidget(),
        oid="unit_id",
        title="OPD",
    )
    unit_nm = colander.SchemaNode(colander.String(),
                                  widget=auto_unit_nm,
                                  title="OPD",
                                  oid="unit_nm")
    wajibpajak_id = colander.SchemaNode(colander.Integer(),
                                        widget=widget.HiddenWidget(),
                                        title="Penyetor",
                                        oid="wajibpajak_id")
    wajibpajak_nm = colander.SchemaNode(colander.String(),
                                        widget=auto_wp_nm,
                                        title="Penyetor",
                                        oid="wajibpajak_nm")
    wp_nama = colander.SchemaNode(colander.String(),
                                  title="Nama Lain",
                                  oid="wp_nama")
    wp_alamat_1 = colander.SchemaNode(colander.String(),
                                      title="Alamat Subjek",
                                      oid="wp_alamat_1")

    wp_alamat_2 = colander.SchemaNode(colander.String(),
                                      title="Alamat Subjek",
                                      oid="wp_alamat_2")

    objekpajak_id = colander.SchemaNode(colander.Integer(),
                                        title="Objek",
                                        widget=widget.HiddenWidget(),
                                        oid="objekpajak_id")

    objekpajak_nm = colander.SchemaNode(colander.String(),
                                        widget=auto_op_nm,
                                        title="Objek",
                                        oid="objekpajak_nm")

    op_nama = colander.SchemaNode(colander.String(),
                                  title="Nama OP Lainnya",
                                  oid="op_nama")
    op_alamat_1 = colander.SchemaNode(colander.String(),
                                      title="Alamat Objek",
                                      oid="op_alamat_1")

    op_alamat_2 = colander.SchemaNode(colander.String(),
                                      title="Alamat Objek",
                                      oid="op_alamat_2")

    # rekening_id = colander.SchemaNode(
    # colander.String(),
    # #widget=widget.HiddenWidget(),
    # title="Rekening ID",
    # oid = "rekening_id"
    # )

    # rekening_nm = colander.SchemaNode(
    # colander.String(),
    # title="Rekening",
    # oid = "rekening_nm"
    # )

    kode = colander.SchemaNode(
        colander.String(),
        title="Kode",
        missing=colander.drop,
    )

    periode_1 = colander.SchemaNode(colander.Date(),
                                    title="Periode 1",
                                    widget=widget.DateInputWidget())
    periode_2 = colander.SchemaNode(colander.Date(), title="Periode 2")
    tgl_terima = colander.SchemaNode(colander.Date(), )
    jatuh_tempo = colander.SchemaNode(colander.Date(), )
    dasar = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="dasar")
    tarif = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="tarif",
                                missing=colander.drop,
                                title="Tarif (%)")
    pokok = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                missing=colander.drop,
                                oid="pokok")
    penambah = colander.SchemaNode(colander.Integer(),
                                   default=0,
                                   widget=moneywidget,
                                   oid="penambah",
                                   missing=colander.drop)
    pengurang = colander.SchemaNode(colander.Integer(),
                                    default=0,
                                    widget=moneywidget,
                                    oid="pengurang",
                                    missing=colander.drop)
    terutang = colander.SchemaNode(colander.Integer(),
                                   default=0,
                                   widget=moneywidget,
                                   oid="terutang")
    denda = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="denda")
    bunga = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="bunga")
    jumlah = colander.SchemaNode(colander.Integer(),
                                 default=0,
                                 widget=moneywidget,
                                 missing=colander.drop,
                                 oid="jumlah")
예제 #4
0
class AddSchema(colander.Schema):
    moneywidget = widget.MoneyInputWidget(size=20,
                                          options={
                                              'allowZero': True,
                                              'precision': 0
                                          })

    unit_id = colander.SchemaNode(
        colander.Integer(),
        widget=widget.HiddenWidget(),
        oid="unit_id",
        title="OPD",
    )
    unit_nm = colander.SchemaNode(colander.String(),
                                  title="OPD",
                                  oid="unit_nm")
    wilayah_id = colander.SchemaNode(colander.Integer(),
                                     widget=deferred_wilayah,
                                     title="Wilayah")
    wp_kode = colander.SchemaNode(colander.String(),
                                  title="Kode Penyetor",
                                  oid="wp_kode")
    wp_nama = colander.SchemaNode(colander.String(),
                                  title="Nama Penyetor",
                                  oid="wp_nama")
    wp_alamat_1 = colander.SchemaNode(colander.String(),
                                      title="Alamat",
                                      oid="wp_alamat_1")
    wp_alamat_2 = colander.SchemaNode(
        colander.String(),
        title="Alamat lain",
        oid="wp_alamat_2",
        missing=colander.drop,
    )
    pajak_id = colander.SchemaNode(
        colander.String(),
        widget=widget.HiddenWidget(),
        oid="pajak_id",
    )

    pajak_nm = colander.SchemaNode(colander.String(),
                                   title="Rekening",
                                   oid="pajak_nm")

    kode = colander.SchemaNode(
        colander.String(),
        title="Kode Bayar",
        missing=colander.drop,
    )

    periode_1 = colander.SchemaNode(colander.Date(),
                                    title="Periode 1",
                                    widget=widget.DateInputWidget())
    periode_2 = colander.SchemaNode(colander.Date(), title="Periode 2")
    tgl_tetap = colander.SchemaNode(colander.Date(), )
    jatuh_tempo = colander.SchemaNode(colander.Date(), )
    dasar = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="dasar")
    tarif = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="tarif",
                                missing=colander.drop)
    pokok = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                missing=colander.drop,
                                oid="pokok")
    denda = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="denda")
    bunga = colander.SchemaNode(colander.Integer(),
                                default=0,
                                widget=moneywidget,
                                oid="bunga")
    jumlah = colander.SchemaNode(colander.Integer(),
                                 default=0,
                                 widget=moneywidget,
                                 missing=colander.drop,
                                 oid="jumlah")
예제 #5
0
class AddSchema(colander.Schema):
    moneywidget = widget.MoneyInputWidget(
            size=20, options={'allowZero':True,
                              'precision':0
                              })
            
    unit_id = colander.SchemaNode(
                    colander.Integer(),
                    widget=widget.HiddenWidget(),
                    oid="unit_id",
                    title="OPD",
                    )
    unit_nm = colander.SchemaNode(
                    colander.String(),
                    title="OPD",
                    oid="unit_nm"
                    )
    wajibpajak_id = colander.SchemaNode(
                    colander.Integer(),
                    widget=widget.HiddenWidget(),
                    title="Penyetor",
                    oid = "wajibpajak_id"
                    )
    wajibpajak_nm = colander.SchemaNode(
                    colander.String(),
                    widget=auto_wp_nm4,
                    title="Penyetor",
                    oid = "wajibpajak_nm"
                    )
    wajib_pajak_us = colander.SchemaNode(
                    colander.Integer(),
                    widget=widget.HiddenWidget(),
                    oid = "wajib_pajak_us"
                    )
    wajib_pajak_un = colander.SchemaNode(
                    colander.Integer(),
                    widget=widget.HiddenWidget(),
                    oid = "wajib_pajak_un"
                    )
    objekpajak_id = colander.SchemaNode(
                    colander.Integer(),
                    title="Objek",
                    widget=widget.HiddenWidget(),
                    oid = "objekpajak_id"
                    )
    objekpajak_nm = colander.SchemaNode(
                    colander.String(),
                    widget=auto_op_nm,
                    title="Objek",
                    oid = "objekpajak_nm"
                    )
                    
    kode   = colander.SchemaNode(
                    colander.String(),
                    title="Kode Bayar",
                    missing = colander.drop,
                    )
                    
    periode_1 = colander.SchemaNode(
                    colander.Date(),
                    title="Periode 1",
                    widget = widget.DateInputWidget()
                    )
    periode_2 = colander.SchemaNode(
                    colander.Date(),
                    title="Periode 2"
                    )
    tgl_tetap = colander.SchemaNode(
                    colander.Date(),
                    )
    jatuh_tempo = colander.SchemaNode(
                    colander.Date(),
                    )
    dasar = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    widget = moneywidget,
                    oid = "dasar"
                    )
    tarif = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    widget = moneywidget,
                    oid = "tarif",
                    missing=colander.drop
                    )
    pokok = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    widget = moneywidget,
                    missing=colander.drop,
                    oid = "pokok"
                    )
    denda = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    widget = moneywidget,
                    oid = "denda"
                    )
    bunga = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    widget = moneywidget,
                    oid = "bunga"
                    )
    jumlah = colander.SchemaNode(
                    colander.Integer(),
                    default = 0,
                    widget = moneywidget,
                    missing=colander.drop,
                    oid = "jumlah"
                    )
예제 #6
0
class AddSchema(colander.Schema):
    moneywidget = widget.MoneyInputWidget(size=20,
                                          options={
                                              'allowZero': True,
                                              'precision': 0
                                          })
    kode = colander.SchemaNode(colander.String(),
                               title="Kode Bayar",
                               widget=widget.TextInputWidget(
                                   mask='9999-9.99.99-999999',
                                   mask_placeholder='#',
                               ))

    arinvoice_id = colander.SchemaNode(
        colander.Integer(),
        oid="arinvoice_id",
        widget=widget.HiddenWidget(readonly=True),
        missing=colander.drop,
        default=0)

    unit_nama = colander.SchemaNode(
        colander.String(),
        title="OPD",
        #title="SKPD",
        oid="unit_nama",
        missing=colander.drop)

    wp_nama = colander.SchemaNode(
        colander.String(),
        title="Subjek",
        oid="wp_nama",
        missing=colander.drop,
    )

    rek_nama = colander.SchemaNode(
        colander.String(),
        title="Rekening",
        oid="rek_nama",
        missing=colander.drop,
    )

    op_nama = colander.SchemaNode(colander.String(),
                                  title="Objek",
                                  missing=colander.drop,
                                  oid="op_nama")
    bank_id = colander.SchemaNode(
        colander.String(),
        title="Bank",
        oid="bank_id",
        missing=colander.drop,
    )
    channel_id = colander.SchemaNode(colander.String(),
                                     oid="channel_id",
                                     missing=colander.drop)
    ntb = colander.SchemaNode(
        colander.String(),
        title="NTB",
        oid="ntb",
        missing=colander.drop,
    )
    ntp = colander.SchemaNode(colander.String(),
                              oid="ntp",
                              missing=colander.drop)

    periode_1 = colander.SchemaNode(
        colander.String(),
        title="Periode 1",
        oid="periode_1",
        missing=colander.drop,
    )
    periode_2 = colander.SchemaNode(colander.String(),
                                    title="Periode 2",
                                    oid="periode_2",
                                    missing=colander.drop)
    tgl_tetap = colander.SchemaNode(
        colander.String(),
        oid="tgl_tetap",
    )
    jatuh_tempo = colander.SchemaNode(
        colander.String(),
        oid="jatuh_tempo",
        missing=colander.drop,
    )
    terutang = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="terutang",
        missing=colander.drop,
    )
    denda = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="denda",
        missing=colander.drop,
    )
    bunga_awal = colander.SchemaNode(
        colander.Integer(),
        default=0,
        oid="bunga_awal",
        widget=moneywidget,
        missing=colander.drop,
    )

    jumlah = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="jumlah",
        missing=colander.drop,
    )

    bunga = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="bunga",
        missing=colander.drop,
    )
    bayar = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="bayar",
        missing=colander.drop,
    )
    tgl_bayar = colander.SchemaNode(colander.Date(),
                                    widget=widget.DateInputWidget(),
                                    missing=colander.drop)