| | |
| | | int colSKUID = getItemCol(cell, startRow - 1, L"SKUID"); |
| | | int colSaleRemark = getItemCol(cell, startRow - 1, L"业务To采购备注"); |
| | | |
| | | int colBuyerMOQ = getItemCol(cell, startRow - 1, L"MOQ"); |
| | | int colBuyerRemark = getItemCol(cell, startRow - 1, L"采购To业务备注"); |
| | | int colFactoryImage = getItemCol(cell, startRow - 1, L"工厂图片"); |
| | | int colGWT = getItemCol(cell, startRow - 1, L"毛重,毛重(KG)"); |
| | |
| | | itemStr += L"<BuyerPrice>" + cell.GetItemString(row, colBuyerPrice) + L"</BuyerPrice>"; |
| | | itemStr += L"<SaleRemark>" + cell.GetItemString(row, colSaleRemark) + L"</SaleRemark>"; |
| | | |
| | | itemStr += L"<BuyerMOQ>" + cell.GetItemString(row, colBuyerMOQ) + L"</BuyerMOQ>"; |
| | | itemStr += L"<BuyerRemark>" + cell.GetItemString(row, colBuyerRemark) + L"</BuyerRemark>"; |
| | | itemStr += L"<FactoryImage>" + cell.GetItemString(row, colFactoryImage) + L"</FactoryImage>"; |
| | | itemStr += L"<GWT>" + cell.GetItemString(row, colGWT) + L"</GWT>"; |
| | |
| | | int colSKUID = getItemCol(cell, startRow - 1, L"SKUID"); |
| | | int colSaleRemark = getItemCol(cell, startRow - 1, L"业务To采购备注"); |
| | | |
| | | int colBuyerMOQ = getItemCol(cell, startRow - 1, L"MOQ"); |
| | | int colBuyerRemark = getItemCol(cell, startRow - 1, L"采购To业务备注"); |
| | | int colFactoryImage = getItemCol(cell, startRow - 1, L"工厂图片"); |
| | | int colGWT = getItemCol(cell, startRow - 1, L"毛重,毛重(KG)"); |
| | |
| | | itemStr += L"<BuyerPrice>" + cell.GetItemString(row, colBuyerPrice) + L"</BuyerPrice>"; |
| | | itemStr += L"<SaleRemark>" + cell.GetItemString(row, colSaleRemark) + L"</SaleRemark>"; |
| | | |
| | | itemStr += L"<BuyerMOQ>" + cell.GetItemString(row, colBuyerMOQ) + L"</BuyerMOQ>"; |
| | | itemStr += L"<BuyerRemark>" + cell.GetItemString(row, colBuyerRemark) + L"</BuyerRemark>"; |
| | | itemStr += L"<FactoryImage>" + cell.GetItemString(row, colFactoryImage) + L"</FactoryImage>"; |
| | | itemStr += L"<GWT>" + cell.GetItemString(row, colGWT) + L"</GWT>"; |
| | |
| | | int colItemSpec = getItemCol(dw_cell, startRow - 1, L"Specifications,规格,产品规格"); |
| | | int colBuyerPrice = getItemCol(dw_cell, startRow - 1, L"采购价,采购价格"); |
| | | |
| | | int colBuyerMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ"); |
| | | int colBuyerRemark = getItemCol(dw_cell, startRow - 1, L"采购To业务备注"); |
| | | int colFactoryImage = getItemCol(dw_cell, startRow - 1, L"工厂图片"); |
| | | int colGWT = getItemCol(dw_cell, startRow - 1, L"毛重,毛重(KG)"); |
| | |
| | | { |
| | | if (dw_cell.GetItemString(row, colPOPrice1) == L"") return L"采购价格1没有录入"; |
| | | } |
| | | itemStr += L"<BuyerMOQ>" + dw_cell.GetItemString(row, colBuyerMOQ) + L"</BuyerMOQ>"; |
| | | itemStr += L"<BuyerRemark>" + dw_cell.GetItemString(row, colBuyerRemark) + L"</BuyerRemark>"; |
| | | itemStr += L"<FactoryImage>" + dw_cell.GetItemString(row, colFactoryImage) + L"</FactoryImage>"; |
| | | itemStr += L"<GWT>" + dw_cell.GetItemString(row, colGWT) + L"</GWT>"; |
| | |
| | | int colBuyerPrice = getItemCol(dw_cell, startRow - 1, L"采购价,采购价格"); |
| | | int colPurchor = getItemCol(dw_cell, startRow - 1, L"采购员,采购人员"); |
| | | |
| | | int colBuyerMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ"); |
| | | int colBuyerRemark = getItemCol(dw_cell, startRow - 1, L"采购To业务备注"); |
| | | int colFactoryImage = getItemCol(dw_cell, startRow - 1, L"工厂图片"); |
| | | int colGWT = getItemCol(dw_cell, startRow - 1, L"毛重,毛重(KG)"); |
| | |
| | | if(dw_cell.GetItemString(row, colVolDesc)==L"") return L"体积信息没有录入"; |
| | | } |
| | | */ |
| | | itemStr += L"<BuyerMOQ>" + dw_cell.GetItemString(row, colBuyerMOQ) + L"</BuyerMOQ>"; |
| | | itemStr += L"<BuyerRemark>" + dw_cell.GetItemString(row, colBuyerRemark) + L"</BuyerRemark>"; |
| | | itemStr += L"<FactoryImage>" + dw_cell.GetItemString(row, colFactoryImage) + L"</FactoryImage>"; |
| | | itemStr += L"<GWT>" + dw_cell.GetItemString(row, colGWT) + L"</GWT>"; |
| | |
| | | xml sheet ; |
| | | sheet.setNativePointer(x.CreateInstance()); |
| | | sheet.loadXML(x.selectSingleNode(L"data/*").xml); |
| | | wangushendi xiuluowushen taigukuangmo |
| | | */ |
| | | |
| | | //trace(x.xml()); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellItemChanged(TEvent* evt, int p) |
| | | |
| | | int ReCalcPOPrice() |
| | | { |
| | | int startRow = getItemHeadRow(dw_cell); |
| | | if (startRow < 1) return 1; |
| | | startRow++; |
| | | |
| | | int sRow = dw_cell.GetRow(); |
| | | int eRow = dw_cell.GetAnchorRow(); |
| | | int sCol = dw_cell.GetColumn(); |
| | | int eCol = dw_cell.GetAnchorCol(); |
| | | auto Exchange = [](int& first, int& second) |
| | | { |
| | | int tmp = first;first = second;second = tmp; |
| | | }; |
| | | if (sRow > eRow)Exchange(sRow, eRow); |
| | | if (sCol > eCol)Exchange(sCol, eCol); |
| | | |
| | | if (action != L"purch") return 1; |
| | | |
| | | if (sRow < startRow && eRow < startRow) return 1; |
| | | if (sRow < startRow) sRow = startRow; |
| | | int colPrice0 = getItemCol(dw_cell, startRow - 1, L"价格"); |
| | | int colPrice1 = getItemCol(dw_cell, startRow - 1, L"价格1"); |
| | | int colPrice2 = getItemCol(dw_cell, startRow - 1, L"价格2"); |
| | | int colPrice3 = getItemCol(dw_cell, startRow - 1, L"价格3"); |
| | | int colPrice = getItemCol(dw_cell, startRow - 1, L"采购价"); |
| | | int colSKUID = getItemCol(dw_cell, startRow - 1, L"SKUID"); |
| | | bool shouldRedraw = false; |
| | | |
| | | if ((colPrice0 >= sCol && colPrice0 <= eCol) || (colPrice1 >= sCol && colPrice1 <= eCol) |
| | | || (colPrice2 >= sCol && colPrice2 <= eCol) || (colPrice3 >= sCol && colPrice3 <= eCol)) |
| | | { |
| | | for (int row = sRow; row <= eRow; row++) |
| | | { |
| | | if (dw_cell.GetItemString(row, colSKUID) == L"")continue; |
| | | for (int col = sCol; col <= eCol; col++) |
| | | { |
| | | if (colPrice0 == col || colPrice1 == col || colPrice2 == col || colPrice3 == col) |
| | | { |
| | | xstring pricea = L""; |
| | | xstring priceb = L""; |
| | | xstring pricec = L""; |
| | | |
| | | xstring price0 = dw_cell.GetItemString(row, colPrice0); |
| | | xstring price1 = dw_cell.GetItemString(row, colPrice1); |
| | | xstring price2 = L""; |
| | | if (colPrice2 > 0) price2 = dw_cell.GetItemString(row, colPrice2); |
| | | xstring price3 = L""; |
| | | if (colPrice3 > 0) price3 = dw_cell.GetItemString(row, colPrice3); |
| | | |
| | | xstring price = L""; |
| | | |
| | | if (price0 != L"") |
| | | { |
| | | price = price0; |
| | | if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1) |
| | | { |
| | | alert(L"价格中没指定ABC"); |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | } |
| | | else if (price.find(L"A") > 0 || price.find(L"a") > 0) |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | else if (price.find(L"B") > 0 || price.find(L"b") > 0) |
| | | if (priceb == L"") priceb = price; else priceb += L"+" + price; |
| | | else if (price.find(L"C") > 0 || price.find(L"c") > 0) |
| | | if (pricec == L"") pricec = price; else pricec += L"+" + price; |
| | | } |
| | | if (price1 != L"") |
| | | { |
| | | price = price1; |
| | | if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1) |
| | | { |
| | | alert(L"价格中没指定ABC"); |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | } |
| | | else if (price.find(L"A") > 0 || price.find(L"a") > 0) |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | else if (price.find(L"B") > 0 || price.find(L"b") > 0) |
| | | if (priceb == L"") priceb = price; else priceb += L"+" + price; |
| | | else if (price.find(L"C") > 0 || price.find(L"c") > 0) |
| | | if (pricec == L"") pricec = price; else pricec += L"+" + price; |
| | | } |
| | | if (price2 != L"") |
| | | { |
| | | price = price2; |
| | | if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1) |
| | | { |
| | | alert(L"价格中没指定ABC"); |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | } |
| | | else if (price.find(L"A") > 0 || price.find(L"a") > 0) |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | else if (price.find(L"B") > 0 || price.find(L"b") > 0) |
| | | if (priceb == L"") priceb = price; else priceb += L"+" + price; |
| | | else if (price.find(L"C") > 0 || price.find(L"c") > 0) |
| | | if (pricec == L"") pricec = price; else pricec += L"+" + price; |
| | | } |
| | | if (price3 != L"") |
| | | { |
| | | price = price3; |
| | | if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1) |
| | | { |
| | | alert(L"价格中没指定ABC"); |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | } |
| | | else if (price.find(L"A") > 0 || price.find(L"a") > 0) |
| | | if (pricea == L"") pricea = price; else pricea += L"+" + price; |
| | | else if (price.find(L"B") > 0 || price.find(L"b") > 0) |
| | | if (priceb == L"") priceb = price; else priceb += L"+" + price; |
| | | else if (price.find(L"C") > 0 || price.find(L"c") > 0) |
| | | if (pricec == L"") pricec = price; else pricec += L"+" + price; |
| | | } |
| | | price = pricec; |
| | | if (priceb != L"") |
| | | { |
| | | if (price == L"") |
| | | price = priceb; |
| | | else |
| | | price += L"+" + priceb; |
| | | } |
| | | if (pricea != L"") |
| | | { |
| | | if (price == L"") |
| | | price = pricea; |
| | | else |
| | | price += L"+" + pricea; |
| | | } |
| | | dw_cell.SetItemString(row, colPrice, price); |
| | | shouldRedraw = true; |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(shouldRedraw)dw_cell.Redraw(); |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellItemChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | CELLNMHDR& hdr = *(CELLNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | int row = hdr.currentrow; |
| | | int col = hdr.currentcol; |
| | | |
| | | |
| | | trace(L"\r\n----row:" + xstring(row) + L"--col:" + xstring(col)); |
| | | trace(L"\r\n----row:" + xstring(row) + L"--col:" + xstring(col)); |
| | | trace(L"\r\n--value:" + dw_cell.GetItemString(row, col) + L"--orig:" + orivalue); |
| | | if (row == ARow && col == ACol && dw_cell.GetItemString(row, col) == orivalue) return 1; |
| | | //if (row == ARow && col == ACol && dw_cell.GetItemString(row, col) == orivalue) return 1; |
| | | trace(L"\r\n--enter:"); |
| | | |
| | | ARow = row; |
| | |
| | | /*计算体积*/ |
| | | double v = 0.0; |
| | | xstring desc = dw_cell.GetItemString(row, colVolDesc); |
| | | if (desc.find(L"cm") >= 0) |
| | | if(desc!=L"") |
| | | { |
| | | desc = desc.replace(L"cm", L""); |
| | | dw_cell.SetItemString(row, colVolDesc, desc); |
| | | } |
| | | if (desc.find(L"CM") >= 0) |
| | | { |
| | | desc = desc.replace(L"CM", L""); |
| | | dw_cell.SetItemString(row, colVolDesc, desc); |
| | | } |
| | | if (desc == L"") |
| | | dw_cell.SetItemString(row, colVol, L""); |
| | | else |
| | | { |
| | | v = calcVol(desc) / 1000000.00; |
| | | xstring str = xstring(v); |
| | | if (str.find(L".") >= 0) str = str.left(str.find(L".") + 5); |
| | | dw_cell.SetItemString(row, colVol, str); |
| | | dw_cell.Redraw(); |
| | | } |
| | | |
| | | xstring qtyperPack = dw_cell.GetItemString(row, colQtyPerPack); |
| | | if (qtyperPack != L"") |
| | | { |
| | | xstring qty1 = qtyperPack; |
| | | xstring qty2 = L""; |
| | | double qty = 0.00; |
| | | int pos2 = qtyperPack.find(L"/"); |
| | | if (pos2 >= 0) |
| | | if (desc.find(L"cm") >= 0) |
| | | { |
| | | qty1 = qtyperPack.left(qtyperPack.find(L"/")); |
| | | qty2 = qtyperPack.mid(qtyperPack.find(L"/") + 1, 9999); |
| | | desc = desc.replace(L"cm", L""); |
| | | dw_cell.SetItemString(row, colVolDesc, desc); |
| | | } |
| | | //if(qty1 !=L"") qty = qty1.toDouble(); |
| | | //if(qty2 !=L"") qty = qty*qty2.toDouble(); |
| | | qty = qty2.toDouble(); |
| | | double ttl = 65.0 * qty / v; |
| | | dw_cell.SetItemString(row, col40HQ, xstring((int)ttl)); |
| | | if (desc.find(L"CM") >= 0) |
| | | { |
| | | desc = desc.replace(L"CM", L""); |
| | | dw_cell.SetItemString(row, colVolDesc, desc); |
| | | } |
| | | if (desc == L"") |
| | | dw_cell.SetItemString(row, colVol, L""); |
| | | else |
| | | { |
| | | v = calcVol(desc) / 1000000.00; |
| | | xstring str = xstring(v); |
| | | if (str.find(L".") >= 0) str = str.left(str.find(L".") + 5); |
| | | dw_cell.SetItemString(row, colVol, str); |
| | | dw_cell.Redraw(); |
| | | } |
| | | |
| | | xstring qtyperPack = dw_cell.GetItemString(row, colQtyPerPack); |
| | | if (qtyperPack != L"") |
| | | { |
| | | xstring qty1 = qtyperPack; |
| | | xstring qty2 = L""; |
| | | double qty = 0.00; |
| | | int pos2 = qtyperPack.find(L"/"); |
| | | if (pos2 >= 0) |
| | | { |
| | | qty1 = qtyperPack.left(qtyperPack.find(L"/")); |
| | | qty2 = qtyperPack.mid(qtyperPack.find(L"/") + 1, 9999); |
| | | } |
| | | //if(qty1 !=L"") qty = qty1.toDouble(); |
| | | //if(qty2 !=L"") qty = qty*qty2.toDouble(); |
| | | if (qty2 != L"") |
| | | { |
| | | qty = qty2.toDouble(); |
| | | double ttl = 65.0 * qty / v; |
| | | dw_cell.SetItemString(row, col40HQ, xstring((int)ttl)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | int colFOBPrice = getItemCol(dw_cell, startRow - 1, L"FOB Price,FOB Price(USD),Fob Price"); |
| | | int colQuantity = getItemCol(dw_cell, startRow - 1, L"数量,Qty"); |
| | | |
| | | int colBuyerMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ"); |
| | | int colBuyerRemark = getItemCol(dw_cell, startRow - 1, L"采购To业务备注"); |
| | | int colFactoryImage = getItemCol(dw_cell, startRow - 1, L"工厂图片"); |
| | | int colGWT = getItemCol(dw_cell, startRow - 1, L"毛重,毛重(KG)"); |
| | |
| | | else if (comdid == L"xmPurched") |
| | | { |
| | | //if(makeMessage(L"/task/quote/purchar/backtosaler")==-1) return 1; |
| | | //dw_cell.SetRowColumn(dw_cell.GetRow(), dw_cell.GetColumn()); |
| | | return OnSaleBack(); |
| | | } |
| | | else if (comdid == L"xmPurch2") |
| | |
| | | } |
| | | } |
| | | SendCtrlCmd(dw_cell, cmd); |
| | | if (comdid == L"IK_xmEditCut"|| comdid == L"IK_xmEditCut")ReCalcPOPrice(); |
| | | return 1; |
| | | } |
| | | else if (comdid == L"xmFormatCellDeleteRow") |
| | |
| | | arg.AddArg(L"EntityID", entityID); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch2Select.vx]", arg); |
| | | xstring taskID = arg.GetArgString(L"TaskID"); |
| | | xstring reason = arg.GetArgString(L"Reason"); |
| | | if (taskID != L"") |
| | | { |
| | | ProcessSendMessage(L"/task/quote/repurch", taskID, L"", L"", true); |
| | | ProcessSendMessage(L"/task/quote/repurch", taskID, reason, L"", true); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | else if (col == colTyp1 || col == colTyp || col == colTyp2 || col == colTyp3) |
| | | { |
| | | xstring pitems1 = L""; |
| | | pitems1 += (xstring)L"<row><显示列></显示列><数据列>" |
| | | + L"</数据列></row>"; |
| | | pitems1 += (xstring)L"<row><显示列>成品</显示列><数据列>" |
| | | + L"成品</数据列></row>"; |
| | | pitems1 += (xstring)L"<row><显示列>散货</显示列><数据列>" |
| | |
| | | else if (col == colTyp1 || col == colTyp) |
| | | { |
| | | xstring pitems1 = L""; |
| | | pitems1 += (xstring)L"<row><显示列></显示列><数据列>" |
| | | + L"</数据列></row>"; |
| | | pitems1 += (xstring)L"<row><显示列>成品</显示列><数据列>" |
| | | + L"成品</数据列></row>"; |
| | | pitems1 += (xstring)L"<row><显示列>散货</显示列><数据列>" |
| | |
| | | int colBuyerPrice = getItemCol(dw_cell, startRow - 1, L"采购价,采购价格"); |
| | | int colBuyer = getItemCol(dw_cell, startRow - 1, L"采购人员"); |
| | | |
| | | int colBuyerMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ"); |
| | | int colBuyerRemark = getItemCol(dw_cell, startRow - 1, L"采购To业务备注"); |
| | | int colFactoryImage = getItemCol(dw_cell, startRow - 1, L"工厂图片"); |
| | | int colGWT = getItemCol(dw_cell, startRow - 1, L"毛重,毛重(KG)"); |
| | |
| | | KXMLDOMElement ele = items.item(i); |
| | | xstring rowid = ele.selectSingleNode(L"RowID").text(); |
| | | xstring BuyerPrice = ele.selectSingleNode(L"BuyerPrice").text(); |
| | | xstring BuyerMOQ = L""; |
| | | xstring BuyerRemark = L""; |
| | | xstring FactoryImage = L""; |
| | | xstring GWT = L""; |
| | |
| | | xstring EnquiryLineID = L""; |
| | | xstring Buyer = L""; |
| | | |
| | | if (ele.selectSingleNode(L"BuyerMOQ")) BuyerMOQ = ele.selectSingleNode(L"BuyerMOQ").text(); |
| | | if (ele.selectSingleNode(L"BuyerRemark")) BuyerRemark = ele.selectSingleNode(L"BuyerRemark").text(); |
| | | if (ele.selectSingleNode(L"FactoryImage"))FactoryImage = ele.selectSingleNode(L"FactoryImage").text(); |
| | | if (ele.selectSingleNode(L"GWT")) GWT = ele.selectSingleNode(L"GWT").text(); |
| | |
| | | if (ele.selectSingleNode(L"Vol")) Vol = ele.selectSingleNode(L"Vol").text(); |
| | | if (ele.selectSingleNode(L"F40HQ")) F40HQ = ele.selectSingleNode(L"F40HQ").text(); |
| | | if (ele.selectSingleNode(L"PurchedDate")) PurchedDate = ele.selectSingleNode(L"PurchedDate").text(); |
| | | trace(L"\r\n******" + PurchedDate); |
| | | //trace(L"\r\n******" + PurchedDate); |
| | | if (ele.selectSingleNode(L"supplier-photo")) supplierphoto = ele.selectSingleNode(L"supplier-photo").text(); |
| | | if (ele.selectSingleNode(L"ProductInfo")) productInfo = ele.selectSingleNode(L"ProductInfo").text(); |
| | | if (ele.selectSingleNode(L"ProductInfo1")) productInfo1 = ele.selectSingleNode(L"ProductInfo1").text(); |
| | |
| | | if (getRowID(dw_cell, row) == rowid) |
| | | { |
| | | dw_cell.SetItemString(row, colBuyerPrice, BuyerPrice); |
| | | dw_cell.SetItemString(row, colBuyerMOQ, BuyerMOQ); |
| | | dw_cell.SetItemString(row, colBuyerRemark, BuyerRemark); |
| | | dw_cell.SetItemString(row, colFactoryImage, FactoryImage); |
| | | dw_cell.SetItemString(row, colGWT, GWT); |
| | |
| | | dw_cell.SetColumnCount(dw_cell.GetValidCol() + 6); |
| | | } |
| | | else |
| | | dw_cell.SetColumnCount(dw_cell.GetValidCol()); |
| | | dw_cell.SetColumnCount(dw_cell.GetValidCol()+3); |
| | | |
| | | //OnRetrieve(); |
| | | |