diff --git a/erp_web/js/pages/financial/advance_in.js b/erp_web/js/pages/financial/advance_in.js index 9ddb2363..8dd24496 100644 --- a/erp_web/js/pages/financial/advance_in.js +++ b/erp_web/js/pages/financial/advance_in.js @@ -896,59 +896,57 @@ function CheckData() { function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { append(); removeit(); - if ($("#accountData").datagrid('getChanges').length) { - if (!CheckData()) - return false; - var inserted = $("#accountData").datagrid('getChanges', "inserted"); - var deleted = $("#accountData").datagrid('getChanges', "deleted"); - var updated = $("#accountData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: url, - dataType: "json", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - info : JSON.stringify({ - Type: listType, - BillNo: $.trim($("#BillNo").val()), - BillTime: $.trim($("#BillTime").val()), - AccountId: $.trim($("#AccountId").val()), - ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 - TotalPrice: TotalPrice, //合计 - OrganId: OrganId, - HandsPersonId: $.trim($("#HandsPersonId").val()), - Remark: $.trim($("#Remark").val()) - }), - listType: listType - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - $('#accountHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } + if (!CheckData()) + return false; + var inserted = $("#accountData").datagrid('getChanges', "inserted"); + var deleted = $("#accountData").datagrid('getChanges', "deleted"); + var updated = $("#accountData").datagrid('getChanges', "updated"); + $.ajax({ + type: "post", + url: url, + dataType: "json", + data: { + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + info : JSON.stringify({ + Type: listType, + BillNo: $.trim($("#BillNo").val()), + BillTime: $.trim($("#BillTime").val()), + AccountId: $.trim($("#AccountId").val()), + ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 + TotalPrice: TotalPrice, //合计 + OrganId: OrganId, + HandsPersonId: $.trim($("#HandsPersonId").val()), + Remark: $.trim($("#Remark").val()) + }), + listType: listType + }, + success: function (tipInfo) + { + if (tipInfo) { + $.messager.alert('提示','保存成功!','info'); + $('#accountHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + showAccountHeadDetails(opts.pageNumber, opts.pageSize); + if (endEditing()) { + $('#accountData').datagrid('acceptChanges'); } - else{ - - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } - }); - } + else{ + + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + + }, + error: function (XmlHttpRequest, textStatus, errorThrown) + { + $.messager.alert('提示',XmlHttpRequest.responseText,'error'); + } + }); } diff --git a/erp_web/js/pages/financial/giro.js b/erp_web/js/pages/financial/giro.js index fe05d6bf..c4db3a2d 100644 --- a/erp_web/js/pages/financial/giro.js +++ b/erp_web/js/pages/financial/giro.js @@ -803,58 +803,56 @@ function CheckData() { function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { append(); removeit(); - if ($("#accountData").datagrid('getChanges').length) { - if (!CheckData()) - return false; - var inserted = $("#accountData").datagrid('getChanges', "inserted"); - var deleted = $("#accountData").datagrid('getChanges', "deleted"); - var updated = $("#accountData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: url, - dataType: "json", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - info : JSON.stringify({ - Type: listType, - BillNo: $.trim($("#BillNo").val()), - BillTime: $.trim($("#BillTime").val()), - AccountId: $.trim($("#AccountId").val()), - ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 - TotalPrice: TotalPrice, //合计 - OrganId: OrganId, - HandsPersonId: $.trim($("#HandsPersonId").val()), - Remark: $.trim($("#Remark").val()) - }), - listType: listType - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - $('#accountHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } + if (!CheckData()) + return false; + var inserted = $("#accountData").datagrid('getChanges', "inserted"); + var deleted = $("#accountData").datagrid('getChanges', "deleted"); + var updated = $("#accountData").datagrid('getChanges', "updated"); + $.ajax({ + type: "post", + url: url, + dataType: "json", + data: { + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + info : JSON.stringify({ + Type: listType, + BillNo: $.trim($("#BillNo").val()), + BillTime: $.trim($("#BillTime").val()), + AccountId: $.trim($("#AccountId").val()), + ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 + TotalPrice: TotalPrice, //合计 + OrganId: OrganId, + HandsPersonId: $.trim($("#HandsPersonId").val()), + Remark: $.trim($("#Remark").val()) + }), + listType: listType + }, + success: function (tipInfo) + { + if (tipInfo) { + $.messager.alert('提示','保存成功!','info'); + $('#accountHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + showAccountHeadDetails(opts.pageNumber, opts.pageSize); + if (endEditing()) { + $('#accountData').datagrid('acceptChanges'); } - else{ - - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } - }); - } + else{ + + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + + }, + error: function (XmlHttpRequest, textStatus, errorThrown) + { + $.messager.alert('提示',XmlHttpRequest.responseText,'error'); + } + }); } \ No newline at end of file diff --git a/erp_web/js/pages/financial/item_in.js b/erp_web/js/pages/financial/item_in.js index 52b19d71..e68bcafb 100644 --- a/erp_web/js/pages/financial/item_in.js +++ b/erp_web/js/pages/financial/item_in.js @@ -819,58 +819,56 @@ function CheckData() { function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { append(); removeit(); - if ($("#accountData").datagrid('getChanges').length) { - if (!CheckData()) - return false; - var inserted = $("#accountData").datagrid('getChanges', "inserted"); - var deleted = $("#accountData").datagrid('getChanges', "deleted"); - var updated = $("#accountData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: url, - dataType: "json", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - info : JSON.stringify({ - Type: listType, - BillNo: $.trim($("#BillNo").val()), - BillTime: $.trim($("#BillTime").val()), - AccountId: $.trim($("#AccountId").val()), - ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 - TotalPrice: TotalPrice, //合计 - OrganId: OrganId, - HandsPersonId: $.trim($("#HandsPersonId").val()), - Remark: $.trim($("#Remark").val()) - }), - listType: listType - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - $('#accountHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } + if (!CheckData()) + return false; + var inserted = $("#accountData").datagrid('getChanges', "inserted"); + var deleted = $("#accountData").datagrid('getChanges', "deleted"); + var updated = $("#accountData").datagrid('getChanges', "updated"); + $.ajax({ + type: "post", + url: url, + dataType: "json", + data: { + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + info : JSON.stringify({ + Type: listType, + BillNo: $.trim($("#BillNo").val()), + BillTime: $.trim($("#BillTime").val()), + AccountId: $.trim($("#AccountId").val()), + ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 + TotalPrice: TotalPrice, //合计 + OrganId: OrganId, + HandsPersonId: $.trim($("#HandsPersonId").val()), + Remark: $.trim($("#Remark").val()) + }), + listType: listType + }, + success: function (tipInfo) + { + if (tipInfo) { + $.messager.alert('提示','保存成功!','info'); + $('#accountHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + showAccountHeadDetails(opts.pageNumber, opts.pageSize); + if (endEditing()) { + $('#accountData').datagrid('acceptChanges'); } - else{ - - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } - }); - } + else{ + + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + + }, + error: function (XmlHttpRequest, textStatus, errorThrown) + { + $.messager.alert('提示',XmlHttpRequest.responseText,'error'); + } + }); } \ No newline at end of file diff --git a/erp_web/js/pages/financial/item_out.js b/erp_web/js/pages/financial/item_out.js index cab3735c..57028e4c 100644 --- a/erp_web/js/pages/financial/item_out.js +++ b/erp_web/js/pages/financial/item_out.js @@ -825,58 +825,56 @@ function CheckData() { function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { append(); removeit(); - if ($("#accountData").datagrid('getChanges').length) { - if (!CheckData()) - return false; - var inserted = $("#accountData").datagrid('getChanges', "inserted"); - var deleted = $("#accountData").datagrid('getChanges', "deleted"); - var updated = $("#accountData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: url, - dataType: "json", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - info : JSON.stringify({ - Type: listType, - BillNo: $.trim($("#BillNo").val()), - BillTime: $.trim($("#BillTime").val()), - AccountId: $.trim($("#AccountId").val()), - ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 - TotalPrice: TotalPrice, //合计 - OrganId: OrganId, - HandsPersonId: $.trim($("#HandsPersonId").val()), - Remark: $.trim($("#Remark").val()) - }), - listType: listType - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - $('#accountHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } + if (!CheckData()) + return false; + var inserted = $("#accountData").datagrid('getChanges', "inserted"); + var deleted = $("#accountData").datagrid('getChanges', "deleted"); + var updated = $("#accountData").datagrid('getChanges', "updated"); + $.ajax({ + type: "post", + url: url, + dataType: "json", + data: { + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + info : JSON.stringify({ + Type: listType, + BillNo: $.trim($("#BillNo").val()), + BillTime: $.trim($("#BillTime").val()), + AccountId: $.trim($("#AccountId").val()), + ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 + TotalPrice: TotalPrice, //合计 + OrganId: OrganId, + HandsPersonId: $.trim($("#HandsPersonId").val()), + Remark: $.trim($("#Remark").val()) + }), + listType: listType + }, + success: function (tipInfo) + { + if (tipInfo) { + $.messager.alert('提示','保存成功!','info'); + $('#accountHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + showAccountHeadDetails(opts.pageNumber, opts.pageSize); + if (endEditing()) { + $('#accountData').datagrid('acceptChanges'); } - else{ - - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } - }); - } + else{ + + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + + }, + error: function (XmlHttpRequest, textStatus, errorThrown) + { + $.messager.alert('提示',XmlHttpRequest.responseText,'error'); + } + }); } \ No newline at end of file diff --git a/erp_web/js/pages/financial/money_in.js b/erp_web/js/pages/financial/money_in.js index af72f085..47f2c483 100644 --- a/erp_web/js/pages/financial/money_in.js +++ b/erp_web/js/pages/financial/money_in.js @@ -815,58 +815,56 @@ function CheckData() { function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { append(); removeit(); - if ($("#accountData").datagrid('getChanges').length) { - if (!CheckData()) - return false; - var inserted = $("#accountData").datagrid('getChanges', "inserted"); - var deleted = $("#accountData").datagrid('getChanges', "deleted"); - var updated = $("#accountData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: url, - dataType: "json", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - info : JSON.stringify({ - Type: listType, - BillNo: $.trim($("#BillNo").val()), - BillTime: $.trim($("#BillTime").val()), - AccountId: $.trim($("#AccountId").val()), - ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 - TotalPrice: TotalPrice, //合计 - OrganId: OrganId, - HandsPersonId: $.trim($("#HandsPersonId").val()), - Remark: $.trim($("#Remark").val()) - }), - listType: listType - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - $('#accountHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } + if (!CheckData()) + return false; + var inserted = $("#accountData").datagrid('getChanges', "inserted"); + var deleted = $("#accountData").datagrid('getChanges', "deleted"); + var updated = $("#accountData").datagrid('getChanges', "updated"); + $.ajax({ + type: "post", + url: url, + dataType: "json", + data: { + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + info : JSON.stringify({ + Type: listType, + BillNo: $.trim($("#BillNo").val()), + BillTime: $.trim($("#BillTime").val()), + AccountId: $.trim($("#AccountId").val()), + ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 + TotalPrice: TotalPrice, //合计 + OrganId: OrganId, + HandsPersonId: $.trim($("#HandsPersonId").val()), + Remark: $.trim($("#Remark").val()) + }), + listType: listType + }, + success: function (tipInfo) + { + if (tipInfo) { + $.messager.alert('提示','保存成功!','info'); + $('#accountHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + showAccountHeadDetails(opts.pageNumber, opts.pageSize); + if (endEditing()) { + $('#accountData').datagrid('acceptChanges'); } - else{ - - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } - }); - } + else{ + + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + + }, + error: function (XmlHttpRequest, textStatus, errorThrown) + { + $.messager.alert('提示',XmlHttpRequest.responseText,'error'); + } + }); } \ No newline at end of file diff --git a/erp_web/js/pages/financial/money_out.js b/erp_web/js/pages/financial/money_out.js index c8941956..6b8eb843 100644 --- a/erp_web/js/pages/financial/money_out.js +++ b/erp_web/js/pages/financial/money_out.js @@ -837,58 +837,56 @@ function CheckData() { function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { append(); removeit(); - if ($("#accountData").datagrid('getChanges').length) { - if (!CheckData()) - return false; - var inserted = $("#accountData").datagrid('getChanges', "inserted"); - var deleted = $("#accountData").datagrid('getChanges', "deleted"); - var updated = $("#accountData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: url, - dataType: "json", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - info : JSON.stringify({ - Type: listType, - BillNo: $.trim($("#BillNo").val()), - BillTime: $.trim($("#BillTime").val()), - AccountId: $.trim($("#AccountId").val()), - ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 - TotalPrice: TotalPrice, //合计 - OrganId: OrganId, - HandsPersonId: $.trim($("#HandsPersonId").val()), - Remark: $.trim($("#Remark").val()) - }), - listType: listType - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - $('#accountHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } + if (!CheckData()) + return false; + var inserted = $("#accountData").datagrid('getChanges', "inserted"); + var deleted = $("#accountData").datagrid('getChanges', "deleted"); + var updated = $("#accountData").datagrid('getChanges', "updated"); + $.ajax({ + type: "post", + url: url, + dataType: "json", + data: { + inserted: JSON.stringify(inserted), + deleted: JSON.stringify(deleted), + updated: JSON.stringify(updated), + info : JSON.stringify({ + Type: listType, + BillNo: $.trim($("#BillNo").val()), + BillTime: $.trim($("#BillTime").val()), + AccountId: $.trim($("#AccountId").val()), + ChangeAmount: ChangeAmount, //付款/收款/优惠/实付 + TotalPrice: TotalPrice, //合计 + OrganId: OrganId, + HandsPersonId: $.trim($("#HandsPersonId").val()), + Remark: $.trim($("#Remark").val()) + }), + listType: listType + }, + success: function (tipInfo) + { + if (tipInfo) { + $.messager.alert('提示','保存成功!','info'); + $('#accountHeadDlg').dialog('close'); + var opts = $("#tableData").datagrid('options'); + showAccountHeadDetails(opts.pageNumber, opts.pageSize); + if (endEditing()) { + $('#accountData').datagrid('acceptChanges'); } - else{ - - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } - }); - } + else{ + + $.messager.show({ + title: '错误提示', + msg: '保存信息失败,请稍后重试!' + }); + } + + }, + error: function (XmlHttpRequest, textStatus, errorThrown) + { + $.messager.alert('提示',XmlHttpRequest.responseText,'error'); + } + }); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/service/supplier/SupplierService.java b/src/main/java/com/jsh/erp/service/supplier/SupplierService.java index ae2695d2..495cb9f8 100644 --- a/src/main/java/com/jsh/erp/service/supplier/SupplierService.java +++ b/src/main/java/com/jsh/erp/service/supplier/SupplierService.java @@ -202,7 +202,7 @@ public class SupplierService { int result=0; try{ if(supplier!=null){ - supplier.setAdvancein(supplier.getAdvancein().add(advanceIn)); //增加预收款的金额,可能增加的是负值 + supplier.setAdvancein((supplier.getAdvancein()==null?BigDecimal.ZERO:supplier.getAdvancein()).add(advanceIn)); //增加预收款的金额,可能增加的是负值 result=supplierMapper.updateByPrimaryKeySelective(supplier); } }catch(Exception e){