⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wareinmaster.asp

📁 印刷物の発注、在庫管理、出庫処理を一元管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:

		'SQL暥嶌惉
		'SELECT
		l_strsql = "SELECT "
		l_strsql = l_strsql & "MAIN.DELIVERY_YMD"		'擖屔梊掕擔
		l_strsql = l_strsql & ",MAIN.LIST_CD"			'挔昜斣崋
		l_strsql = l_strsql & ",MAIN.LIST_EDA"			'巬斣
		l_strsql = l_strsql & ",LB.LIST_NAME"			'挔昜柤
		l_strsql = l_strsql & ",MAIN.DELIVERY_NUM || LB.NAME DELIVERY_NUM"		'擖屔悢
		l_strsql = l_strsql & ",MAIN.DELIVERY_PLACE"	'擺昳応強
		l_strsql = l_strsql & ",MAIN.ORDER_MANAGE_NO"	'敪拲娗棟斣崋
		'FROM
		l_strsql = l_strsql & " FROM "
		
		'-------------------------------
		'擺昳忣曬僥乕僽儖丄敪拲僥乕僽儖
		'-------------------------------
		l_strsql = l_strsql & "(SELECT "
		l_strsql = l_strsql & " DI.DELIVERY_YMD"
		l_strsql = l_strsql & ",OD.ORDER_MANAGE_NO"
		l_strsql = l_strsql & ",OD.LIST_CD"
		l_strsql = l_strsql & ",OD.LIST_EDA"
		l_strsql = l_strsql & ",DI.DELIVERY_NUM"
		l_strsql = l_strsql & ",DI.DELIVERY_PLACE"
		l_strsql = l_strsql & " FROM "
		l_strsql = l_strsql & " DELIVERYINFO_T DI"
		l_strsql = l_strsql & ",ORDER_T OD"
		l_strsql = l_strsql & " WHERE DI.SYSTEM_ID =  '" & l_sysid & "'"
		l_strsql = l_strsql & "   AND DI.COMPANY_ID = '" & l_coid & "'"
		l_strsql = l_strsql & "   AND DI.DEL_FLG <> '1' "
		l_strsql = l_strsql & "   AND OD.SYSTEM_ID =  '" & l_sysid & "'"
		l_strsql = l_strsql & "   AND OD.COMPANY_ID = '" & l_coid & "'"
		l_strsql = l_strsql & "   AND OD.DEL_FLG <> '1' "
		l_strsql = l_strsql & "   AND DI.DELIVERY_INFO = OD.DELIVERY_INFO"

		'夋柺擖椡偟偨撪梕傪愝掕
		If IsObject(l_indata) Then

			'AND 擺昳応強
			If l_indata.Item("pdDeliveryPlace") <> "" Then
				l_strsql = l_strsql & " AND DI.DELIVERY_PLACE =" & "'" & l_indata.Item("pdDeliveryPlace") & "'"
			End If
			
			'AND 擖屔梊掕擔(FROM)乣擖屔梊掕擔(TO)
			Dim l_fromymd
			Dim l_toymd

			'偦偺懠乮巜掕乯偺応崌
			If l_indata.Item("rdoDeliveryYMD") = "1" Then
				l_fromymd = Trim(l_indata.Item("pdfromyear") & l_indata.Item("pdfrommonth") & l_indata.Item("pdfromday"))
				l_toymd = Trim(l_indata.Item("pdtoyear") & l_indata.Item("pdtomonth") & l_indata.Item("pdtoday"))
	
				If l_fromymd <> "" and l_toymd <> "" Then	'DELIVERY_YMD BETWEEN l_fromymd AND l_toymd
					l_strsql = l_strsql & " AND TO_CHAR(DI.DELIVERY_YMD, 'yyyymmdd') BETWEEN '" & l_fromymd & _
						 "' AND '" & l_toymd  & "'"
				ElseIf l_fromymd <> "" Then					'DELIVERY_YMD = fromymd
					l_strsql = l_strsql & " AND TO_CHAR(DI.DELIVERY_YMD, 'yyyymmdd') >= '" & l_fromymd & "'"
				ElseIf l_toymd <> "" Then					'DELIVERY_YMD = toymd
					l_strsql = l_strsql & " AND TO_CHAR(DI.DELIVERY_YMD, 'yyyymmdd') <= '" & l_toymd & "'"
				End If
			
			'摉擔偺応崌
			Else
				l_strsql = l_strsql & " AND TO_CHAR(DI.DELIVERY_YMD, 'yyyymmdd') = '" & replace(date(),"/","") & "'"
					
			End If

		End If

		l_strsql = l_strsql & ") MAIN "
		
		'-----------------
		'挔昜婎杮僥乕僽儖
		'-----------------
		l_strsql = l_strsql & ",(SELECT A.*, B.NAME"
		l_strsql = l_strsql & "	 FROM LISTBASE_T A, CODE_M B "
		l_strsql = l_strsql & " WHERE A.SYSTEM_ID =  '" & l_sysid & "'"
		l_strsql = l_strsql & "   AND A.COMPANY_ID = '" & l_coid & "'"
		l_strsql = l_strsql & "   AND A.DEL_FLG <> '1'"
		l_strsql = l_strsql & "   AND B.SYSTEM_ID(+) =  '" & l_sysid & "'"
		l_strsql = l_strsql & "   AND B.CLASSIFIED_CODE(+) =  '" & CD_LIST_UNIT & "'"
		l_strsql = l_strsql & "   AND B.DEL_FLG(+) <> '1'"
		l_strsql = l_strsql & "   AND A.LIST_UNIT = B.CODE(+)"
		l_strsql = l_strsql & ") LB "

		'WHERE
		l_strsql = l_strsql & "WHERE MAIN.LIST_CD = LB.LIST_CD(+)"
		l_strsql = l_strsql & "  AND MAIN.LIST_EDA = LB.LIST_EDA(+)"

		'ORDER BY
		If IsObject(l_indata) Then
			'ORDER BY
			l_strsql = l_strsql & " ORDER BY " & GetOrderByStr(l_indata.Item("sortkey"),l_indata.Item("sortdesc"))
		Else
			'ORDER BY (擖椡抣偑側偄応崌偼僨僼僅儖僩偺僜乕僩弴愝掕)
			l_strsql = l_strsql & " ORDER BY MAIN.DELIVERY_YMD DESC, MAIN.LIST_CD DESC, MAIN.LIST_EDA DESC"
		End If
