From 34e70d896cc61ea11347662e21ba0f6b65294d23 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期一, 22 七月 2024 09:59:56 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/mis-prj

---
 jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp |    4 
 jrj/project/business/VATNotify/simple.maint.vatnotify.cpp    |    4 
 jrj/ext-jrj/ext-jrj.vcxproj                                  |    1 
 jrj/project/business/VATNotify/update.vatnotify.cpp          |   13 +-
 jrj/project/business/VATNotify/import.vatnotify.cpp          |  201 ++++++++++++++++++++++++++++++++++++++++++++++++++
 jrj/ext-jrj/ext-jrj.vcxproj.filters                          |    3 
 6 files changed, 216 insertions(+), 10 deletions(-)

diff --git a/jrj/ext-jrj/ext-jrj.vcxproj b/jrj/ext-jrj/ext-jrj.vcxproj
index 7113a31..c5efd8a 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj
+++ b/jrj/ext-jrj/ext-jrj.vcxproj
@@ -943,6 +943,7 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\VATNotify\del.vatinvoice.cpp" />
+    <ClCompile Include="..\project\business\VATNotify\import.vatnotify.cpp" />
     <ClCompile Include="..\project\business\VATNotify\list.vatinvoice.cpp" />
     <ClCompile Include="..\project\business\VATNotify\list.vatnotify.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj.filters b/jrj/ext-jrj/ext-jrj.vcxproj.filters
index be47a63..784eab9 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj.filters
+++ b/jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -1160,5 +1160,8 @@
     <ClCompile Include="..\project\business\AP\list.RefundSourcingLine.Entity.xarch.cpp">
       <Filter>project\business\AP</Filter>
     </ClCompile>
+    <ClCompile Include="..\project\business\VATNotify\import.vatnotify.cpp">
+      <Filter>project\business\VATNotify</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/jrj/project/business/VATNotify/import.vatnotify.cpp b/jrj/project/business/VATNotify/import.vatnotify.cpp
new file mode 100644
index 0000000..963a6d1
--- /dev/null
+++ b/jrj/project/business/VATNotify/import.vatnotify.cpp
@@ -0,0 +1,201 @@
+#include <wobject/xstring.hpp>
+#include <xcontrol/xtreeview.hpp>
+#include <xcontrol/xdwgrid.hpp>
+
+#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
+#include "viewobject/view.base.hpp"
+
+using xml = KXMLDOMDocument;
+	class __declspec(dllexport) importvatnotifyWin :  public xframe
+	{
+	public:
+		xdwgrid	dw_list;
+		xdwgrid	dw_base;
+
+		xnode	m_agentNode;	//Agent Condition
+
+	public:
+		importvatnotifyWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
+	public:
+		static importvatnotifyWin* CreateInstance(void* implPtr, void* hWnd)
+		{
+			importvatnotifyWin* pWin = new importvatnotifyWin(implPtr, (HWND)hWnd);
+			return pWin;
+		}
+		int SetAgent()
+		{
+			xstring xfNodeAgentArea  = L"agentarea";
+			xnode anode = GetAgentNode(xfNodeAgentArea);
+			if(m_agentNode)
+			{
+				SetAgentNode (anode,m_agentNode);
+			}
+			else
+			{
+				KXMLDOMElement xframeElement =  GetElement();
+				KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
+				if(agent)
+				{
+					xstring s = agent.xml();
+					m_agentNode =  SetAgentNode (anode,s);
+				}
+			}
+			return 1;
+		}
+
+		//焦点激活处理函数
+		int OnSetFocus(TEvent* evt, LPARAM param)
+		{
+			//重置工具条
+			//SetAgent();
+			return 1;
+		}
+				
+		int OnImport()
+		{
+			xml x ;
+			
+			xaserverarg arg;
+			
+			int row = dw_list.GetRow();
+			if(row < 1)  return 1;
+			KXMLDOMElement ele = dw_list.GetRowElement(row);
+			xstring invno = ele.selectSingleNode(L"InvoiceNo").text(); 
+			arg.AddArg(L"InvoiceNo",invno);
+			
+			if (getUrl(L"/sale/data/VATNotify/import/invoice",arg.GetString(),x)!=1)
+			{
+				alert(x.text());
+				return 1;
+			}else	
+			{
+				alert(x.text());
+				OnRetrieve();
+			}
+			return 1;
+		}
+		int OnImport2()
+		{
+			xml x;
+			
+			xaserverarg arg;	
+			for(int row=1; row<= dw_list.GetRowCount();row++){
+				KXMLDOMElement ele = dw_list.GetRowElement(row);
+				xstring invno = ele.selectSingleNode(L"InvoiceNo").text(); 
+				arg.AddArg(L"InvoiceNo",invno);
+				if (getUrl(L"/sale/data/VATNotify/import/invoice",arg.GetString(),x)!=1)
+				{
+					//alert(x.text());
+					return 1;
+				}else	
+				{
+					//alert(x.text());
+					//OnRetrieve();
+				}
+			}
+			return 1;
+		}
+			
+
+				
+		//命令发布函数
+		int OnCmdDispatch(xstring comdid)
+		{
+			if(comdid==L"xmRetrieve")
+			{
+				OnRetrieve();
+			}
+			else if(comdid==L"xmOk")
+			{
+				return OnImport();
+			}else if (comdid==L"xmClose"){
+				CloseWindow();
+			}
+			return 0;
+		}
+		
+		//命令处理事件
+		int OnXCommand(TEvent* evt, LPARAM param)
+		{
+			return OnCmdDispatch(evt->xcommand.pStrID);
+		}
+		
+		int OnAttachEvent()
+		{
+			//绑定工具条点击事件
+			AttachEvent(L"WM_XCOMMAND", (FEvent)&importvatnotifyWin::OnXCommand);
+			//获取焦点事件,用于重置工具条
+			AttachEvent(L"WM_SETFOCUS", (FEvent)&importvatnotifyWin::OnSetFocus);
+			AttachEvent(L"dw_list",L"DWV_CLICKED", (FEvent)&importvatnotifyWin::OnClicked);
+			return 1;
+		}
+		
+		int OnClicked(TEvent* evt, LPARAM p)
+		{
+			DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+			int row = hdr.row;
+			if(row < 1) return 1;
+			
+			KXMLDOMElement ele = dw_list.GetRowElement(row);
+			xstring invno = ele.selectSingleNode(L"InvoiceNo").text(); 
+			
+			xml x ;
+			xaserverarg arg;	
+			arg.AddArg(L"invoiceno",invno);
+			//alert(invno);
+			if (getUrl(L"/sale/data/VATNotify/pref/importbase",arg.GetString(),x)!=1)
+			{
+				trace(x.text());
+				return -1;
+			}else	
+			{
+				dw_base.Retrieve(x);
+				dw_base.Redraw();
+				dw_base.SetReadOnly(true);
+				dw_base.SetSelectionMode(1);
+			}
+
+			return 1;
+		}
+
+		int  OnRetrieve()
+		{
+			xml x ;
+			xaserverarg arg ;	
+			
+			xstring QueryTxt = xcontrol(GetControl(L"sle_search")).GetText();
+			arg.AddArg(L"QueryTxt",QueryTxt);
+			if (getUrl(L"/sale/data/VATNotify/pref/importlist",arg.GetString(),x)!=1)
+			{
+				trace(x.text());
+				return -1;
+			}else	
+			{
+				dw_list.Retrieve(x);
+				dw_list.Redraw();
+				dw_list.SetReadOnly(true);
+				//dw_list.SetSelectionMode(3);
+			}
+			return 1;
+		}
+		
+		int onload()
+		{
+			dw_list = GetControl(L"dw_list");
+			dw_list.openUrl(L"/sale/view/VATNotify/template/VATNotify/importlist");
+			dw_base = GetControl(L"dw_base");
+			dw_base.openUrl(L"/sale/view/VATNotify/template/VATNotify/importbase");
+		
+			OnAttachEvent();	
+			OnRetrieve();
+			
+			return 1;
+		}
+		
+		int onloaded()
+		{
+			//SetAgent();			
+			
+			return 1;
+		}		
+	};
\ No newline at end of file
diff --git a/jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp b/jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp
index 632263a..ca10bec 100644
--- a/jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp
+++ b/jrj/project/business/VATNotify/maint.papercard.vatnotify.cpp
@@ -689,7 +689,7 @@
 
 			if (GetWinParam())
 			{
-				int pArg = GetArg();
+				arg = GetArg();
 			
 			}
 			else
