全电发票微调

QDHHYT
ddlucky 1 year ago
parent 33bc3bafd3
commit d41673f0d4

@ -1036,9 +1036,10 @@ namespace DSWeb.Areas.Account.Controllers
}
else
{
jsonRespose.Success = false;
jsonRespose.Message = "必须选择冲红理由!";
return jsonRespose;
//jsonRespose.Success = false;
//jsonRespose.Message = "必须选择冲红理由!";
//return jsonRespose;
head.redReason = "2";
}
}
}
@ -1066,9 +1067,16 @@ namespace DSWeb.Areas.Account.Controllers
}
else
{
jsonRespose.Success = false;
jsonRespose.Message = "必须选择冲红理由!";
return jsonRespose;
//jsonRespose.Success = false;
//jsonRespose.Message = "必须选择冲红理由!";
//return jsonRespose;
head.redReason = "2";
head.DbOperationType = DbOperationType.DbotUpd;
head.ModelUIStatus = "E";
var modb = new ModelObjectDB();
result = modb.Save(head);
}
}
@ -1932,102 +1940,130 @@ namespace DSWeb.Areas.Account.Controllers
else if (head.INVITERFACE == "诺诺全电发票")
{
var hx = .getHelper(head.TAXCODE);
//20230529
//1 如果ch_fee_invoice.billuuid有值的话
//这个值是最近一次提交的红字确认单订单编码
//用这个值读取红字确认单状态 如成功则做红票相应的处理
//如状态15申请中 则不做操作返回申请中
//如非成功和15 则返回错误 并清空billuuid
//2 如果ch_fee_invoice.billuuid无值 则重新产生值并发出红字确认单
//此时head.billUuid如果不为空 代表已有红字申请单
if (!string.IsNullOrWhiteSpace(head.billUuid))//&&
//20230608 如果ptorred=2
//代表这个head就是红票
if (head.PTORRED == "2")
{
redhead.BILLNO = redhead.billUuid;
redhead = AutoMapperHelper.MapTo<ChInvoice_HangXin, ChInvoice_HangXin>(head);
//redhead.REDNUM = head.INVOICENO;
var _r = hx.ReadRedConfirm(ref redhead, detailList);
result = hx.ReadInvoice(redhead);
if (!_r.Success)
if (!result.Success)
{
return BasicDataRefDAL.GetContentResult( _r);
return BasicDataRefDAL.GetContentResult(result);
}
else
else {
ChinvoiceDAL.SetRed(redhead);
BlueInvoice = ChinvoiceDAL.GetData(" cm.INVOICECODE='" + head.REDCODE + "' and cm.INVOICENO='" + head.REDNUM + "'");
result = SetInvoiceFee(BlueInvoice);
return BasicDataRefDAL.GetContentResult(result);
}
}
else
{
//20230529
//1 如果ch_fee_invoice.billuuid有值的话
//这个值是最近一次提交的红字确认单订单编码
//用这个值读取红字确认单状态 如成功则做红票相应的处理
//如状态15申请中 则不做操作返回申请中
//如非成功和15 则返回错误 并清空billuuid
//2 如果ch_fee_invoice.billuuid无值 则重新产生值并发出红字确认单
//此时head.billUuid如果不为空 代表已有红字申请单
if (!string.IsNullOrWhiteSpace(head.billUuid))//&&
{
redhead.BILLNO = redhead.billUuid;
//var hx = 诺诺全电发票.getHelper(head.TAXCODE);
if (!hx.CanUse)
{
result.SetErrorInfo(hx.ERRORMSG);
var _r = hx.ReadRedConfirm(ref redhead, detailList);
return BasicDataRefDAL.GetContentResult(result);
}
//if (hx.accessToken == "")
//{
// BasicDataRefDAL.SaveLog("NNReadInv;税号" + head.TAXCODE + "的 accessToken为空", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
result = hx.ReadInvoice(redhead);
if (!result.Success)
if (!_r.Success)
{
return BasicDataRefDAL.GetContentResult(result);
return BasicDataRefDAL.GetContentResult(_r);
}
else
{
//if (result.Message == "需要重新认证")
//{
// //HangXinRequestHelper.clear(hx.accessToken);
// BasicDataRefDAL.SaveLog("ReadInvoice 反回‘需要重新认证’", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
//var hx = 诺诺全电发票.getHelper(head.TAXCODE);
if (!hx.CanUse)
{
result.SetErrorInfo(hx.ERRORMSG);
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
return BasicDataRefDAL.GetContentResult(result);
}
//if (hx.accessToken == "")
//{
// BasicDataRefDAL.SaveLog("NNReadInv;税号" + head.TAXCODE + "的 accessToken为空", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
result = hx.ReadInvoice(redhead);
if (!result.Success)
{
return BasicDataRefDAL.GetContentResult(result);
}
if (redhead.PTORRED == "2")
{
ChinvoiceDAL.SetRed(redhead);
//if (result.Message == "需要重新认证")
//{
// //HangXinRequestHelper.clear(hx.accessToken);
// BasicDataRefDAL.SaveLog("ReadInvoice 反回‘需要重新认证’", "", "诺诺平台", "返回认证窗口");
// var _r = TokenPage();
// return _r;
//}
//将原票内的申请和费用恢复原状
//var BlueInvoice = ChinvoiceDAL.GetData(" cm.INVOICECODE='" + head.REDCODE + "' and cm.INVOICENO='" + head.REDNUM + "'");
//result = SetInvoiceFee(BlueInvoice);
}
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
//如果状态为开出成功 则执行锁定
if (returndate.EINVOICESTATE == "2" && returndate.BILLSTATUS == 0)
{
//ChinvoiceDAL.Lock(returndate.BILLNO);
if (redhead.PTORRED == "2")
{
ChinvoiceDAL.SetRed(redhead);
//20200106 添加 如sys_param_set.PARAMNAME=INVOICEAUTOLOCK 没有值或值为false 则不执行锁定
var needautolock = MsSysParamSetDAL.GetSysParam("INVOICEAUTOLOCK").isnullortrue();
//将原票内的申请和费用恢复原状
BlueInvoice = ChinvoiceDAL.GetData(" cm.INVOICECODE='" + head.REDCODE + "' and cm.INVOICENO='" + head.REDNUM + "'");
result = SetInvoiceFee(BlueInvoice);
}
if (needautolock)
//如果状态为开出成功 则执行锁定
if (returndate.EINVOICESTATE == "2" && returndate.BILLSTATUS == 0)
{
ChinvoiceDAL.Lock(returndate.BILLNO);
//ChinvoiceDAL.Lock(returndate.BILLNO);
//20200106 添加 如sys_param_set.PARAMNAME=INVOICEAUTOLOCK 没有值或值为false 则不执行锁定
var needautolock = MsSysParamSetDAL.GetSysParam("INVOICEAUTOLOCK").isnullortrue();
if (needautolock)
{
ChinvoiceDAL.Lock(returndate.BILLNO);
}
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
}
returndate = ChinvoiceDAL.GetData(" BILLNO='" + head.BILLNO + "'");
}
result.Data = returndate;
result.Data = returndate;
return BasicDataRefDAL.GetContentResult(result);
}
return BasicDataRefDAL.GetContentResult(result);
}
else
{
//head.billUuid如果不为空 代表还没发红字申请单
//获取红票信息并发出
redhead.BILLNO = PubSysDAL.GetBillNo("0308");
}
else
{
//head.billUuid如果不为空 代表还没发红字申请单
//获取红票信息并发出
redhead.BILLNO = PubSysDAL.GetBillNo("0308");
head.billUuid = redhead.BILLNO;
head.billUuid = redhead.BILLNO;
result = hx.PostRedConfirm(redhead, ref head, detailList);
if (result.Success == false)
{
result = hx.PostRedConfirm(redhead, ref head, detailList);
}
}
}
//诺诺全电票根据红字申请单的结果读取确认单
modb.Save(head);

@ -904,7 +904,11 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
/// <summary>
/// 对应蓝票全电号码(全电普票、全电专票都需要)
/// </summary>
public string blueInvoiceNumber { get { return ChInvoice_HangXin.REDNUM; } }
public string blueInvoiceNumber { get {
return
ChInvoice_HangXin.REDNUM;
}
}
public string billTime { get; set; }
@ -975,7 +979,12 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
//若有值,则在无需确认或购销双方已确认后去自动开红票,发票的开票单号用该值
//public string orderNo { get { return ChInvoice_HangXin.BILLNO; } }
public string phone { get { return ChInvoice_HangXin.PUSHMOBILE; } }
public string phone { get {
if (ChInvoice_HangXin.PUSHMOBILE == "0") return "";
else
return ChInvoice_HangXin.PUSHMOBILE;
}
}
public string email { get { return ChInvoice_HangXin.PUSHEMAIL; } }
}
@ -1588,14 +1597,10 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
var billno = head.BILLNO;
//20191028 如果该发票的状态为开票失败 则将其billno临时变更为billno+时分秒以避开诺诺平台的orderNo不能重复的逻辑
//然后处理返回值时将新的流水号写回。
//20191108
//if (head.EINVOICESTATE == "3"|| head.EINVOICESTATE == "0")
//{
// head.BILLNO= billno+ DateTime.Now.ToString("HHmmss");
//}
if (head.REMARK.IndexOf("购方银行") >= 0)
{
head.REMARK += $" 购方银行:{head.CUSTBANK};销方银行:{head.ACCOUNT}";
}
var _head = new HXInvoice(head, detailList);
@ -2132,8 +2137,8 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
head.INVOICECODE = info.invoiceCode;
head.INVOICENO = info.invoiceNo;
head.EINVOICESTATE = info.status;
head.INVOICEINFOURL = info.ofdUrl;
head.INVOICEPDFURL = info.paperPdfUrl;
head.INVOICEINFOURL = info.pdfUrl;
head.INVOICEPDFURL = info.pdfUrl;
head.INVOICEMAKETIME = BasicDataRefDAL.Timestamp2Datetime(info.invoiceTime).ToString("yyyy-MM-dd HH:mm:ss");
//if (!string.IsNullOrWhiteSpace(info.invoiceSerialNum))
@ -2412,6 +2417,8 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
if (!_r.Success)
{
if(_r.Message!="红字确认单申请中")
bluehead.billUuid = "";
return _r;
}
else
@ -2433,6 +2440,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
if (!result.Success)
{
return result;
}
@ -2571,7 +2579,8 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
}
else
{
return result.SetErrorInfo(_return.());
return result.SetErrorInfo(_return.());
}
}

@ -144,7 +144,7 @@ function DsOpenEditWin_FullUrl(url, caption, height, width, top, left) {
pageinfo.concat(",location=no");
return window.open("http://" + url, _caption, pageinfo);
return window.open("https://" + url, _caption, pageinfo);
}
/*

@ -1971,7 +1971,7 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
forceSelection: true,
valueField: 'EnumValueName',
displayField: 'EnumValueName',
name: 'REASON',
name: 'REASONCMB',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {

Loading…
Cancel
Save