DS7_JingHan
hanxuntao 2 years ago
parent 4e444ebbb2
commit 8684f85988

@ -957,6 +957,53 @@ namespace DSWeb.Areas.Account.Controllers
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitBack(string bill)
{
var headdata = ChinvoiceapplicationDAL.GetData("BILLNO='" + bill + "'");
var dataList = ChinvoiceapplicationDAL.GetBodyList("BILLNO='" + bill + "'", "");
if (dataList == null || dataList.Count == 0)
{
var jsonRespose = new JsonResponse { Success = false, Message = "无费用明细不能提交审核!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
var feelist = new List<Chfee_do_detail>();
var feepartlist = new List<Chfee_do_detail>();
foreach (var fee in dataList) {
if (fee.ORIGAMOUNT != fee.ORIGSTLAMOUNT)
{
if (fee.ORIGSTLAMOUNT == 0)
{
feelist.Add(fee);
}
else {
feepartlist.Add(fee);
}
}
}
DBResult result = ChinvoiceapplicationDAL.DelFeeDo(feelist, headdata.GID);
if (result.Success) {
result = ChinvoiceapplicationDAL.DelpartFeeDo(feelist, headdata.GID);
var bodyList = ChinvoiceapplicationDAL.GetApplicationDetailList("LINKGID='"+ headdata.GID + "'");
var detaillist = new List<ChInvoiceapplicationDetail>();
foreach (var body in bodyList)
{
if (body.BILLSTATUS != "已开") {
detaillist.Add(body);
}
}
result = ChinvoiceapplicationDAL.DelInvAppDetail(detaillist);
}
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult SubmitAuditBack(string bill)
{

@ -6084,7 +6084,7 @@ namespace DSWeb.MvcShipping.DAL.Chfee_AuditDAL
var CUSTTYPE = T_ALL_DA.GetStrSQL("CUSTTYPE", "SELECT CUSTTYPE from info_client WHERE SHORTNAME='" + head.CUSTOMERNAME+ "'");
var content = File.ReadAllText(htmlfile);
content = content.Replace("$OP$",deptname+"_"+ head.OP.Replace("\r\n", "<br />"));
content = content.Replace("$OP$",deptname+"_"+ username.Replace("\r\n", "<br />"));
content = content.Replace("$ETD$", head.ETD.Replace("\r\n", "<br />"));
content = content.Replace("$CUSTNO$", head.CUSTNO.Replace("\r\n", "<br />"));
content = content.Replace("$MBLNO$", head.MBLNO.Replace("\r\n", "<br />"));

@ -4403,6 +4403,71 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
return result;
}
public static DBResult DelpartFeeDo(List<Chfee_do_detail> boday, string GID)
{
var result = new DBResult();
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
conn.Open();
var tran = conn.BeginTransaction();
try
{
if (boday != null)
{
var cmddelete = db.GetSqlStringCommand("update ch_fee_do set amount=doamount,origamount=ORIGSTLAMOUNT where GID=@FEEDOID");
var cmdupdate = db.GetSqlStringCommand("update ch_fee set ORDERINVOICE=ORDERINVOICE-@ORIGAMOUNT where GID=@GID");
var cmdupdatedui = db.GetSqlStringCommand("update ch_dui_detail set INVNO='' where CH_ID=@GID AND INVNO=@PAYNO AND DUINO=@DUINO");
foreach (var enumValue in boday)
{
cmddelete.Parameters.Clear();
db.AddInParameter(cmddelete, "@FEEDOID", DbType.String, enumValue.FEEDOID);
db.ExecuteNonQuery(cmddelete, tran);
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@ORIGAMOUNT", DbType.Decimal, enumValue.ORIGAMOUNT- enumValue.ORIGSTLAMOUNT);
db.AddInParameter(cmdupdate, "@GID", DbType.String, enumValue.FEEID);
db.ExecuteNonQuery(cmdupdate, tran);
}
}
result = new DBResult();
result.Success = true;
result.Message = "成功";
tran.Commit();
}
catch (Exception)
{
tran.Rollback();
result.Success = false;
result.Message = "保存出现错误,请重试或联系系统管理员";
return result;
}
}
result.Success = true;
result.Message = "保存成功";
return result;
}
public static int p_update_Amount(string billno,string GID)
{
Database db = DatabaseFactory.CreateDatabase();

@ -174,7 +174,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
height: 180,
height: 380,
region: 'north',
split: true,
loadMask: { msg: "数据加载中,请稍等..." },

@ -1022,7 +1022,15 @@ Ext.extend(Shipping.MsChInvoiceapplicationBLEdit, Ext.Panel, {
this.onSubmitAuditBackClick();
},
scope: this
}
}, '-', {
id: 'btnSubmitBack',
text: '撤销未开票申请',
tooltip: '驳回未开票申请',
handler: function (button, event) {
this.onSubmitBackClick();
},
scope: this
}
]
}); //end 按钮Toolbar
@ -5219,7 +5227,124 @@ onSubmitAuditBackClick: function () {
},
},
onSubmitBackClick: function () {
var Duino = this.formEdit.getForm().findField('BILLNO').getValue();
var GID = this.formEdit.getForm().findField('GID').getValue();
var billstatus = this.formEdit.getForm().findField('BILLSTATUS').getValue();
if (Duino == '*') {
Ext.Msg.show({ title: '提示', msg: '请先保存发票申请,然后才能提交审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
_this = this;
Ext.Ajax.request({
waitMsg: '正在添加数据...',
url: '/Account/Chfee_invoiceapplication/SubmitBack',
params: {
bill: Duino
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
var sql = this.sqlcontext;
this.storeBodyAddList.load({ params: { start: 0, limit: _this.PageSize, sort: '', condition: sql } });
_this.storeBodyList.load({
params: { condition: " BILLNO='" + Duino + "'" },
callback: function (r, options, success) {
if (success) {
if (_this.storeBodyList.getCount() > 0) {
_this.comboxCurr.setReadOnly(true);
_this.comboxCustCode.setReadOnly(true);
}
else {
_this.comboxCurr.setReadOnly(false);
_this.comboxCustCode.setReadOnly(false);
_CUSTOMERNAME = "";
}
_this.formEdit.getForm().findField('CUSTOMERNAME').setValue(_CUSTOMERNAME);
}
},
scope: this
});
this.storeBodySum.load({ params: { condition: " BILLNO='" + Duino + "'" } });
//this.storeDetailList.load({ params: { condition: " PID='" + GID + "'"} });
this.storeAppDetailList.load({ params: { condition: " LINKGID='" + GID + "'" } });
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/Account/Chfee_invoiceapplication/GetData',
params: {
handle: 'edit',
condition: " BILLNO='" + Duino + "'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
var data = result.data;
_this.formEdit.getForm().findField('BILLSTATUS').setDisabled(false);
_this.formEdit.getForm().reset();
_this.formEdit.getForm().setValues(data);
_this.formEdit.getForm().findField('BILLSTATUS').setDisabled(true);
var editp = Ext.create('MsChInvoiceapplication', data);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
_this.GetEditStatus();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
ImportRemarks: function () {

@ -2778,7 +2778,7 @@ Ext.extend(Shipping.MsChPayapplicationBLEdit, Ext.Panel, {
_this.addBill();
} else {
Ext.MessageBox.alert('提示', '无添加申请费用明细!');
// Ext.MessageBox.alert('提示', '无添加申请费用明细!');
}
}
}

@ -7021,13 +7021,16 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
canDelete = true;
if (feeStatus != 1&&feeStatus != 6)
canDelete =false;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengShanChuFuHeTiaoJianDeFeiYong, //'只能删除费用状态为[录入状态]和[驳回提交]的费用,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
})
return;
}
if (canDelete) {
var op = rec.data.EnteroPerator;
@ -7038,6 +7041,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
return;
}
} else if (type == 2) {
@ -7046,6 +7050,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
return;
}
}
@ -7054,6 +7059,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已开出发票无法删除!'
canDelete = false;
return;
}
}
@ -7061,6 +7067,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
if (rec.data.VOUALLNO !='') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenChenPingZhengShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已开出发票无法删除!'
canDelete = false;
return;
}
}
@ -7068,6 +7075,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已申请费用无法删除!'
canDelete = false;
return;
}
}
@ -7075,6 +7083,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已申请开票无法删除!'
canDelete = false;
return;
}
}
@ -7082,6 +7091,7 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
if (rec.data.DEBITAMOUNT!=0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法删除!'
canDelete = false;
return;
}
}

