|
|
@@ -1610,12 +1610,13 @@ public class Order extends Controller {
|
|
|
|
|
|
Row orderRow = rows.get(0);
|
|
|
Rows departmenthrrows =dbConnect.runSqlQuery("select t1.*,t2.depname from sys_departmenthrid t1 left join sys_department t2 on t1.departmentid=t2.departmentid where t1.hrid="+hrid);
|
|
|
-
|
|
|
+ Rows accountbalancerows = dbConnect.runSqlQuery("select * from sa_accountbalance t1 inner join sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid and t1.siteid=t2.siteid where t2.accountname='现金账户' and t1.sys_enterpriseid=" + orderRow.getLong("sys_enterpriseid"));
|
|
|
long st_stockbillid = createTableID("st_stockbill");
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill");
|
|
|
insertSQL.setUniqueid(st_stockbillid);
|
|
|
insertSQL.setSiteid(siteid);
|
|
|
insertSQL.setValue("sys_enterpriseid", orderRow.getLong("sys_enterpriseid"));
|
|
|
+ insertSQL.setValue("sa_accountclassid",accountbalancerows.isNotEmpty()?accountbalancerows.get(0).getLong("sa_accountclassid"):0);
|
|
|
insertSQL.setValue("rec_contactsid", orderRow.getLong("rec_contactsid"));
|
|
|
insertSQL.setValue("departmentid", departmenthrrows.isNotEmpty()?departmenthrrows.get(0).getLong("departmentid"):0);
|
|
|
insertSQL.setValue("stockid", 0);
|
|
|
@@ -1697,7 +1698,6 @@ public class Order extends Controller {
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
|
|
|
String depname= departmenthrrows.isNotEmpty()?departmenthrrows.get(0).getString("depname"):"";
|
|
|
- Rows accountbalancerows = dbConnect.runSqlQuery("select * from sa_accountbalance t1 inner join sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid and t1.siteid=t2.siteid where t2.accountname='现金账户' and t1.sys_enterpriseid=" + orderRow.getLong("sys_enterpriseid"));
|
|
|
if(depname.equals("售后部")){
|
|
|
if(accountbalancerows.isNotEmpty()){
|
|
|
if(accountbalancerows.get(0).getBigDecimal("discountamount").compareTo(BigDecimal.ZERO)>0){
|
|
|
@@ -1770,13 +1770,13 @@ public class Order extends Controller {
|
|
|
Row orderRow = rows.get(0);
|
|
|
Rows departmenthrrows =dbConnect.runSqlQuery("select t1.*,t2.depname from sys_departmenthrid t1 left join sys_department t2 on t1.departmentid=t2.departmentid where t1.hrid="+hrid);
|
|
|
Rows accountbalancerows = dbConnect.runSqlQuery("select * from sa_accountbalance t1 inner join sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid and t1.siteid=t2.siteid where t2.accountname='现金账户' and t1.sys_enterpriseid=" + orderRow.getLong("sys_enterpriseid"));
|
|
|
-
|
|
|
long st_stockbillid = createTableID("st_stockbill");
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill");
|
|
|
insertSQL.setUniqueid(st_stockbillid);
|
|
|
insertSQL.setSiteid(siteid);
|
|
|
insertSQL.setValue("sys_enterpriseid", orderRow.getLong("sys_enterpriseid"));
|
|
|
insertSQL.setValue("rec_contactsid", orderRow.getLong("rec_contactsid"));
|
|
|
+ insertSQL.setValue("sa_accountclassid",accountbalancerows.isNotEmpty()?accountbalancerows.get(0).getLong("sa_accountclassid"):0);
|
|
|
insertSQL.setValue("departmentid", departmenthrrows.isNotEmpty()?departmenthrrows.get(0).getLong("departmentid"):0);
|
|
|
insertSQL.setValue("stockid", 0);
|
|
|
insertSQL.setValue("type", "销售出库");
|
|
|
@@ -1788,8 +1788,8 @@ public class Order extends Controller {
|
|
|
insertSQL.setValue("billno", createBillCode("stockbill"));
|
|
|
|
|
|
insertSQL.setValue("outplace", rowsdetail.get(0).getString("outplace"));
|
|
|
- insertSQL.setValue("delivery", "");
|
|
|
- insertSQL.setValue("logisticsmethod", orderRow.getString("logisticsmethod"));
|
|
|
+ insertSQL.setValue("delivery", orderRow.getString("delivery"));
|
|
|
+ insertSQL.setValue("logisticsmethod", "");
|
|
|
insertSQL.setValue("invoice_enterprisename", orderRow.getString("invoicename"));
|
|
|
insertSQL.setValue("invoice_address", orderRow.getString("invoiceaddress"));
|
|
|
insertSQL.setValue("invoice_taxno", orderRow.getString("invoicetaxno"));
|
|
|
@@ -2057,6 +2057,7 @@ public class Order extends Controller {
|
|
|
insertSQL.setSiteid(siteid);
|
|
|
insertSQL.setValue("sys_enterpriseid", sys_enterpriseid);
|
|
|
insertSQL.setValue("rec_contactsid", orderdetailRows.get(0).getLong("rec_contactsid"));
|
|
|
+ insertSQL.setValue("sa_accountclassid",accountbalancerows.isNotEmpty()?accountbalancerows.get(0).getLong("sa_accountclassid"):0);
|
|
|
insertSQL.setValue("departmentid", departmenthrrows.isNotEmpty()?departmenthrrows.get(0).getLong("departmentid"):0);
|
|
|
insertSQL.setValue("stockid", 0);
|
|
|
insertSQL.setValue("type", "销售出库");
|
|
|
@@ -2069,7 +2070,7 @@ public class Order extends Controller {
|
|
|
|
|
|
insertSQL.setValue("outplace", orderdetailRows.get(0).getString("outplace"));
|
|
|
insertSQL.setValue("delivery", orderdetailRows.get(0).getString("delivery"));
|
|
|
- insertSQL.setValue("logisticsmethod", orderdetailRows.get(0).getString("logisticsmethod"));
|
|
|
+ insertSQL.setValue("logisticsmethod","");
|
|
|
insertSQL.setValue("invoice_enterprisename",enterprisefinancerowsMap.containsKey(sys_enterpriseid)?enterprisefinancerowsMap.get(sys_enterpriseid).get(0).getString("enterprisename"):"");
|
|
|
insertSQL.setValue("invoice_address",enterprisefinancerowsMap.containsKey(sys_enterpriseid)?enterprisefinancerowsMap.get(sys_enterpriseid).get(0).getString("address"):"");
|
|
|
insertSQL.setValue("invoice_taxno",enterprisefinancerowsMap.containsKey(sys_enterpriseid)?enterprisefinancerowsMap.get(sys_enterpriseid).get(0).getString("taxno"):"");
|