• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang util.NamedDbf类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/peteraba/invoice-export/util.NamedDbf的典型用法代码示例。如果您正苦于以下问题:Golang NamedDbf类的具体用法?Golang NamedDbf怎么用?Golang NamedDbf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了NamedDbf类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: createInvoice

func createInvoice(venaplo util.NamedDbf) (schema.Szamla, error) {
	invoice := schema.Szamla{}

	header, err := createHeader(venaplo)
	if err != nil {
		return invoice, err
	}
	invoice.Fejlec = header

	additional, err := createAdditional(venaplo)
	if err != nil {
		return invoice, err
	}
	invoice.Nem_kotelezo = additional

	clause, err := createAdditionalClause(venaplo)
	if err != nil {
		return invoice, err
	}
	invoice.Zaradekok = &clause

	accountNumField, err := venaplo.FieldByName(FOLYOSZLSZ)
	if err != nil {
		return invoice, err
	}
	invoice.Folyoszamlaszam = int(accountNumField.(int64))

	return invoice, err
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:29,代码来源:venaplo.go


示例2: createAdditionalClause

func createAdditionalClause(venaplo util.NamedDbf) (schema.Zaradekok, error) {
	clause := schema.Zaradekok{}

	zaradek, err := venaplo.FieldByName(ZARADEK)
	if err != nil {
		return clause, err
	}

	zaradekInt := zaradek.(int)

	clause.Penzforgelsz = (zaradekInt == 3)
	clause.Onszamla = (zaradekInt == 2)
	clause.Ford_ado = (zaradekInt == 5)
	switch zaradekInt {
	case 5:
		clause.Kulonb_szer_szab = 1
		break
	case 6:
		clause.Kulonb_szer_szab = 2
		break
	case 7:
		clause.Kulonb_szer_szab = 3
		break
	case 8:
		clause.Kulonb_szer_szab = 4
		break
	}

	return clause, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:30,代码来源:venaplo.go


示例3: createHeader

func createHeader(venaplo util.NamedDbf) (schema.Fejlec, error) {
	header := schema.Fejlec{}

	invoiceNum, err := venaplo.FieldByName(SZAMLASZAM)
	if err != nil {
		return header, err
	}
	header.Szlasorszam = strings.Trim(invoiceNum.(string), util.Whitespace)

	dateline, err := venaplo.FieldByName(SZAMLAKELT)
	if err != nil {
		return header, err
	}
	dl := dateline.(time.Time)
	header.Szladatum = schema.Datum{&dl}

	date, err := venaplo.FieldByName(DATUM)
	if err != nil {
		return header, err
	}
	d := date.(time.Time)
	header.Teljdatum = schema.Datum{&d}

	st, err := venaplo.FieldByName(FIZMODJA)
	if err != nil {
		return header, err
	}
	header.Szlatipus = 1
	if st.(int64) == 6 {
		header.Szlatipus = 4
	}

	return header, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:34,代码来源:venaplo.go


示例4: GetVendor

func GetVendor(cegadat util.NamedDbf) (schema.Szamlakibocsato, error) {
	vendor := schema.Szamlakibocsato{}

	taxNumber, err := cegadat.FieldByName(EUADOSZAM)
	if err != nil {
		return vendor, err
	}
	vendor.Adoszam = strings.Trim(taxNumber.(string), util.Whitespace)

	additional_clause, err := cegadat.FieldByName(ZARADEK)
	if err != nil {
		return vendor, err
	}
	vendor.Kisadozo = (additional_clause.(int64) == 4)

	name, err := cegadat.FieldByName(NEV)
	if err != nil {
		return vendor, err
	}
	vendor.Nev = strings.Trim(name.(string), util.Whitespace)

	address, err := getVendorAddress(cegadat)
	if err != nil {
		return vendor, err
	}
	vendor.Cim = address

	vendor.Egyeni_vallalkozo = false

	return vendor, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:31,代码来源:cegadat.go


示例5: createCustomer

func createCustomer(an311 util.NamedDbf) (schema.Vevo, int, error) {
	customer := schema.Vevo{}

	accountNumField, err := an311.FieldByName(FOLYOSZLSZ)
	if err != nil {
		return customer, 0, err
	}
	accountNum := int(accountNumField.(int64))

	nameField, err := an311.FieldByName(NEV)
	if err != nil {
		return customer, accountNum, err
	}
	customer.Nev = strings.Trim(nameField.(string), util.Whitespace)

	name2Field, err := an311.FieldByName(NEV2)
	if err != nil {
		return customer, accountNum, err
	}
	if name2Field.(string) != "" {
		customer.Nev += " " + strings.Trim(name2Field.(string), util.Whitespace)
	}

	customer.Cim, err = getCustomerAddress(an311)
	if err != nil {
		return customer, accountNum, err
	}

	return customer, accountNum, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:30,代码来源:an311.go


示例6: createAdditional

func createAdditional(venaplo util.NamedDbf) (schema.Nem_kotelezo, error) {
	additional := schema.Nem_kotelezo{}

	paymentMethod, err := venaplo.FieldByName(FIZMODJA)
	if err != nil {
		return additional, err
	}

	switch paymentMethod.(int64) {
	case 1:
		additional.Fiz_mod = "Átutalás"
		break
	case 2:
		additional.Fiz_mod = "Készpénz"
		break
	case 3:
		additional.Fiz_mod = "Utalvány"
		break
	case 4:
		additional.Fiz_mod = "Csekk"
		break
	case 5:
		additional.Fiz_mod = "Inkasszó"
		break
	case 6:
		additional.Fiz_mod = "Storno"
		break
	case 7:
		additional.Fiz_mod = "Bankkártya"
		break
	}

	prompt, err := venaplo.FieldByName(FIZHATIDO)
	if err != nil {
		return additional, err
	}
	p := prompt.(time.Time)
	additional.Fiz_hatarido = schema.Datum{&p}

	currency, err := venaplo.FieldByName(DEVNEM)
	if err != nil {
		return additional, err
	}
	additional.Penznem = currency.(string)

	return additional, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:47,代码来源:venaplo.go


示例7: getVendorAddress

func getVendorAddress(cegadat util.NamedDbf) (schema.Cim, error) {
	address := schema.Cim{}

	postcode, err := cegadat.FieldByName(IRSZAM)
	if err != nil {
		return address, err
	}
	address.Iranyitoszam = strings.Trim(postcode.(string), util.Whitespace)

	town, err := cegadat.FieldByName(TELEPULES)
	if err != nil {
		return address, err
	}
	address.Telepules = strings.Trim(town.(string), util.Whitespace)

	thoroughfareName, err := cegadat.FieldByName(KOZTERULET)
	if err != nil {
		return address, err
	}
	address.Kozterulet_neve = strings.Trim(thoroughfareName.(string), util.Whitespace)

	thoroughfareType, err := cegadat.FieldByName(JELLEG)
	if err != nil {
		return address, err
	}
	address.Kozterulet_jellege = strings.Trim(thoroughfareType.(string), util.Whitespace)

	houseNumber, err := cegadat.FieldByName(HAZSZAM)
	if err != nil {
		return address, err
	}
	address.Hazszam = strings.Trim(houseNumber.(string), util.Whitespace)

	building, err := cegadat.FieldByName(EPULET)
	if err != nil {
		return address, err
	}
	address.Epulet = strings.Trim(building.(string), util.Whitespace)

	staircase, err := cegadat.FieldByName(LEPCSO)
	if err != nil {
		return address, err
	}
	address.Lepcsohaz = strings.Trim(staircase.(string), util.Whitespace)

	floor, err := cegadat.FieldByName(EMELET)
	if err != nil {
		return address, err
	}
	address.Szint = strings.Trim(floor.(string), util.Whitespace)

	doorNumber, err := cegadat.FieldByName(AJTO)
	if err != nil {
		return address, err
	}
	address.Ajto = strings.Trim(doorNumber.(string), util.Whitespace)

	return address, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:59,代码来源:cegadat.go


示例8: getCustomerAddress

func getCustomerAddress(an311 util.NamedDbf) (schema.Cim, error) {
	address := schema.Cim{}

	postcode, err := an311.FieldByName(IRSZAM)
	if err != nil {
		return address, err
	}
	address.Iranyitoszam = strings.Trim(postcode.(string), util.Whitespace)

	town, err := an311.FieldByName(TELEPULES)
	if err != nil {
		return address, err
	}
	address.Telepules = strings.Trim(town.(string), util.Whitespace)

	thoroughfareName, err := an311.FieldByName(KOZTERULET)
	if err != nil {
		return address, err
	}
	if s, ok := thoroughfareName.(string); ok {
		address.Kozterulet_neve = strings.Trim(s, util.Whitespace)
	}

	thoroughfareType, err := an311.FieldByName(JELLEG)
	if err != nil {
		return address, err
	}
	if s, ok := thoroughfareType.(string); ok {
		address.Kozterulet_jellege = strings.Trim(s, util.Whitespace)
	}

	houseNumber, err := an311.FieldByName(HAZSZAM)
	if err != nil {
		return address, err
	}
	if s, ok := houseNumber.(string); ok {
		address.Hazszam = strings.Trim(s, util.Whitespace)
	}

	building, err := an311.FieldByName(EPULET)
	if err != nil {
		return address, err
	}
	if s, ok := building.(string); ok {
		address.Epulet = strings.Trim(s, util.Whitespace)
	}

	staircase, err := an311.FieldByName(LEPCSO)
	if err != nil {
		return address, err
	}
	if s, ok := staircase.(string); ok {
		address.Lepcsohaz = strings.Trim(s, util.Whitespace)
	}

	floor, err := an311.FieldByName(EMELET)
	if err != nil {
		return address, err
	}
	if s, ok := floor.(string); ok {
		address.Szint = strings.Trim(s, util.Whitespace)
	}

	doorNumber, err := an311.FieldByName(AJTO)
	if err != nil {
		return address, err
	}
	if s, ok := doorNumber.(string); ok {
		address.Ajto = strings.Trim(s, util.Whitespace)
	}

	return address, nil
}
开发者ID:peteraba,项目名称:invoice-export,代码行数:73,代码来源:an311.go



注:本文中的github.com/peteraba/invoice-export/util.NamedDbf类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang diskv.New函数代码示例发布时间:2022-05-28
下一篇:
Golang template.Messages类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap