增加-预付款充值和消费的功能
This commit is contained in:
@@ -159,6 +159,56 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新供应商-只更新预付款,其余用原来的值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void updateAdvanceIn()
|
||||||
|
{
|
||||||
|
Boolean flag = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Supplier supplier = supplierService.get(model.getSupplierID());
|
||||||
|
supplier.setContacts(supplier.getContacts());
|
||||||
|
supplier.setType(supplier.getType());
|
||||||
|
supplier.setDescription(supplier.getDescription());
|
||||||
|
supplier.setEmail(supplier.getEmail());
|
||||||
|
supplier.setAdvanceIn(supplier.getAdvanceIn() + model.getAdvanceIn()); //增加预收款的金额,可能增加的是负值
|
||||||
|
supplier.setBeginNeedGet(supplier.getBeginNeedGet());
|
||||||
|
supplier.setBeginNeedPay(supplier.getBeginNeedPay());
|
||||||
|
supplier.setIsystem((short)1);
|
||||||
|
supplier.setPhonenum(supplier.getPhonenum());
|
||||||
|
supplier.setSupplier(supplier.getSupplier());
|
||||||
|
supplier.setEnabled(supplier.getEnabled());
|
||||||
|
supplierService.update(supplier);
|
||||||
|
|
||||||
|
flag = true;
|
||||||
|
tipMsg = "成功";
|
||||||
|
tipType = 0;
|
||||||
|
}
|
||||||
|
catch (DataAccessException e)
|
||||||
|
{
|
||||||
|
Log.errorFileSync(">>>>>>>>>>>>>修改供应商ID为 : " + model.getSupplierID() + "信息失败", e);
|
||||||
|
flag = false;
|
||||||
|
tipMsg = "失败";
|
||||||
|
tipType = 1;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
toClient(flag.toString());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
Log.errorFileSync(">>>>>>>>>>>>修改供应商回写客户端结果异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logService.create(new Logdetails(getUser(), "更新供应商预付款", model.getClientIp(),
|
||||||
|
new Timestamp(System.currentTimeMillis())
|
||||||
|
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除指定ID供应商
|
* 批量删除指定ID供应商
|
||||||
* @return
|
* @return
|
||||||
@@ -244,6 +294,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
|||||||
item.put("contacts",supplier.getContacts());
|
item.put("contacts",supplier.getContacts());
|
||||||
item.put("phonenum", supplier.getPhonenum());
|
item.put("phonenum", supplier.getPhonenum());
|
||||||
item.put("email", supplier.getEmail());
|
item.put("email", supplier.getEmail());
|
||||||
|
item.put("AdvanceIn",supplier.getAdvanceIn());
|
||||||
item.put("BeginNeedGet",supplier.getBeginNeedGet());
|
item.put("BeginNeedGet",supplier.getBeginNeedGet());
|
||||||
item.put("BeginNeedPay",supplier.getBeginNeedPay());
|
item.put("BeginNeedPay",supplier.getBeginNeedPay());
|
||||||
item.put("isystem", supplier.getIsystem() == (short)0?"是":"否");
|
item.put("isystem", supplier.getIsystem() == (short)0?"是":"否");
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
|
|||||||
depotHead.setChangeAmount(model.getChangeAmount());
|
depotHead.setChangeAmount(model.getChangeAmount());
|
||||||
if(model.getAllocationProjectId()!=null){depotHead.setAllocationProjectId(new Depot(model.getAllocationProjectId()));}
|
if(model.getAllocationProjectId()!=null){depotHead.setAllocationProjectId(new Depot(model.getAllocationProjectId()));}
|
||||||
depotHead.setTotalPrice(model.getTotalPrice());
|
depotHead.setTotalPrice(model.getTotalPrice());
|
||||||
|
depotHead.setPayType(model.getPayType());
|
||||||
depotHead.setRemark(model.getRemark());
|
depotHead.setRemark(model.getRemark());
|
||||||
depotHeadService.create(depotHead);
|
depotHeadService.create(depotHead);
|
||||||
|
|
||||||
@@ -182,6 +183,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
|
|||||||
depotHead.setChangeAmount(model.getChangeAmount());
|
depotHead.setChangeAmount(model.getChangeAmount());
|
||||||
if(model.getAllocationProjectId()!=null){depotHead.setAllocationProjectId(new Depot(model.getAllocationProjectId()));}
|
if(model.getAllocationProjectId()!=null){depotHead.setAllocationProjectId(new Depot(model.getAllocationProjectId()));}
|
||||||
depotHead.setTotalPrice(model.getTotalPrice());
|
depotHead.setTotalPrice(model.getTotalPrice());
|
||||||
|
depotHead.setPayType(model.getPayType());
|
||||||
depotHead.setRemark(model.getRemark());
|
depotHead.setRemark(model.getRemark());
|
||||||
depotHeadService.update(depotHead);
|
depotHeadService.update(depotHead);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.jsh.dao.basic;
|
|||||||
|
|
||||||
import com.jsh.base.BaseDAO;
|
import com.jsh.base.BaseDAO;
|
||||||
import com.jsh.model.po.Supplier;
|
import com.jsh.model.po.Supplier;
|
||||||
|
import com.jsh.util.PageUtil;
|
||||||
|
import com.jsh.util.SearchConditionUtil;
|
||||||
|
import org.hibernate.Query;
|
||||||
|
|
||||||
public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO
|
public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO
|
||||||
{
|
{
|
||||||
@@ -15,5 +18,4 @@ public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO
|
|||||||
return Supplier.class;
|
return Supplier.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,5 +5,4 @@ import com.jsh.model.po.Supplier;
|
|||||||
|
|
||||||
public interface SupplierIDAO extends BaseIDAO<Supplier>
|
public interface SupplierIDAO extends BaseIDAO<Supplier>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public class DepotHead implements java.io.Serializable
|
|||||||
private Double ChangeAmount;
|
private Double ChangeAmount;
|
||||||
private Depot AllocationProjectId;
|
private Depot AllocationProjectId;
|
||||||
private Double TotalPrice;
|
private Double TotalPrice;
|
||||||
|
private String PayType;
|
||||||
private String Remark;
|
private String Remark;
|
||||||
|
|
||||||
public DepotHead()
|
public DepotHead()
|
||||||
@@ -34,7 +35,7 @@ public class DepotHead implements java.io.Serializable
|
|||||||
public DepotHead(String type, String subType, Depot projectId,
|
public DepotHead(String type, String subType, Depot projectId,
|
||||||
String number, String operPersonName, Timestamp createTime,
|
String number, String operPersonName, Timestamp createTime,
|
||||||
Timestamp operTime, Supplier organId, Person handsPersonId,
|
Timestamp operTime, Supplier organId, Person handsPersonId,
|
||||||
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice, String remark) {
|
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice,String payType, String remark) {
|
||||||
super();
|
super();
|
||||||
Type = type;
|
Type = type;
|
||||||
SubType = subType;
|
SubType = subType;
|
||||||
@@ -49,6 +50,7 @@ public class DepotHead implements java.io.Serializable
|
|||||||
ChangeAmount = changeAmount;
|
ChangeAmount = changeAmount;
|
||||||
AllocationProjectId = allocationProjectId;
|
AllocationProjectId = allocationProjectId;
|
||||||
TotalPrice = totalPrice;
|
TotalPrice = totalPrice;
|
||||||
|
PayType = payType;
|
||||||
Remark = remark;
|
Remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,6 +166,14 @@ public class DepotHead implements java.io.Serializable
|
|||||||
TotalPrice = totalPrice;
|
TotalPrice = totalPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPayType() {
|
||||||
|
return PayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayType(String payType) {
|
||||||
|
PayType = payType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getRemark() {
|
public String getRemark() {
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public class Supplier implements java.io.Serializable
|
|||||||
private String contacts;
|
private String contacts;
|
||||||
private String phonenum;
|
private String phonenum;
|
||||||
private String email;
|
private String email;
|
||||||
|
private Double advanceIn;
|
||||||
private Double BeginNeedGet;
|
private Double BeginNeedGet;
|
||||||
private Double BeginNeedPay;
|
private Double BeginNeedPay;
|
||||||
private Double AllNeedGet;
|
private Double AllNeedGet;
|
||||||
@@ -28,7 +29,7 @@ public class Supplier implements java.io.Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Supplier(String supplier, String type, String contacts, String phonenum,
|
public Supplier(String supplier, String type, String contacts, String phonenum,
|
||||||
String email, Short isystem, String description, Boolean enabled,
|
String email, Short isystem, String description, Boolean enabled, Double advanceIn,
|
||||||
Double beginNeedGet,Double beginNeedPay,Double allNeedGet,Double allNeedPay) {
|
Double beginNeedGet,Double beginNeedPay,Double allNeedGet,Double allNeedPay) {
|
||||||
super();
|
super();
|
||||||
this.supplier = supplier;
|
this.supplier = supplier;
|
||||||
@@ -43,6 +44,7 @@ public class Supplier implements java.io.Serializable
|
|||||||
this.isystem = isystem;
|
this.isystem = isystem;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
|
this.advanceIn = advanceIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId()
|
public Long getId()
|
||||||
@@ -160,4 +162,11 @@ public class Supplier implements java.io.Serializable
|
|||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getAdvanceIn() {
|
||||||
|
return advanceIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdvanceIn(Double advanceIn) {
|
||||||
|
this.advanceIn = advanceIn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ public class SupplierModel implements Serializable
|
|||||||
*/
|
*/
|
||||||
private String email = "";
|
private String email = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预付款
|
||||||
|
*/
|
||||||
|
private Double AdvanceIn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 期初应收
|
* 期初应收
|
||||||
*/
|
*/
|
||||||
@@ -136,6 +141,14 @@ public class SupplierModel implements Serializable
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getAdvanceIn() {
|
||||||
|
return AdvanceIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdvanceIn(Double advanceIn) {
|
||||||
|
AdvanceIn = advanceIn;
|
||||||
|
}
|
||||||
|
|
||||||
public void setBeginNeedGet(Double beginNeedGet)
|
public void setBeginNeedGet(Double beginNeedGet)
|
||||||
{
|
{
|
||||||
BeginNeedGet = beginNeedGet;
|
BeginNeedGet = beginNeedGet;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class DepotHeadModel implements Serializable
|
|||||||
private Double ChangeAmount;
|
private Double ChangeAmount;
|
||||||
private Long AllocationProjectId;
|
private Long AllocationProjectId;
|
||||||
private Double TotalPrice;
|
private Double TotalPrice;
|
||||||
|
private String PayType = "";
|
||||||
private String Remark = "";
|
private String Remark = "";
|
||||||
|
|
||||||
private String BeginTime; //查询开始时间
|
private String BeginTime; //查询开始时间
|
||||||
@@ -158,6 +159,14 @@ public class DepotHeadModel implements Serializable
|
|||||||
TotalPrice = totalPrice;
|
TotalPrice = totalPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPayType() {
|
||||||
|
return PayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayType(String payType) {
|
||||||
|
PayType = payType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getRemark() {
|
public String getRemark() {
|
||||||
return Remark;
|
return Remark;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.jsh.service.basic;
|
|||||||
import com.jsh.base.BaseService;
|
import com.jsh.base.BaseService;
|
||||||
import com.jsh.dao.basic.SupplierIDAO;
|
import com.jsh.dao.basic.SupplierIDAO;
|
||||||
import com.jsh.model.po.Supplier;
|
import com.jsh.model.po.Supplier;
|
||||||
|
import com.jsh.util.JshException;
|
||||||
|
|
||||||
public class SupplierService extends BaseService<Supplier> implements SupplierIService
|
public class SupplierService extends BaseService<Supplier> implements SupplierIService
|
||||||
{
|
{
|
||||||
@@ -22,4 +23,5 @@ public class SupplierService extends BaseService<Supplier> implements SupplierIS
|
|||||||
{
|
{
|
||||||
return Supplier.class;
|
return Supplier.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,11 @@
|
|||||||
<comment>合计金额</comment>
|
<comment>合计金额</comment>
|
||||||
</column>
|
</column>
|
||||||
</property>
|
</property>
|
||||||
|
<property generated="never" lazy="false" name="PayType" type="java.lang.String">
|
||||||
|
<column length="50" name="PayType">
|
||||||
|
<comment>付款类型</comment>
|
||||||
|
</column>
|
||||||
|
</property>
|
||||||
<property generated="never" lazy="false" name="Remark" type="java.lang.String">
|
<property generated="never" lazy="false" name="Remark" type="java.lang.String">
|
||||||
<column length="1000" name="Remark">
|
<column length="1000" name="Remark">
|
||||||
<comment>备注</comment>
|
<comment>备注</comment>
|
||||||
|
|||||||
@@ -32,6 +32,11 @@
|
|||||||
<comment>电子邮箱</comment>
|
<comment>电子邮箱</comment>
|
||||||
</column>
|
</column>
|
||||||
</property>
|
</property>
|
||||||
|
<property generated="never" lazy="false" name="AdvanceIn" type="java.lang.Double">
|
||||||
|
<column name="AdvanceIn" precision="22" scale="3">
|
||||||
|
<comment>预收款</comment>
|
||||||
|
</column>
|
||||||
|
</property>
|
||||||
<property generated="never" lazy="false" name="BeginNeedGet" type="java.lang.Double">
|
<property generated="never" lazy="false" name="BeginNeedGet" type="java.lang.Double">
|
||||||
<column name="BeginNeedGet" precision="22" scale="3">
|
<column name="BeginNeedGet" precision="22" scale="3">
|
||||||
<comment>期初应收</comment>
|
<comment>期初应收</comment>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
var accepId = null; //保存的主表id
|
var accepId = null; //保存的主表id
|
||||||
var url;
|
var url;
|
||||||
var accountHeadID = 0;
|
var accountHeadID = 0;
|
||||||
|
var preTotalPrice = 0; //前一次加载的金额
|
||||||
var orgAccountHead = ""; //保存编辑前的名称
|
var orgAccountHead = ""; //保存编辑前的名称
|
||||||
var editIndex = undefined;
|
var editIndex = undefined;
|
||||||
var listTitle = ""; //单据标题
|
var listTitle = ""; //单据标题
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
listTitle = $("#tablePanel").prev().text();
|
listTitle = $("#tablePanel").prev().text();
|
||||||
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
|
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
|
||||||
var cusUrl = path + "/supplier/findBySelect_cus.action"; //客户接口
|
var cusUrl = path + "/supplier/findBySelect_cus.action"; //客户接口
|
||||||
|
var retailUrl = path + "/supplier/findBySelect_retail.action"; //散户接口
|
||||||
if(listTitle === "收入单列表"){
|
if(listTitle === "收入单列表"){
|
||||||
listType = "收入";
|
listType = "收入";
|
||||||
itemType = false; //显示当前列
|
itemType = false; //显示当前列
|
||||||
@@ -76,6 +78,14 @@
|
|||||||
inOrOut = "";
|
inOrOut = "";
|
||||||
organUrl = supUrl;
|
organUrl = supUrl;
|
||||||
}
|
}
|
||||||
|
else if(listTitle === "收预付款列表"){
|
||||||
|
listType = "收预付款";
|
||||||
|
itemType = true; //隐藏当前列
|
||||||
|
moneyType = false; //显示当前列
|
||||||
|
payTypeTitle = "无标题";
|
||||||
|
inOrOut = "";
|
||||||
|
organUrl = retailUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//获取账户信息
|
//获取账户信息
|
||||||
function initSystemData_account(){
|
function initSystemData_account(){
|
||||||
@@ -117,7 +127,13 @@
|
|||||||
$('#OrganId').combobox({
|
$('#OrganId').combobox({
|
||||||
url: organUrl,
|
url: organUrl,
|
||||||
valueField:'id',
|
valueField:'id',
|
||||||
textField:'supplier'
|
textField:'supplier',
|
||||||
|
formatter: function(row){
|
||||||
|
var opts = $(this).combobox('options');
|
||||||
|
if(row[opts.textField]!=="非会员") {
|
||||||
|
return row[opts.textField];
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,6 +215,7 @@
|
|||||||
pageList: initPageNum,
|
pageList: initPageNum,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||||
|
{field: 'OrganId',width:5, hidden:true},
|
||||||
{ title: '单据编号',field: 'BillNo',width:100},
|
{ title: '单据编号',field: 'BillNo',width:100},
|
||||||
{ title: '单据时间 ',field: 'BillTime',width:100},
|
{ title: '单据时间 ',field: 'BillTime',width:100},
|
||||||
{ title: '合计',field: 'TotalPrice',width:80},
|
{ title: '合计',field: 'TotalPrice',width:80},
|
||||||
@@ -213,7 +230,7 @@
|
|||||||
{
|
{
|
||||||
str += '<img src="' + path + '/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(\'' + rowInfo + '\');"/> <a onclick="showAccountHead(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">查看</a> ';
|
str += '<img src="' + path + '/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(\'' + rowInfo + '\');"/> <a onclick="showAccountHead(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">查看</a> ';
|
||||||
str += '<img src="' + path + '/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(\'' + rowInfo + '\');"/> <a onclick="editAccountHead(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
str += '<img src="' + path + '/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(\'' + rowInfo + '\');"/> <a onclick="editAccountHead(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||||
str += '<img src="' + path + '/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead('+ rec.Id +');"/> <a onclick="deleteAccountHead('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>';
|
str += '<img src="' + path + '/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead('+ rec.Id +',' + rec.OrganId +',' + rec.TotalPrice+ ');"/> <a onclick="deleteAccountHead('+ rec.Id +',' + rec.OrganId +',' + rec.TotalPrice +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>';
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -441,7 +458,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//删除财务信息
|
//删除财务信息
|
||||||
function deleteAccountHead(accountHeadID){
|
function deleteAccountHead(accountHeadID, thisOrganId, totalPrice){
|
||||||
$.messager.confirm('删除确认','确定要删除此财务信息吗?',function(r)
|
$.messager.confirm('删除确认','确定要删除此财务信息吗?',function(r)
|
||||||
{
|
{
|
||||||
if (r)
|
if (r)
|
||||||
@@ -472,6 +489,28 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//更新会员的预收款信息
|
||||||
|
if(listType === "收预付款"){
|
||||||
|
$.ajax({
|
||||||
|
type:"post",
|
||||||
|
url: path + "/supplier/updateAdvanceIn.action",
|
||||||
|
dataType: "json",
|
||||||
|
data:{
|
||||||
|
SupplierID: thisOrganId, //会员id
|
||||||
|
AdvanceIn: 0-totalPrice //删除时同时删除用户的预付款信息
|
||||||
|
},
|
||||||
|
success: function(res){
|
||||||
|
if(res) {
|
||||||
|
//保存会员预收款成功
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(){
|
||||||
|
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -491,16 +530,38 @@
|
|||||||
if (r)
|
if (r)
|
||||||
{
|
{
|
||||||
var ids = "";
|
var ids = "";
|
||||||
for(var i = 0;i < row.length; i ++)
|
for(var i = 0;i < row.length; i ++) {
|
||||||
{
|
|
||||||
if(i == row.length-1)
|
if(i == row.length-1)
|
||||||
{
|
{
|
||||||
ids += row[i].Id;
|
ids += row[i].Id;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//alert(row[i].id);
|
|
||||||
ids += row[i].Id + ",";
|
ids += row[i].Id + ",";
|
||||||
}
|
}
|
||||||
|
//批量更新会员的预收款信息
|
||||||
|
for(var i = 0;i < row.length; i ++) {
|
||||||
|
if(listType === "收预付款"){
|
||||||
|
$.ajax({
|
||||||
|
type:"post",
|
||||||
|
url: path + "/supplier/updateAdvanceIn.action",
|
||||||
|
dataType: "json",
|
||||||
|
data:{
|
||||||
|
SupplierID: row[i].OrganId, //会员id
|
||||||
|
AdvanceIn: 0 - row[i].TotalPrice //删除时同时删除用户的预付款信息
|
||||||
|
},
|
||||||
|
success: function(res){
|
||||||
|
if(res) {
|
||||||
|
//保存会员预收款成功
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(){
|
||||||
|
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//批量删除
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: path + "/accountHead/batchDelete.action",
|
url: path + "/accountHead/batchDelete.action",
|
||||||
@@ -562,6 +623,7 @@
|
|||||||
$("#HandsPersonId").val(accountHeadInfo[8]);
|
$("#HandsPersonId").val(accountHeadInfo[8]);
|
||||||
$("#ChangeAmount").val(accountHeadInfo[10]);
|
$("#ChangeAmount").val(accountHeadInfo[10]);
|
||||||
var TotalPrice = accountHeadInfo[11];
|
var TotalPrice = accountHeadInfo[11];
|
||||||
|
preTotalPrice = accountHeadInfo[11]; //记录前一次合计金额,用于收预付款
|
||||||
var editTitle = listTitle.replace("列表","信息");
|
var editTitle = listTitle.replace("列表","信息");
|
||||||
$('#accountHeadDlg').dialog('open').dialog('setTitle','<img src="' + path + '/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑' + editTitle);
|
$('#accountHeadDlg').dialog('open').dialog('setTitle','<img src="' + path + '/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑' + editTitle);
|
||||||
$(".window-mask").css({ width: webW ,height: webH});
|
$(".window-mask").css({ width: webW ,height: webH});
|
||||||
@@ -643,6 +705,36 @@
|
|||||||
//支出和付款为负数
|
//支出和付款为负数
|
||||||
TotalPrice = 0 - TotalPrice;
|
TotalPrice = 0 - TotalPrice;
|
||||||
}
|
}
|
||||||
|
//更新会员的预收款信息
|
||||||
|
if(listType === "收预付款"){
|
||||||
|
var advanceIn = 0; //预付款金额
|
||||||
|
if(accountHeadID){
|
||||||
|
advanceIn = TotalPrice - preTotalPrice; //修改时,预付款=合计金额-加载金额
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
advanceIn = TotalPrice; //新增时,预付款=合计金额
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
type:"post",
|
||||||
|
url: path + "/supplier/updateAdvanceIn.action",
|
||||||
|
dataType: "json",
|
||||||
|
data:{
|
||||||
|
SupplierID: OrganId,
|
||||||
|
AdvanceIn: advanceIn
|
||||||
|
},
|
||||||
|
success: function(res){
|
||||||
|
if(res) {
|
||||||
|
//保存会员预收款成功
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(){
|
||||||
|
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存单位信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
@@ -734,6 +734,7 @@
|
|||||||
|
|
||||||
//零售单据修改收款时,自动计算找零
|
//零售单据修改收款时,自动计算找零
|
||||||
if(listSubType == "零售" || listSubType == "零售退货") {
|
if(listSubType == "零售" || listSubType == "零售退货") {
|
||||||
|
$("#payType").val("现付");
|
||||||
$("#OrganId").combobox("setValue", orgDefaultId);
|
$("#OrganId").combobox("setValue", orgDefaultId);
|
||||||
var getAmount = $("#depotHeadFM .get-amount");
|
var getAmount = $("#depotHeadFM .get-amount");
|
||||||
var changeAmount = $("#depotHeadFM .change-amount");
|
var changeAmount = $("#depotHeadFM .change-amount");
|
||||||
@@ -857,6 +858,13 @@
|
|||||||
ChangeAmount = 0 - ChangeAmount;
|
ChangeAmount = 0 - ChangeAmount;
|
||||||
TotalPrice = 0 - TotalPrice;
|
TotalPrice = 0 - TotalPrice;
|
||||||
}
|
}
|
||||||
|
//零售时候,可以从会员预付款中扣款
|
||||||
|
var thisPayType = "现付";
|
||||||
|
if(listSubType === "零售" || listSubType === "零售退货") {
|
||||||
|
if($("#payType").val() ==="预付款") {
|
||||||
|
thisPayType = "预付款";
|
||||||
|
}
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: url,
|
url: url,
|
||||||
@@ -874,6 +882,7 @@
|
|||||||
AccountId: $.trim($("#AccountId").val()),
|
AccountId: $.trim($("#AccountId").val()),
|
||||||
ChangeAmount: ChangeAmount, //付款/收款
|
ChangeAmount: ChangeAmount, //付款/收款
|
||||||
TotalPrice: TotalPrice, //合计
|
TotalPrice: TotalPrice, //合计
|
||||||
|
PayType: thisPayType, //现付/预付款
|
||||||
Remark: $.trim($("#Remark").val()),
|
Remark: $.trim($("#Remark").val()),
|
||||||
clientIp: clientIp
|
clientIp: clientIp
|
||||||
}),
|
}),
|
||||||
@@ -891,6 +900,29 @@
|
|||||||
{
|
{
|
||||||
getMaxId(); //查找最大的Id
|
getMaxId(); //查找最大的Id
|
||||||
accept(depotHeadMaxId); //新增
|
accept(depotHeadMaxId); //新增
|
||||||
|
|
||||||
|
if(thisPayType === "预付款") {
|
||||||
|
//更新用户信息-预付款
|
||||||
|
$.ajax({
|
||||||
|
type:"post",
|
||||||
|
url: path + "/supplier/updateAdvanceIn.action",
|
||||||
|
dataType: "json",
|
||||||
|
data:{
|
||||||
|
SupplierID: OrganId, //会员id
|
||||||
|
AdvanceIn: 0 - ChangeAmount //保存的同时扣掉用户的预付款
|
||||||
|
},
|
||||||
|
success: function(res){
|
||||||
|
if(res) {
|
||||||
|
//保存会员预收款成功
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(){
|
||||||
|
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -203,6 +203,7 @@
|
|||||||
{ title: '联系人', field: 'contacts',width:50,align:"center"},
|
{ title: '联系人', field: 'contacts',width:50,align:"center"},
|
||||||
{ title: '联系电话', field: 'phonenum',width:60,align:"center"},
|
{ title: '联系电话', field: 'phonenum',width:60,align:"center"},
|
||||||
{ title: '电子邮箱',field: 'email',width:80,align:"center"},
|
{ title: '电子邮箱',field: 'email',width:80,align:"center"},
|
||||||
|
{ title: '预付款',field: 'AdvanceIn',width:70,align:"center"},
|
||||||
{ title: '期初应收',field: 'BeginNeedGet',width:70,align:"center"},
|
{ title: '期初应收',field: 'BeginNeedGet',width:70,align:"center"},
|
||||||
{ title: '期初应付',field: 'BeginNeedPay',width:70,align:"center"},
|
{ title: '期初应付',field: 'BeginNeedPay',width:70,align:"center"},
|
||||||
{ title: '类型',field: 'type',width:50},
|
{ title: '类型',field: 'type',width:50},
|
||||||
|
|||||||
@@ -87,9 +87,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>单据备注:</td>
|
<td>单据备注:</td>
|
||||||
<td style="padding:5px" colspan="5">
|
<td style="padding:5px" colspan="3">
|
||||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 292px;"/>
|
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 292px;"/>
|
||||||
</td>
|
</td>
|
||||||
|
<td>付款类型:</td>
|
||||||
|
<td style="padding:5px">
|
||||||
|
<select name="payType" id="payType" style="width:130px;">
|
||||||
|
<option value="现付">现付</option>
|
||||||
|
<option value="预付款">预付款</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
|
|||||||
Reference in New Issue
Block a user