ok,err:=session.Table("pln_workorder").Where("finr = ? and custordernr = ? and status < ?",G_FINR,t.Custordernr,26).Get(&plc)
ok,err:=session.Table("pln_workorder").Where("finr = ? and custordernr = ? and status < ?",G_FINR,t.Custordernr,common.WO_STATUS_RELEASED).Get(&plc)
iferr!=nil{
returnerr
}
if!ok{
if_,err=session.Table("pln_custorder").Where("finr = ? and custordernr = ? and status = ?",G_FINR,t.Custordernr,20).Cols(fields).Update(t);err!=nil{
if_,err=session.Table("pln_custorder").Where("finr = ? and custordernr = ? and status = ?",G_FINR,t.Custordernr,common.WO_STATUS_PLANNED).Cols(fields).Update(t);err!=nil{