fmd-vat-rate-select.go 738 B

1234567891011121314151617181920212223242526272829
  1. package models_func
  2. import (
  3. "errors"
  4. e "github.com/dabory/abango-rest/etc"
  5. "github.com/go-xorm/xorm"
  6. )
  7. type VatRateSelect struct {
  8. Id int `xorm:"not null pk autoincr INT(10)"`
  9. VatName string `xorm:"VARCHAR(21)"`
  10. IsIncluded string `xorm:"not null default '0' CHAR(4)"`
  11. VatRate string `xorm:"not null DECIMAL(4,2)"`
  12. }
  13. type VatRateSelectPage struct {
  14. Page []VatRateSelect
  15. }
  16. func GetVatRateSelect(YDB *xorm.Engine, sel *VatRateSelectPage, filter string) error {
  17. qry := *YDB.Table("dbr_vat_rate").Asc("sort_no").Where(filter)
  18. if err := qry.Find(&sel.Page); err == nil {
  19. e.FuncRun("234adsrared", e.CurrFuncName())
  20. return nil
  21. } else {
  22. return errors.New("ltrysgaera" + e.CurrFuncName() + err.Error())
  23. }
  24. }