|
|
@ -62,11 +62,16 @@ namespace SCP.Views.SupplierData |
|
|
|
private void SearchData(Action<IQueryable<V_TB_RECEIVE_LIST>> p_action) |
|
|
|
{ |
|
|
|
V_TB_RECEIVE_LIST _entity = new V_TB_RECEIVE_LIST(); |
|
|
|
MyQueryStringDeCode de = new MyQueryStringDeCode(); |
|
|
|
string ReceiveID = de.QueryString("ReceiveID"); |
|
|
|
if (ReceiveID == "") |
|
|
|
|
|
|
|
|
|
|
|
if (Session["InvoiceCreateQueryParm"] != null) |
|
|
|
{ |
|
|
|
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(parm.ReceiveID)) |
|
|
|
|
|
|
|
{ Alert.Show("参数不正确!"); return; } |
|
|
|
var ary = ReceiveID.Split(','); |
|
|
|
var ary = parm.ReceiveID.Split(','); |
|
|
|
if (ary != null && ary.Length > 0) |
|
|
|
{ |
|
|
|
_entity.UIDList = new List<long>(); |
|
|
@ -84,13 +89,23 @@ namespace SCP.Views.SupplierData |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show("操作超时!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void BindData() |
|
|
|
{ |
|
|
|
SearchData(q => |
|
|
|
{ |
|
|
|
MyQueryStringDeCode de = new MyQueryStringDeCode(); |
|
|
|
|
|
|
|
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; |
|
|
|
Grid_SCP_INVOICE_CREATE.RecordCount = q.Count(); |
|
|
|
q = SortAndPage<V_TB_RECEIVE_LIST>(q, Grid_SCP_INVOICE_CREATE); |
|
|
|
List<V_TB_RECEIVE_LIST> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST(q.ToList()); |
|
|
@ -106,7 +121,7 @@ namespace SCP.Views.SupplierData |
|
|
|
if (CurrentUser.RoleList.Contains("采购人员")) |
|
|
|
{ |
|
|
|
|
|
|
|
_vendId = de.QueryString("VendId"); |
|
|
|
_vendId = parm.VendId; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -144,7 +159,7 @@ namespace SCP.Views.SupplierData |
|
|
|
// }
|
|
|
|
//});
|
|
|
|
|
|
|
|
var _isall=de.QueryString("IsAll"); |
|
|
|
var _isall=parm.IsAll; |
|
|
|
if(_isall=="0") |
|
|
|
{ |
|
|
|
temp.ForEach(p => { |
|
|
@ -181,22 +196,27 @@ namespace SCP.Views.SupplierData |
|
|
|
} |
|
|
|
//确认创建发票
|
|
|
|
protected void btnOk_OnClick(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
if (Session["InvoiceCreateQueryParm"] != null) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; |
|
|
|
|
|
|
|
V_TB_INVOICE invoice = new V_TB_INVOICE(); |
|
|
|
invoice.InvcBillNum = SCP_BILLCODE_CONTROLLER.MakeInvoiceCode(); |
|
|
|
invoice.CreateTime = DateTime.Now; |
|
|
|
invoice.InvoiceNum = ""; |
|
|
|
invoice.Remark = txtRemark.Text; |
|
|
|
invoice.CreateUser = CurrentUser.Name; |
|
|
|
MyQueryStringDeCode de = new MyQueryStringDeCode(); |
|
|
|
string _VendId= de.QueryString("VendId"); |
|
|
|
string _tax = de.QueryString("Tax"); |
|
|
|
|
|
|
|
string _VendId = parm.VendId; |
|
|
|
string _tax = parm.Tax; |
|
|
|
invoice.VendId = _VendId; |
|
|
|
invoice.State = (int)InvoiceState.New; |
|
|
|
invoice.Tax = decimal.Parse(_tax); |
|
|
|
string _cj = de.QueryString("CJ"); |
|
|
|
string _tz= de.QueryString("TZ"); |
|
|
|
string _cj = parm.CJ; |
|
|
|
string _tz = parm.TZ; |
|
|
|
invoice.BlancePrice = decimal.Parse(_tz); |
|
|
|
invoice.ContractPrice = decimal.Parse(_cj); |
|
|
|
|
|
|
@ -206,7 +226,7 @@ namespace SCP.Views.SupplierData |
|
|
|
{ |
|
|
|
object[] rowDataKeys = Grid_SCP_INVOICE_CREATE.DataKeys[i]; |
|
|
|
string uid = rowDataKeys[0].ToString(); |
|
|
|
var _entity=new V_TB_RECEIVE_LIST(); |
|
|
|
var _entity = new V_TB_RECEIVE_LIST(); |
|
|
|
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]); |
|
|
|
_entity.RecvBillNum = rowDataKeys[1] as string; |
|
|
|
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]); |
|
|
@ -285,7 +305,7 @@ namespace SCP.Views.SupplierData |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (Qty >_entity.CanQty) |
|
|
|
if (Qty > _entity.CanQty) |
|
|
|
{ |
|
|
|
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("开票数量不能大于可用开票数量")); |
|
|
|
return; |
|
|
@ -301,29 +321,35 @@ namespace SCP.Views.SupplierData |
|
|
|
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有可用的开票记录")); |
|
|
|
return; |
|
|
|
} |
|
|
|
int _number= 0; |
|
|
|
_list.ForEach(p =>{ |
|
|
|
if(p.Qty>0) |
|
|
|
int _number = 0; |
|
|
|
_list.ForEach(p => |
|
|
|
{ |
|
|
|
if (p.Qty > 0) |
|
|
|
{ |
|
|
|
_number++; |
|
|
|
} |
|
|
|
}); |
|
|
|
if(_number == _list.Count) |
|
|
|
if (_number == _list.Count) |
|
|
|
{ |
|
|
|
string _modify = de.QueryString("Modify"); |
|
|
|
string _modify = parm.Modify; |
|
|
|
if (_modify == "1") |
|
|
|
{ |
|
|
|
Alert.Show("有退货单未处理!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var ret=SCP_INVOICE_CONTROLLER.CREATE_TB_INVOICE(invoice, _list); |
|
|
|
var ret = SCP_INVOICE_CONTROLLER.CREATE_TB_INVOICE(invoice, _list); |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
string script = $"alert(\'发票 {invoice.InvcBillNum} 生成成功\');"; |
|
|
|
script += ActiveWindow.GetHidePostBackReference(); |
|
|
|
PageContext.RegisterStartupScript(script); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show("操作超时"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
@ -378,7 +404,7 @@ namespace SCP.Views.SupplierData |
|
|
|
} |
|
|
|
//_info.SupplierCode = vu.VenderId;
|
|
|
|
} |
|
|
|
|
|
|
|
Session["InvoiceCreateQueryParm"] = null; |
|
|
|
return strTax; |
|
|
|
} |
|
|
|
|
|
|
|