'response.write l_strsql
		debug_t(l_strsql)

		'DB傛傝堦棗傪庢摼偟偰曉偡(1儁乕僕 = 30峴傪愝掕)
		Set SearchListBase = l_dbaccess.ProcRecordset(l_strsql,MAXROW_FORM_LIST,0)

	End Function

	'/*******************************************************
	'/* 僜乕僩暥庢摼
	'/* param丗l_sortkey(String) 僜乕僩僉乕
	'/* return String 僜乕僩暥
	'/*******************************************************
	Private Function GetOrderByStr(l_sortkey, l_sortdesc)
		Dim l_retStr	'String
		Dim l_seq		'String

		'僜乕僩弴愝掕
		If l_sortdesc = FLG_ON Then
			l_seq = " DESC"
		End If

		'僜乕僩暥嶌惉
		If l_sortkey = SORT_KEY1 Then				'僨僼僅儖僩(擖屔梊掕擔(崀弴)亄挔昜斣崋(崀弴))
			l_retStr = "MAIN.DELIVERY_YMD DESC, MAIN.LIST_CD DESC, MAIN.LIST_EDA DESC"
		ElseIf l_sortkey = SORT_KEY2 Then			'擖屔梊掕擔弴
			l_retStr = "MAIN.DELIVERY_YMD" & l_seq			
		ElseIf l_sortkey = SORT_KEY3 Then			'挔昜斣崋弴
			l_retStr = "MAIN.LIST_CD" & l_seq & ",MAIN.LIST_EDA" & l_seq			
		ElseIf l_sortkey = SORT_KEY4 Then			'挔昜柤弴
			l_retStr = "LB.LIST_NAME" & l_seq
		ElseIf l_sortkey = SORT_KEY5 Then			'擖屔悢弴
			l_retStr = "MAIN.DELIVERY_NUM" & l_seq
		ElseIf l_sortkey = SORT_KEY6 Then			'擺昳応強弴
			l_retStr = "MAIN.DELIVERY_PLACE" & l_seq
		End If

		GetOrderByStr = l_retStr
		
	End Function

	'/***********************************
	'/* 夛幮柤庢摼
	'/* param丗Param1	僔僗僥儉ID
	'/*        Param2	夛幮ID
	'/* return丗
	'/***********************************
	Public Function GetCompNameRec(Param1, Param2)
	
		Dim l_db
		Dim l_SQL
		Dim l_rec

		Set l_db = New DbAccess
		Call l_db.ProcConnection(DSN, USERID, PASSWD)
		
		l_SQL = "SELECT COMPANY_NAME" & _
				"  FROM COMPANY_M " & _
				" WHERE SYSTEM_ID = '" & Param1 & "' " & _
				"   AND COMPANY_ID = '" & Param2 & "' "

		Set l_rec = l_db.ProcRecordset(l_SQL,1,0)

		Do Until l_rec.EOF
			GetCompNameRec = l_rec.Fields.Item("COMPANY_NAME")
			l_rec.MoveNext
		Loop
		
		Call l_db.CloseRecodeset
		Call l_db.CloseConnection
		
	End Function

	'/*******************************************************
	'/* 擖屔巜帵忣曬傪侾儗僐乕僪拪弌偡傞
	'/* param丗l_dbaccess(DBAccess) DB傾僋僙僗
	'/*        l_sysid(String) 		僔僗僥儉ID
	'/*        l_coid(String) 		夛幮ID
	'/*		   l_listCd				挔昜斣崋
	'/*		   l_listEda			挔昜斣崋巬斣
	'/*        l_orderManageNo		敪拲娗棟斣崋
	'/* return ADODB.Recordset 専嶕寢壥
	'/*******************************************************
	Public Function SearchWareRec(l_dbaccess, l_sysid, l_coid, l_listCd, l_listEda, l_orderManageNo)
		Dim l_strsql	'String
		Dim l_recSet

		'SQL暥嶌惉
		'SELECT
		l_strsql = "select "
		l_strsql = l_strsql & "LB.List_Name "
		l_strsql = l_strsql & ",O.ORDER_STATUS "
		l_strsql = l_strsql & ",DI.Delivery_Info "
		l_strsql = l_strsql & ",DI.Seq_no "
		l_strsql = l_strsql & ",DI.Delivery_Place "
		l_strsql = l_strsql & ",to_char(DI.Delivery_YMD,'yyyy') Delivery_Y "
		l_strsql = l_strsql & ",to_char(DI.Delivery_YMD,'mm') Delivery_M "
		l_strsql = l_strsql & ",to_char(DI.Delivery_YMD,'dd') Delivery_D "
		l_strsql = l_strsql & ",to_char(DI.Delivery_YMD,'hh24') Delivery_H "
		l_strsql = l_strsql & ",DI.Delivery_Num "
		
		'FROM
		l_strsql = l_strsql & "from DeliveryInfo_T DI, Order_T O, ListBase_T LB "

		'WHERE
		l_strsql = l_strsql & "where O.Delivery_Info = DI.Delivery_Info "
		l_strsql = l_strsql & "and O.List_Cd = LB.List_Cd(+) "
		l_strsql = l_strsql & "and O.List_Eda = LB.List_Eda(+) "
		l_strsql = l_strsql & "and O.System_Id = '" & l_sysid & "' "
		l_strsql = l_strsql & "and O.Company_Id = '" & l_coid & "' "
		l_strsql = l_strsql & "and O.order_manage_no = " & l_orderManageNo 
		l_strsql = l_strsql & "and O.List_Cd = '" & l_listCd & "' "
		l_strsql = l_strsql & "and O.List_Eda = '" & l_listEda & "' "
		l_strsql = l_strsql & "and O.DEL_FLG <> '1'"
		l_strsql = l_strsql & "and DI.DEL_FLG <> '1'"

		'ORDER BY
		l_strsql = l_strsql & "order by DI.Seq_no"		
