DS7_JingHan
hanxuntao 2 years ago
parent 1a2994783a
commit 4e444ebbb2

@ -231,12 +231,12 @@ namespace DSWeb.Areas.Account.Controllers
}
public ContentResult AddDetail(string bill, string data, string curr)
public ContentResult AddDetail(string bill, string data, string curr,string isdd="0")
{
var bodyList = JsonConvert.Deserialize<List<BillChfeeDetail>>(data);
var modb = new ModelObjectDB();
DBResult result = ChrecvapplicationDAL.AddDetail(bill, bodyList, curr, Convert.ToString(Session["COMPANYID"]));
DBResult result = ChrecvapplicationDAL.AddDetail(bill, bodyList, curr, Convert.ToString(Session["COMPANYID"]), isdd);
if (result.Success) { ChrecvapplicationDAL.p_update_Amount(bill); }
@ -244,7 +244,7 @@ namespace DSWeb.Areas.Account.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult AddBill(string billno, string billcust, string billcurr, string feesql, string storeCurrExrate, bool custgroup = false)
public ContentResult AddBill(string billno, string billcust, string billcurr, string feesql, string storeCurrExrate, bool custgroup = false, string isdd = "0")
{
var exrateList = JsonConvert.Deserialize<List<ChFeeExrate>>(storeCurrExrate);
@ -255,7 +255,7 @@ namespace DSWeb.Areas.Account.Controllers
if ((exrateList == null) || (exrateList.Count == 0))
{
var modb = new ModelObjectDB();
DBResult result = ChrecvapplicationDAL.AddBill(billno, billcust, billcurr, feesql, exrateList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), custgroup);
DBResult result = ChrecvapplicationDAL.AddBill(billno, billcust, billcurr, feesql, exrateList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), custgroup, isdd);
if (result.Success) { ChrecvapplicationDAL.p_update_Amount(billno); }
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
@ -276,7 +276,7 @@ namespace DSWeb.Areas.Account.Controllers
{
var modb = new ModelObjectDB();
DBResult result = ChrecvapplicationDAL.AddBill(billno, billcust, billcurr, feesql, exrateList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
DBResult result = ChrecvapplicationDAL.AddBill(billno, billcust, billcurr, feesql, exrateList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]),false,isdd);
if (result.Success) { ChrecvapplicationDAL.p_update_Amount(billno); }
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };

@ -96,6 +96,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
strSql.Append(",(select ADDRESS from [company] where gid=cm.SALECORPID) ADDRESS");
strSql.Append(",(select BILLRISES from [company] where gid=cm.SALECORPID) BILLRISES");
strSql.Append(",PAYEE,CHECKER,SETRED,INVITERFACE");
strSql.Append(",(select top 1 REMARK from [info_client_inv] where CUSTNAME=cm.CUSTOMERNAME) INVREMARK");
strSql.Append(" FROM ch_fee_invoice cm where 1=1 ");
if (!string.IsNullOrEmpty(strCondition))
@ -184,7 +185,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
strSql.Append(",(select OFFICEPHONE from [company] where gid=cm.SALECORPID) OFFICEPHONE");
strSql.Append(",(select ADDRESS from [company] where gid=cm.SALECORPID) ADDRESS");
strSql.Append(",(select BILLRISES from [company] where gid=cm.SALECORPID) BILLRISES");
strSql.Append(",(select top 1 REMARK from [info_client_inv] where CUSTNAME=cm.CUSTOMERNAME) INVREMARK");
strSql.Append(",PAYEE,CHECKER,SETRED,INVITERFACE");
strSql.Append(" FROM ch_fee_invoice cm where 1=1 ");
@ -336,6 +337,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
data.CREATEUSERREF = Convert.ToString(reader["CREATEUSERREF"]);
if (reader["CREATETIME"] != DBNull.Value)
data.CREATETIME = Convert.ToDateTime(reader["CREATETIME"]).ToString("yyyy-MM-dd HH:mm:ss");
data.INVREMARK= Convert.ToString(reader["INVREMARK"]);
#endregion
headList.Add(data);
}

