| | |
| | | #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 |
| | | { |
| | |
| | | } |
| | | } |
| | | tools += L"</vbox>"; |
| | | SetAgentNodeContent(anode, tools); |
| | | SetAgentNode(anode, tools); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | KXMLDOMDocument xbasedoc = xbase; |
| | | dw_base.DwUpdateAllTo(xbasedoc); |
| | | |
| | | xaserverarg arg = GDNView::MakeArg(); |
| | | xaserverarg arg ; |
| | | //if(dw_billnote.DeletedCount()+dw_billnote.ModifiedCount() > 0) |
| | | //{ |
| | | xml xbillnote ; |
| | |
| | | |
| | | KXMLDOMDocument xprofitdoc = xprofit; |
| | | dw_profit.DwUpdateAllTo(xprofitdoc); |
| | | xaserverarg arg3 = GDNView::MakeArg(); |
| | | xaserverarg arg3 ; |
| | | arg3.AddArg(L"content", xprofit.xml()); |
| | | if (xurl::get(L"/sale/data/Gdn/update/profit", arg3.GetString(), xprofit) != 1) |
| | | { |
| | |
| | | KXMLDOMDocument xitemdoc = xitem; |
| | | dw_item.DwUpdateAllToEx(xitemdoc); |
| | | //dw_base.DwUpdateAllTo(xitemdoc); |
| | | xaserverarg arg1 = GDNView::MakeArg(); |
| | | xaserverarg arg1 ; |
| | | arg1.AddArg(L"content", xitem.xml()); |
| | | |
| | | if (xurl::get(L"/sale/data/Gdn/update/item", arg1.GetString(), xitem) != 1) |
| | |
| | | xml x; |
| | | |
| | | dw_source.DwUpdateAllToEx(x); |
| | | xaserverarg arg2 = GDNView::MakeArg(); |
| | | xaserverarg arg2 ; |
| | | arg2.AddArg(L"content", x.xml()); |
| | | |
| | | if (xurl::get(L"/sale/data/Gdn/update/sourceex", arg2.GetString(), x) != 1) |
| | |
| | | { |
| | | 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; |
| | |
| | | xml x1 ; |
| | | |
| | | dw_invoiceItem.DwUpdateAllToEx(x1); |
| | | xaserverarg arg4 = GDNView::MakeArg(); |
| | | xaserverarg arg4; |
| | | arg4.AddArg(L"content", x1.xml()); |
| | | if (xurl::get(L"/sale/data/Gdn/update/itemex", arg4.GetString(), x1) != 1) |
| | | if (!x1) |
| | |
| | | xml xfcl ; |
| | | |
| | | dw_fcl.DwUpdateAllToEx(xfcl); |
| | | xaserverarg arg8 = GDNView::MakeArg(); |
| | | xaserverarg arg8 ; |
| | | arg8.AddArg(L"content", xfcl.xml()); |
| | | |
| | | if (xurl::get(L"/sale/data/Gdn/update/container", arg8.GetString(), xfcl) != 1) |
| | |
| | | dw_cdelement.DwUpdateAllToEx(xcdelement); |
| | | if (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.text(); |
| | |
| | | xstring GDNLineID = dw_item.GetGuid(nRow); |
| | | if (clear) ClearSourcingItem(nRow); |
| | | double ExchangeCostEx = dw_profit.GetItemDouble(1, L"ExchangeCostEx"); |
| | | xml x = xml::Make(); |
| | | xml x ; |
| | | x.loadXML(L"<data/>"); |
| | | KXMLDOMElement e = dw_item.GetRowElement(nRow); |
| | | KXMLDOMNode n = e.cloneNode(-1); |
| | |
| | | n.Release(); |
| | | 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) |
| | |
| | | xstring GDNLineID = dw_item.GetGuid(nRow); |
| | | if (clear) ClearSourcingItem(nRow); |
| | | double ExchangeCostEx = dw_profit.GetItemDouble(1, L"ExchangeCostEx"); |
| | | xml x = xml::Make(); |
| | | xml x ; |
| | | x.loadXML(L"<data/>"); |
| | | KXMLDOMElement e = dw_item.GetRowElement(nRow); |
| | | KXMLDOMNode n = e.cloneNode(-1); |
| | |
| | | n.Release(); |
| | | 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) |
| | |
| | | dw_item.DwUpdateAllToEx(xitemdoc); |
| | | |
| | | |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitemexOne", L"content", xitem.GetXml()); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/PurchaseOrder/gdn/sourcing/refreshitemexOne", L"content", xitem.xml()); |
| | | trace(x.xml()); |
| | | if (x) |
| | | { |
| | |
| | | |
| | | PoTotal(); |
| | | |
| | | x.Free(); |
| | | evalProfitAmountEx(); |
| | | } |
| | | |
| | |
| | | { |
| | | 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""); |
| | | } |
| | |
| | | { |
| | | xaserverarg arg ; |
| | | |
| | | xstring str = dw_billnote.GetItemString(row, colname); |
| | | 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); |
| | | |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | |
| | | int OnMakeCustom() |
| | | { |
| | | int HCursor = xutil::SetCursorWait(); |
| | | HCURSOR HCursor = xutil::SetCursorWait(); |
| | | dw_custom.AcceptText(); |
| | | int cnt = dw_custom.GetRowCount(); |
| | | bool cdelement = false; |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | |
| | | 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); |
| | |
| | | KXMLDOMNode t = items.item(i); |
| | | dw_item.SetItemString(row, L"SeqNo", xstring((row * 10))); |
| | | dw_item.SetItemString(row, L"GDNID", dw_base.GetGuid(1)); |
| | | double cost = (double) t.selectSingleNode(L"Cost").text().todouble(); |
| | | double cost = xstring(t.selectSingleNode(L"Cost").text()).toDouble(); |
| | | |
| | | |
| | | if (t.selectSingleNode(L"SONo")) |
| | |
| | | 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"); |
| | |
| | | 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"); |
| | |
| | | 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")); |
| | |
| | | } |
| | | 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"") |
| | |
| | | KXMLDOMNode n = o.selectSingleNode(L"VATRates"); |
| | | if (n) |
| | | { |
| | | tax = n.text.toDouble(); |
| | | tax = xstring(n.text()).toDouble(); |
| | | n.Release(); |
| | | } |
| | | n = o.selectSingleNode(L"VATRefundRate"); |
| | | if (n) |
| | | { |
| | | retax = n.text.toDouble(); |
| | | retax = xstring(n.text()).toDouble(); |
| | | n.Release(); |
| | | } |
| | | o.Release(); |
| | |
| | | double rate = expRate.toDouble(); |
| | | ManagementFee = sale * rate; |
| | | } |
| | | trace(ManagementFee.toString()); |
| | | dw_profit.SetItemDouble(1, L"ManagementFee", ManagementFee); |
| | | return 1; |
| | | } |
| | |
| | | evalDrawbackEx(); |
| | | evalTotalCost(); |
| | | evalProfitAmountEx(); |
| | | return 1; |
| | | } |
| | | |
| | | int OnItemAskStyle(TEvent* evt, LPARAM p) |
| | |
| | | AttachEvent(L"dw_item", L"DWV_ASKSTYLE", (FEvent)&GDN3MaintWin::OnItemAskStyle); |
| | | |
| | | AttachCloseWindow(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int RetrieveUseBuffer(xstring invno) |
| | | { |
| | | |
| | | xml x; |
| | | x = new xml; |
| | | |
| | | |
| | | xaserverarg arg; |
| | | |
| | |
| | | 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>"; |
| | | 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); |
| | | } |
| | |
| | | dw_item.SetSelectionMode(1); |
| | | if (dw_item.GetRowCount() < 1) |
| | | { |
| | | xml x2 = xml::Make(); |
| | | xml x2 ; |
| | | x2.loadXML(L"<GDN/>"); |
| | | dw_item.Retrieve(x2); |
| | | x2.Free(); |
| | | } |
| | | |
| | | /* |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | //node.release(); |
| | | dw_cdelement.Retrieve(ele); |
| | | dw_cdelement.SetSelectionMode(1); |
| | | ele.release(); |
| | | } |
| | | |
| | | node = xdoc.selectSingleNode(L"data/Item[@subject='Container' or @subject='container']/*"); |
| | |
| | | ele = node; |
| | | //node.release(); |
| | | dw_fcl.Retrieve(ele); |
| | | ele.release(); |
| | | } |
| | | |
| | | return 1; |
| | |
| | | int OnRefreshSource(xstring invno) |
| | | { |
| | | xml x; |
| | | x = new xml; |
| | | |
| | | |
| | | xaserverarg arg ; |
| | | |
| | |
| | | //return RetrieveUseBuffer(invno); |
| | | |
| | | xml x; |
| | | x = new xml; |
| | | |
| | | |
| | | xaserverarg arg ; |
| | | |
| | |
| | | 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>") + |
| | | "<Item Name='FORMA' Field='Remark'></Item></data></DocInfo></GDN>"); |
| | | 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); |
| | | dw_billnote.Retrieve(x); |
| | | } |
| | |
| | | |
| | | 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""; |
| | |
| | | { |
| | | InvoiceID1 = x.text(); |
| | | } |
| | | arg.Free(); |
| | | x.Free(); |
| | | return InvoiceID1; |
| | | } |
| | | |
| | |
| | | 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); |
| | | dw_billnote.Retrieve(x); |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | |
| | | 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(); |
| | | |
| | | InvoiceNo = arg_param.GetArgString(L"InvoiceNo"); |
| | | if (InvoiceNo == L"") InvoiceNo = arg_param.GetArgString(L"EntityNo"); |
| | |
| | | else |
| | | { |
| | | OnNewInital(); |
| | | if (GetParam()) |
| | | if (GetWinParam()) |
| | | { |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(GetParam()); |
| | | xaserverarg arg = GetArg(); |
| | | |
| | | if (arg.GetArgString(L"CustomerID") != L"") |
| | | { |
| | |
| | | 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"); |
| | | } |
| | | } |