zhuyiyi hace 11 meses
padre
commit
f52319f934

+ 3 - 1
SiteCore/Handler/sync.order.cs

@@ -7874,7 +7874,9 @@ namespace SiteCore.Handler
             string price2 = GetPostString("price2");
             if (price2.Length > 0) lw.Add(string.Format("payment <= '{0}'", price2));
             string ispartrefund = GetPostString("ispartrefund");
-            if (ispartrefund.Length > 0) lw.Add(string.Format("IsPartRefund={0}", ispartrefund));
+            if (ispartrefund.Length > 0) lw.Add(string.Format("IsPartRefund={0}", ispartrefund));  
+            string designerorg = GetPostString("designerorg");
+            if (designerorg.Length > 0) lw.Add(string.Format("DesOrgID={0}", designerorg));
 
             int myOrgid = CurrentUser.UserPost.OrgID;
             string myOrgCode = CurrentUser.UserPost.Post.Code;

+ 96 - 0
SiteCore/taobao/preSalesHelper.cs

@@ -954,6 +954,102 @@ namespace SiteCore.Handler
             }
             returnErrorMsg("缺少必要的参数id");
         }
+
+        public void save_erp_billinfo()
+        {
+            if (UrlPostParmsCheck("ctid"))
+            {
+                string eid = GetPostString("ctid");
+                CeErpTradeCell entity = null;
+                if (eid != "") entity = CeErpTradeCell.GetByCtid(eid);
+                if (entity != null)
+                {
+                    CeErpBill bill = CeErpBill.GetByTid(eid);
+                    bool isHave = false;
+                    if (bill != null)
+                    {
+                        isHave = true;
+                        if (bill.state != 4)
+                        {
+                            returnErrorMsg("此单已经申请过发票了");
+                            return;
+                        }
+                    }
+                    if (entity.IsNeedBill == 0)
+                    {
+                        entity.IsNeedBill = 1;
+                    }
+                    entity.Update();
+                    string errjson = "";
+                    try
+                    {
+
+                        CeErpBill bill_entity = new CeErpBill();
+                        bill_entity.tid = entity.tid;
+
+                        bill_entity.title = GetPostString("title");
+                        string taxstr = GetPostString("tax");
+                        taxstr = taxstr.Replace(" ", "");
+                        bill_entity.tax = taxstr;
+                        bill_entity.bank = GetPostString("bank");
+                        string bankacstr = GetPostString("bankac");
+                        bankacstr = bankacstr.Replace(" ", "");
+                        bill_entity.bankac = bankacstr;
+                        bill_entity.address = GetPostString("address");
+                        bill_entity.phone = GetPostString("phone");
+                        bill_entity.price = GetPostString("price");
+
+                        int billCount = (int)Math.Floor(Convert.ToDouble(bill_entity.price) / 1000.00);
+                        if (Convert.ToDouble(bill_entity.price) % 1000.00 > 0.00001)
+                        {
+                            billCount += 1;
+                        }
+
+                        string prebill = "ltb";
+                        for (int idx = 1; idx <= billCount; idx++)
+                        {
+                            string dtstr = DateTime.Now.ToString("yyyyMMddHHmmss");
+                            string billoid = prebill + idx + dtstr;
+                            bill_entity.billOrderId += billoid;
+                            if (idx < billCount)
+                            {
+                                bill_entity.billOrderId += ",";
+                            }
+                        }
+
+
+                        bill_entity.productId = GetPostInt("ProductName");
+                        bill_entity.num = GetPostInt("num");
+                        bill_entity.unit = GetPostString("unit");
+                        bill_entity.type = GetPostString("type");
+                        bill_entity.sendType = GetPostString("SendType");
+                        bill_entity.email = GetPostString("email");
+                        bill_entity.buyer_nick = GetPostString("buyer_nick");
+                        bill_entity.shopName = GetPostString("ShopName");
+                        bill_entity.applymemo = GetPostString("applyMemo");
+                        bill_entity.createTime = DateTime.Now;
+                        bill_entity.state = 0;
+                        bill_entity.userId = 11;
+                        errjson = Utils.Serialization.JsonString.ConvertObject(bill_entity);
+                        bill_entity.Create();
+
+                    }
+                    catch (Exception ex)
+                    {
+                        XLog.SaveLog(0, errjson + "创建发票出错," + ex.Message);
+                        returnErrorMsg("创建发票出错!");
+                        return;
+                    }
+
+
+                    LogHelper.addLog(entity.ctid, CurrentUser.UserID, "申请发票", entity.OrderState, 1);
+                    returnSuccessMsg("发票申请成功!");
+                    return;
+                }
+
+                returnErrorMsg("找不到记录");
+            }
+        }
         /**
          * 查货
          * ctid

+ 1 - 1
Web/EDesign/MyReDesign.aspx.cs

@@ -17,7 +17,7 @@ public partial class EDesign_MyReDesign : BasePage
         _repTitle = "退款列表";
         PmTag = "myReDesign";
         //_selfCheckPermission = true;
-        _filterItem = "order,shop,memo,wang,moeny,responsible_man,refund_time";
+        _filterItem = "order,shop,memo,wang,moeny,responsible_man,refund_time,designer_org";
         _keyFilterVisible = false;
         _addVisible = false;
     }

+ 2 - 2
Web/EDesign/js/myReDesign.js

@@ -222,7 +222,7 @@ function searchFn() {
     //form.setIsValid(false);
     //console.log("565656565", data);
     grid.load({
-        tid: s.tid, shopname: s.shop, buyer_nick: s.ww, design: s.design, orderState: s.state, ispartrefund: s.ispartrefund,
+        tid: s.tid, shopname: s.shop, buyer_nick: s.ww, design: s.design, orderState: s.state, ispartrefund: s.ispartrefund, designerorg: s.designerorg,
         date1: s.date1, date2: s.date2, price1: s.price1, price2: s.price2, seller_memo: s.memo, refunddate1: s.refunddate1, refunddate2: s.refunddate2, responsibleman: s.responsibleman
     });
 }
@@ -261,7 +261,7 @@ function onSearchCheckedChanged(e) {
         stime = timearr[0];
         etime = timearr[1];
         grid.load({
-            tid: s.tid, shopname: s.shop, buyer_nick: s.ww, design: s.design, orderState: s.state, ispartrefund: s.ispartrefund,
+            tid: s.tid, shopname: s.shop, buyer_nick: s.ww, design: s.design, orderState: s.state, ispartrefund: s.ispartrefund, designerorg: s.designerorg,
             refunddate1: stime, refunddate2: etime, price1: s.price1, price2: s.price2, seller_memo: s.memo, responsibleman: s.responsibleman
         });
     }

+ 2 - 2
Web/MasterPage/ErpView.master

@@ -309,11 +309,11 @@
             </div>
 
             <div class="filter_item" id="f_designer_org" runat="server" visible="false">
-                <label>部门</label>
+                <label>设计部门</label>
                 <input id="txtSearchDesignerOrg" name="designerorg" shownullitem="true" allowinput="true" class="mini-combobox inp_middle" url="../handler/sync.ashx?t=get_sel_design_org" value="" textfield="name" valuefield="id" />
             </div>
             <div class="filter_item" id="f_customer_org" runat="server" visible="false">
-                <label>部门</label>
+                <label>客服部门</label>
                 <input id="txtSearchCustomerOrg" name="customerorg" shownullitem="true" allowinput="true" class="mini-combobox inp_middle" url="../handler/sync.ashx?t=get_sel_customer_org" value="" textfield="name" valuefield="id" />
             </div>