@@ -763,7 +763,7 @@
 
 			if (GetWinParam())
 			{
-				int pArg = GetArg();
+				arg = GetArg();
 				
 				InvNo = arg.GetArgString(L"invoiceno");
 				SetWindowText(GetHWND(), InvNo);
diff --git a/jrj/project/business/VATNotify/simple.maint.vatnotify.cpp b/jrj/project/business/VATNotify/simple.maint.vatnotify.cpp
index a9e96be..cac6ab8 100644
--- a/jrj/project/business/VATNotify/simple.maint.vatnotify.cpp
+++ b/jrj/project/business/VATNotify/simple.maint.vatnotify.cpp
@@ -778,7 +778,7 @@
 
 			if (GetWinParam())
 			{
-				int pArg = GetArg();
+				arg = GetArg();
 				
 			}
 			else
@@ -860,7 +860,7 @@
 
 			if (GetWinParam())
 			{
-				int pArg = GetArg();
+				arg = GetArg();
 				
 				InvNo = arg.GetArgString(L"invoiceno");
 				SetWindowText(GetHWND(), InvNo);
diff --git a/jrj/project/business/VATNotify/update.vatnotify.cpp b/jrj/project/business/VATNotify/update.vatnotify.cpp
index 7aa19e5..709e11f 100644
--- a/jrj/project/business/VATNotify/update.vatnotify.cpp
+++ b/jrj/project/business/VATNotify/update.vatnotify.cpp
@@ -13,6 +13,7 @@
 		xdwgrid	dw_item;
 		xdwgrid	dw_goods;
 		xnode	m_agentNode;	//Agent Condition
+		xstring		InvNo;
 
 	public:
 		UpdateVatNotifyWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
@@ -257,11 +258,11 @@
 			
 			if (GetWinParam())
 			{
-				int pArg = GetArg();
-				
+				arg = GetArg();
+				InvNo = arg.GetArgString(L"invoiceno");
 			}
 			else
-				arg.AddArg(L"invoiceno", L"15HDLD0720");
+				arg.AddArg(L"invoiceno", InvNo);
 
 			arg.AddArg(L"ClassifyID", classifyID);
 			arg.AddArg(L"SupplierID", supplierID);
@@ -300,11 +301,11 @@
 			
 			if (GetWinParam())
 			{
-				int pArg = GetArg();
-				
+				arg  = GetArg();
+				InvNo = arg.GetArgString(L"invoiceno");
 			}
 			else
-				arg.AddArg(L"invoiceno", L"15HDLD0720");
+				arg.AddArg(L"invoiceno", InvNo);
 			if (getUrl(L"/sale/data/VATNotify/entity/base/miss", arg.GetString(), x) != 1)
 			{
 				trace(x.text());

--
Gitblit v1.9.3