打印时间: {{ .print_time }}
{{ if .__title }} {{else}} {{end}}
{{.__title|trim}}
订货单{{ if .state_text }}
{{ .state_text }}
{{end}}
订货单{{ if .state_text }}
{{ .state_text }}
{{end}}

单据编号: {{ .code }} 单据日期: {{ .bill_date }} 手工单号: {{ .manual_code | empty }}
客户名称: {{ .customer_name | empty }} 客户编号: {{ .customer_code | empty }} 订货类型: {{ .order_type | empty }}
电话: {{ .customer_mobile | empty }} 订货方式: {{ .order_mode | empty }}
地址: {{ .customer_province | empty }}{{ .customer_city | empty }}{{ .customer_district | empty }}{{ .customer_address | empty }}
备注: {{ .remark | empty }}

{{range $si,$sv := (index $.sizes 0)}} {{end}} {{range $i,$v := .sizes}} {{ $title_goods := ``}} {{ $title_color := ``}} {{ $title_price := ``}} {{ $title_quantity := ``}} {{ $title_amount := ``}} {{if eq $i $.sizes_last_index}} {{ $title_goods = `货号`}} {{ $title_color = `颜色`}} {{ $title_price = `单价`}} {{ $title_quantity = `数量`}} {{ $title_amount = `金额`}} {{end}} {{range $si,$sv := $v}} {{end}} {{if eq $i $.sizes_last_index}} {{end}} {{end}} {{range $d := .detail}} {{range $si,$sv := (index $.sizes 0)}} {{end}} {{end}} {{range $si,$sv := (index $.sizes 0)}} {{end}}
{{ $title_goods }} {{ $title_color }}{{ $sv }}{{ $title_price }} {{ $title_quantity }} {{ $title_amount }}
{{ $d.code }} {{ $d.color_name }}{{ (mapValStr $d (printf `s%d` (addInt $si 1) )) | emptyZero }}{{ $d.price }} {{ $d.quantity }} {{ $d.amount }}
合计 {{ .bill_quantity }} {{ .bill_amount }}

{{range $i,$v := .__tails}}
{{ $v }}
{{end}}
制单:
出纳:
理单:
仓库:
审核: