erp同步销售发票定时任务 取消发票号回写单据号

This commit is contained in:
lihao 2025-05-09 09:04:20 +08:00
parent 089b56a8b6
commit f3842ce879
1 changed files with 13 additions and 11 deletions

View File

@ -71,11 +71,13 @@ public class InvoiceTaskPlugin implements IBackgroundWorkPlugin{
dao.executeUpdate(sscivmSql);
Logger.error("---sscivmSqlExecute------"+sscivmSql);
//修改发票关联关系单据编码
String sirSql = "UPDATE sscivm_invoice_relation set billno = '" + fphm +"' where pk_invoice = '"+ pk_invoice +"' and billid = '"+ csaleinvoiceid +"'";
dao.executeUpdate(sirSql);
Logger.error("---sirSqlExecute------"+sirSql);
// String sirSql = "UPDATE sscivm_invoice_relation set billno = '" + fphm +"' where pk_invoice = '"+ pk_invoice +"' and billid = '"+ csaleinvoiceid +"'";
// dao.executeUpdate(sirSql);
// Logger.error("---sirSqlExecute------"+sirSql);
//ERP销售发票回传根据销售发票id回写发票号和单据编号
String sSaleSql = "UPDATE so_saleinvoice set vdef20 = 'Y' , vdef13 = '" + fphm + "', vbillcode = '" + fphm +"' where csaleinvoiceid = '" + csaleinvoiceid + "'";
// String sSaleSql = "UPDATE so_saleinvoice set vdef20 = 'Y' , vdef13 = '" + fphm + "', vbillcode = '" + fphm +"' where csaleinvoiceid = '" + csaleinvoiceid + "'";
String sSaleSql = "UPDATE so_saleinvoice set vdef20 = 'Y' , vdef13 = '" + fphm + "' where csaleinvoiceid = '" + csaleinvoiceid + "'";
dao.executeUpdate(sSaleSql);
Logger.error("---sSaleSqlExecute------"+sSaleSql);
//根据销售发票id 回写下游应收单表头发票号
@ -94,13 +96,13 @@ public class InvoiceTaskPlugin implements IBackgroundWorkPlugin{
dao.executeUpdate(recItemSql);
Logger.error("---recItemSqlExecute------"+recItemSql);
//查询销售发票下游单据如果有将下游单据表体字段来源单据号更新成新的发票号
String saleOutSql = "UPDATE ic_saleout_b \n" +
"SET vsourcebillcode = '"+ fphm +"' \n" +
"WHERE\n" +
"csourcetype = '32' \n" +
"AND csourcebillhid = '" + csaleinvoiceid +"'";
dao.executeUpdate(saleOutSql);
Logger.error("---saleOutSqlExecute------"+saleOutSql);
// String saleOutSql = "UPDATE ic_saleout_b \n" +
// "SET vsourcebillcode = '"+ fphm +"' \n" +
// "WHERE\n" +
// "csourcetype = '32' \n" +
// "AND csourcebillhid = '" + csaleinvoiceid +"'";
// dao.executeUpdate(saleOutSql);
// Logger.error("---saleOutSqlExecute------"+saleOutSql);
//正常结束
TransactionFactory.getTMProxy().end(null);
}