소스 검색

核销生成红单添加开票和收货信息

hxh 1 개월 전
부모
커밋
cc0efa1164
1개의 변경된 파일23개의 추가작업 그리고 3개의 파일을 삭제
  1. 23 3
      src/custom/restcontroller/webmanage/sale/tpartreimbursement/tpartreimbursement.java

+ 23 - 3
src/custom/restcontroller/webmanage/sale/tpartreimbursement/tpartreimbursement.java

@@ -606,14 +606,34 @@ public class tpartreimbursement extends Controller {
         insertSQL.setValue("billno", billno);
         insertSQL.setValue("billno", billno);
         insertSQL.setValue("outplace", "谈桥");
         insertSQL.setValue("outplace", "谈桥");
         insertSQL.setValue("delivery", "");
         insertSQL.setValue("delivery", "");
-        insertSQL.setValue("invoice_enterprisename", "");
-        insertSQL.setValue("invoice_address", "");
-        insertSQL.setValue("invoice_taxno", "");
+        Rows invoicerows = dbConnect.runSqlQuery("select * from sys_enterprise_finance where sys_enterpriseid=" + sys_enterpriseid + " order by isdefault desc");
+        Rows addressrows = dbConnect.runSqlQuery("select * from sys_enterprise_contacts where type='配件' and sys_enterpriseid=" + sys_enterpriseid + " order by isdefault desc");
+        if(invoicerows.isNotEmpty()){
+            insertSQL.setValue("invoice_enterprisename", invoicerows.get(0).getString("enterprisename"));
+            insertSQL.setValue("invoice_address", invoicerows.get(0).getString("address"));
+            insertSQL.setValue("invoice_taxno", invoicerows.get(0).getString("taxno"));
+        }else{
+            insertSQL.setValue("invoice_enterprisename", "");
+            insertSQL.setValue("invoice_address", "");
+            insertSQL.setValue("invoice_taxno", "");
+        }
+
+        if(addressrows.isNotEmpty()){
+            insertSQL.setValue("name", addressrows.get(0).getString("name"));
+            insertSQL.setValue("address", addressrows.get(0).getString("address"));
+            insertSQL.setValue("phonenumber", addressrows.get(0).getString("phonenumber"));
+        }else{
+            insertSQL.setValue("name", "");
+            insertSQL.setValue("address", "");
+            insertSQL.setValue("phonenumber", "");
+        }
+
         insertSQL.setValue("tracknumber", "");
         insertSQL.setValue("tracknumber", "");
         insertSQL.setValue("isconfirm", 0);
         insertSQL.setValue("isconfirm", 0);
         insertSQL.setValue("sourceobject", "tpartreimbursement");
         insertSQL.setValue("sourceobject", "tpartreimbursement");
 
 
 
 
+
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
         Calendar calendar = Calendar.getInstance();
         Calendar calendar = Calendar.getInstance();
         insertSQL.setValue("period", dateFormat.format(calendar.getTime()));
         insertSQL.setValue("period", dateFormat.format(calendar.getTime()));