fix saldo bei gutschriften
This commit is contained in:
parent
841fbeb71e
commit
b7199e22da
1 changed files with 20 additions and 2 deletions
|
|
@ -90,7 +90,7 @@ public class CargosoftMigrationRestService implements Serializable {
|
|||
int errors = 0;
|
||||
int count = 0;
|
||||
public static String _QUERY = "($modelversion:rechnungsausgang-de-1.0)\n" +
|
||||
"AND $created:[20240604 TO 20240619]";
|
||||
"AND $created:[20240604 TO 20240701]";
|
||||
// public static String _QUERY = "($modelversion:rechnungsausgang-dwc-1.0)\n" +
|
||||
// //
|
||||
// "AND $created:[20240604 TO 20240619]";
|
||||
|
|
@ -120,7 +120,7 @@ public class CargosoftMigrationRestService implements Serializable {
|
|||
@Path("/test")
|
||||
@Produces({ MediaType.TEXT_PLAIN })
|
||||
public String testeFehlerhafteCargosoftDaten() throws QueryException {
|
||||
|
||||
int falsch = 0;
|
||||
logger.info("query=" + _QUERY);
|
||||
log = "Query\n" + _QUERY;
|
||||
List<ItemCollection> result = documentService.find(_QUERY, 9999, 0);
|
||||
|
|
@ -131,6 +131,24 @@ public class CargosoftMigrationRestService implements Serializable {
|
|||
log = log + "\n\nACHTUNG ES GIBT MEHR ALS 10000 RECHNUNGEN !";
|
||||
}
|
||||
|
||||
for (ItemCollection workitem : result) {
|
||||
String type = workitem.getItemValueString("invoice.type");
|
||||
if ("G".equals(type) || "SR".equals(type)) {
|
||||
double total = workitem.getItemValueDouble("invoice.saldo");
|
||||
if (total >= 0) {
|
||||
logger.info("---Falsch: " + workitem.getUniqueID());
|
||||
falsch++;
|
||||
workitem.setItemValue("invoice.saldo", -total);
|
||||
documentService.save(workitem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log = log + "\n\n";
|
||||
log = log + "" + result.size() + " rechnungen geprüft";
|
||||
log = log + "" + falsch + " davon falsch";
|
||||
log = log + "\n\n";
|
||||
return log;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue