xj qian
2024-11-18 a468bd6b4866e7d02df525e7cb077a3753438905
jrj/project/business/QuoteFile.cpp
@@ -2220,7 +2220,10 @@
   {
      trace(L"BusinessItemID:" + id);
      xml x = ViewObject::RetrieveData(L"/sale/data/TO/business/document", L"BusinessItemID", id);
      BSTR str;
      x.get_xml(str);
      ::SysFreeString(str);
      /*
      xml sheet ;
      sheet.setNativePointer(x.CreateInstance());
@@ -3523,14 +3526,31 @@
      startRow++;
      int row = dw_cell.GetRow();
      int colPurchPrice = getItemCol(dw_cell, headrow, L"价格");
      int colPurchPrice1 = getItemCol(dw_cell, headrow, L"价格1");
      int colPurchPrice2 = getItemCol(dw_cell, headrow, L"价格2");
      int colPurchPrice3 = getItemCol(dw_cell, headrow, L"价格3");
      if (colPurchPrice3 > 0) return  1;
      if (colPurchPrice2 < 1)
      if (colPurchPrice1 < 1)
      {
         //dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         //dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);
         dw_cell.SetRowColumn(row, colPurchPrice + 1);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice + 1);
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         dw_cell.SetItemString(headrow, colPurchPrice + 1, L"供应商1");
         dw_cell.SetItemString(headrow, colPurchPrice + 2, L"类型1");
         dw_cell.SetItemString(headrow, colPurchPrice + 3, L"价格1");
         dw_cell.SetColumnWidth(colPurchPrice + 2, 0);
      }
      else if (colPurchPrice2 < 1)
      {
         dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         //dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);
         dw_cell.SetRowColumn(row, colPurchPrice1 + 1);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice1 + 1);
@@ -3542,10 +3562,11 @@
         dw_cell.SetItemString(headrow, colPurchPrice1 + 1, L"供应商2");
         dw_cell.SetItemString(headrow, colPurchPrice1 + 2, L"类型2");
         dw_cell.SetItemString(headrow, colPurchPrice1 + 3, L"价格2");
         dw_cell.SetColumnWidth(colPurchPrice1 + 2, 0);
      }
      else
      else if(colPurchPrice3 < 1)
      {
         //dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         //dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);
         dw_cell.SetRowColumn(row, colPurchPrice2 + 1);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice2 + 1);
@@ -3557,6 +3578,7 @@
         dw_cell.SetItemString(headrow, colPurchPrice2 + 1, L"供应商3");
         dw_cell.SetItemString(headrow, colPurchPrice2 + 2, L"类型3");
         dw_cell.SetItemString(headrow, colPurchPrice2 + 3, L"价格3");
         dw_cell.SetColumnWidth(colPurchPrice2 + 2, 0);
      }
      return 1;
   }
@@ -3580,6 +3602,8 @@
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         dw_cell.SetColumnCount(dw_cell.GetColumnCount() - 3);
         return 1;
      }
@@ -3592,6 +3616,8 @@
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         dw_cell.SetColumnCount(dw_cell.GetColumnCount() - 3);
         return 1;
      }
@@ -3603,6 +3629,8 @@
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         dw_cell.SetColumnCount(dw_cell.GetColumnCount() - 3);
         return 1;
      }
@@ -4123,6 +4151,7 @@
      ensureRowID();
      xstring content = dw_cell.GetData();
      string val = content.c_str();
      content = content.mid(content.find(L"<xsheet"), 9999999);
      while (true)
      {
@@ -5029,14 +5058,12 @@
         int colSupplier1 = getItemCol(dw_cell, startRow - 1, L"供应商1");
         int colBuyPrice1 = getItemCol(dw_cell, startRow - 1, L"价格1");
         int colSaleSendDate = getItemCol(dw_cell, startRow - 1, L"业务发送采购时间");
         dw_cell.SetColumnWidth(colSKUID, 0);
         dw_cell.SetColumnWidth(colItemNo, 0);
         dw_cell.SetColumnWidth(colCustomerItemNo, 0);
         dw_cell.SetColumnWidth(colItemName, 0);
         dw_cell.SetColumnWidth(colItemCName, 0);
         dw_cell.SetColumnWidth(colBuyerRemark, 0);
         //dw_cell.SetColumnWidth(colBuyerRemark, 0);
         dw_cell.SetColumnWidth(colPackage, 0);
         dw_cell.SetColumnWidth(colQty, 0);
         dw_cell.SetColumnWidth(col40HQ, 0);
@@ -5086,7 +5113,7 @@
               }
            }
         }
         if (!bPrice1)
         if (!bPrice1 && colSupplier1 > 0)
         {
            dw_cell.SetRowColumn(1, colSupplier1);
            dw_cell.SetAnchorRowColumn(1, colSupplier1);
@@ -5096,25 +5123,38 @@
         }
         dw_cell.SetRowColumn(1, 1);
         dw_cell.SetAnchorRowColumn(startRow-1, 1);
         dw_cell.SetAnchorRowColumn(startRow - 2, 1);
         SendCtrlCmd(dw_cell, L"xmEditCopy");
         dw_cell.SetRowColumn(1, colPhoto);
         dw_cell.SetAnchorRowColumn(startRow - 1, colPhoto);
         dw_cell.SetAnchorRowColumn(startRow - 2, colPhoto);
         SendCtrlCmd(dw_cell, L"xmEditPaste");
         dw_cell.SetRowColumn(1, 2);
         dw_cell.SetAnchorRowColumn(startRow - 1, 2);
         dw_cell.SetAnchorRowColumn(startRow - 2, 2);
         SendCtrlCmd(dw_cell, L"xmEditCopy");
         dw_cell.SetRowColumn(1, colPhoto+1);
         dw_cell.SetAnchorRowColumn(startRow - 1, colPhoto+1);
         dw_cell.SetAnchorRowColumn(startRow - 2, colPhoto+1);
         SendCtrlCmd(dw_cell, L"xmEditPaste");
         int colSaleSendDate = getItemCol(dw_cell, startRow - 1, L"业务发送采购时间");
         dw_cell.SetItemString(2, colBuyerPrice, L"业务员");
         dw_cell.SetItemString(3, colBuyerPrice, L"发送日期:");
         dw_cell.SetItemString(2, colBuyerPrice+1, dw_cell.GetItemString(startRow, colSaler));
         dw_cell.SetItemString(3, colBuyerPrice+1, dw_cell.GetItemString(startRow, colSaleSendDate));
         dw_cell.SetColumnWidth(colSaleSendDate, 0);
         int colMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ");
         int colSupplier = getItemCol(dw_cell, startRow - 1, L"供应商");
         int colBuyPrice = getItemCol(dw_cell, startRow - 1, L"价格");
         dw_cell.SetRowColumn(startRow, colSupplier);
         dw_cell.SetAnchorRowColumn(startRow, colSupplier);
         dw_cell.SetColumnWidth(colBuyerPrice, 50);
         dw_cell.SetColumnWidth(colMOQ, 50);
         dw_cell.SetColumnWidth(colBuyPrice, 50);
      }
      
@@ -5261,7 +5301,7 @@
      {
         xnode anode = GetAgentNode(L"tabheader");
         anode.SetLayerFlow(0x00000100);
         dw_cell.SetColumnCount(dw_cell.GetValidCol() + 6);
         dw_cell.SetColumnCount(dw_cell.GetValidCol() + 9);
         //dw_cell.SetFixedCols(7);
         AdjustView(dw_cell);
      }