debug_t(l_strsql)
		'DB傛傝儗僐乕僪傪庢摼偟偰曉偡
		Set SearchWareRec = l_dbaccess.ProcRecordset(l_strsql,1,0)

	End Function

	'/*******************************************************
	'/* 挔昜柤傪拪弌偡傞
	'/* param丗l_dbaccess(DBAccess) DB傾僋僙僗
	'/*        l_sysid(String) 		僔僗僥儉ID
	'/*        l_coid(String) 		夛幮ID
	'/*		   l_listCd				挔昜斣崋
	'/*		   l_listEda			挔昜斣崋巬斣
	'/* return ADODB.Recordset 専嶕寢壥
	'/*******************************************************
	Public Function SearchListName(l_dbaccess, l_sysid, l_coid, l_listCd, l_listEda)
		Dim l_strsql	'String
		Dim l_recSet

		'SQL暥嶌惉
		'SELECT
		l_strsql = "select "
		l_strsql = l_strsql & "List_Name "
		
		'FROM
		l_strsql = l_strsql & "from ListBase_T "

		'WHERE
		l_strsql = l_strsql & "where SYSTEM_ID = '" & l_sysid & "' "
		l_strsql = l_strsql & "and COMPANY_ID = '" & l_coid & "' "
		l_strsql = l_strsql & "and List_Cd = '" & l_listCd & "' "
		l_strsql = l_strsql & "and List_Eda = '" & l_listEda & "' "

		'DB傛傝儗僐乕僪傪庢摼偟偰曉偡
		Set SearchListName = l_dbaccess.ProcRecordset(l_strsql,1,0)

	End Function

	'/*******************************************************
	'/* 敪拲斣崋傪拪弌偡傞
	'/* param丗l_dbaccess(DBAccess) DB傾僋僙僗
	'/*        
	'/* return ADODB.Recordset 専嶕寢壥
	'/*******************************************************
	Public Function SearchOrderId(l_dbaccess)

		Dim l_strsql	'String
		Dim l_recSet

		'SQL暥惗惉
		l_strsql = "select "
		l_strsql = l_strsql & "lpad(nvl(max(substr(ORDER_ID, 3, 6)), 0) + 1, 6, '0') ORDER_ID "
		l_strsql = l_strsql & "from ORDER_T "
		
		'DB傛傝儗僐乕僪傪庢摼偟偰曉偡
		Set l_recSet = l_dbaccess.ProcRecordset(l_strsql,1,0)

		Do Until l_recSet.EOF
			SearchOrderId = Mid(Date(), 3, 2) & l_recSet.Fields.Item("ORDER_ID")
			l_recSet.MoveNext
		Loop

	End Function

	'/*******************************************************
	'/* 挔昜桳岠僠僃僢僋
	'/* 壓彂偒丄攑巭丄嶍彍偱側偄傕偺
	'/* param丗l_dbaccess(DBAccess) DB傾僋僙僗
	'/*        l_sysid(String) 		僔僗僥儉ID
	'/*		   l_listCd				挔昜斣崋
	'/*		   l_listEda			挔昜斣崋巬斣
	'/* return true:懚嵼丂false:懚嵼偣偢
	'/*******************************************************
	Public Function ExistList(l_dbaccess, l_sysid, l_listCd, l_listEda)
		Dim l_SQL
		Dim l_recSet

		l_SQL = "SELECT COUNT(*) AS COUNT FROM LISTBASE_T " &_
				" WHERE SYSTEM_ID = '" & l_sysid & "' " &_
				"   AND LIST_CD = '" & l_listCd & "' " &_
				"   AND LIST_EDA = '" & l_listEda & "' " &_
				"   AND LIST_STATUS = '" & LSTS_APPROVE & "' " &_
				"   AND DEL_FLG = '" & FLG_OFF & "' "

		'DB傛傝儗僐乕僪傪庢摼偟偰曉偡
		Set l_recSet = l_dbaccess.ProcRecordset(l_SQL,1,0)

		If l_recSet.Fields.Item("COUNT") = 0 Then
			ExistList = false
		Else
			ExistList = true
		End If
	End Function

	'/*******************************************************
	'/* 擖屔巜帵嶍彍
	'/* param丗l_dbaccess(DBAccess) DB傾僋僙僗
	'/*        l_sysid(String) 		僔僗僥儉ID
	'/*        l_manageNo			敪拲娗棟斣崋
	'/*		   l_listCd				挔昜斣崋
	'/*		   l_listEda			挔昜斣崋巬斣
	'/* return true:懚嵼丂false:懚嵼偣偢
	'/*******************************************************
	Public Function DeleWarehousingRec(l_dbaccess, l_sysid, l_manageNo, l_listCd, l_listEda)
		Dim l_SQL

		l_SQL = "UPDATE ORDER_T " &_
				"   SET UPDATE_YMD = SYSDATE," &_
				"       DEL_FLG = '" & FLG_ON & "' " &_
				" WHERE SYSTEM_ID = '" & l_sysid & "' " &_
				"   AND ORDER_MANAGE_NO = " & l_manageNo
'response.write l_SQL
		If Not l_dbaccess.ProcExecute(l_SQL) Then
			Call l_dbaccess.ProcRollBack
			DeleWarehousingRec = false
		Else
			DeleWarehousingRec = true
		End If
	End Function
End Class
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -