Browse Source

更新货款调账的供应商和客户对象

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8560 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
b01c0e6c0e

+ 0 - 3
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseAPBillServiceImpl.java

@@ -86,11 +86,8 @@ public class PurchaseAPBillServiceImpl implements PurchaseAPBillService {
 				if (!CollectionUtils.isEmpty(apBill.getDetails())) {
 					for (PurchaseAPBillDetail detail : apBill.getDetails()) {
 						ApbillAdjustment adjust = new ApbillAdjustment(apBill);
-						Enterprise enter = enterpriseDao.findEnterpriseByUu(adjust.getCustuu());
-						adjust.setCustname(enter.getEnName());
 						adjust.setInoutno(detail.getAbd_pdinoutno());
 						Product product = new Product();
-						product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 						product.setCode(detail.getAbd_prodcode());
 						adjust.setPrid(product.getId());
 						adjust.setDetno(detail.getAbd_detno());

+ 4 - 3
src/main/java/com/uas/platform/b2b/model/ApbillAdjustment.java

@@ -429,13 +429,14 @@ public class ApbillAdjustment implements Serializable {
 	}
 
 	public ApbillAdjustment(PurchaseAPBill apBill) {
-		Long enuu = SystemSession.getUser().getEnterprise().getUu();
+		Enterprise enterprise = SystemSession.getUser().getEnterprise();
 		this.setCurrency(apBill.getAb_currency());
 		this.setDate(new Date());
 		this.setOrderdate(apBill.getAb_date());
 		this.setSourceid(apBill.getAb_id());
-		this.setEnuu(enuu);
-		this.setCustuu(apBill.getAb_vendoruu());
+		this.setEnuu(apBill.getAb_vendoruu());
+		this.setCustuu(enterprise.getUu());
+		this.setCustname(enterprise.getEnName());
 	}
 
 	public ApbillAdjustment() {