From a4d2315ee4ca3f6177b4fb2526bed2feff3d89be Mon Sep 17 00:00:00 2001
From: lifan <2308045698@qq.com>
Date: 星期三, 22 十月 2025 16:52:58 +0800
Subject: [PATCH] update
---
jrj/project/business/GDN3.maint.cpp | 1386 +++++++++++++++++++++++++++++----------------------------
1 files changed, 712 insertions(+), 674 deletions(-)
diff --git a/jrj/project/business/GDN3.maint.cpp b/jrj/project/business/GDN3.maint.cpp
index c8af0b1..ec33e89 100644
--- a/jrj/project/business/GDN3.maint.cpp
+++ b/jrj/project/business/GDN3.maint.cpp
@@ -8,6 +8,8 @@
#include "viewobject/view.base.hpp"
#include "viewobject/saleorder.view.hpp"
#include "viewobject/quote.view.hpp"
+#include "viewobject/gdn3.view.hpp"
+#include "viewobject/custom.view.hpp"
class __declspec(dllexport) GDN3MaintWin : public maint
{
@@ -53,18 +55,18 @@
xml x;
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg ;
+
arg.AddArg(L"scene", scene, L"xs:xstring");
arg.AddArg(L"EntityID", EntityID, L"xs:xstring");
arg.AddArg(L"EntityName", EntityName, L"xs:xstring");
- url::get(L"/workflow/query/datarole/" + EntityName, arg.GetString(), x);
+ xurl::get(L"/workflow/query/datarole/" + EntityName, arg.GetString(), x);
xstring sNodes;
sNodes = L"datarole/actions/action[contains(@scene,'" + scene + L"')]";
- KXMLDOMNodeList nlist = x.GetXmlDoc().SelectNodes(sNodes);
+ KXMLDOMNodeList nlist = x.selectNodes(sNodes);
int index;
- int nlen = nlist.length;
+ int nlen = nlist.length();
KXMLDOMElement ele;
xstring tools = L"<vbox class=''>";
@@ -74,17 +76,17 @@
for (index = 0; index < nlen; index++)
{
ele = nlist.item(index);
- xstring name = ele.selectSingleNode(L"@id").text;//.getAttribute(L"id");
- xstring label = ele.selectSingleNode(L"@caption").text;//ele.getAttribute(L"caption");
+ xstring name = ele.selectSingleNode(L"@id").text();//.getAttribute(L"id");
+ xstring label = ele.selectSingleNode(L"@caption").text();//ele.getAttribute(L"caption");
xstring image;
xstring src = L"";
if (ele.selectSingleNode(L"@image"))
- image = ele.selectSingleNode(L"@image").text;
+ image = ele.selectSingleNode(L"@image").text();
else
image = L"0 22";
if (ele.selectSingleNode(L"@src"))
- src = ele.selectSingleNode(L"@src").text;
+ src = ele.selectSingleNode(L"@src").text();
xstring tool;
if (name.find(L"bill.update") >= 0) haveUpdate = true;
@@ -96,17 +98,17 @@
}
if (agent)
{
- nlist = agent.SelectNodes(L".//xtoolbutton");
- nlen = nlist.length;
+ nlist = agent.selectNodes(L".//xtoolbutton");
+ nlen = nlist.length();
for (index = 0; index < nlen; index++)
{
ele = nlist.item(index);
- xstring tmp = ele.xml;
+ xstring tmp = ele.xml();
tools += tmp;
}
}
tools += L"</vbox>";
- SetAgentNodeContent(anode, tools);
+ SetAgentNode(anode, tools);
return 1;
}
@@ -178,52 +180,52 @@
return 1;
}
- xstring GetEntityData(int pr)
+ xstring GetEntityData(LPARAM pr)
{
dw_base.AcceptText();
dw_source.AcceptText();
dw_item.AcceptText();
dw_custom.AcceptText();
- xml xbase = new xml;
- xbase.setNativePointer(xml::CreateInstance());
- dw_base.DwUpdateAllTo(xbase.GetXmlDoc());
+ xml xbase;
+
+ dw_base.DwUpdateAllTo(xbase);
- KXMLDOMElement ebase = xbase.GetXmlDoc().documentElement;
+ KXMLDOMElement ebase = xbase.documentElement();
- xml xitem = new xml;
- xitem.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xitemdoc = xitem.GetXmlDoc();
+ xml xitem ;
+
+ KXMLDOMDocument xitemdoc = xitem;
dw_item.DwUpdateAllToEx(xitemdoc);
- if (xitem.GetXml() != L"")
+ if ((xstring)xitem.xml() != L"")
{
- KXMLDOMElement eitem = xitemdoc.documentElement;
+ KXMLDOMElement eitem = xitemdoc.documentElement();
if (eitem) ebase.appendChild(eitem);
}
- xml xsource = new xml;
- xsource.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xsourcedoc = xsource.GetXmlDoc();
+ xml xsource;
+
+ KXMLDOMDocument xsourcedoc = xsource;
dw_source.DwUpdateAllToEx(xsourcedoc);
- if (xsource.GetXml() != L"")
+ if ((xstring)xsource.xml() != L"")
{
- KXMLDOMElement eitem1 = xitemdoc.documentElement;
+ KXMLDOMElement eitem1 = xitemdoc.documentElement();
if (eitem1) ebase.appendChild(eitem1);
}
- xml xcustom = new xml;
- xcustom.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xcustomdoc = xcustom.GetXmlDoc();
+ xml xcustom;
+
+ KXMLDOMDocument xcustomdoc = xcustom;
dw_source.DwUpdateAllToEx(xcustomdoc);
- if (xcustom.GetXml() != L"")
+ if ((xstring)xcustom.xml() != L"")
{
- KXMLDOMElement eitem2 = xitemdoc.documentElement;
- if (eitem2) ebase.appendChild(eitem1);
+ KXMLDOMElement eitem2 = xitemdoc.documentElement();
+ if (eitem2) ebase.appendChild(eitem2);
}
- return ebase.xml;
+ return ebase.xml();
}
@@ -246,14 +248,14 @@
return 1;
}
- xstring GetEntityID(int /*param*/ pr)
+ xstring GetEntityID(LPARAM /*param*/ pr)
{
return InvoiceID;
}
- xstring GetEntityName(int /*param*/ pr)
+ xstring GetEntityName(LPARAM /*param*/ pr)
{
- return "GDN3";
+ return L"GDN3";
}
xstring GetGuid()
@@ -266,14 +268,14 @@
xml x = ViewObject::RetrieveData(L"/sale/data/GDN/habit/customer", L"CustomerID", CustomerID);
if (x)
{
- KXMLDOMNodeList nodes = x.GetXmlDoc().selectNodes(L"GDN/*");
- int len = nodes.length;
+ KXMLDOMNodeList nodes = x.selectNodes(L"GDN/*");
+ int len = nodes.length();
for (int i = 0; i < len; i++)
{
KXMLDOMElement e = nodes.item(i);
- dw_base.SetItemString(1, e.tagName, e.text);
+ dw_base.SetItemString(1, e.tagName(), e.text());
if (e.selectSingleNode(L"@_displaystring"))
- dw_base.SetItemDisplayString(1, e.tagName, e.selectSingleNode(L"@_displaystring").text);
+ dw_base.SetItemDisplayString(1, e.tagName(), e.selectSingleNode(L"@_displaystring").text());
}
}
return 1;
@@ -358,7 +360,7 @@
for (int row = 1; row <= dw_item.GetRowCount(); row++)
{
double Quantity = dw_item.GetItemDouble(row, L"Quantity");
- int Packages = dw_item.GetItemDouble(row, L"Packages").toInt();
+ int Packages = (int)dw_item.GetItemDouble(row, L"Packages");
double GW = dw_item.GetItemDouble(row, L"GW");
double NW = dw_item.GetItemDouble(row, L"NW");
double Vol = dw_item.GetItemDouble(row, L"Volume");
@@ -373,7 +375,7 @@
GW_s += GW;
NW_s += NW;
Amount_s += Amount;
- Vol_s += Vol.round(2);
+ Vol_s += xdouble(Vol).round(2);
Cost_s += Cost;
ResearchCommissionRate_s += ResearchCommissionRate;
MiddlemanAmountRate_s += MiddlemanAmountRate;
@@ -381,10 +383,10 @@
dw_base.SetItemDouble(1, L"Quantity", Quantity_s);
dw_base.SetItemDouble(1, L"GW", GW_s);
dw_base.SetItemDouble(1, L"NW", NW_s);
- dw_base.SetItemString(1, L"Packages", Packages_s.toString());
- dw_base.SetItemDouble(1, L"Volume", Vol_s.round(2));
- dw_base.ItemChangeTo(1, L"Amount", Amount_s.toString());
-
+ dw_base.SetItemString(1, L"Packages", xstring(Packages_s));
+ dw_base.SetItemDouble(1, L"Volume", xdouble(Vol_s).round(2));
+ dw_base.ItemChangeTo(1, L"Amount", xstring(Amount_s));
+ dw_base.ItemChangeTo(1, L"InsuredAmount", xstring(Amount_s));
dw_base.SetItemDouble(1, L"PrivateCommissionAmount", ResearchCommissionRate_s + MiddlemanAmountRate_s);
//dw_base.SetItemDouble(1,L"Cost",Cost_s);
@@ -426,7 +428,7 @@
xml check_x = ViewObject::RetrieveData(L"/sale/data/GDN/source/FindByInvoiceNo", L"InvoiceNo", InvoiceNo1);
if (check_x)
{
- xstring cnt = check_x.GetXmlDoc().documentElement.getAttribute(L"count");
+ xstring cnt = check_x.documentElement().getAttribute(L"count");
if (cnt != L"0") {
alert(L"外运编号已存在,请重新填写!");
return 0;
@@ -503,7 +505,7 @@
//if(dw_base.GetItemString(1,L"GoodsSource") == L"")
//{
- // alert(L"请选择货物产地(货物产地:开票工厂金额最大的工厂所属地)L");
+ // alert(L"请选择货物产地(货物产地:开票工厂金额最大的工厂所属地)");
// return 0;
// }
@@ -511,32 +513,32 @@
xstring str = L"";
dw_base.AcceptText();
- xml xbase = new xml;
- xbase.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xbasedoc = xbase.GetXmlDoc();
+ xml xbase;
+
+ KXMLDOMDocument xbasedoc = xbase;
dw_base.DwUpdateAllTo(xbasedoc);
- xaserverarg arg = GDNView::MakeArg();
+ xaserverarg arg ;
//if(dw_billnote.DeletedCount()+dw_billnote.ModifiedCount() > 0)
//{
- xml xbillnote = new xml;
- xbillnote.setNativePointer(xml::CreateInstance());
- dw_billnote.DwUpdateAllToEx(xbillnote.GetXmlDoc());
+ xml xbillnote ;
+
+ dw_billnote.DwUpdateAllToEx(xbillnote);
- KXMLDOMElement docinfo = xbillnote.GetXmlDoc().selectSingleNode(L"GDN/DocInfo");
- docinfo.SetAttribute(L"update.modify", L"1");
- xbase.GetXmlDoc().documentElement.appendChild(docinfo);
- xbase.GetXmlDoc().documentElement.SetAttribute(L"update.modify", L"1");
+ KXMLDOMElement docinfo = xbillnote.selectSingleNode(L"GDN/DocInfo");
+ docinfo.setAttribute(L"update.modify", L"1");
+ xbase.documentElement().appendChild(docinfo);
+ xbase.documentElement().setAttribute(L"update.modify", L"1");
//}
- arg.AddArg(L"content", xbase.GetXml());
- if (url::get(L"/sale/data/Gdn3/update/base", arg.GetString(), xbase) != 1)
+ arg.AddArg(L"content", xbase.xml());
+ if (xurl::get(L"/sale/data/Gdn3/update/base", arg.GetString(), xbase) != 1)
{
- xstring error = xbase.GetXmlDoc().text;
+ xstring error = xbase.text();
alert(L"err:" + error);
alert(L"基本信息保存失败!");
return -1;
}
- str = xbase.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = xbase.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"基本信息保存失败!");
@@ -545,19 +547,19 @@
dw_base.ResetUpdateStatus();
dw_profit.AcceptText();
- xml xprofit = new xml;
- xprofit.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xprofitdoc = xprofit.GetXmlDoc();
+ xml xprofit;
+
+ KXMLDOMDocument xprofitdoc = xprofit;
dw_profit.DwUpdateAllTo(xprofitdoc);
- xaserverarg arg3 = GDNView::MakeArg();
- arg3.AddArg(L"content", xprofit.GetXml());
- if (url::get(L"/sale/data/Gdn/update/profit", arg3.GetString(), xprofit) != 1)
+ xaserverarg arg3 ;
+ arg3.AddArg(L"content", xprofit.xml());
+ if (xurl::get(L"/sale/data/Gdn/update/profit", arg3.GetString(), xprofit) != 1)
{
- xstring error4 = xprofit.GetXmlDoc().text;
+ xstring error4 = xprofit.text();
}
else
{
- str = xprofit.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = xprofit.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"盈亏信息保存失败!");
@@ -573,25 +575,25 @@
{
if (dw_item.GetItemString(k, L"SeqNo") == L"")
{
- dw_item.SetItemString(k, L"SeqNo", k.toString());
+ dw_item.SetItemString(k, L"SeqNo", xstring(k));
}
}
- xml xitem = new xml;
- xitem.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xitemdoc = xitem.GetXmlDoc();
+ xml xitem ;
+
+ KXMLDOMDocument xitemdoc = xitem;
dw_item.DwUpdateAllToEx(xitemdoc);
//dw_base.DwUpdateAllTo(xitemdoc);
- xaserverarg arg1 = GDNView::MakeArg();
- arg1.AddArg(L"content", xitem.GetXml());
+ xaserverarg arg1 ;
+ arg1.AddArg(L"content", xitem.xml());
- if (url::get(L"/sale/data/Gdn/update/item", arg1.GetString(), xitem) != 1)
+ if (xurl::get(L"/sale/data/Gdn/update/item", arg1.GetString(), xitem) != 1)
{
- xstring error1 = xitem.GetXmlDoc().text;
+ xstring error1 = xitem.text();
}
else
{
- str = xitem.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = xitem.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"商品信息保存失败!");
@@ -602,18 +604,18 @@
}
dw_source.AcceptText();
xml x;
- x.setNativePointer(x.CreateInstance());
- dw_source.DwUpdateAllToEx(x.GetXmlDoc());
- xaserverarg arg2 = GDNView::MakeArg();
- arg2.AddArg(L"content", x.GetXml());
+
+ dw_source.DwUpdateAllToEx(x);
+ xaserverarg arg2 ;
+ arg2.AddArg(L"content", x.xml());
- if (url::get(L"/sale/data/Gdn/update/sourceex", arg2.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/update/sourceex", arg2.GetString(), x) != 1)
{
- xstring error3 = x.GetXmlDoc().text;
+ xstring error3 = x.text();
}
else
{
- str = x.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = x.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"货源信息保存失败!");
@@ -627,22 +629,23 @@
{
if (dw_custom.GetItemString(k, L"LineNo") == L"")
{
- dw_custom.SetItemString(k, L"LineNo", k.toString());
+ dw_custom.SetItemString(k, L"LineNo", xstring(k));
}
}
- xml xcustom = new xml;
- xcustom.setNativePointer(xcustom.CreateInstance());
- dw_custom.DwUpdateAllToEx(xcustom.GetXmlDoc());
- if (xcustom.GetXml() != L"")
+ xml xcustom;
+ xstring error5;
+ dw_custom.DwUpdateAllToEx(xcustom);
+
+ if ((xstring)xcustom.xml() != L"")
{
- xcustom = CustomView::UpdateCustomItem(dw_base.GetItemString(1, L"InvoiceNo"), xcustom.GetXml());
+ xcustom = CustomView::UpdateCustomItem(dw_base.GetItemString(1, L"InvoiceNo"), xcustom.xml());
if (!xcustom)
{
- xstring error5 = xcustom.GetXmlDoc().text;
+ error5 = xcustom.text();
}
else
{
- str = xcustom.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = xcustom.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"报关信息保存失败!");
@@ -654,18 +657,18 @@
if (dw_invoiceItem.GetRowCount() > 0)
{
dw_invoiceItem.AcceptText();
- xml x1 = new xml;
- x1.setNativePointer(x1.CreateInstance());
- dw_invoiceItem.DwUpdateAllToEx(x1.GetXmlDoc());
- xaserverarg arg4 = GDNView::MakeArg();
- arg4.AddArg(L"content", x1.GetXml());
- if (url::get(L"/sale/data/Gdn/update/itemex", arg4.GetString(), x1) != 1)
+ xml x1 ;
+
+ dw_invoiceItem.DwUpdateAllToEx(x1);
+ xaserverarg arg4;
+ arg4.AddArg(L"content", x1.xml());
+ if (xurl::get(L"/sale/data/Gdn/update/itemex", arg4.GetString(), x1) != 1)
if (!x1)
{
alert(L"议付信息保存失败!");
return -1;
}
- str = x1.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = x1.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"议付信息保存失败!");
@@ -674,19 +677,19 @@
dw_invoiceItem.ResetUpdateStatus();
}
dw_fcl.AcceptText();
- xml xfcl = new xml;
- xfcl.setNativePointer(xfcl.CreateInstance());
- dw_fcl.DwUpdateAllToEx(xfcl.GetXmlDoc());
- xaserverarg arg8 = GDNView::MakeArg();
- arg8.AddArg(L"content", xfcl.GetXml());
+ xml xfcl ;
+
+ dw_fcl.DwUpdateAllToEx(xfcl);
+ xaserverarg arg8 ;
+ arg8.AddArg(L"content", xfcl.xml());
- if (url::get(L"/sale/data/Gdn/update/container", arg8.GetString(), xfcl) != 1)
+ if (xurl::get(L"/sale/data/Gdn/update/container", arg8.GetString(), xfcl) != 1)
{
- xstring error8 = xfcl.GetXmlDoc().text;
+ xstring error8 = xfcl.text();
}
else
{
- str = xfcl.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = xfcl.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"分箱信息保存失败!");
@@ -695,22 +698,22 @@
dw_fcl.ResetUpdateStatus();
}
dw_cdelement.AcceptText();
- xml xcdelement = new xml;
- xcdelement.setNativePointer(xcdelement.CreateInstance());
- dw_cdelement.DwUpdateAllToEx(xcdelement.GetXmlDoc());
- if (xcdelement.GetXml() != L"")
+ xml xcdelement ;
+
+ dw_cdelement.DwUpdateAllToEx(xcdelement);
+ if ((xstring)xcdelement.xml() != L"")
{
- xcdelement = CustomView::UpdateCustomElement(dw_base.GetItemString(1, L"InvoiceNo"), xcdelement.GetXml());
+ xcdelement = CustomView::UpdateCustomElement(dw_base.GetItemString(1, L"InvoiceNo"), xcdelement.xml());
if (!xcdelement)
{
- xstring error6 = xcdelement.GetXmlDoc().text;
+ xstring error6 = xcdelement.text();
alert(L"err:" + error6);
alert(L"申报要素信息保存失败!");
//return -1;
}
else
{
- str = xcdelement.GetXmlDoc().documentElement.getAttribute(L"text");
+ str = xcdelement.documentElement().getAttribute(L"text");
if (str == L"false")
{
alert(L"申报要素信息保存失败!");
@@ -744,7 +747,7 @@
classfyid = dw_item.GetItemString(i, L"ClassifyID");
if (dw_custom.LookUpRow(L"ClassifyID", classfyid) == 0)
{
- alert(L"出货商品第" + i.toString() + L"行海关代码[" +
+ alert(L"出货商品第" + xstring(i) + L"行海关代码[" +
dw_item.GetItemDisplayString(i, L"ClassifyID") + L"]与报关商品不一致");
return false;
}
@@ -756,14 +759,14 @@
classfyid = dw_custom.GetItemString(i, L"ClassifyID");
if (dw_item.LookUpRow(L"ClassifyID", classfyid) == 0)
{
- alert(L"报关商品第" + i.toString() + L"行海关代码[" +
+ alert(L"报关商品第" + xstring(i) + L"行海关代码[" +
dw_item.GetItemDisplayString(i, L"ClassifyID") + L"]与出货商品不一致");
return false;
}
xml xx3 = ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNClassifyID", L"InvoiceNo", classfyid);
trace(classfyid);
- xstring Results3 = xx3.GetXmlDoc().text;
+ xstring Results3 = xx3.text();
if (Results3 != L"")
{
alert(Results3);
@@ -790,12 +793,12 @@
if(No != L"")
{
xml x = ViewObject::RetrieveData(L"/sale/data/GDN/GDNClassifyID",L"InvoiceNo", No);
- if(x.GetXmlDoc().selectSingleNode(L"data/item/ClassifyID"))
- if(x.GetXmlDoc().selectSingleNode(L"data/item/CDquantity"))
+ if(x.selectSingleNode(L"data/item/ClassifyID"))
+ if(x.selectSingleNode(L"data/item/CDquantity"))
xstring ClassifyIDOne=L"";
xstring CDquantityOne=L"";
- ClassifyIDOne = x.GetXmlDoc().selectSingleNode(L"data/item/ClassifyID").text;
- CDquantityOne= x.GetXmlDoc().selectSingleNode(L"data/item/CDquantity").text;
+ ClassifyIDOne = x.selectSingleNode(L"data/item/ClassifyID").text();
+ CDquantityOne= x.selectSingleNode(L"data/item/CDquantity").text();
double CDquantityTwo=CDquantityOne.toInt();
}
double ttl=0.0;
@@ -835,13 +838,13 @@
{
double GW = dw_custom.GetItemDouble(k, L"GW");
double NW = dw_custom.GetItemDouble(k, L"NW");
- GWS += (GW).round(2);
- NWS += (NW).round(2);
+ GWS += xdouble(GW).round(2);
+ NWS += xdouble(NW).round(2);
}
double GW1 = dw_base.GetItemDouble(1, L"GW");
double NW1 = dw_base.GetItemDouble(1, L"NW");
- if ((NWS).round(2) != (NW1).round(2) || (GWS).round(2) != (GW1).round(2))
+ if (xdouble(NWS).round(2) != xdouble(NW1).round(2) || xdouble(GWS).round(2) != xdouble(GW1).round(2))
{
alert(L"毛重总量或净总重量不一致,需要核对!");
return 0;
@@ -867,7 +870,7 @@
xstring ClassifyID = dw_custom.GetItemString(k, L"ClassifyID");
xstring ClassifyName = dw_custom.GetItemString(k, L"CustName");
xstring GroupNo = dw_custom.GetItemString(k, L"GroupNo");
- if (GroupNo != L"") ClassifyName += ClassifyName + L"(L" + GroupNo + L")L";
+ if (GroupNo != L"") ClassifyName += ClassifyName + L"(" + GroupNo + L")";
double LegalQty = dw_custom.GetItemDouble(k, L"LegalQty");
@@ -882,7 +885,7 @@
NWS += NW;
}
- trace(L"*****" + NWS.toString() + L"*****" + LegalQty.toString() + L"*****");
+ trace(L"*****" + xstring(NWS) + L"*****" + xstring(LegalQty) + L"*****");
NWS = NWS - LegalQty;
if (NWS < 0.0) NWS = 0.0 - NWS;
@@ -911,7 +914,7 @@
xstring ClassifyID = dw_custom.GetItemString(k, L"ClassifyID");
xstring ClassifyName = dw_custom.GetItemString(k, L"CustName");
xstring GroupNo = dw_custom.GetItemString(k, L"GroupNo");
- if (GroupNo != L"") ClassifyName += ClassifyName + L"(L" + GroupNo + L")L";
+ if (GroupNo != L"") ClassifyName += ClassifyName + L"(" + GroupNo + L")";
double VQuantity = dw_custom.GetItemDouble(k, L"Quantity");
double VAmount = dw_custom.GetItemDouble(k, L"Amount");
double qty = 0.0;
@@ -954,7 +957,7 @@
bool validProfit()
{
- double amt = dw_profit.GetItemString(1, L"ProfitAmountEx");
+ double amt = dw_profit.GetItemDouble(1, L"ProfitAmountEx");
if (amt < 0.0)
{
if (dw_profit.GetItemString(1, L"Note") == L"")
@@ -998,63 +1001,62 @@
xstring GDNLineID = dw_item.GetGuid(nRow);
if (clear) ClearSourcingItem(nRow);
double ExchangeCostEx = dw_profit.GetItemDouble(1, L"ExchangeCostEx");
- xml x = xml::Make();
- x.LoadXml(L"<data/>");
+ xml x ;
+ x.loadXML(L"<data/>");
KXMLDOMElement e = dw_item.GetRowElement(nRow);
KXMLDOMNode n = e.cloneNode(-1);
- x.GetXmlDoc().documentElement.appendChild(n);
- n.Release();
- xstring val = x.GetXml();
+ x.documentElement().appendChild(n);
+
+ xstring val = x.xml();
trace(L"=======L" + val + L"=======L");
- x.Free();
xml source = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitemex", L"content", val);
if (source)
{
- KXMLDOMNodeList items = source.GetXmlDoc().selectNodes(L"data/Item");
+ KXMLDOMNodeList items = source.selectNodes(L"data/Item");
//trace(L"=======L"+source.GetXml()+L"=======L");
- int len = items.length;
+ int len = items.length();
int row = 0;
for (int i = 0; i < len; i++)
{
row = dw_source.InsertRow(0);
KXMLDOMNode t = items.item(i);
//dw_source.SetItemDouble(row,L"Swapthecost",ExchangeCostEx);
- if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text);
- if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text);
- if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text);
- if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text);
+ if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text());
+ if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text());
+ if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text());
+ if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text());
- if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text);
+ if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text());
- if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text);
- if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text);
- if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text);
- if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text);
- if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text);
- if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text);
- if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text);
- if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text);
- if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text);
- if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text);
- if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text);
- if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text);
+ if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text());
+ if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text());
+ if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text());
+ if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text());
+ if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text());
+ if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text());
+ if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text());
+ if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text());
+ if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text());
+ if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text());
+ if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text());
+ if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text());
//trace(L"\r\nHasVATInvoice:"+dw_source.GetItemDisplayString(row,L"HasVATInvoice"));
if (dw_source.GetItemString(row, L"HasVATInvoice") == L"Y")
{
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
- if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text);
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
+ if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text());
}
- if (t.selectSingleNode(L"Amount"))dw_source.SetItemString(row, L"Amount", t.selectSingleNode(L"Amount").text);
- if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text);
- if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text);
- if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text);
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
- if (t.selectSingleNode(L"PurcharName"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharName").text);
- if (t.selectSingleNode(L"PurcharID"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharID").text);
+ if (t.selectSingleNode(L"Amount"))dw_source.SetItemString(row, L"Amount", t.selectSingleNode(L"Amount").text());
+ if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text());
+ if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text());
+ if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text());
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
+ if (t.selectSingleNode(L"PurcharName"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharName").text());
+ if (t.selectSingleNode(L"PurcharID"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharID").text());
- if (t.selectSingleNode(L"PackUnitPrice"))dw_source.SetItemString(row, L"PackUnitPrice", t.selectSingleNode(L"PackUnitPrice").text);
+ if (t.selectSingleNode(L"PackUnitPrice"))dw_source.SetItemString(row, L"PackUnitPrice", t.selectSingleNode(L"PackUnitPrice").text());
}
@@ -1077,64 +1079,63 @@
xstring GDNLineID = dw_item.GetGuid(nRow);
if (clear) ClearSourcingItem(nRow);
double ExchangeCostEx = dw_profit.GetItemDouble(1, L"ExchangeCostEx");
- xml x = xml::Make();
- x.LoadXml(L"<data/>");
+ xml x ;
+ x.loadXML(L"<data/>");
KXMLDOMElement e = dw_item.GetRowElement(nRow);
KXMLDOMNode n = e.cloneNode(-1);
- x.GetXmlDoc().documentElement.appendChild(n);
- n.Release();
- xstring val = x.GetXml();
+ x.documentElement().appendChild(n);
+
+ xstring val = x.xml();
trace(L"123=======L" + val + L"=======123");
- x.Free();
xml source = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitemexOne", L"content", val);
if (source)
{
- KXMLDOMNodeList items = source.GetXmlDoc().selectNodes(L"data/Item");
- int len = items.length;
+ KXMLDOMNodeList items = source.selectNodes(L"data/Item");
+ int len = items.length();
int row = 0;
for (int i = 0; i < len; i++)
{
row = dw_source.InsertRow(0);
KXMLDOMNode t = items.item(i);
//dw_source.SetItemDouble(row,L"Swapthecost",ExchangeCostEx);
- if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text);
- if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text);
- if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text);
- if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text);
+ if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text());
+ if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text());
+ if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text());
+ if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text());
- if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text);
+ if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text());
- if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text);
- if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text);
- if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text);
- if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text);
- if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text);
- if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text);
- if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text);
- if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text);
- if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text);
- if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text);
- if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text);
- if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text);
- if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text);
- // if(t.selectSingleNode(L"HSCode"))dw_source.SetItemString(row,L"HSCode",t.selectSingleNode(L"HSCode").text);
+ if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text());
+ if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text());
+ if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text());
+ if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text());
+ if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text());
+ if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text());
+ if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text());
+ if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text());
+ if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text());
+ if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text());
+ if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text());
+ if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text());
+ if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text());
+ // if(t.selectSingleNode(L"HSCode"))dw_source.SetItemString(row,L"HSCode",t.selectSingleNode(L"HSCode").text());
if (dw_source.GetItemString(row, L"HasVATInvoice") == L"Y")
{
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
- if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text);
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
+ if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text());
}
- if (t.selectSingleNode(L"Amount"))dw_source.SetItemString(row, L"Amount", t.selectSingleNode(L"Amount").text);
- if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text);
- if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text);
- if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text);
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
- if (t.selectSingleNode(L"PurcharName"))dw_source.SetItemDisplayString(row, L"PurcharID", t.selectSingleNode(L"PurcharName").text);
- if (t.selectSingleNode(L"PurcharID"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharID").text);
+ if (t.selectSingleNode(L"Amount"))dw_source.SetItemString(row, L"Amount", t.selectSingleNode(L"Amount").text());
+ if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text());
+ if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text());
+ if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text());
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
+ if (t.selectSingleNode(L"PurcharName"))dw_source.SetItemDisplayString(row, L"PurcharID", t.selectSingleNode(L"PurcharName").text());
+ if (t.selectSingleNode(L"PurcharID"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharID").text());
- if (t.selectSingleNode(L"PackUnitPrice"))dw_source.SetItemString(row, L"PackUnitPrice", t.selectSingleNode(L"PackUnitPrice").text);
+ if (t.selectSingleNode(L"PackUnitPrice"))dw_source.SetItemString(row, L"PackUnitPrice", t.selectSingleNode(L"PackUnitPrice").text());
}
PoTotal(nRow);
@@ -1156,57 +1157,57 @@
while (dw_source.GetRowCount() > 0) dw_source.DeleteRow(1);
dw_item.AcceptText();
- xml xitem = new xml;
- xitem.setNativePointer(xml::CreateInstance());
- KXMLDOMDocument xitemdoc = xitem.GetXmlDoc();
+ xml xitem ;
+
+ KXMLDOMDocument xitemdoc = xitem;
dw_item.DwUpdateAllToEx(xitemdoc);
- trace(L"****" + xitem.GetXml() + L"****");
+
- xml x = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitemexOne", L"content", xitem.GetXml());
- trace(x.GetXml());
+ xml x = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitemexOne", L"content", xitem.xml());
+ trace(x.xml());
if (x)
{
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"data/Item");
- int len = items.length;
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
+ int len = items.length();
int row = 0;
for (int i = 0; i < len; i++)
{
row = dw_source.InsertRow(0);
KXMLDOMNode t = items.item(i);
- if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text);
- if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text);
- if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text);
- if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text);
+ if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text());
+ if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text());
+ if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text());
+ if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text());
- if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text);
+ if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text());
- if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text);
- if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text);
- if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text);
- if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text);
- if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text);
- if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text);
- if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text);
- if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text);
+ if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text());
+ if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text());
+ if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text());
+ if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text());
+ if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text());
+ if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text());
+ if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text());
+ if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text());
- if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text);
+ if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text());
- if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text);
- if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text);
- if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text);
- if (t.selectSingleNode(L"Amount"))dw_source.SetItemDisplayString(row, L"Amount", t.selectSingleNode(L"Amount").text);
- if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text);
- if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text);
- if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemDisplayString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text);
- if (t.selectSingleNode(L"PurcharName"))dw_source.SetItemDisplayString(row, L"PurcharID", t.selectSingleNode(L"PurcharName").text);
- if (t.selectSingleNode(L"PurcharID"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharID").text);
- if (t.selectSingleNode(L"PackUnitPrice"))dw_source.SetItemString(row, L"PackUnitPrice", t.selectSingleNode(L"PackUnitPrice").text);
- // if(t.selectSingleNode(L"HSCode"))dw_source.SetItemString(row,L"HSCode",t.selectSingleNode(L"HSCode").text);
+ if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text());
+ if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text());
+ if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text());
+ if (t.selectSingleNode(L"Amount"))dw_source.SetItemDisplayString(row, L"Amount", t.selectSingleNode(L"Amount").text());
+ if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text());
+ if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text());
+ if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemDisplayString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text());
+ if (t.selectSingleNode(L"PurcharName"))dw_source.SetItemDisplayString(row, L"PurcharID", t.selectSingleNode(L"PurcharName").text());
+ if (t.selectSingleNode(L"PurcharID"))dw_source.SetItemString(row, L"PurcharID", t.selectSingleNode(L"PurcharID").text());
+ if (t.selectSingleNode(L"PackUnitPrice"))dw_source.SetItemString(row, L"PackUnitPrice", t.selectSingleNode(L"PackUnitPrice").text());
+ // if(t.selectSingleNode(L"HSCode"))dw_source.SetItemString(row,L"HSCode",t.selectSingleNode(L"HSCode").text());
if (dw_source.GetItemDisplayString(row, L"HasVATInvoice") == L"Y")
{
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
- if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text);
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
+ if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text());
}
}
evalPurcharCost();
@@ -1216,7 +1217,6 @@
PoTotal();
- x.Free();
evalProfitAmountEx();
}
@@ -1235,42 +1235,42 @@
xml x = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitem", L"InvoiceNo", No, L"GDNLineID", gdnLineID);
if (x)
{
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"data/Item");
- int len = items.length;
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
+ int len = items.length();
int row = 0;
for (int i = 0; i < len; i++)
{
row = dw_source.InsertRow(0);
KXMLDOMNode t = items.item(i);
- if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text);
- if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text);
- if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text);
- if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text);
+ if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text());
+ if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text());
+ if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text());
+ if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text());
- if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text);
+ if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text());
- if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text);
- if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text);
- if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text);
- if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text);
- if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text);
- if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text);
- if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text);
- if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text);
- if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text);
- if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text);
- if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text);
- if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text);
+ if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text());
+ if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text());
+ if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text());
+ if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text());
+ if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text());
+ if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text());
+ if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text());
+ if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text());
+ if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text());
+ if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"SupplierID").text());
+ if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text());
+ if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text());
if (dw_source.GetItemDisplayString(row, L"HasVATInvoice") == L"Y")
{
- if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text);
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
+ if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text());
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
}
- if (t.selectSingleNode(L"Amount"))dw_source.SetItemDisplayString(row, L"Amount", t.selectSingleNode(L"Amount").text);
- if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text);
- if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text);
- if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemDisplayString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text);
+ if (t.selectSingleNode(L"Amount"))dw_source.SetItemDisplayString(row, L"Amount", t.selectSingleNode(L"Amount").text());
+ if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text());
+ if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text());
+ if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemDisplayString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text());
}
}
evalTotalCost();
@@ -1282,22 +1282,22 @@
}
//event
- int OnDWClick(ref TNotifyEvent evt, int p)
+ int OnDWClick(TEvent* evt, int p)
{
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
- xstring value = hdr.data;
- xstring colname = hdr.colname;
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ xstring value = hdr->data;
+ xstring colname = hdr->colname;
return 1;
}
- int OnProfitItemChanged(ref TNotifyEvent evt, int p)
+ int OnProfitItemChanged(TEvent* evt, int p)
{
- int HCursor = xutil::SetCursorWait();
- ref DWNMHDR hdr = cast(evt.pnmh as ref DWNMHDR);
- int row = hdr.row;
- xstring col = hdr.colname;
- xstring data = hdr.data;
+ HCURSOR HCursor = xutil::SetCursorWait();
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ int row = hdr->row;
+ xstring col = hdr->colname;
+ xstring data = hdr->data;
if (col == L"DrawbackIntrest" ||
col == L"DrawbackIntrest" ||
@@ -1327,13 +1327,13 @@
return 1;
}
- int OnCustomItemChanged(ref TNotifyEvent evt, int p)
+ int OnCustomItemChanged(TEvent* evt, int p)
{
- int HCursor = xutil::SetCursorWait();
- ref DWNMHDR hdr = cast(evt.pnmh as ref DWNMHDR);
- int row = hdr.row;
- xstring col = hdr.colname;
- xstring data = hdr.data;
+ HCURSOR HCursor = xutil::SetCursorWait();
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ int row = hdr->row;
+ xstring col = hdr->colname;
+ xstring data = hdr->data;
if (col == L"AdjustParam")
{
double rate = 1.0;
@@ -1377,14 +1377,13 @@
return 1;
}
- int OnBaseItemChanged(ref TNotifyEvent evt, int p)
+ int OnBaseItemChanged(TEvent* evt, int p)
{
-
- int HCursor = xutil::SetCursorWait();
- ref DWNMHDR hdr = cast(evt.pnmh as ref DWNMHDR);
- int row = hdr.row;
- xstring col = hdr.colname;
- xstring data = hdr.data;
+ HCURSOR HCursor = xutil::SetCursorWait();
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ int row = hdr->row;
+ xstring col = hdr->colname;
+ xstring data = hdr->data;
if (col == L"CustomerID")
{
@@ -1416,6 +1415,7 @@
}
CalcDraftAmount();
CalcProfit();
+ GetInsuranceAmountEx();
dw_base.Redraw();
}
@@ -1441,11 +1441,11 @@
xml supplier_x = ViewObject::RetrieveData(L"/sale/data/expense3/view/FindByOriginName", L"OriginName", s);
if (supplier_x)
{
- KXMLDOMNode o = supplier_x.GetXmlDoc().selectSingleNode(L"Item");
- xstring GoodsSource = o.selectSingleNode(L"OriginName").text;
- xstring OriginID = o.selectSingleNode(L"OriginID").text;
+ KXMLDOMNode o = supplier_x.selectSingleNode(L"Item");
+ xstring GoodsSource = o.selectSingleNode(L"OriginName").text();
+ xstring OriginID = o.selectSingleNode(L"OriginID").text();
xstring sname = OriginID + L" " + s;
- xstring name = o.selectSingleNode(L"name").text;
+ xstring name = o.selectSingleNode(L"name").text();
if (sname == name) {
dw_base.SetItemDisplayString(1, L"GoodsSource", name);
dw_base.SetItemString(1, L"GoodsSource", name);
@@ -1529,31 +1529,68 @@
else if (col == L"ETD")
{
xstring ETD = dw_base.GetItemString(1, L"ETD");
+ xstring CustomerID = dw_base.GetItemString(1, L"CustomerID");
+
xstring exchangeRate = L"";
+ xstring PremiumRate = L"";
if (ETD != L"")
{
trace(ETD);
xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramEx", L"ETD", ETD);
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchangeRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ if (x.selectSingleNode(L"root/item/@value"))
+ exchangeRate = x.selectSingleNode(L"root/item/@value").text();
if (exchangeRate != L"")
{
dw_profit.SetItemString(1, L"ExchangeRate", exchangeRate);
}
else
{
- xml xp = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate");
- if (xp.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchangeRate = xp.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ xml xp = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"cryrate");
+ if (xp.selectSingleNode(L"root/item/@value"))
+ exchangeRate = xp.selectSingleNode(L"root/item/@value").text();
dw_profit.SetItemString(1, L"ExchangeRate", exchangeRate);
}
evalManagementFee();
evalRiskFundAmount();
- }
+ xml x1 = ViewObject::RetrieveData(L"/sale/data/GDN3/GetInsuranceRateEx", L"ETD", ETD, L"CustomerID", CustomerID);
+ if (x1.selectSingleNode(L"root/item/@value"))
+ PremiumRate = x1.selectSingleNode(L"root/item/@value").text();
+
+ if (PremiumRate != L"")
+ {
+ dw_base.SetItemString(1, L"InsuranceRateEx", PremiumRate);
+ GetInsuranceAmountEx();
+ }
+
+ }
dw_profit.Redraw();
+ dw_base.Redraw();
}
+ else if (col == L"InsuredAmount" || col == L"InsuranceRateEx")
+ {
+ GetInsuranceAmountEx();
+ }
+ return 1;
+ }
+
+ int GetInsuranceAmountEx()
+ {
+ double InsuranceRateEx = dw_base.GetItemDouble(1, L"InsuranceRateEx");
+ double InsuredAmount = dw_base.GetItemDouble(1, L"InsuredAmount");
+
+ double ExchangeAmountEx = dw_profit.GetItemDouble(1, L"ExchangeAmountEx");
+
+ dw_base.SetItemDouble(1, L"InsuranceAmountEx", InsuranceRateEx * InsuredAmount / 100);
+ dw_profit.SetItemDouble(1, L"SinosurAmount", InsuranceRateEx * InsuredAmount / 100);
+
+ dw_profit.SetItemDouble(1, L"ExchangeAmountEx", ExchangeAmountEx + (InsuranceRateEx * InsuredAmount / 100));
+ evalProfitAmount();
+ //dw_profit.ItemChangeTo(1,"SinosurAmount",(InsuranceRateEx * InsuredAmount/100).toString());
+ dw_base.Redraw();
+ dw_profit.Redraw();
+
return 1;
}
@@ -1586,10 +1623,10 @@
xml x = ViewObject::RetrieveData(L"/sale/data/Custom3/custom/classifyinfo", L"ClassifyID", ClassifyID);
if (x)
{
- KXMLDOMNode o = x.GetXmlDoc().selectSingleNode(L"data/Item");
+ KXMLDOMNode o = x.selectSingleNode(L"data/Item");
if (o)
{
- refundRate = o.selectSingleNode(L"VATRefundRate").text;
+ refundRate = o.selectSingleNode(L"VATRefundRate").text();
}
}
if (refundRate != L"*")
@@ -1614,7 +1651,7 @@
{
if (data == L"")
{
- dw_item.SetItemDisplayString(row, col, L"");
+ dw_item.SetItemDisplayString(row, col.c_str(), L"");
dw_item.SetItemString(row, L"CDUnitPrice", L"");
dw_item.SetItemDisplayString(row, L"CDUnitPrice", L"");
}
@@ -1627,7 +1664,7 @@
if (d4 != 0.0)
{
double d5 = d3 / d4;
- d5 = d5.round(4);
+ d5 = xdouble(d5).round(4);
if (d3 <= 0.0 && d4 <= 0.0)
{
//trace(L"--------1111-----------");
@@ -1643,14 +1680,13 @@
return 1;
}
- int OnItemChanged(ref TNotifyEvent evt, int p)
+ int OnItemChanged(TEvent* evt, int p)
{
- //if(datareading) return 0;
- int HCursor = xutil::SetCursorWait();
- ref DWNMHDR hdr = cast(evt.pnmh as ref DWNMHDR);
- int row = hdr.row;
- xstring col = hdr.colname;
- xstring data = hdr.data;
+ HCURSOR HCursor = xutil::SetCursorWait();
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ int row = hdr->row;
+ xstring col = hdr->colname;
+ xstring data = hdr->data;
if (col == L"ClassifyID")
{
@@ -1664,7 +1700,7 @@
double dqty = dw_item.GetItemDouble(row, L"Quantity");
xstring spackingrate = dw_item.GetItemString(row, L"PackingRate");
int ipack = caclPacking(dqty, spackingrate);
- dw_item.ItemChangeTo(row, L"Packages", ipack.toString());
+ dw_item.ItemChangeTo(row, L"Packages", xstring(ipack));
if (col == L"Quantity")
{
if (!datareading)
@@ -1695,7 +1731,7 @@
dw_item.SetItemDouble(row, L"VolumePerPkg", pv2);
double ctns2 = dw_item.GetItemDouble(row, L"Packages");
double svol2 = pv2 * ctns2;
- dw_item.SetItemDouble(row, L"Volume", svol2.round(2));
+ dw_item.SetItemDouble(row, L"Volume", xdouble(svol2).round(2));
dw_item.SetItemDouble(row, L"NW", nw);
dw_item.SetItemDouble(row, L"GW", gw);
@@ -1753,14 +1789,14 @@
double svol = pv * ctns;
//trace(svol.toString() +L"******"+svol.round(2));
- dw_item.SetItemDouble(row, L"Volume", svol.round(2));
+ dw_item.SetItemDouble(row, L"Volume", xdouble(svol).round(2));
double Volumes = 0.0;
for (int roww = 1; roww <= dw_item.GetRowCount(); ++roww)
{
double Volume = dw_item.GetItemDouble(roww, L"Volume");
- Volumes += Volume.round(2);
+ Volumes += xdouble(Volume).round(2);
}
- dw_base.SetItemDouble(1, L"Volume", Volumes.round(2));
+ dw_base.SetItemDouble(1, L"Volume", xdouble(Volumes).round(2));
dw_item.Redraw();
}
if (col == L"VolumePerPkg")
@@ -1778,7 +1814,7 @@
double d1 = dw_item.GetItemDouble(row, L"Quantity");
double d2 = dw_item.GetItemDouble(row, L"UnitPrice");
double d = d1 * d2;
- d = d.round(2);
+ d = xdouble(d).round(2);
dw_item.SetItemDouble(row, L"Amount", d);
calcTotal();
@@ -1801,6 +1837,7 @@
double Amount_s = 0.0;
double Vol_s = 0.0;
double Vol_A = 2.0;
+ double GDNItemAmount = 0.0;
for (int row = 1; row <= dw_source.GetRowCount(); ++row)
{
for (int k = 1; k <= dw_item.GetRowCount(); ++k) {
@@ -1808,7 +1845,7 @@
KXMLDOMElement e = dw_item.GetRowElement(k);
xstring GDNLineID = e.getAttribute(L"guid");
double GDNSourceAmount = dw_source.GetItemDouble(row, L"BuyAmount");
- double GDNItemAmount = dw_item.GetItemDouble(k, L"Amount");
+ GDNItemAmount = dw_item.GetItemDouble(k, L"Amount");
xstring POGDNLineID = dw_source.GetItemString(row, L"GDNLineID");
if (GDNLineID == POGDNLineID) {
Amount_s += GDNSourceAmount;
@@ -1821,20 +1858,20 @@
return 1;
}
- int OnItemChangedEx(ref TNotifyEvent evt, int p)
+ int OnItemChangedEx(TEvent* evt, int p)
{
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
- xstring colname = hdr.colname;
- xstring value = hdr.data;
-
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ xstring colname = hdr->colname;
+ xstring value = hdr->data;
+
if (colname == L"VATRefundRate")
{
- //double price1 = dw_source.GetItemDouble(hdr.row,L"BuyUnitPrice");
- //double quantity1 = dw_source.GetItemDouble(hdr.row,L"BuyQuantity");
- double amount1 = dw_source.GetItemDouble(hdr.row, L"BuyAmount");
- double VATRefundRate = dw_source.GetItemDouble(hdr.row, L"VATRefundRate");
- //dw_source.SetItemDouble(hdr.row,L"RefundAmount", price1 * quantity1 / 1.13 * VATRefundRate/100);
- dw_source.SetItemDouble(hdr.row, L"RefundAmount", amount1 / 1.13 * VATRefundRate / 100);
+ //double price1 = dw_source.GetItemDouble(hdr->row,L"BuyUnitPrice");
+ //double quantity1 = dw_source.GetItemDouble(hdr->row,L"BuyQuantity");
+ double amount1 = dw_source.GetItemDouble(hdr->row, L"BuyAmount");
+ double VATRefundRate = dw_source.GetItemDouble(hdr->row, L"VATRefundRate");
+ //dw_source.SetItemDouble(hdr->row,L"RefundAmount", price1 * quantity1 / 1.13 * VATRefundRate/100);
+ dw_source.SetItemDouble(hdr->row, L"RefundAmount", amount1 / 1.13 * VATRefundRate / 100);
evalDrawbackEx();
evalTotalCost();
evalProfitAmountEx();
@@ -1842,19 +1879,19 @@
if (colname == L"BuyUnitPrice" || colname == L"BuyQuantity" || colname == L"PackUnitPrice") //读取最近订单信息
{
- double price = dw_source.GetItemDouble(hdr.row, L"BuyUnitPrice");
- double quantity = dw_source.GetItemDouble(hdr.row, L"BuyQuantity");
- double Amount = dw_source.GetItemDouble(hdr.row, L"Amount");
- double PackUnitPrice = dw_source.GetItemDouble(hdr.row, L"PackUnitPrice");
- dw_source.SetItemDouble(hdr.row, L"BuyAmount", price * quantity + PackUnitPrice);
+ double price = dw_source.GetItemDouble(hdr->row, L"BuyUnitPrice");
+ double quantity = dw_source.GetItemDouble(hdr->row, L"BuyQuantity");
+ double Amount = dw_source.GetItemDouble(hdr->row, L"Amount");
+ double PackUnitPrice = dw_source.GetItemDouble(hdr->row, L"PackUnitPrice");
+ dw_source.SetItemDouble(hdr->row, L"BuyAmount", price * quantity + PackUnitPrice);
}
if (colname == L"BuyUnitPrice" || colname == L"BuyQuantity" || colname == L"PackUnitPrice" || colname == L"BuyAmount")
{
- if (dw_source.GetItemString(hdr.row, L"VATRefundRate") != L"")
+ if (dw_source.GetItemString(hdr->row, L"VATRefundRate") != L"")
{
- double amount2 = dw_source.GetItemDouble(hdr.row, L"BuyAmount");
- double VATRefundRate2 = dw_source.GetItemDouble(hdr.row, L"VATRefundRate");
- dw_source.SetItemDouble(hdr.row, L"RefundAmount", amount2 / 1.13 * VATRefundRate2 / 100);
+ double amount2 = dw_source.GetItemDouble(hdr->row, L"BuyAmount");
+ double VATRefundRate2 = dw_source.GetItemDouble(hdr->row, L"VATRefundRate");
+ dw_source.SetItemDouble(hdr->row, L"RefundAmount", amount2 / 1.13 * VATRefundRate2 / 100);
}
CalcProfit();
}
@@ -1862,36 +1899,37 @@
}
- int OnAskDataBase(ref TNotifyEvent evt, int p)
+ int OnAskDataBase(TEvent* evt, int p)
{
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
- xstring x = hdr.colname;
+ xstring x = hdr->colname;
if (x == L"userSalespersonID")
{
xstring sSalespersonID = dw_base.GetItemString(1, L"SalespersonID");
- hdr.data = sSalespersonID;
+ hdr->data = sSalespersonID.c_str(true);
}
return 1;
}
- int OnBillNoteDoubleClicked(ref TNotifyEvent evt, int p)
+ int OnBillNoteDoubleClicked(TEvent* evt, int p)
{
- ref DWNMHDR hdr = evt.pnmh;
- xstring colname = hdr.colname;
- int row = hdr.row;
+ DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
+ xstring colname = hdr->colname;
+ int row = hdr->row;
if (colname == L"Content")
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
- xstring str = dw_billnote.GetItemString(row, colname);
+ xaserverarg arg ;
+
+ xstring str = dw_billnote.GetItemString(row, colname.c_str());
arg.AddArg(L"value", str);
- openUrl(L"/sale/view/view.dlg/xpage/memo/edit/new", arg.getNativePointer());
+ openUrl(L"/sale/view/view.dlg/xpage/memo/edit/new", &arg);
+
xstring comdid = arg.GetArgString(L"comdid");
if (comdid == L"xmOK")
{
xstring value = arg.GetArgString(L"value");
- dw_billnote.SetItemString(row, colname, value);
+ dw_billnote.SetItemString(row, colname.c_str(), value);
dw_billnote.Redraw();
}
}
@@ -1902,13 +1940,13 @@
{
CheckCDLine();
CheckGW();
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg ;
+
arg.AddArg(L"EntityName", L"GDN3", L"");
arg.AddArg(L"EntityID", InvoiceID, L"");
arg.AddArg(L"EntityNo", dw_base.GetItemString(1, L"InvoiceNo"), L"");
- int p = arg.ptr_native_;
- openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", p);
+
+ openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", &arg);
return 1;
}
@@ -1924,7 +1962,7 @@
for (int row = 1; row <= dw_item.GetRowCount(); ++row)
{
double Quantity = dw_item.GetItemDouble(row, L"Quantity");
- int Packages = dw_item.GetItemDouble(row, L"Packages").toInt();
+ int Packages = (int)dw_item.GetItemDouble(row, L"Packages");
double GW = dw_item.GetItemDouble(row, L"GW");
double NW = dw_item.GetItemDouble(row, L"NW");
double Amount = dw_item.GetItemDouble(row, L"Amount");
@@ -2020,7 +2058,7 @@
int OnMakeCustom()
{
- int HCursor = xutil::SetCursorWait();
+ HCURSOR HCursor = xutil::SetCursorWait();
dw_custom.AcceptText();
int cnt = dw_custom.GetRowCount();
bool cdelement = false;
@@ -2098,17 +2136,17 @@
val = dw_custom.GetItemDouble(i, L"Quantity");
- val += Quantity.round(3);
+ val += xdouble(Quantity).round(3);
double sqty = 0;
sqty = val;
dw_custom.SetItemDouble(i, L"Quantity", val);
val = dw_custom.GetItemDouble(i, L"GW");
- val += GW.round(3);
+ val += xdouble(GW).round(3);
dw_custom.SetItemDouble(i, L"GW", val);
val = dw_custom.GetItemDouble(i, L"NW");
- val += NW.round(3);
+ val += xdouble(NW).round(3);
dw_custom.SetItemDouble(i, L"NW", val);
int nval = dw_custom.GetItemDouble(i, L"Packages");
@@ -2127,30 +2165,30 @@
if (x)
{
- KXMLDOMNode o = x.GetXmlDoc().selectSingleNode(L"data/Item");
+ KXMLDOMNode o = x.selectSingleNode(L"data/Item");
if (o)
{
if (o.selectSingleNode(L"VATRates"))
{
- xstring str1 = o.selectSingleNode(L"VATRates").text;
- if (str1.find(L",L") >= 0) str1 = str1.left(str1.find(L",L"));
+ xstring str1 = o.selectSingleNode(L"VATRates").text();
+ if (str1.find(L",") >= 0) str1 = str1.left(str1.find(L","));
dw_custom.SetItemString(i, L"VATRates", str1);
}
if (o.selectSingleNode(L"CustEName"))
{
- dw_custom.SetItemString(i, L"CustEName", o.selectSingleNode(L"CustEName").text);
+ dw_custom.SetItemString(i, L"CustEName", o.selectSingleNode(L"CustEName").text());
}
if (o.selectSingleNode(L"SupervisionRuler"))
{
- dw_custom.SetItemString(i, L"SupervisionRuler", o.selectSingleNode(L"SupervisionRuler").text);
+ dw_custom.SetItemString(i, L"SupervisionRuler", o.selectSingleNode(L"SupervisionRuler").text());
}
if (o.selectSingleNode(L"VATRefundRate"))
{
- dw_custom.SetItemString(i, L"VATRefundRate", o.selectSingleNode(L"VATRefundRate").text);
+ dw_custom.SetItemString(i, L"VATRefundRate", o.selectSingleNode(L"VATRefundRate").text());
}
if (o.selectSingleNode(L"HSCode"))
{
- xstring hscode = o.selectSingleNode(L"HSCode").text;
+ xstring hscode = o.selectSingleNode(L"HSCode").text();
if (dw_custom.GetItemString(i, L"CustName").find(L"[") >= 0)
{
xstring str = dw_custom.GetItemString(i, L"CustName");
@@ -2162,9 +2200,9 @@
}
if (o.selectSingleNode(L"UOM"))
{
- dw_custom.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text);
- dw_customex.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text);
- xstring uom = o.selectSingleNode(L"UOM").text;
+ dw_custom.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text());
+ dw_customex.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text());
+ xstring uom = o.selectSingleNode(L"UOM").text();
if (uom == L"千克")
{
dw_custom.SetItemString(i, L"LegalQty", dw_custom.GetItemString(i, L"NW"));
@@ -2180,30 +2218,30 @@
xml x= ViewObject::RetrieveData(L"/sale/data/Custom3/custom/classifyinfo",L"ClassifyID",ClassifyID);
if(x)
{
- KXMLDOMNode o = x.GetXmlDoc().selectSingleNode(L"data/Item");
+ KXMLDOMNode o = x.selectSingleNode(L"data/Item");
if(o)
{
if(o.selectSingleNode(L"VATRates"))
{
- xstring str1 = o.selectSingleNode(L"VATRates").text;
- if(str1.find(L",L")) str1 = str1.left(str1.find(L",L"));
+ xstring str1 = o.selectSingleNode(L"VATRates").text();
+ if(str1.find(L",")) str1 = str1.left(str1.find(L","));
dw_custom.SetItemString(i,L"VATRates",str1);
}
if(o.selectSingleNode(L"CustEName"))
{
- dw_custom.SetItemString(i,L"CustEName",o.selectSingleNode(L"CustEName").text);
+ dw_custom.SetItemString(i,L"CustEName",o.selectSingleNode(L"CustEName").text());
}dw_base.SetItemString(1,L"Amount")
if(o.selectSingleNode(L"VATRefundRate"))
{
- dw_custom.SetItemString(i,L"VATRefundRate",o.selectSingleNode(L"VATRefundRate").text);
+ dw_custom.SetItemString(i,L"VATRefundRate",o.selectSingleNode(L"VATRefundRate").text());
}
if(o.selectSingleNode(L"SupervisionRuler"))
{
- dw_custom.SetItemString(i,L"SupervisionRuler",o.selectSingleNode(L"SupervisionRuler").text);
+ dw_custom.SetItemString(i,L"SupervisionRuler",o.selectSingleNode(L"SupervisionRuler").text());
}
if(o.selectSingleNode(L"HSCode"))
{
- xstring hscode = o.selectSingleNode(L"HSCode").text;
+ xstring hscode = o.selectSingleNode(L"HSCode").text();
if(dw_custom.GetItemString(i,L"CustName").find(L"["+hscode)>=0)
{
xstring str = dw_custom.GetItemString(i,L"CustName");
@@ -2214,9 +2252,9 @@
}
if(o.selectSingleNode(L"UOM"))
{
- dw_custom.SetItemString(i,L"LegalUOMCode",o.selectSingleNode(L"UOM").text);
- dw_customex.SetItemString(i,L"LegalUOMCode",o.selectSingleNode(L"UOM").text);
- xstring uom = o.selectSingleNode(L"UOM").text;
+ dw_custom.SetItemString(i,L"LegalUOMCode",o.selectSingleNode(L"UOM").text());
+ dw_customex.SetItemString(i,L"LegalUOMCode",o.selectSingleNode(L"UOM").text());
+ xstring uom = o.selectSingleNode(L"UOM").text();
if(uom==L"千克")
{
dw_custom.SetItemString(i,L"LegalQty",dw_custom.GetItemString(i,L"NW"));
@@ -2238,8 +2276,8 @@
{
if (dw_custom.GetItemString(m, L"UseFlag") == L"0")
{
- if (dw_custom.GetItemString(i, L"ClassifyID") != L"")
- DeleteCDElement(dw_custom.GetItemString(i, L"ClassifyID"));
+ if (dw_custom.GetItemString(m, L"ClassifyID") != L"")
+ DeleteCDElement(dw_custom.GetItemString(m, L"ClassifyID"));
dw_custom.DeleteRow(m);
}
}
@@ -2256,8 +2294,8 @@
xml x = ViewObject::RetrieveData(L"/sale/data/Custom3/custom/classifyelement", L"ClassifyID", ClassifyID);
if (x)
{
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"/GDN/CDElement");
- int lens = items.length;
+ KXMLDOMNodeList items = x.selectNodes(L"/GDN/CDElement");
+ int lens = items.length();
for (int k = 0; k < lens; k++)
{
int row = dw_cdelement.InsertRow(0);
@@ -2267,17 +2305,17 @@
xstring CDLineID = e1.getAttribute(L"guid");
if (CDLineID == L"")
{
- e1.SetAttribute(L"guid", ViewObject::GetGuid());
+ e1.setAttribute(L"guid", ViewObject::GetGuid());
CDLineID = e1.getAttribute(L"guid");
}
dw_cdelement.SetItemString(row, L"CDLineID", CDLineID);
dw_cdelement.SetItemString(row, L"GDNID", dw_base.GetGuid(1));
- if (e.selectSingleNode(L"HSCode")) dw_cdelement.SetItemString(row, L"HSCode", e.selectSingleNode(L"HSCode").text);
- if (e.selectSingleNode(L"SeqNo")) dw_cdelement.SetItemString(row, L"SeqNo", e.selectSingleNode(L"SeqNo").text);
- if (e.selectSingleNode(L"EleName")) dw_cdelement.SetItemString(row, L"EleName", e.selectSingleNode(L"EleName").text);
- if (e.selectSingleNode(L"EleContent")) dw_cdelement.SetItemString(row, L"EleContent", e.selectSingleNode(L"EleContent").text);
- if (e.selectSingleNode(L"CustomName")) dw_cdelement.SetItemString(row, L"CustomName", e.selectSingleNode(L"CustomName").text);
- if (e.selectSingleNode(L"ClassifyID")) dw_cdelement.SetItemString(row, L"ClassifyID", e.selectSingleNode(L"ClassifyID").text);
+ if (e.selectSingleNode(L"HSCode")) dw_cdelement.SetItemString(row, L"HSCode", e.selectSingleNode(L"HSCode").text());
+ if (e.selectSingleNode(L"SeqNo")) dw_cdelement.SetItemString(row, L"SeqNo", e.selectSingleNode(L"SeqNo").text());
+ if (e.selectSingleNode(L"EleName")) dw_cdelement.SetItemString(row, L"EleName", e.selectSingleNode(L"EleName").text());
+ if (e.selectSingleNode(L"EleContent")) dw_cdelement.SetItemString(row, L"EleContent", e.selectSingleNode(L"EleContent").text());
+ if (e.selectSingleNode(L"CustomName")) dw_cdelement.SetItemString(row, L"CustomName", e.selectSingleNode(L"CustomName").text());
+ if (e.selectSingleNode(L"ClassifyID")) dw_cdelement.SetItemString(row, L"ClassifyID", e.selectSingleNode(L"ClassifyID").text());
/*if(e.selectSingleNode(L"EleName"))
{
if(e.selectSingleNode(L"EleName").text==L"品牌类型")
@@ -2325,7 +2363,7 @@
{
if (dw_cdelement.GetRowCount() > 0)
{
- if (win32::MessageBox(GetHWND(), L"更新报关信息会使报关要素无效,是否继续?", L"提示", 1) == 2)
+ if (MessageBoxW(GetHWND(), L"更新报关信息会使报关要素无效,是否继续?", L"提示", 1) == 2)
return 1;
}
int cnt = dw_custom.GetRowCount();
@@ -2435,33 +2473,33 @@
xml x = ViewObject::RetrieveData(L"/sale/data/Custom3/custom/classifyinfoex", L"ClassifyID", ClassifyID);
if (x)
{
- KXMLDOMNode o = x.GetXmlDoc().selectSingleNode(L"data/Item");
+ KXMLDOMNode o = x.selectSingleNode(L"data/Item");
if (o)
{
if (o.selectSingleNode(L"VATRates"))
{
- xstring str1 = o.selectSingleNode(L"VATRates").text;
- if (str1.find(L",L")) str1 = str1.left(str1.find(L",L"));
+ xstring str1 = o.selectSingleNode(L"VATRates").text();
+ if (str1.find(L",")) str1 = str1.left(str1.find(L","));
dw_custom.SetItemString(i, L"VATRates", str1);
dw_customex.SetItemString(i, L"VATRates", str1);
}
if (o.selectSingleNode(L"CustEName"))
{
- dw_custom.SetItemString(i, L"CustEName", o.selectSingleNode(L"CustEName").text);
- dw_customex.SetItemString(i, L"CustEName", o.selectSingleNode(L"CustEName").text);
+ dw_custom.SetItemString(i, L"CustEName", o.selectSingleNode(L"CustEName").text());
+ dw_customex.SetItemString(i, L"CustEName", o.selectSingleNode(L"CustEName").text());
}
if (o.selectSingleNode(L"SupervisionRuler"))
{
- dw_custom.SetItemString(i, L"SupervisionRuler", o.selectSingleNode(L"SupervisionRuler").text);
+ dw_custom.SetItemString(i, L"SupervisionRuler", o.selectSingleNode(L"SupervisionRuler").text());
}
if (o.selectSingleNode(L"VATRefundRate"))
{
- dw_custom.SetItemString(i, L"VATRefundRate", o.selectSingleNode(L"VATRefundRate").text);
- dw_customex.SetItemString(i, L"VATRefundRate", o.selectSingleNode(L"VATRefundRate").text);
+ dw_custom.SetItemString(i, L"VATRefundRate", o.selectSingleNode(L"VATRefundRate").text());
+ dw_customex.SetItemString(i, L"VATRefundRate", o.selectSingleNode(L"VATRefundRate").text());
}
if (o.selectSingleNode(L"HSCode"))
{
- xstring hscode = o.selectSingleNode(L"HSCode").text;
+ xstring hscode = o.selectSingleNode(L"HSCode").text();
if (dw_custom.GetItemString(i, L"CustName").find(L"[" + hscode) >= 0)
{
xstring str = dw_custom.GetItemString(i, L"CustName");
@@ -2475,9 +2513,9 @@
}
if (o.selectSingleNode(L"UOM"))
{
- dw_custom.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text);
- dw_customex.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text);
- xstring uom = o.selectSingleNode(L"UOM").text;
+ dw_custom.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text());
+ dw_customex.SetItemString(i, L"LegalUOMCode", o.selectSingleNode(L"UOM").text());
+ xstring uom = o.selectSingleNode(L"UOM").text();
if (uom == L"千克")
{
dw_custom.SetItemString(i, L"LegalQty", dw_custom.GetItemString(i, L"NW"));
@@ -2502,18 +2540,19 @@
int OnAddSourcingItem()
{
- xaserverarg arg = GDNView::MakeArg();
+ xaserverarg arg ;
arg.AddArg(L"InvoiceNo", dw_base.GetItemString(1, L"InvoiceNo"));
int p = arg;
OpenWindow(L"dev:xpage[select.item.po.vx]", p);
+
xstring str = arg.GetArgString(L"items");
if (str != L"")
{
xml x;
- x.LoadXml(str);
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"data/Item");
- int len = items.length;
+ x.loadXML(str);
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
+ int len = items.length();
int row = 0;
for (int i = 0; i < len; i++)
{
@@ -2527,32 +2566,32 @@
}
KXMLDOMNode t = items.item(i);
- if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text);
- if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text);
- if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text);
- if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text);
+ if (t.selectSingleNode(L"PONo"))dw_source.SetItemString(row, L"PONo", t.selectSingleNode(L"PONo").text());
+ if (t.selectSingleNode(L"POItemID"))dw_source.SetItemString(row, L"POItemID", t.selectSingleNode(L"POItemID").text());
+ if (t.selectSingleNode(L"SOLineID"))dw_source.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text());
+ if (t.selectSingleNode(L"GDNLineID"))dw_source.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text());
- if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text);
+ if (t.selectSingleNode(L"GDNID"))dw_source.SetItemString(row, L"GDNID", t.selectSingleNode(L"GDNID").text());
- if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text);
- if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text);
- if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text);
- if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text);
- if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text);
- if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text);
- if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text);
- if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text);
- if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text);
- if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"POSupplierID").text);
- if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text);
- if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text);
- if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemDisplayString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text);
- if (t.selectSingleNode(L"Amount"))dw_source.SetItemDisplayString(row, L"Amount", t.selectSingleNode(L"Amount").text);
- if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text);
- if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text);
- if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemDisplayString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text);
- if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemDisplayString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text);
- //if(t.selectSingleNode(L"HSCode"))dw_source.SetItemDisplayString(row,L"HSCode",t.selectSingleNode(L"HSCode").text);
+ if (t.selectSingleNode(L"GoodsNo"))dw_source.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text());
+ if (t.selectSingleNode(L"GDNQuantity"))dw_source.SetItemString(row, L"GDNQuantity", t.selectSingleNode(L"GDNQuantity").text());
+ if (t.selectSingleNode(L"BuyQuantity"))dw_source.SetItemString(row, L"BuyQuantity", t.selectSingleNode(L"BuyQuantity").text());
+ if (t.selectSingleNode(L"CName"))dw_source.SetItemString(row, L"CName", t.selectSingleNode(L"CName").text());
+ if (t.selectSingleNode(L"CustomerItemNo"))dw_source.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text());
+ if (t.selectSingleNode(L"BOMPart"))dw_source.SetItemString(row, L"BOMPart", t.selectSingleNode(L"BOMPart").text());
+ if (t.selectSingleNode(L"ItemID"))dw_source.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text());
+ if (t.selectSingleNode(L"BuyUnitPrice"))dw_source.SetItemString(row, L"BuyUnitPrice", t.selectSingleNode(L"BuyUnitPrice").text());
+ if (t.selectSingleNode(L"BuyAmount"))dw_source.SetItemString(row, L"BuyAmount", t.selectSingleNode(L"BuyAmount").text());
+ if (t.selectSingleNode(L"SupplierID"))dw_source.SetItemString(row, L"SupplierID", t.selectSingleNode(L"POSupplierID").text());
+ if (t.selectSingleNode(L"SupplierID/@_displaystring"))dw_source.SetItemDisplayString(row, L"SupplierID", t.selectSingleNode(L"SupplierID/@_displaystring").text());
+ if (t.selectSingleNode(L"HasVATInvoice"))dw_source.SetItemDisplayString(row, L"HasVATInvoice", t.selectSingleNode(L"HasVATInvoice").text());
+ if (t.selectSingleNode(L"VATRefundRate"))dw_source.SetItemDisplayString(row, L"VATRefundRate", t.selectSingleNode(L"VATRefundRate").text());
+ if (t.selectSingleNode(L"Amount"))dw_source.SetItemDisplayString(row, L"Amount", t.selectSingleNode(L"Amount").text());
+ if (t.selectSingleNode(L"POCreatorID"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID").text());
+ if (t.selectSingleNode(L"POCreatorID/@_displaystring"))dw_source.SetItemDisplayString(row, L"POCreatorID", t.selectSingleNode(L"POCreatorID/@_displaystring").text());
+ if (t.selectSingleNode(L"Swapthecost"))dw_source.SetItemDisplayString(row, L"Swapthecost", t.selectSingleNode(L"Swapthecost").text());
+ if (t.selectSingleNode(L"RefundAmount"))dw_source.SetItemDisplayString(row, L"RefundAmount", t.selectSingleNode(L"RefundAmount").text());
+ //if(t.selectSingleNode(L"HSCode"))dw_source.SetItemDisplayString(row,L"HSCode",t.selectSingleNode(L"HSCode").text());
}
CalcProfit();
}
@@ -2576,9 +2615,9 @@
trace(str);
xml x;
- x.LoadXml(str);
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"data/Item");
- int len = items.length;
+ x.loadXML(str);
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
+ int len = items.length();
int row = 0;
xstring SONos = dw_base.GetItemString(1, L"SONos");
xstring OrderNos = dw_base.GetItemString(1, L"OrderNos");
@@ -2600,13 +2639,14 @@
row = dw_item.InsertRow(0);
}
KXMLDOMNode t = items.item(i);
- dw_item.SetItemString(row, L"SeqNo", (row * 10).toString());
+ dw_item.SetItemString(row, L"SeqNo", xstring((row * 10)));
dw_item.SetItemString(row, L"GDNID", dw_base.GetGuid(1));
- double cost = t.selectSingleNode(L"Cost").text.toDouble();
+ double cost = xstring(t.selectSingleNode(L"Cost").text()).toDouble();
+
if (t.selectSingleNode(L"SONo"))
{
- xstring SONo = t.selectSingleNode(L"SONo").text;
+ xstring SONo = t.selectSingleNode(L"SONo").text();
if (SONos == L"")
{
SONos = SONo;
@@ -2614,22 +2654,22 @@
}
else if (SONos.find(SONo) < 0)
{
- SONos += L",L" + SONo;
+ SONos += L"," + SONo;
costs += cost;
}
}
if (t.selectSingleNode(L"CustomerPONo"))
{
- xstring CustomerPONo = t.selectSingleNode(L"CustomerPONo").text;
+ xstring CustomerPONo = t.selectSingleNode(L"CustomerPONo").text();
if (OrderNos == L"")
OrderNos = CustomerPONo;
- else if (OrderNos.find(CustomerPONo) < 0) OrderNos += L",L" + CustomerPONo;
+ else if (OrderNos.find(CustomerPONo) < 0) OrderNos += L"," + CustomerPONo;
}
if (t.selectSingleNode(L"OperationTips"))
{
- xstring OperationTips = t.selectSingleNode(L"OperationTips").text;
+ xstring OperationTips = t.selectSingleNode(L"OperationTips").text();
if (OperationTipss == L"")
OperationTipss = OperationTips;
else if (OperationTipss.find(OperationTips) < 0) OperationTipss += L"\r\n" + OperationTips;
@@ -2637,86 +2677,91 @@
if (t.selectSingleNode(L"FrontMarks"))
{
- xstring FrontMarks = t.selectSingleNode(L"FrontMarks").text;
+ xstring FrontMarks = t.selectSingleNode(L"FrontMarks").text();
if (FrontMarkss == L"")
FrontMarkss = FrontMarks;
else if (FrontMarkss.find(FrontMarks) < 0) FrontMarkss += L"\r\n" + FrontMarks;
}
//int cost = t.selectSingleNode(L"Cost").text.toDouble();
- //dw_base.SetItemString(1,L"Cost",t.selectSingleNode(L"Cost").text);
- if (t.selectSingleNode(L"SalespersonID/@_displaystring"))dw_base.SetItemDisplayString(1, L"SalespersonID", t.selectSingleNode(L"SalespersonID/@_displaystring").text);
- if (t.selectSingleNode(L"SalespersonID"))dw_base.SetItemString(1, L"SalespersonID", t.selectSingleNode(L"SalespersonID").text);
- if (t.selectSingleNode(L"CustomerID"))dw_base.SetItemString(1, L"CustomerID", t.selectSingleNode(L"CustomerID").text);
- if (t.selectSingleNode(L"CustomerID/@_displaystring"))dw_base.SetItemDisplayString(1, L"CustomerID", t.selectSingleNode(L"CustomerID/@_displaystring").text);
+ //dw_base.SetItemString(1,L"Cost",t.selectSingleNode(L"Cost").text());
+ if (t.selectSingleNode(L"SalespersonID/@_displaystring"))dw_base.SetItemDisplayString(1, L"SalespersonID", t.selectSingleNode(L"SalespersonID/@_displaystring").text());
+ if (t.selectSingleNode(L"SalespersonID"))dw_base.SetItemString(1, L"SalespersonID", t.selectSingleNode(L"SalespersonID").text());
+ if (t.selectSingleNode(L"CustomerID"))dw_base.SetItemString(1, L"CustomerID", t.selectSingleNode(L"CustomerID").text());
+ if (t.selectSingleNode(L"CustomerID/@_displaystring"))dw_base.SetItemDisplayString(1, L"CustomerID", t.selectSingleNode(L"CustomerID/@_displaystring").text());
+
+ if (t.selectSingleNode(L"UOCCode"))dw_base.SetItemString(1, L"UOCCode", t.selectSingleNode(L"UOCCode").text());
+ if (t.selectSingleNode(L"ApprovalIimit"))dw_base.SetItemString(1, L"ApprovalIimit", t.selectSingleNode(L"ApprovalIimit").text());
+ if (t.selectSingleNode(L"InsuranceRateEx"))dw_base.SetItemString(1, L"InsuranceRateEx", t.selectSingleNode(L"InsuranceRateEx").text());
+ if (t.selectSingleNode(L"AvailableIimits"))dw_base.SetItemString(1, L"AvailableIimits", t.selectSingleNode(L"AvailableIimits").text());
//trace(L"*****************");
- if (t.selectSingleNode(L"LCNo"))dw_base.SetItemString(1, L"LCNo", t.selectSingleNode(L"LCNo").text);
- if (t.selectSingleNode(L"LCSignDate"))dw_base.SetItemString(1, L"LCSignDate", t.selectSingleNode(L"LCSignDate").text);
- if (t.selectSingleNode(L"LCReceiveDate"))dw_base.SetItemString(1, L"LCReceiveDate", t.selectSingleNode(L"LCReceiveDate").text);
- if (t.selectSingleNode(L"DraftPayer"))dw_base.SetItemString(1, L"DraftPayer", t.selectSingleNode(L"DraftPayer").text);
- if (t.selectSingleNode(L"NegotiatingBank"))dw_base.SetItemString(1, L"NegotiatingBank", t.selectSingleNode(L"NegotiatingBank").text);
- if (t.selectSingleNode(L"DraftTerm"))dw_base.SetItemString(1, L"DraftTerm", t.selectSingleNode(L"DraftTerm").text);
- if (t.selectSingleNode(L"CustomerDesc"))dw_base.SetItemString(1, L"CustomerDesc", t.selectSingleNode(L"CustomerDesc").text);
- if (t.selectSingleNode(L"LCSigner"))dw_base.SetItemString(1, L"LCSigner", t.selectSingleNode(L"LCSigner").text);
- if (t.selectSingleNode(L"Consignee"))dw_base.SetItemString(1, L"Consignee", t.selectSingleNode(L"Consignee").text);
- if (t.selectSingleNode(L"NotifyParty"))dw_base.SetItemString(1, L"NotifyParty", t.selectSingleNode(L"NotifyParty").text);
- if (t.selectSingleNode(L"Country"))dw_base.SetItemString(1, L"Country", t.selectSingleNode(L"Country").text);
- if (t.selectSingleNode(L"CountryName"))dw_base.SetItemDisplayString(1, L"Country", t.selectSingleNode(L"CountryName").text);
- if (t.selectSingleNode(L"TradeType"))dw_base.SetItemString(1, L"TradeType", t.selectSingleNode(L"TradeType").text);
- if (t.selectSingleNode(L"TradeTypeName"))dw_base.SetItemDisplayString(1, L"TradeType", t.selectSingleNode(L"TradeTypeName").text);
- if (t.selectSingleNode(L"TransportMode"))dw_base.SetItemString(1, L"TransportMode", t.selectSingleNode(L"TransportMode").text);
- if (t.selectSingleNode(L"TransportModeName"))dw_base.SetItemDisplayString(1, L"TransportMode", t.selectSingleNode(L"TransportModeName").text);
- if (t.selectSingleNode(L"POL"))dw_base.SetItemString(1, L"POL", t.selectSingleNode(L"POL").text);
- if (t.selectSingleNode(L"PriceTerm"))dw_base.SetItemString(1, L"PriceTerm", t.selectSingleNode(L"PriceTerm").text);
- if (t.selectSingleNode(L"PaymentTerm"))dw_base.SetItemString(1, L"PaymentTerm", t.selectSingleNode(L"PaymentTerm").text);
- if (t.selectSingleNode(L"PaymentTermMore"))dw_base.SetItemString(1, L"PaymentTermMore", t.selectSingleNode(L"PaymentTermMore").text);
+ if (t.selectSingleNode(L"LCNo"))dw_base.SetItemString(1, L"LCNo", t.selectSingleNode(L"LCNo").text());
+ if (t.selectSingleNode(L"LCSignDate"))dw_base.SetItemString(1, L"LCSignDate", t.selectSingleNode(L"LCSignDate").text());
+ if (t.selectSingleNode(L"LCReceiveDate"))dw_base.SetItemString(1, L"LCReceiveDate", t.selectSingleNode(L"LCReceiveDate").text());
+ if (t.selectSingleNode(L"DraftPayer"))dw_base.SetItemString(1, L"DraftPayer", t.selectSingleNode(L"DraftPayer").text());
+ if (t.selectSingleNode(L"NegotiatingBank"))dw_base.SetItemString(1, L"NegotiatingBank", t.selectSingleNode(L"NegotiatingBank").text());
+ if (t.selectSingleNode(L"DraftTerm"))dw_base.SetItemString(1, L"DraftTerm", t.selectSingleNode(L"DraftTerm").text());
+ if (t.selectSingleNode(L"CustomerDesc"))dw_base.SetItemString(1, L"CustomerDesc", t.selectSingleNode(L"CustomerDesc").text());
+ if (t.selectSingleNode(L"LCSigner"))dw_base.SetItemString(1, L"LCSigner", t.selectSingleNode(L"LCSigner").text());
+ if (t.selectSingleNode(L"Consignee"))dw_base.SetItemString(1, L"Consignee", t.selectSingleNode(L"Consignee").text());
+ if (t.selectSingleNode(L"NotifyParty"))dw_base.SetItemString(1, L"NotifyParty", t.selectSingleNode(L"NotifyParty").text());
+ if (t.selectSingleNode(L"Country"))dw_base.SetItemString(1, L"Country", t.selectSingleNode(L"Country").text());
+ if (t.selectSingleNode(L"CountryName"))dw_base.SetItemDisplayString(1, L"Country", t.selectSingleNode(L"CountryName").text());
+ if (t.selectSingleNode(L"TradeType"))dw_base.SetItemString(1, L"TradeType", t.selectSingleNode(L"TradeType").text());
+ if (t.selectSingleNode(L"TradeTypeName"))dw_base.SetItemDisplayString(1, L"TradeType", t.selectSingleNode(L"TradeTypeName").text());
+ if (t.selectSingleNode(L"TransportMode"))dw_base.SetItemString(1, L"TransportMode", t.selectSingleNode(L"TransportMode").text());
+ if (t.selectSingleNode(L"TransportModeName"))dw_base.SetItemDisplayString(1, L"TransportMode", t.selectSingleNode(L"TransportModeName").text());
+ if (t.selectSingleNode(L"POL"))dw_base.SetItemString(1, L"POL", t.selectSingleNode(L"POL").text());
+ if (t.selectSingleNode(L"PriceTerm"))dw_base.SetItemString(1, L"PriceTerm", t.selectSingleNode(L"PriceTerm").text());
+ if (t.selectSingleNode(L"PaymentTerm"))dw_base.SetItemString(1, L"PaymentTerm", t.selectSingleNode(L"PaymentTerm").text());
+ if (t.selectSingleNode(L"PaymentTermMore"))dw_base.SetItemString(1, L"PaymentTermMore", t.selectSingleNode(L"PaymentTermMore").text());
- if (t.selectSingleNode(L"SOLineID"))dw_item.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text);
- if (t.selectSingleNode(L"GoodsNo"))dw_item.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text);
- if (t.selectSingleNode(L"EName"))dw_item.SetItemString(row, L"EName", t.selectSingleNode(L"EName").text);
- if (t.selectSingleNode(L"CustomerItemNo"))dw_item.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text);
- if (t.selectSingleNode(L"ItemID"))dw_item.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text);
- if (t.selectSingleNode(L"UnitPrice"))dw_item.SetItemString(row, L"UnitPrice", t.selectSingleNode(L"UnitPrice").text);
- if (t.selectSingleNode(L"GDNLineID"))dw_item.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text);
+ if (t.selectSingleNode(L"SOLineID"))dw_item.SetItemString(row, L"SOLineID", t.selectSingleNode(L"SOLineID").text());
+ if (t.selectSingleNode(L"GoodsNo"))dw_item.SetItemString(row, L"GoodsNo", t.selectSingleNode(L"GoodsNo").text());
+ if (t.selectSingleNode(L"EName"))dw_item.SetItemString(row, L"EName", t.selectSingleNode(L"EName").text());
+ if (t.selectSingleNode(L"CustomerItemNo"))dw_item.SetItemString(row, L"CustomerItemNo", t.selectSingleNode(L"CustomerItemNo").text());
+ if (t.selectSingleNode(L"ItemID"))dw_item.SetItemString(row, L"ItemID", t.selectSingleNode(L"ItemID").text());
+ if (t.selectSingleNode(L"UnitPrice"))dw_item.SetItemString(row, L"UnitPrice", t.selectSingleNode(L"UnitPrice").text());
+ if (t.selectSingleNode(L"GDNLineID"))dw_item.SetItemString(row, L"GDNLineID", t.selectSingleNode(L"GDNLineID").text());
- if (t.selectSingleNode(L"SONo"))dw_item.SetItemString(row, L"SONo", t.selectSingleNode(L"SONo").text);
+ if (t.selectSingleNode(L"SONo"))dw_item.SetItemString(row, L"SONo", t.selectSingleNode(L"SONo").text());
- if (t.selectSingleNode(L"SOLineNo"))dw_item.SetItemString(row, L"SOLineNo", t.selectSingleNode(L"SOLineNo").text);
- if (t.selectSingleNode(L"CustomerPONo"))dw_item.SetItemString(row, L"PONo", t.selectSingleNode(L"CustomerPONo").text);
- if (t.selectSingleNode(L"GroupNo"))dw_item.SetItemString(row, L"PONo", t.selectSingleNode(L"GroupNo").text);
+ if (t.selectSingleNode(L"SOLineNo"))dw_item.SetItemString(row, L"SOLineNo", t.selectSingleNode(L"SOLineNo").text());
+ if (t.selectSingleNode(L"CustomerPONo"))dw_item.SetItemString(row, L"PONo", t.selectSingleNode(L"CustomerPONo").text());
+ if (t.selectSingleNode(L"GroupNo"))dw_item.SetItemString(row, L"PONo", t.selectSingleNode(L"GroupNo").text());
- if (t.selectSingleNode(L"SKUNo"))dw_item.SetItemString(row, L"SKUNo", t.selectSingleNode(L"SKUNo").text);
- if (t.selectSingleNode(L"Packing"))dw_item.SetItemString(row, L"Packing", t.selectSingleNode(L"Packing").text);
- if (t.selectSingleNode(L"InnerQty"))dw_item.SetItemString(row, L"InnerQty", t.selectSingleNode(L"InnerQty").text);
- if (t.selectSingleNode(L"PackingRate"))dw_item.SetItemString(row, L"PackingRate", t.selectSingleNode(L"PackingRate").text);
- if (t.selectSingleNode(L"Brand"))dw_item.SetItemString(row, L"Brand", t.selectSingleNode(L"Brand").text);
- if (t.selectSingleNode(L"UOMCode"))dw_item.SetItemString(row, L"UOMCode", t.selectSingleNode(L"UOMCode").text);
- if (t.selectSingleNode(L"UOMCode/@_displaystring"))dw_item.SetItemDisplayString(row, L"UOMCode", t.selectSingleNode(L"UOMCode/@_displaystring").text);
+ if (t.selectSingleNode(L"SKUNo"))dw_item.SetItemString(row, L"SKUNo", t.selectSingleNode(L"SKUNo").text());
+ if (t.selectSingleNode(L"Packing"))dw_item.SetItemString(row, L"Packing", t.selectSingleNode(L"Packing").text());
+ if (t.selectSingleNode(L"InnerQty"))dw_item.SetItemString(row, L"InnerQty", t.selectSingleNode(L"InnerQty").text());
+ if (t.selectSingleNode(L"PackingRate"))dw_item.SetItemString(row, L"PackingRate", t.selectSingleNode(L"PackingRate").text());
+ if (t.selectSingleNode(L"Brand"))dw_item.SetItemString(row, L"Brand", t.selectSingleNode(L"Brand").text());
+ if (t.selectSingleNode(L"UOMCode"))dw_item.SetItemString(row, L"UOMCode", t.selectSingleNode(L"UOMCode").text());
+ if (t.selectSingleNode(L"UOMCode/@_displaystring"))dw_item.SetItemDisplayString(row, L"UOMCode", t.selectSingleNode(L"UOMCode/@_displaystring").text());
- if (t.selectSingleNode(L"KOPCode"))dw_item.SetItemString(row, L"KOPCode", t.selectSingleNode(L"KOPCode").text);
- if (t.selectSingleNode(L"KOPCode/@_displaystring"))dw_item.SetItemDisplayString(row, L"KOPCode", t.selectSingleNode(L"KOPCode/@_displaystring").text);
- if (t.selectSingleNode(L"PackageL"))dw_item.SetItemString(row, L"PackageL", t.selectSingleNode(L"PackageL").text);
- if (t.selectSingleNode(L"PackageW"))dw_item.SetItemString(row, L"PackageW", t.selectSingleNode(L"PackageW").text);
- if (t.selectSingleNode(L"PackageH"))dw_item.SetItemString(row, L"PackageH", t.selectSingleNode(L"PackageH").text);
- if (t.selectSingleNode(L"GWPerPkg"))dw_item.SetItemString(row, L"GWPerPkg", t.selectSingleNode(L"GWPerPkg").text);
- if (t.selectSingleNode(L"NWPerPkg"))dw_item.SetItemString(row, L"NWPerPkg", t.selectSingleNode(L"NWPerPkg").text);
- if (t.selectSingleNode(L"ClassifyID"))dw_item.SetItemString(row, L"ClassifyID", t.selectSingleNode(L"ClassifyID").text);
- if (t.selectSingleNode(L"ClassifyID/@_displaystring"))dw_item.SetItemDisplayString(row, L"ClassifyID", t.selectSingleNode(L"ClassifyID/@_displaystring").text);
- if (t.selectSingleNode(L"Remarks"))dw_item.SetItemString(row, L"Remarks", t.selectSingleNode(L"Remarks").text);
+ if (t.selectSingleNode(L"KOPCode"))dw_item.SetItemString(row, L"KOPCode", t.selectSingleNode(L"KOPCode").text());
+ if (t.selectSingleNode(L"KOPCode/@_displaystring"))dw_item.SetItemDisplayString(row, L"KOPCode", t.selectSingleNode(L"KOPCode/@_displaystring").text());
+ if (t.selectSingleNode(L"PackageL"))dw_item.SetItemString(row, L"PackageL", t.selectSingleNode(L"PackageL").text());
+ if (t.selectSingleNode(L"PackageW"))dw_item.SetItemString(row, L"PackageW", t.selectSingleNode(L"PackageW").text());
+ if (t.selectSingleNode(L"PackageH"))dw_item.SetItemString(row, L"PackageH", t.selectSingleNode(L"PackageH").text());
+ if (t.selectSingleNode(L"GWPerPkg"))dw_item.SetItemString(row, L"GWPerPkg", t.selectSingleNode(L"GWPerPkg").text());
+ if (t.selectSingleNode(L"NWPerPkg"))dw_item.SetItemString(row, L"NWPerPkg", t.selectSingleNode(L"NWPerPkg").text());
+ if (t.selectSingleNode(L"ClassifyID"))dw_item.SetItemString(row, L"ClassifyID", t.selectSingleNode(L"ClassifyID").text());
+ if (t.selectSingleNode(L"ClassifyID/@_displaystring"))dw_item.SetItemDisplayString(row, L"ClassifyID", t.selectSingleNode(L"ClassifyID/@_displaystring").text());
+ if (t.selectSingleNode(L"Remarks"))dw_item.SetItemString(row, L"Remarks", t.selectSingleNode(L"Remarks").text());
- if (t.selectSingleNode(L"UnitCommPrice"))dw_item.SetItemString(row, L"UnitCommPrice", t.selectSingleNode(L"UnitCommPrice").text);
- if (t.selectSingleNode(L"MiddlemanAmount"))dw_item.SetItemString(row, L"MiddlemanAmount", t.selectSingleNode(L"MiddlemanAmount").text);
+ if (t.selectSingleNode(L"UnitCommPrice"))dw_item.SetItemString(row, L"UnitCommPrice", t.selectSingleNode(L"UnitCommPrice").text());
+ if (t.selectSingleNode(L"MiddlemanAmount"))dw_item.SetItemString(row, L"MiddlemanAmount", t.selectSingleNode(L"MiddlemanAmount").text());
if (t.selectSingleNode(L"ShipQuantity"))
- dw_item.ItemChangeTo(row, L"Quantity", t.selectSingleNode(L"ShipQuantity").text);
+ dw_item.ItemChangeTo(row, L"Quantity", t.selectSingleNode(L"ShipQuantity").text());
else
- if (t.selectSingleNode(L"Quantity"))dw_item.ItemChangeTo(row, L"Quantity", t.selectSingleNode(L"Quantity").text);
+ if (t.selectSingleNode(L"Quantity"))dw_item.ItemChangeTo(row, L"Quantity", t.selectSingleNode(L"Quantity").text());
double d1 = dw_item.GetItemDouble(row, L"Quantity");
double d2 = dw_item.GetItemDouble(row, L"UnitPrice");
double d = d1 * d2;
- d = d.round(2);
+ d = xdouble(d).round(2);
dw_item.SetItemDouble(row, L"Amount", d);
double UnitCommPrice = dw_item.GetItemDouble(row, L"UnitCommPrice");
@@ -2726,7 +2771,7 @@
double MiddlemanAmountRate = MiddlemanAmount * Quantity;
PrivateCommissionAmount += ResearchCommission;
PrivateCommissionAmountEx += MiddlemanAmountRate;
- //if(t.selectSingleNode(L"Amount"))dw_item.SetItemString(row,L"Amount",t.selectSingleNode(L"Amount").text);
+ //if(t.selectSingleNode(L"Amount"))dw_item.SetItemString(row,L"Amount",t.selectSingleNode(L"Amount").text());
RefreshSourcingItem(row, false);
@@ -2739,7 +2784,7 @@
dw_base.SetItemString(1, L"Mark", FrontMarkss);
double CostEx = dw_base.GetItemDouble(1, L"Cost");
- if (CostEx == 0 || CostEx == L"")
+ if (CostEx == 0)
{
if (costs >= 0) {
dw_base.SetItemString(1, L"CostMoreLess", L"1");
@@ -2765,14 +2810,13 @@
int OnAddGDNItem()
{
//trace(L"12313");
- xaserverarg arg = GDNView::MakeArg();
+ xaserverarg arg ;
arg.AddArg(L"CustomerID", dw_base.GetItemString(1, L"CustomerID"));
arg.AddArg(L"InvoiceNo", dw_base.GetItemString(1, L"InvoiceNo"));
arg.AddArg(L"SONo", dw_base.GetItemString(1, L""));
- int p = arg;
if (dw_base.GetItemString(1, L"CustomerID") == L"")
{
- OpenWindow(L"dev:xpage[SelectItem.New.GDN.vx]", cast(arg as int));
+ OpenWindow(L"dev:xpage[SelectItem.New.GDN.vx]", arg);
if (dw_base.GetItemString(1, L"CustomerID") == L"")
{
dw_base.SetItemDisplayString(1, L"CustomerID", arg.GetArgString(L"PartyName"));
@@ -2783,7 +2827,7 @@
}
else
{
- OpenWindow(L"dev:xpage[select.gdnitem.so.vx]", p);
+ OpenWindow(L"dev:xpage[select.gdnitem.so.vx]", arg);
}
xstring str = arg.GetArgString(L"items");
@@ -2800,7 +2844,7 @@
xstring CDLineID = e1.getAttribute(L"guid");
if (CDLineID == L"")
{
- e1.SetAttribute(L"guid", ViewObject::GetGuid());
+ e1.setAttribute(L"guid", ViewObject::GetGuid());
CDLineID = e1.getAttribute(L"guid");
}
@@ -2831,8 +2875,8 @@
xml x = ViewObject::RetrieveData(L"/sale/data/Custom3/custom/classifyelement", L"ClassifyID", ClassifyID);
if (x)
{
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"/GDN/CDElement");
- int lens = items.length;
+ KXMLDOMNodeList items = x.selectNodes(L"/GDN/CDElement");
+ int lens = items.length();
for (int k = 0; k < lens; k++)
{
int row = dw_cdelement.InsertRow(0);
@@ -2842,15 +2886,15 @@
xstring CDLineID = e1.getAttribute(L"guid");
if (CDLineID == L"")
{
- e1.SetAttribute(L"guid", ViewObject::GetGuid());
+ e1.setAttribute(L"guid", ViewObject::GetGuid());
CDLineID = e1.getAttribute(L"guid");
}
dw_cdelement.SetItemString(row, L"CDLineID", CDLineID);
dw_cdelement.SetItemString(row, L"GDNID", dw_base.GetGuid(1));
- if (e.selectSingleNode(L"HSCode")) dw_cdelement.SetItemString(row, L"HSCode", e.selectSingleNode(L"HSCode").text);
- if (e.selectSingleNode(L"SeqNo")) dw_cdelement.SetItemString(row, L"SeqNo", e.selectSingleNode(L"SeqNo").text);
- if (e.selectSingleNode(L"EleName")) dw_cdelement.SetItemString(row, L"EleName", e.selectSingleNode(L"EleName").text);
- if (e.selectSingleNode(L"EleContent")) dw_cdelement.SetItemString(row, L"EleContent", e.selectSingleNode(L"EleContent").text);
+ if (e.selectSingleNode(L"HSCode")) dw_cdelement.SetItemString(row, L"HSCode", e.selectSingleNode(L"HSCode").text());
+ if (e.selectSingleNode(L"SeqNo")) dw_cdelement.SetItemString(row, L"SeqNo", e.selectSingleNode(L"SeqNo").text());
+ if (e.selectSingleNode(L"EleName")) dw_cdelement.SetItemString(row, L"EleName", e.selectSingleNode(L"EleName").text());
+ if (e.selectSingleNode(L"EleContent")) dw_cdelement.SetItemString(row, L"EleContent", e.selectSingleNode(L"EleContent").text());
/*if(e.selectSingleNode(L"EleName"))
{
if(e.selectSingleNode(L"EleName").text==L"品牌类型")
@@ -2879,8 +2923,8 @@
}
}
}*/
- if (e.selectSingleNode(L"CustomName")) dw_cdelement.SetItemString(row, L"CustomName", e.selectSingleNode(L"CustomName").text);
- if (e.selectSingleNode(L"ClassifyID")) dw_cdelement.SetItemString(row, L"ClassifyID", e.selectSingleNode(L"ClassifyID").text);
+ if (e.selectSingleNode(L"CustomName")) dw_cdelement.SetItemString(row, L"CustomName", e.selectSingleNode(L"CustomName").text());
+ if (e.selectSingleNode(L"ClassifyID")) dw_cdelement.SetItemString(row, L"ClassifyID", e.selectSingleNode(L"ClassifyID").text());
}
}
}
@@ -2908,7 +2952,7 @@
}
else if (SONo_s.find(SONo) < 0)
{
- SONo_s += L",L" + SONo;
+ SONo_s += L"," + SONo;
}
xstring PONo = dw_item.GetItemString(k, L"PONo");
if (PONo_s == L"")
@@ -2917,7 +2961,7 @@
}
else if (PONo_s.find(PONo) < 0)
{
- PONo_s += L",L" + PONo;
+ PONo_s += L"," + PONo;
}
}
dw_base.SetItemString(1, L"OrderNos", PONo_s);
@@ -2945,13 +2989,14 @@
}
if (comdid == L"xmSearch")
{
- xaserverarg arg1 = new xaserverarg;
- arg1.setNativePointer(arg1.CreateInstance());
+
+ xaserverarg& arg1 = *new xaserverarg;
+
arg1.AddArg(L"text", searchStr);
if (tabname == L"sourcing")
{
- OpenWindow(L"dev:xpage[search.dialog.vx]", cast(arg1 as int));
+ OpenWindow(L"dev:xpage[search.dialog.vx]", (LPARAM)&arg1);
xstring str = arg1.GetArgString(L"text");
searchStr = str;
dw_source.Filter(L"*", searchStr);
@@ -2959,8 +3004,8 @@
}
else if (tabname == L"goods")
{
- OpenWindow(L"dev:xpage[search.dialog.vx]", cast(arg1 as int));
- str = arg1.GetArgString(L"text");
+ OpenWindow(L"dev:xpage[search.dialog.vx]", (LPARAM)&arg1);
+ xstring str = arg1.GetArgString(L"text");
searchStr = str;
dw_item.Filter(L"*", searchStr);
return 1;
@@ -2971,11 +3016,11 @@
if (comdid == L"action:bill.GDNDelay")
{
xstring EntityIDEx = dw_base.GetGuid(1);
- xaserverarg argEx = new xaserverarg;
- argEx.setNativePointer(argEx.CreateInstance());
+ xaserverarg& argEx = *new xaserverarg;
+
trace(EntityIDEx);
argEx.AddArg(L"GDNID", EntityIDEx);
- OpenWindow(L"dev:xpage[GDNDelay.vx]", cast(argEx as int));
+ OpenWindow(L"dev:xpage[GDNDelay.vx]", (LPARAM)&argEx);
return 1;
}
if (comdid == L"action:bill.Volume")
@@ -2987,7 +3032,7 @@
{
xstring EntityID1 = dw_base.GetGuid(1);
xml x1 = ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNJudge", L"GDNID", EntityID1);
- xstring Results1 = x1.GetXmlDoc().text;
+ xstring Results1 = x1.text();
if (Results1 != L"")
{
alert(Results1);
@@ -3019,7 +3064,7 @@
xstring EntityID = dw_base.GetGuid(1);
xml xx = ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNJudge", L"GDNID", EntityID);
- xstring Results = xx.GetXmlDoc().text;
+ xstring Results = xx.text();
if (Results != L"")
{
alert(Results);
@@ -3027,7 +3072,7 @@
}
xml xx1 = ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNJudgeEx", L"GDNID", EntityID);
- xstring Results2 = xx1.GetXmlDoc().text;
+ xstring Results2 = xx1.text();
if (Results2 != L"")
{
alert(Results2);
@@ -3035,7 +3080,7 @@
}
xml xx3 = ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNJudgeExS", L"GDNID", EntityID);
- xstring Results3 = xx3.GetXmlDoc().text;
+ xstring Results3 = xx3.text();
if (Results3 != L"")
{
alert(Results3);
@@ -3043,7 +3088,7 @@
}
xml xx4 = ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNJudgeAmount", L"GDNID", EntityID);
- xstring Results4 = xx4.GetXmlDoc().text;
+ xstring Results4 = xx4.text();
if (Results4 != L"")
{
alert(Results4);
@@ -3051,18 +3096,18 @@
}
/* xml xx5= ViewObject::RetrieveData(L"/sale/data/GDN/GetGDNCost",L"GDNID",EntityID);
- xstring Results5=xx5.GetXmlDoc().text;
+ xstring Results5=xx5.text();
if(Results5 !=L"")
{
alert(Results5);
return 0;
}*/
- xaserverarg arg7 = new xaserverarg;
- arg7.setNativePointer(arg7.CreateInstance());
+ xaserverarg& arg7 = *new xaserverarg;
+
trace(EntityID);
arg7.AddArg(L"GDNID", EntityID);
- OpenWindow(L"dev:xpage[GDNDelay.vx]", cast(arg7 as int));
+ OpenWindow(L"dev:xpage[GDNDelay.vx]", (LPARAM)arg7);
}
if (comdid.find(L"action:", 0) >= 0)
@@ -3183,11 +3228,12 @@
{
if (dw_base.GetItemString(1, L"InvoiceNo") != L"")
{
- xaserverarg arg2 = new xaserverarg;
- arg2.setNativePointer(arg2.CreateInstance());
+ xaserverarg& arg2 = *new xaserverarg;
+
arg2.AddArg(L"InvoiceNo", dw_base.GetItemString(1, L"InvoiceNo"));
- arg2.AddArg(L"HWND", GetHWND().toString());
- OpenWindow(L"dev:xpage[GDNSourcePaperCard.vx]", cast(arg2 as int));
+ //arg2.AddArg(L"HWND", xstring((__int64)GetHWND()));
+ arg2.SetParam(L"HWND", (LPARAM)GetHWND());
+ OpenWindow(L"dev:xpage[GDNSourcePaperCard.vx]",(LPARAM)&arg2);
}
else
{
@@ -3203,13 +3249,13 @@
}
else if (comdid == L"xmMaintBuyPrice")
{
- xaserverarg arg = GDNView::MakeArg();
+ xaserverarg arg ;
int row = dw_source.GetRow();
if (row < 1) return 1;
arg.AddArg(L"SupplierID", dw_source.GetItemString(row, L"SupplierID"));
arg.AddArg(L"SupplierName", dw_source.GetItemDisplayString(row, L"SupplierID"));
arg.AddArg(L"Price", dw_source.GetItemString(row, L"BuyUnitPrice"));
- OpenWindow(L"dev:xpage[GDNSourcePriceMaint.vx]", cast(arg as int));
+ OpenWindow(L"dev:xpage[GDNSourcePriceMaint.vx]", arg);
if (arg.GetArgString(L"result") == L"ok")
{
if (arg.GetArgString(L"SupplierID") != L"")
@@ -3229,17 +3275,17 @@
{
xstring name = L"出运明细单";
xml x = ViewObject::RetrieveData(L"/sale/data/TradeFinance3/GetSetUpRemarks", L"Type", name);
- KXMLDOMNodeList items = x.GetXmlDoc().selectNodes(L"data/Item");
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
KXMLDOMNode t = items.item(0);
xstring Content = L"";
if (t.selectSingleNode(L"Content"))
{
- Content = t.selectSingleNode(L"Content").text;
+ Content = t.selectSingleNode(L"Content").text();
}
- xaserverarg arg1 = new xaserverarg;
- arg1.setNativePointer(arg1.CreateInstance());
+ xaserverarg arg1 ;
+
arg1.AddArg(L"value", Content);
- OpenWindow(L"dev:xpage[memo.edit.new.vx]", arg1.getNativePointer());
+ OpenWindow(L"dev:xpage[memo.edit.new.vx]", arg1);
return 1;
}
@@ -3248,7 +3294,7 @@
{
xstring GDNID = dw_base.GetGuid(1);
xml x = ViewObject::RetrieveData(L"/sale/data/GDN/CheckGW", L"GDNID", GDNID);
- xstring r = x.GetXmlDoc().text;
+ xstring r = x.text();
int r1 = r.toInt();
if (x)
{
@@ -3260,7 +3306,7 @@
xml xs = ViewObject::RetrieveData(L"/sale/data/GDN/CheckCDLine", L"GDNID", GDNID);
- xstring rs = xs.GetXmlDoc().text;
+ xstring rs = xs.text();
int rs1 = rs.toInt();
if (xs)
{
@@ -3274,9 +3320,9 @@
return 1;
}
//命令处理事件
- int OnXCommand(ref TXCommandEvent evt, int param)
+ int OnXCommand(TEvent* evt, int param)
{
- return OnCmdDispatch(evt.pStrID);
+ return OnCmdDispatch(evt->xcommand.pStrID);
}
//风险计提
@@ -3287,14 +3333,14 @@
xstring exchRate = L"";
xstring exchRate2 = L"";
- xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"prepareFeeRate");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"prepareFeeRate");
+ if (x.selectSingleNode(L"root/item/@value"))
+ exchRate = x.selectSingleNode(L"root/item/@value").text();
double rate = exchRate.toDouble();
- xml x1 = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchRate2 = x1.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ xml x1 = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"cryrate");
+ if (x.selectSingleNode(L"root/item/@value"))
+ exchRate2 = x1.selectSingleNode(L"root/item/@value").text();
double cryrate = exchRate2.toDouble();
if (CurrencyCode == L"RMB" || CurrencyCode == L"CNY")
@@ -3343,24 +3389,24 @@
if (x)
{
// trace(L"\r\n" + x.GetXml());
- KXMLDOMNode o = x.GetXmlDoc().selectSingleNode(L"data/Item");
+ KXMLDOMNode o = x.selectSingleNode(L"data/Item");
if (o)
{
KXMLDOMNode n = o.selectSingleNode(L"VATRates");
if (n)
{
- tax = n.text.toDouble();
- n.Release();
+ tax = xstring(n.text()).toDouble();
+
}
n = o.selectSingleNode(L"VATRefundRate");
if (n)
{
- retax = n.text.toDouble();
- n.Release();
+ retax = xstring(n.text()).toDouble();
+
}
o.Release();
}
- x.GetXmlDoc().Release();
+ x.Release();
}
}
@@ -3394,13 +3440,13 @@
xstring expRate = L"";
xstring exchRate = L"";
- xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"cryrate");
+ if (x.selectSingleNode(L"root/item/@value"))
+ exchRate = x.selectSingleNode(L"root/item/@value").text();
- x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"mgtFeeRate");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- expRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"mgtFeeRate");
+ if (x.selectSingleNode(L"root/item/@value"))
+ expRate = x.selectSingleNode(L"root/item/@value").text();
//double sale = dw_profit.GetItemDouble(1,L"ExchangeAmountEx");
xstring ETDEx = dw_base.GetItemString(1, L"ETD");
@@ -3427,7 +3473,6 @@
double rate = expRate.toDouble();
ManagementFee = sale * rate;
}
- trace(ManagementFee.toString());
dw_profit.SetItemDouble(1, L"ManagementFee", ManagementFee);
return 1;
}
@@ -3439,17 +3484,18 @@
xstring expRate = L"";
xstring exchRate = L"";
- xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"cryrate");
+ if (x.selectSingleNode(L"root/item/@value"))
+ exchRate = x.selectSingleNode(L"root/item/@value").text();
- x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"RiskFundAmount");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- expRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"RiskFundAmount");
+ if (x.selectSingleNode(L"root/item/@value"))
+ expRate = x.selectSingleNode(L"root/item/@value").text();
+ //alert(expRate);
//double sale = dw_profit.GetItemDouble(1,L"ExchangeAmountEx");
xstring ETDEx = dw_base.GetItemString(1, L"ETD");
- if (ETDEx < "2023-01-01")
+ if (ETDEx < L"2023-01-01")
{
//alert(L"1");
expRate = L"0.0";
@@ -3513,6 +3559,7 @@
dw_profit.SetItemString(1, L"Amount", dw_base.GetItemString(1, L"Amount"));
dw_profit.SetItemString(1, L"Freight", dw_base.GetItemString(1, L"Freight"));
dw_profit.SetItemString(1, L"InsuranceAmount", dw_base.GetItemString(1, L"InsuranceAmount"));
+ dw_profit.SetItemString(1, L"SinosurAmount", dw_base.GetItemString(1, L"InsuranceAmountEx"));
//dw_profit.SetItemString(1,L"CommissionAmount",dw_base.GetItemString(1,L"CommissionAmount"));
double comm1 = dw_base.GetItemDouble(1, L"CommissionAmount");
@@ -3540,6 +3587,7 @@
ttl -= dw_base.GetItemDouble(1, L"CommissionAmount");
ttl -= dw_base.GetItemDouble(1, L"PrivateCommissionAmount");
ttl -= dw_base.GetItemDouble(1, L"DiscountAmount");
+ ttl -= dw_base.GetItemDouble(1, L"InsuranceAmountEx");
ttl += dw_profit.GetItemDouble(1, L"SaleExternCost");
@@ -3547,9 +3595,9 @@
xstring exchangeRate = L"";
exchangeRate = dw_profit.GetItemString(1, L"ExchangeRate");
if (exchangeRate == L"") {
- xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate");
- if (x.GetXmlDoc().selectSingleNode(L"root/item/@value"))
- exchangeRate = x.GetXmlDoc().selectSingleNode(L"root/item/@value").text;
+ xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/paramS", L"item", L"cryrate");
+ if (x.selectSingleNode(L"root/item/@value"))
+ exchangeRate = x.selectSingleNode(L"root/item/@value").text();
dw_profit.SetItemString(1, L"ExchangeRate", exchangeRate);
}
if (exchangeRate != L"" || CurrencyCode == L"USD") {
@@ -3633,6 +3681,7 @@
int CalcProfit()
{
+ GetInsuranceAmountEx();
evalSale();
evalManagementFee();
evalRiskFundAmount();
@@ -3641,12 +3690,13 @@
evalDrawbackEx();
evalTotalCost();
evalProfitAmountEx();
+ return 1;
}
- int OnItemAskStyle(ref TNotifyEvent evt, int p)
+ int OnItemAskStyle(TEvent* evt, LPARAM p)
{
int DMS_CSSSTYLE = 0x8;
- ref DWASKSTYLENMHDR hdr = trust(evt.pnmh as ref DWASKSTYLENMHDR);
+ DWASKSTYLENMHDR& hdr = *(DWASKSTYLENMHDR*)evt->notify.pnmh;
int row = hdr.row;
int col = hdr.col;
xstring colname = hdr.colname;
@@ -3666,7 +3716,7 @@
if ((Quantity / PackingRate) * PackingRate != Quantity)
{
hdr.mask = DMS_CSSSTYLE;
- hdr.cssstyle = L"color:#ff0000";
+ hdr.pCssStyle = (wchar_t*)L"color:#ff0000";
}
}
}
@@ -3676,41 +3726,41 @@
int OnAttachEvent()
{
//绑定工具条点击事件
- AttachEvent(L"WM_XCOMMAND", OnXCommand);
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&GDN3MaintWin::OnXCommand);
//获取焦点事件,用于重置工具条
- AttachEvent(L"WM_SETFOCUS", OnSetFocus);
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&GDN3MaintWin::OnSetFocus);
- AttachEvent(L"dw_item", L"DWV_ITEMCHANGED", OnItemChanged);
- AttachEvent(L"dw_source", L"DWV_ITEMCHANGED", OnItemChangedEx);
- AttachEvent(L"dw_base", L"DWV_ASKDATA", OnAskDataBase);
+ AttachEvent(L"dw_item", L"DWV_ITEMCHANGED", (FEvent)&GDN3MaintWin::OnItemChanged);
+ AttachEvent(L"dw_source", L"DWV_ITEMCHANGED", (FEvent)&GDN3MaintWin::OnItemChangedEx);
+ AttachEvent(L"dw_base", L"DWV_ASKDATA", (FEvent)&GDN3MaintWin::OnAskDataBase);
- AttachEvent(L"dw_base", L"DWV_ITEMCHANGED", OnBaseItemChanged);
+ AttachEvent(L"dw_base", L"DWV_ITEMCHANGED", (FEvent)&GDN3MaintWin::OnBaseItemChanged);
- AttachEvent(L"dw_profit", L"DWV_ITEMCHANGED", OnProfitItemChanged);
- AttachEvent(L"dw_custom", L"DWV_ITEMCHANGED", OnCustomItemChanged);
- AttachEvent(L"dw_billnote", L"DWV_DOUBLECLICKED", OnBillNoteDoubleClicked);//行双击
- AttachEvent(L"dw_item", L"DWV_ASKSTYLE", OnItemAskStyle);
+ AttachEvent(L"dw_profit", L"DWV_ITEMCHANGED", (FEvent)&GDN3MaintWin::OnProfitItemChanged);
+ AttachEvent(L"dw_custom", L"DWV_ITEMCHANGED", (FEvent)&GDN3MaintWin::OnCustomItemChanged);
+ AttachEvent(L"dw_billnote", L"DWV_DOUBLECLICKED", (FEvent)&GDN3MaintWin::OnBillNoteDoubleClicked);//行双击
+ AttachEvent(L"dw_item", L"DWV_ASKSTYLE", (FEvent)&GDN3MaintWin::OnItemAskStyle);
AttachCloseWindow();
-
+ return 1;
}
int RetrieveUseBuffer(xstring invno)
{
xml x;
- x = new xml;
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+
+ xaserverarg arg;
+
arg.AddArg(L"EntityID", GetEntityID(1));
arg.AddArg(L"invno", invno);
//int t0 = win32::GetTickCount();
- //if(url::get(L"/sale/data/Gdn/data/buffer", arg.GetString(),x)!=1)
- if (url::get(L"/sale/data/Gdn/data", arg.GetString(), x) != 1)
+ //if(xurl::get(L"/sale/data/Gdn/data/buffer", arg.GetString(),x)!=1)
+ if (xurl::get(L"/sale/data/Gdn/data", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
@@ -3719,7 +3769,7 @@
KXMLDOMElement ele;
KXMLDOMNode node;
- KXMLDOMDocument xdoc = x.GetXmlDoc();
+ KXMLDOMDocument xdoc =x;
node = xdoc.selectSingleNode(L"data/Item[@subject='Base' or @subject='base']/*");
dw_base.DwRetrieve(GetServerUrl(), L"[gdnbase.gdn.sql.xq]", L"EntityID", InvoiceID);
@@ -3735,16 +3785,14 @@
if (dw_billnote.GetRowCount() < 1)
{
xml x0;
- x0 = new xml;
- x0.setNativePointer(xml::CreateInstance());
- xstring billnote = L"<GDN><DocInfo><data><Item Name='报关发票' Field='Remark'></Item>" +
- "<Item Name='报关箱单' Field='Remark'></Item>" +
- "<Item Name='议付发票' Field='Remark'></Item>" +
- "<Item Name='议付箱单' Field='Remark'></Item>" +
- "<Item Name='装船通知' Field='Remark'></Item>" +
- "<Item Name='加拿大海关发票' Field='Remark'></Item>" +
- "<Item Name='FORMA' Field='Remark'></Item></data></DocInfo></GDN>";
- x0.LoadXml(billnote);
+ xstring billnote = L"<GDN><DocInfo><data><Item Name='报关发票' Field='Remark'></Item>"
+ L"<Item Name='报关箱单' Field='Remark'></Item>"
+ L"<Item Name='议付发票' Field='Remark'></Item>"
+ L"<Item Name='议付箱单' Field='Remark'></Item>"
+ L"<Item Name='装船通知' Field='Remark'></Item>"
+ L"<Item Name='加拿大海关发票' Field='Remark'></Item>"
+ L"<Item Name='FORMA' Field='Remark'></Item></data></DocInfo></GDN>";
+ x0.loadXML(billnote);
dw_billnote.Retrieve(x0);
}
}
@@ -3761,10 +3809,9 @@
dw_item.SetSelectionMode(1);
if (dw_item.GetRowCount() < 1)
{
- xml x2 = xml::Make();
- x2.LoadXml(L"<GDN/>");
+ xml x2 ;
+ x2.loadXML(L"<GDN/>");
dw_item.Retrieve(x2);
- x2.Free();
}
/*
@@ -3783,7 +3830,6 @@
ele = node;
//node.release();
dw_invoiceItem.Retrieve(ele);
- ele.release();
}
//alert(L"123"+InvoiceID);
//dw_source.DwRetrieve(GetServerUrl(),L"[source.gdn.sql.xq]", L"EntityID", InvoiceID);
@@ -3795,7 +3841,6 @@
ele = node;
//node.release();
dw_source.Retrieve(ele);
- ele.release();
}
dw_custom.DwRetrieve(GetServerUrl(), L"[cdline.gdn.sql.xq]", L"EntityID", InvoiceID);
dw_custom.SetSelectionMode(1);
@@ -3816,7 +3861,6 @@
//node.release();
dw_cdelement.Retrieve(ele);
dw_cdelement.SetSelectionMode(1);
- ele.release();
}
node = xdoc.selectSingleNode(L"data/Item[@subject='Container' or @subject='container']/*");
@@ -3825,7 +3869,6 @@
ele = node;
//node.release();
dw_fcl.Retrieve(ele);
- ele.release();
}
return 1;
@@ -3834,15 +3877,14 @@
int OnRefreshSource(xstring invno)
{
xml x;
- x = new xml;
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+
+ xaserverarg arg ;
arg.AddArg(L"invno", invno);
- if (url::get(L"/sale/data/Gdn/source/maintex", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/maintex", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
@@ -3856,23 +3898,22 @@
//return RetrieveUseBuffer(invno);
xml x;
- x = new xml;
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+
+ xaserverarg arg ;
arg.AddArg(L"invno", invno);
- if (url::get(L"/sale/data/Gdn/source/maintex", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/maintex", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
dw_source.Retrieve(x);
dw_source.SetSelectionMode(1);
- if (url::get(L"/sale/data/Gdn/source/base", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/base", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
@@ -3881,60 +3922,60 @@
dw_billnote.Retrieve(x);
if (dw_billnote.GetRowCount() < 1)
{
- xstring billnote = L"<GDN><DocInfo><data><Item Name='报关发票' Field='Remark'></Item>" +
- "<Item Name='报关箱单' Field='Remark'></Item>" +
- "<Item Name='议付发票' Field='Remark'></Item>" +
- "<Item Name='议付箱单' Field='Remark'></Item>" +
- "<Item Name='装船通知' Field='Remark'></Item>" +
- "<Item Name='加拿大海关发票' Field='Remark'></Item>" +
+ xstring billnote = L"<GDN><DocInfo><data><Item Name='报关发票' Field='Remark'></Item>"
+ "<Item Name='报关箱单' Field='Remark'></Item>"
+ "<Item Name='议付发票' Field='Remark'></Item>"
+ "<Item Name='议付箱单' Field='Remark'></Item>"
+ "<Item Name='装船通知' Field='Remark'></Item>"
+ "<Item Name='加拿大海关发票' Field='Remark'></Item>"
"<Item Name='FORMA' Field='Remark'></Item></data></DocInfo></GDN>";
- x.LoadXml(billnote);
+ x.loadXML(billnote);
dw_billnote.Retrieve(x);
}
- if (url::get(L"/sale/data/Gdn/source/gdnline", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/gdnline", arg.GetString(), x) != 1)
{
- alert(x.GetXml);
+ alert(x.xml());
return -1;
}
dw_item.Retrieve(x);
dw_item.SetSelectionMode(1);
- if (url::get(L"/sale/data/Gdn/source/gdnlineex", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/gdnlineex", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
dw_invoiceItem.Retrieve(x);
- if (url::get(L"/sale/data/Gdn/source/profit", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/profit", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
dw_profit.Retrieve(x);
- if (url::get(L"/sale/data/Custom3/maint/custom/data", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Custom3/maint/custom/data", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
dw_custom.Retrieve(x);
dw_customex.Retrieve(x);
dw_custom.SetSelectionMode(1);
- if (url::get(L"/sale/data/Gdn/source/cdelement", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/cdelement", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
dw_cdelement.Retrieve(x);
dw_cdelement.SetSelectionMode(1);
//dw_cdelement.Retrieve(x);
- if (url::get(L"/sale/data/Gdn/source/container", arg.GetString(), x) != 1)
+ if (xurl::get(L"/sale/data/Gdn/source/container", arg.GetString(), x) != 1)
{
- alert(x.GetXmlDoc().text);
+ alert(x.text());
return -1;
}
dw_fcl.Retrieve(x);
@@ -3963,25 +4004,23 @@
dPackages = dQty / sPRate.toDouble();
}
- if ((dPackages * 1000).toInt() > dPackages.toInt() * 1000)
+ if (((int)dPackages * 1000) > (int)dPackages * 1000)
dPackages = dPackages + 1;
- return dPackages.toInt();
+ return (int)dPackages;
}
xstring GetInvoiceID(xstring InvoiceNo)
{
- xml x = xml::Make();
- xaserverarg arg = xaserverarg::Make();
+ xml x ;
+ xaserverarg arg ;
arg.AddArg(L"InvoiceNo", InvoiceNo);
xaserver::ExecXQuery(GetServerUrl(), L"[gdnid.gdn.xq]", arg.GetString(), x);
xstring InvoiceID1 = L"";
- if (x.GetXmlDoc())
+ if (x)
{
- InvoiceID1 = x.GetXmlDoc().text;
+ InvoiceID1 = x.text();
}
- arg.Free();
- x.Free();
return InvoiceID1;
}
@@ -4012,21 +4051,22 @@
dw_base.SetGuid(1, id);
dw_profit.SetGuid(1, id);
- xml x = ViewObject::MakeXml();
- xstring billnote = L"<GDN><DocInfo><data><Item Name='报关发票' Field='Remark'></Item>" +
- "<Item Name='报关箱单' Field='Remark'></Item>" +
- "<Item Name='议付发票' Field='Remark'></Item>" +
- "<Item Name='议付箱单' Field='Remark'></Item>" +
- "<Item Name='装船通知' Field='Remark'></Item>" +
- "<Item Name='加拿大海关发票' Field='Remark'></Item>" +
+ xml x;
+ xstring billnote = L"<GDN><DocInfo><data><Item Name='报关发票' Field='Remark'></Item>"
+ "<Item Name='报关箱单' Field='Remark'></Item>"
+ "<Item Name='议付发票' Field='Remark'></Item>"
+ "<Item Name='议付箱单' Field='Remark'></Item>"
+ "<Item Name='装船通知' Field='Remark'></Item>"
+ "<Item Name='加拿大海关发票' Field='Remark'></Item>"
"<Item Name='FORMA' Field='Remark'></Item></data></DocInfo></GDN>";
- x.LoadXml(billnote);
+ x.loadXML(billnote);
dw_billnote.Retrieve(x);
+ return 1;
}
int onload()
{
-
+ SetArg();
xstring userid = publiccode::GetUser().id;
//trace(userid);
haveUpdate = true;
@@ -4100,7 +4140,7 @@
dw_custom.SetColumnState(L"ClassifyID", false);
dw_custom.SetColumnState(L"AmountEx", false);
//dw_custom.SetReadOnlyColumn(L"CustName",true);
- dw_custom.SetColumnState(L"LineNo", false);
+ //dw_custom.SetColumnState(L"LineNo", false);
dw_customex = GetControl(L"dw_customex");
@@ -4134,11 +4174,10 @@
dw_doclist.openUrl(L"/sale/view/GDN/template/doclist");
InvoiceNo = L"";
- if (GetParam())
+ if (GetWinParam())
{
- xaserverarg arg_param = new xaserverarg;
- arg_param.setNativePointer(GetParam());
-
+ xaserverarg arg_param=GetArg();
+ xstring xs = arg_param.GetString();
InvoiceNo = arg_param.GetArgString(L"InvoiceNo");
if (InvoiceNo == L"") InvoiceNo = arg_param.GetArgString(L"EntityNo");
if (InvoiceNo == L"")
@@ -4184,10 +4223,9 @@
else
{
OnNewInital();
- if (GetParam())
+ if (GetWinParam())
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(GetParam());
+ xaserverarg arg = GetArg();
if (arg.GetArgString(L"CustomerID") != L"")
{
@@ -4197,7 +4235,7 @@
xstring colname = L"CustomerID";
xstring value = arg.GetArgString(L"CustomerID");
KXMLDOMNodeList nlist = GetElement().selectNodes(L"//*[@name='" + dwname + L"']/trans[@for='" + colname + L"']");
- ViewObject::TransData(nlist, dw_base, 1, colname, value);
+ ViewObject::TransData(nlist, dw_base, 1, colname, value);
trace(L"+++++L");
}
}
--
Gitblit v1.9.3