@ -670,6 +670,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
this.formAMSPIL.getForm().findField('SalesRepCode').setValue('CN087');
this.formAMSPIL.getForm().findField('MasterBOLIndicator').setValue('3');
} if (combo.value == '现代') {
this.formHead.getForm().findField('CONTRACTNO').setValue('081546');
}
this.storeCodePackage.load({ params: { CARRIER: combo.value } });
this.storeCodeCtn.load({ params: { CARRIER: combo.value } });
@ -1591,7 +1595,14 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
defaultType: 'textfield',
items: [ {
fieldLabel: Zi.LAN.ORDERNO, //'订舱编号',
name: 'ORDERNO'
name: 'ORDERNO',
listeners: {
scope: this,
blur: function (field, The, eOpts) {
_this.formHead.getForm().findField('ORDERNO').setValue(field.value.toUpperCase().trim());
}
}
}, {
fieldLabel: Zi.LAN.MBLNO, //'主提单号',
name: 'MBLNO',

@ -1085,13 +1085,6 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
header: Zi.LAN.ISSUETYPE, //'签单方式',
width: 100
},
{
sortable: true,
id: '',
dataIndex: 'OPERATOR',
header: Zi.LAN.OPERATOR2, //'委托单位联系人',
width: 100
},
{
sortable: true,
id: '',
@ -1129,7 +1122,15 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
}, {
dataIndex: 'BLFRT',
header: Zi.LAN.BLFRT, //'付费方式',
width: 120
width: 120,
renderer: function (value, meta, record) {
if (value == 'FREIGHT PREPAID')
return 'PP';
else if (value == 'FREIGHT COLLECT')
return 'CC';
else
return value;
}
}, {
dataIndex: 'APPLYNO',
header: Zi.LAN.APPLYNO, //'申请放箱号',
@ -1228,6 +1229,14 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
header: Zi.LAN.INSURANCEOP, //'货物标识',
width: 70
}, {
dataIndex: 'OPERATOR',
header: 'OP', //'其他备注',
width: 120
}, {
dataIndex: 'MAILPROJECT',
header: 'EMAIL', //'其他备注',
width: 120
}, {
dataIndex: 'ISCANCEL',
header: '退舱', //'退舱',
width: 60,

Loading…
Cancel
Save