|
|
@@ -3,6 +3,7 @@ package tinvoiceapply;
|
|
|
import baseclass.PaoCust;
|
|
|
import baseclass.tools.GetFieldsName;
|
|
|
import baseclass.tools.Math;
|
|
|
+import openapi.base.data.Row;
|
|
|
import openapi.base.data.Rows;
|
|
|
import openapi.base.data.db.DBConnect;
|
|
|
import p2.pao.PaoRemote;
|
|
|
@@ -12,6 +13,8 @@ import p2.util.P2AppException;
|
|
|
import p2.util.P2Exception;
|
|
|
import tinvoicebill.tinvoicebill;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
public class tinvoiceapply extends PaoCust {
|
|
|
public tinvoiceapply(PaoSet arg0) {
|
|
|
super(arg0);
|
|
|
@@ -110,9 +113,37 @@ public class tinvoiceapply extends PaoCust {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ String orderinvoicecheck = "";
|
|
|
+
|
|
|
+ public String orderinvoicecheck() throws P2Exception {
|
|
|
+ orderinvoicecheck = "";
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select distinct t3.fsonum,t3.finvoicetaxnumber,t3.finvoicename from tinvoiceapply t1\n" +
|
|
|
+ "inner join tinvoiceapplyorder t2 on t1.siteid=t2.siteid and t1.tinvoiceapplyid=t2.tinvoiceapplyid\n" +
|
|
|
+ "inner join saorder t3 on t2.siteid=t3.siteid and t2.saorderid=t3.saorderid\n" +
|
|
|
+ "where t1.tinvoiceapplyid='" + getUniqueIDValue() + "' and isnull(t1.finvoicetaxnumber,'')!=isnull(t3.finvoicetaxnumber,'') ");
|
|
|
+ for (Row row : rows) {
|
|
|
+ orderinvoicecheck = orderinvoicecheck + row.getString("fsonum") + ";";
|
|
|
+ }
|
|
|
+ return orderinvoicecheck;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void submit(boolean issubmit) throws P2Exception {
|
|
|
super.submit(issubmit);
|
|
|
+ if (issubmit) {
|
|
|
+ if (!orderinvoicecheck.equals("")) {
|
|
|
+ PaoSetRemote tinvoiceapplyorderSet = getPaoSet("tinvoiceapplyorder");
|
|
|
+ HashMap<String, PaoRemote> map = getPaoMap(tinvoiceapplyorderSet, "saorderid");
|
|
|
+ for (String saorderid : map.keySet()) {
|
|
|
+ PaoRemote saorder = map.get(saorderid);
|
|
|
+ saorder.setValue("finvoicetaxnumber", getString("finvoicetaxnumber"), 11L);
|
|
|
+ saorder.setValue("finvoicename", getString("finvoicename"), 11L);
|
|
|
+ saorder.setValue("finvoiceaddress", getString("finvoiceaddress"), 11L);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
setValue("fstatus", issubmit ? "Ìá½»" : "н¨", 11L);
|
|
|
setValue("submitby", issubmit ? getUserName() : "", 11L);
|
|
|
setValue("submitdate", issubmit ? getDateTime() : null, 11L);
|
|
|
@@ -368,10 +399,10 @@ public class tinvoiceapply extends PaoCust {
|
|
|
DBConnect dbConnect = new DBConnect();
|
|
|
Rows rows = dbConnect.runSqlQuery("select fphonenumber,(isnull(fbank,'')+isnull(fbankcardid,''))as finvoicebankandaccount from tagents_invoice where ftaxnumber='" + finvoicetaxnumber + "' and fbankcardid is not null");
|
|
|
if (!rows.isEmpty()) {
|
|
|
- setValue("FINVOICEMOBILE", rows.get(0).getString("fphonenumber"));
|
|
|
+ //setValue("FINVOICEMOBILE", rows.get(0).getString("fphonenumber"));
|
|
|
setValue("FINVOICEBANKANDACCOUNT", rows.get(0).getString("finvoicebankandaccount"));
|
|
|
} else {
|
|
|
- setValue("FINVOICEMOBILE", "");
|
|
|
+ //setValue("FINVOICEMOBILE", "");
|
|
|
setValue("FINVOICEBANKANDACCOUNT", "");
|
|
|
}
|
|
|
}
|