|
|
@@ -194,19 +194,19 @@ public class salogis extends PaoCust {
|
|
|
// "group by t4.saorderdetailid,t4.finvoiceamount\n" +
|
|
|
// ")t where t.finvoiceamount-t.finvoiceamount2>0");
|
|
|
|
|
|
- Rows rows=dbConnect.runSqlQuery("\n" +
|
|
|
+ Rows rows = dbConnect.runSqlQuery("\n" +
|
|
|
"select convert(bigint,t.saorderdetailid)as saorderdetailid,sum(t.finvoiceamount)-sum(t.finvoiceamount2) as finvoiceamount from (\n" +
|
|
|
"\tselect t4.saorderdetailid,isnull(t4.finvoiceamount,0)as finvoiceamount,0 finvoiceamount2 from salogis t1\n" +
|
|
|
"\tinner join salogisdetail t2 on t1.salogisid=t2.fparentid\n" +
|
|
|
"\tinner join sainvoicedetail t3 on t2.fsourceid=t3.fparentid and t2.fsourceobject='SAINVOICE'\n" +
|
|
|
"\tinner join saorderdetail t4 on t3.fsourceid=t4.saorderdetailid\n" +
|
|
|
- "\twhere t1.salogisid='"+getUniqueIDValue()+"'\n" +
|
|
|
+ "\twhere t1.salogisid='" + getUniqueIDValue() + "'\n" +
|
|
|
"\tunion all\n" +
|
|
|
"\tselect t4.fsourceid,0 as finvoiceamount,isnull(t4.finvoiceamount,0) as finvoiceamount2 from salogis t1\n" +
|
|
|
"\tinner join salogisdetail t2 on t1.salogisid=t2.fparentid\n" +
|
|
|
"\tinner join sainvoicedetail t3 on t2.fsourceid=t3.fparentid and t2.fsourceobject='SAINVOICE'\n" +
|
|
|
"\tinner join sainvoicedetail t4 on t3.fsourceid=t4.fsourceid\n" +
|
|
|
- "\twhere t1.salogisid='"+getUniqueIDValue()+"'\n" +
|
|
|
+ "\twhere t1.salogisid='" + getUniqueIDValue() + "'\n" +
|
|
|
"\t\n" +
|
|
|
")t \n" +
|
|
|
"group by t.saorderdetailid\n" +
|
|
|
@@ -311,6 +311,18 @@ public class salogis extends PaoCust {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新发货单已核销数量
|
|
|
+ * @throws P2Exception
|
|
|
+ */
|
|
|
+ public void updatesainvoicewriteamount() throws P2Exception {
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select t2.fsourceid as saorderdetailid from salogisdetail t1 inner join sainvoicedetail t2 on t1.fsourceid=t2.fparentid where t1.fparentid='" + getUniqueIDValue() + "'");
|
|
|
+ for (Row row : rows) {
|
|
|
+ dbConnect.runSqlUpdate("exec updatesainvoicewriteoffamount " + row.getString("saorderdetailid"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 收货确认验证
|
|
|
*
|