@ -404,6 +404,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append(" SELECT GID,LINKGID,BILLSTATUS,CUSTOMERNAME,INVOICECUSTNAME,AMOUNT,CURRENCY,REMARK,CUSTRATENO,CUSTADDRTEL,CUSTBANK,CUSTTEL,CUSTADDR ");
strSql.Append(",EMAIL,GOODSNAME,(Select GOODNAME from code_goods_inv where GID=ch_fee_invoiceapplication_detail.GOODSNAME) AS GOODSNAMEREF");
strSql.Append(",(SELECT TOP 1 INVOICENO FROM ch_fee_invoice WHERE BILLNO = ch_fee_invoiceapplication_detail.INVBILLNO) INVOICENO,INVOICELINE ");
strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=80003 and EnumValueID=ch_fee_invoiceapplication_detail.INVOICELINE) as INVOICELINEREF");
strSql.Append(" FROM ch_fee_invoiceapplication_detail ");
if (!string.IsNullOrEmpty(strCondition))
@ -1879,7 +1880,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append(" LEFT JOIN v_op_gain_cust_sum g ON (g.BSNO=B.BSNO and g.CUSTOMERNAME=f.CUSTOMERNAME) ");
strSql.Append(" left join ch_dui_detail d on (d.CH_ID=f.GID) WHERE D.DUINO='" + duino + "' AND ISNULL(D.INVNO,'')='' ");
strSql.Append(" and (f.AMOUNT-f.ORDERAMOUNT)<>0 and f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
strSql.Append(" and f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
}
else
{
@ -1892,7 +1893,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append(" FROM CH_FEE f ");
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append(" LEFT JOIN v_op_gain_cust_sum g ON (g.BSNO=B.BSNO and g.CUSTOMERNAME=f.CUSTOMERNAME) ");
strSql.Append(" where (f.AMOUNT-f.ORDERAMOUNT)<>0 and f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
strSql.Append(" where f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
}
@ -1909,7 +1910,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
}
if (INVISNOTSTL.PARAMVALUE == "1")
{
strSql.Append(" and ISNULL(f.AMOUNT,0)<>ISNULL(f.SETTLEMENT,0) ");
}
var isopen = MsBaseInfoDAL.GetUserModuleEnable("modFeenotopen", userid);
if (isopen == false)
@ -1997,7 +2002,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append(" FROM CH_FEE f ");
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append(" left join ch_dui_detail d on (d.CH_ID=f.GID) WHERE D.DUINO='" + duino + "' AND ISNULL(D.INVNO,'')='' ");
strSql.Append(" and (f.AMOUNT-f.ORDERAMOUNT)<>0 and f.ISINVOICE<>1 and f.FEESTATUS IN (0,8,9) and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
strSql.Append(" and f.ISINVOICE<>1 and f.FEESTATUS IN (0,8,9) and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
}
else
@ -2005,7 +2010,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append("SELECT COUNT(*) FROM (select b.BSNO,f.CUSTOMERNAME ");
strSql.Append(" FROM CH_FEE f ");
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append(" where (f.AMOUNT-f.ORDERAMOUNT)<>0 and f.ISINVOICE<>1 and f.FEESTATUS IN (0,8,9) and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
strSql.Append(" where f.ISINVOICE<>1 and f.FEESTATUS IN (0,8,9) and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
}
if (!string.IsNullOrEmpty(strCondition))
@ -2578,7 +2583,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append(",(select ShowName from [user] where GID=f.EnteroPerator) as OpName");
strSql.Append(",f.INPUTMODE,f.UNIT,f.UNITPRICE,f.QUANTITY,d.DEBITAMOUNT from ch_fee f ");
strSql.Append(" left join ch_dui_detail d on (d.CH_ID=f.GID) WHERE D.DUINO='" + duino + "' AND ISNULL(D.INVNO,'')='' ");
strSql.Append(" and (f.AMOUNT-f.ORDERAMOUNT)<>0 and f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
strSql.Append(" and f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
}
else
@ -2589,7 +2594,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoiceapplication
strSql.Append(",f.feeName,f.customerName,f.amount,f.amount-isnull(f.INVOICE,0)-isnull(f.ORDERINVOICE,0)+isnull(f.ORDERINVSETTLEMENT,0) as balamount,f.currency,f.exChangerate,f.AccTaxRate,f.remark");
strSql.Append(",(select ShowName from [user] where GID=f.EnteroPerator) as OpName");
strSql.Append(",f.INPUTMODE,f.UNIT,f.UNITPRICE,f.QUANTITY,0 DEBITAMOUNT from ch_fee f ");
strSql.Append(" where (f.AMOUNT-f.ORDERAMOUNT)<>0 and f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
strSql.Append(" where f.ISINVOICE<>1 and (f.AMOUNT<>(ISNULL(f.INVOICE,0)+ISNULL(f.ORDERINVOICE,0)-ISNULL(f.ORDERINVSETTLEMENT,0))) and ISNULL(f.INVLINKGID,'')='' ");
}
var InvAppFeeStatus = MsSysParamSetDAL.GetData("PARAMNAME='InvAppFeeStatus'");
if (InvAppFeeStatus.PARAMVALUE != "2")

@ -1200,7 +1200,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
public static DBResult AddDetail(string billno, List<BillChfeeDetail> bodyList, string curr, string companyid)
public static DBResult AddDetail(string billno, List<BillChfeeDetail> bodyList, string curr, string companyid, string isdd = "0")
{
var result = new DBResult();
@ -1228,6 +1228,14 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
@"UPDATE CH_FEE SET ORDERAMOUNT=ISNULL(ORDERAMOUNT,0)+@ORDERAMOUNT WHERE GID=@GID AND ((AMOUNT>=0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT2)>=0)
OR (AMOUNT<0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT3)<=0))");
if (isdd == "1")
{
cmdUpdate =
db.GetSqlStringCommand(
@"UPDATE CH_FEE SET ORDERAMOUNT=ISNULL(ORDERAMOUNT,0)+@ORDERAMOUNT,ORDERINVOICE=isnull(ORDERINVOICE,0)+@ORDERAMOUNT WHERE GID=@GID AND ((AMOUNT>=0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT2)>=0)
OR (AMOUNT<0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT3)<=0))");
}
if (bodyList != null)
{
@ -1310,7 +1318,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
}
public static DBResult AddBill(string billno, string billcust, string billcurr, string feesql, List<ChFeeExrate> exratelist, string companyid,string userid,string username, bool custgroup = false)
public static DBResult AddBill(string billno, string billcust, string billcurr, string feesql, List<ChFeeExrate> exratelist, string companyid,string userid,string username, bool custgroup = false, string isdd = "0")
{
var result = new DBResult();
var recapp = GetData("BILLNO='"+billno+"'");
@ -1346,7 +1354,13 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
@"UPDATE CH_FEE SET ORDERAMOUNT=ISNULL(ORDERAMOUNT,0)+@ORDERAMOUNT WHERE GID=@GID AND ((AMOUNT>=0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT2)>=0)
OR (AMOUNT<0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT3)<=0))");
if (isdd == "1") {
cmdUpdate =
db.GetSqlStringCommand(
@"UPDATE CH_FEE SET ORDERAMOUNT=ISNULL(ORDERAMOUNT,0)+@ORDERAMOUNT,ORDERINVOICE=isnull(ORDERINVOICE,0)+@ORDERAMOUNT WHERE GID=@GID AND ((AMOUNT>=0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT2)>=0)
OR (AMOUNT<0 AND ((AMOUNT-SETTLEMENT)-@ORDERAMOUNT3)<=0))");
}
if (feelist != null)
{
@ -1472,6 +1486,13 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
public static DBResult DelFeeDo(List<Chfee_do_detail> boday)
{
var result = new DBResult();
if (boday == null || boday.Count == 0) {
result.Success = true;
result.Message = "成功";
return result;
}
var headdata = GetData("BILLNO='"+ boday[0].BILLNO + "'");
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
@ -1487,6 +1508,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
{
var cmdupdate = db.GetSqlStringCommand("update ch_fee set ORDERAMOUNT=isnull((select sum(Amount) from ch_fee_do where GID<>@FEEDOID and feeid=ch_fee.gid and CATEGORY in(2,5) ),0) where GID=@GID");
if (headdata.SETTLEMODE == 3) {
cmdupdate = db.GetSqlStringCommand("update ch_fee set ORDERAMOUNT=isnull((select sum(Amount) from ch_fee_do where GID<>@FEEDOID and feeid=ch_fee.gid and CATEGORY in(2,5) ),0),ORDERINVOICE=ORDERINVOICE-@ORDERINVOICE where GID=@GID");
}
var cmddelete = db.GetSqlStringCommand("delete from ch_fee_do where GID=@FEEDOID");
@ -1497,7 +1523,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@FEEDOID", DbType.String, enumValue.FEEDOID);
db.AddInParameter(cmdupdate, "@GID", DbType.String, enumValue.FEEID);
db.ExecuteNonQuery(cmdupdate, tran);
if (headdata.SETTLEMODE == 3)
{
db.AddInParameter(cmdupdate, "@ORDERINVOICE", DbType.Decimal, enumValue.ORIGAMOUNT);
}
db.ExecuteNonQuery(cmdupdate, tran);
cmddelete.Parameters.Clear();
db.AddInParameter(cmddelete, "@FEEDOID", DbType.String, enumValue.FEEDOID);

@ -104,7 +104,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice
}
public string CREATEUSERREF { get; set; }
public string INVREMARK { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string CREATETIME

@ -440,6 +440,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoiceapplication
[ModelDB]
public string INVOICELINE { get; set; }
public string INVOICELINEREF { get; set; }
public string GOODSNAMEREF { get; set; }
public string INVBILLNO { get; set; }

@ -1237,6 +1237,14 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
}]
}]
}, {
xtype: 'textareafield',
grow: true,
name: 'INVREMARK',
readOnly: true,
height: 61,
fieldLabel: '客户发票备注',
anchor: '100%'
},
//////
{
@ -2165,7 +2173,152 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
}
});
this.initappgirdcolums = [{
sortable: false,
dataIndex: 'BILLNO',
header: '申请单号',
width: 120
}, {
sortable: false,
dataIndex: 'BILLSTATUSREF',
header: '状态',
width: 80
}, {
sortable: true,
dataIndex: 'INVTYPE',
header: '开票方式',
width: 60
}, {
sortable: true,
dataIndex: 'APPLYAMOUNT',
header: '人民币金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'OTCURRAMOUNT',
header: '美元金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: '开票币别',
width: 60
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: '折合金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'INVAMOUNT',
header: '开票金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: false,
dataIndex: 'APPLYTIME',
header: '申请日期',
width: 100
}, {
sortable: false,
dataIndex: 'APPLICANTNAME',
header: '申请人',
width: 100
}, {
sortable: false,
dataIndex: 'INVOICENO',
header: '发票号',
width: 120
}, {
sortable: false,
dataIndex: 'INVOICECUSTNAME',
header: '发票抬头',
width: 160
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 360
}, {
sortable: true,
dataIndex: 'SHENREMARK',
header: '开票要求',
width: 360
}
];
this.appgirdcolums=this.initappgirdcolums;
this.gridAppList = new Ext.grid.GridPanel({
store: this.storeBodyAppList,
enableHdMenu: false,
@ -2177,158 +2330,28 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
viewConfig: {
enableTextSelection: true
},
//tbar: [{
// text: '删除申请明细',
// tooltip: '删除申请明细',
// iconCls: "btndeletedetail",
// id: "btndeldetail",
// handler: function (button, event) {
// this.onDeleteClick(button, event);
// },
// scope: this
//}],
columns: [{
sortable: false,
dataIndex: 'BILLNO',
header: '申请单号',
width: 120
}, {
sortable: false,
dataIndex: 'BILLSTATUSREF',
header: '状态',
width: 80
}, {
sortable: true,
dataIndex: 'INVTYPE',
header: '开票方式',
width: 60
}, {
sortable: true,
dataIndex: 'APPLYAMOUNT',
header: '人民币金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'OTCURRAMOUNT',
header: '美元金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: '开票币别',
width: 60
}, {
sortable: true,
dataIndex: 'AMOUNT',
header: '折合金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'INVAMOUNT',
header: '开票金额',
align: 'right',
width: 100,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
tbar: [{
text: "保存列表样式",
id: "btntest",
menu: [
{
text: "保存",
handler: function (button, event) {
this.appgirdcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'app', _this.gridAppList.columns, _this.appgirdcolums, 1, true);
}
catch (e) {
return value;
}, {
text: "初始化",
handler: function (menu, event) {
_this.appgirdcolums = DsTruck.SaveGridPanel(USERID, _this.formname + 'app', _this.gridAppList.columns, _this.initappgirdcolums, 1, true);
}
return value;
}
}, {
sortable: false,
dataIndex: 'APPLYTIME',
header: '申请日期',
width: 100
}, {
sortable: false,
dataIndex: 'APPLICANTNAME',
header: '申请人',
width: 100
}, {
sortable: false,
dataIndex: 'INVOICENO',
header: '发票号',
width: 120
}, {
sortable: false,
dataIndex: 'INVOICECUSTNAME',
header: '发票抬头',
width: 160
}, {
sortable: false,
dataIndex: 'REMARK',
header: '备注',
width: 260
}
]
}],
scope: this
}],
columns: this.appgirdcolums
});
this.appgirdcolums = DsTruck.GetGridPanel(USERID, this.formname+'app', this.appgirdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridAppList.reconfigure(this.storeBodyAppList, this.appgirdcolums);

@ -81,7 +81,8 @@
{ name: 'PUSHMODEREF', type: 'string' },
{ name: 'INVOICELINEREF', type: 'string' },
{ name: 'EINVOICESTATEREF', type: 'string' },
{ name: 'SETRED', type: 'string' }
{ name: 'SETRED', type: 'string' },
{ name: 'INVREMARK', type: 'string' }
]

@ -181,6 +181,10 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
columns: this.girdcolums ,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
@ -856,7 +860,7 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
store: this.StoreINVOICELINE,
forceSelection: true,
name: 'INVOICELINE',
valueField: 'EnumValueName',
valueField: 'EnumValueId',
displayField: 'EnumValueName'
});
@ -968,6 +972,9 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
dataIndex: 'INVOICELINE',
header: '发票种类',
editor: this.comboxINVOICELINE,
renderer: function (value, p, record) {
return record.data.INVOICELINEREF;
},
width: 80
}, {
sortable: false,
@ -1512,9 +1519,20 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
}
} else if (e.field == 'INVOICELINE') {
var records = DsStoreQueryBy(this.StoreINVOICELINE, 'EnumValueId', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var CLIENTNAME = data.EnumValueName;
e.record.set('INVOICELINEREF', CLIENTNAME);
}
}
},
onAddInvAppDetailClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();

@ -297,7 +297,15 @@ Ext.extend(Shipping.ChInvoiceapplicationAudit, Ext.Panel, {
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '1'
value: '1',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
@ -340,7 +348,15 @@ Ext.extend(Shipping.ChInvoiceapplicationAudit, Ext.Panel, {
forceSelection: true,
name: 'APPLICANT',
valueField: 'GID',
displayField: 'CodeAndName'
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.formSearch = Ext.widget('form', {

@ -194,6 +194,8 @@ Ext.define('ChInvoiceapplicationDetail', {
{ name: 'LINKGID', type: 'string' },
{ name: 'BILLSTATUS', type: 'string' },
{ name: 'INVOICELINE', type: 'string' },
{ name: 'INVOICELINEREF', type: 'string' },
{ name: 'INVOICECUSTNAME', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'AMOUNT', type: 'string' },

@ -1409,12 +1409,21 @@ Ext.extend(Shipping.MsChInvoiceapplicationBLEdit, Ext.Panel, {
});
this.comboxINVOICELINE = getEnumcombox({
NAME: 'INVOICELINE',
enumTypeId: 80003
this.StoreINVOICELINE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.StoreINVOICELINE.load({ params: { enumTypeId: 80003 } });
this.comboxINVOICELINE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreINVOICELINE,
forceSelection: true,
name: 'INVOICELINE',
valueField: 'EnumValueId',
displayField: 'EnumValueName'
});
this.gridAppDetailList = new Ext.grid.GridPanel({
store: this.storeAppDetailList,
enableHdMenu: false,
@ -1487,6 +1496,9 @@ Ext.extend(Shipping.MsChInvoiceapplicationBLEdit, Ext.Panel, {
dataIndex: 'INVOICELINE',
header: '发票种类',
editor: this.comboxINVOICELINE,
renderer: function (value, p, record) {
return record.data.INVOICELINEREF;
},
width: 80
}, {
sortable: false,
@ -3704,6 +3716,13 @@ gridListDetailAfterEdit: function (editor, e, eOpts) {
e.record.set('GOODSNAMEREF', '');
}
} else if (e.field == 'INVOICELINE') {
var records = DsStoreQueryBy(this.StoreINVOICELINE, 'EnumValueId', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var CLIENTNAME = data.EnumValueName;
e.record.set('INVOICELINEREF', CLIENTNAME);
}
}
},
@ -3866,12 +3885,18 @@ onUpKeyClick: function (col) {
var bodyDatas = [];
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.GID == "" || rec.PID == "*") //如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeAppDetailList.remove(selectedRecords[i]);
if (rec.data.BILLSTATUS != '已开') {
if (rec.GID == "" || rec.PID == "*") //如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeAppDetailList.remove(selectedRecords[i]);
} else {
bodyDatas.push(rec);
}
} else {
Ext.Msg.show({ title: '提示', msg: '已开发票不允许删除!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
bodyDatas.push(rec);
}
}
var jsonBody = ConvertRecordsToJsonAll(bodyDatas);
@ -6231,15 +6256,22 @@ NextRecord: function () {
//合计选中的费用数字和
onSelectFee: function (button, event) {
//Ext.getCmp("zongshu").setText("1234");
var rmbsum = 0;
var usdsum = 0;
var selectedRecords = this.gridAddFeeList.selModel.getSelection();
var sum = 0;
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
sum = sum + rec.get("StlAmount");
if (rec.get('Currency') == 'RMB') {
rmbsum = rmbsum + rec.get("StlAmount");
} else if (rec.get('Currency') == 'USD') {
usdsum = usdsum + rec.get("StlAmount");
}
}
sum = sum.toFixed(2);
Ext.getCmp("zongshu").setText(" 选中金额:" + sum);
rmbsum = rmbsum.toFixed(2);
usdsum = usdsum.toFixed(2);
Ext.getCmp("zongshu").setText(" 选中金额 RMB:" + rmbsum + " USD:" + usdsum);
},

@ -2485,7 +2485,8 @@ Ext.extend(Shipping.MsChRecvapplicationDdEdit, Ext.Panel, {
params: {
bill: billno,
data: jsonbodyAddDatas,
curr: billcurr
curr: billcurr,
isdd:'1'
},
callback: function (options, success, response) {
if (success) {
@ -2773,7 +2774,8 @@ Ext.extend(Shipping.MsChRecvapplicationDdEdit, Ext.Panel, {
billcurr: billcurr,
feesql: sql,
storeCurrExrate: currBody,
custgroup: true
custgroup: true,
isdd: '1'
},
callback: function (options, success, response) {
if (success) {

@ -16150,6 +16150,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
dlPKGS += ctn.PKGS;
dlKGS += ctn.KGS;
dlCBM += ctn.CBM;
if (ctn.CNTRNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + "集装箱箱号不能为空!"; }
}
}
@ -16161,6 +16163,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱重量合计数必须等于委托单总重量数"; }
if (dlCBM != Convert.ToDecimal(bill.CBM))
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱尺码合计数必须等于委托单总尺码数"; }
}
}
@ -16696,7 +16699,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
tempstr += GetSpaceStr("", 14);//13 //Filler//M//X(14)//237 //250 //Spaces
tempstr = GetSpaceStr(tempstr, 236);
tempstr += GetSpaceStr(OpAms.SalesRepCode, 14);//13 //Filler//M//X(14)//237 //250 //Spaces
if (!string.IsNullOrEmpty(bill.SERVICECONTRACTNO))//运费预付
{
tempstr += GetSpaceStr(bill.SERVICECONTRACTNO, 10);//3 //Booking Party Code//O//X(10)//6 //15 //webcsm Partner Code
@ -17875,9 +17878,15 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
// tempstr += GetSpaceStr("", 10);//3//Shipper Code//O//X(10)//6//15//webcsm Partner Code//mandtory for CIF shpts,预付必填
//}
//else
//{
tempstr += GetSpaceStr(OpAms.ShipperEdiCode, 10);//3//Shipper Code//O//X(10)//6//15//webcsm Partner Code//mandtory for CIF shpts,预付必填
//}
if (filetype == "E")
{
tempstr += GetSpaceStr(ftpset.ALIASSENDCODE, 10);
}
else {
tempstr += GetSpaceStr(OpAms.ShipperEdiCode, 10);
}
//}
tempstr += GetSpaceStr("", 3);//4//Shipper Code//O//X(3)//16//18//webcsm Partner Subcode
tempstr += GetSpaceStr("", 4);//5//Filler//M//X(4)//19//22//Spaces
var Shipping = "";

@ -2044,6 +2044,16 @@ Ext.extend(Shipping.MsInfoClientEdit, Ext.Panel, {
selectOnFocus: true,
enableKeyEvents: true
}
}, {
sortable: true,
dataIndex: 'REMARK',
width: 200,
header: Zi.LAN.INVREMARK, //'汇率',
editor: {
xtype: 'textfield',
selectOnFocus: true,
enableKeyEvents: true
}
}
]
});

@ -309,4 +309,5 @@ Zi.LAN.CARRIER = "船公司";
Zi.LAN.STLREMARK = "结算描述";
Zi.LAN.INVOICECUSTNAME = "发票抬头";
Zi.LAN.CUSTBANK = "人民币银行账号";
Zi.LAN.CUSTUSDBANK = "美元银行账号";
Zi.LAN.CUSTUSDBANK = "美元银行账号";
Zi.LAN.INVREMARK = "开票备注";

@ -311,3 +311,4 @@ Zi.LAN.STLREMARK = "结算描述";
Zi.LAN.INVOICECUSTNAME = "发票抬头";
Zi.LAN.CUSTBANK = "人民币银行账号";
Zi.LAN.CUSTUSDBANK = "美元银行账号";
Zi.LAN.INVREMARK = "开票备注";

@ -631,7 +631,15 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
dataIndex: 'VESSEL',
header: Zi.LAN.VESSEL, //'船名',
width: 100,
filter: true
filter: true,
renderer: function (value, meta) {
meta.tdCls = 'mblno';
btnurl = getGridCopyButton(value);
return btnurl + value;
}
},
{
sortable: true,
@ -7862,99 +7870,101 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
icount = icount + 1;
}
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/IsDeleteList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/DeleteList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onDsQuery();
if (jsonresult.Message != '')
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
else
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
else {
if (jsonresult.Message!='') {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} else {
Ext.MessageBox.confirm(Zi.LAN.TiShi, jsonresult.Message2 +"确定删除吗?", function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/DeleteList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onDsQuery();
if (jsonresult.Message != '')
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
else
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
Ext.MessageBox.confirm(Zi.LAN.TiShi, "确定删除吗?", function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/IsDeleteList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/DeleteList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_thisopseaeindex.onDsQuery();
if (jsonresult.Message != '')
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
else
Ext.Msg.hide();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
else {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
else {
if (jsonresult.Message != '') {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
} else {
Ext.MessageBox.confirm(Zi.LAN.TiShi, jsonresult.Message2 + "确定删除吗?", function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/DeleteList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_thisopseaeindex.onDsQuery();
if (jsonresult.Message != '')
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
else
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
}
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
});

Loading…
Cancel
Save