Subversion Repositories SmartDukaan

Rev

Rev 37832 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37832 Rev 37833
Line 265... Line 265...
265
 
265
 
266
    @Autowired
266
    @Autowired
267
    private MovementPoTask movementPoTask;
267
    private MovementPoTask movementPoTask;
268
 
268
 
269
    @Autowired
269
    @Autowired
-
 
270
    private com.smartdukaan.cron.migrations.IrnRetrier irnRetrier;
-
 
271
 
-
 
272
    @Autowired
270
    private ScheduledTasks scheduledTasks;
273
    private ScheduledTasks scheduledTasks;
271
 
274
 
272
    @Autowired
275
    @Autowired
273
    private ScheduledTasksTest scheduledTasksTest;
276
    private ScheduledTasksTest scheduledTasksTest;
274
 
277
 
Line 433... Line 436...
433
            }
436
            }
434
            movementBillingTask.billMovements(poNumbers, args.getOptionValues("email").get(0),
437
            movementBillingTask.billMovements(poNumbers, args.getOptionValues("email").get(0),
435
                    Integer.parseInt(args.getOptionValues("provider").get(0)), args.containsOption("live"));
438
                    Integer.parseInt(args.getOptionValues("provider").get(0)), args.containsOption("live"));
436
            System.exit(0);
439
            System.exit(0);
437
        }
440
        }
-
 
441
        if (args.containsOption("retryIrn")) {
-
 
442
            if (!args.containsOption("invoices")) {
-
 
443
                LOGGER.error("retryIrn needs --invoices=INV1,INV2 (invoices NIC rejected, irn_generated=0)");
-
 
444
                System.exit(1);
-
 
445
            }
-
 
446
            List<String> invoiceNumbers = new ArrayList<>();
-
 
447
            for (String value : args.getOptionValues("invoices")) {
-
 
448
                for (String invoiceNumber : value.split(",")) {
-
 
449
                    if (!invoiceNumber.trim().isEmpty()) {
-
 
450
                        invoiceNumbers.add(invoiceNumber.trim());
-
 
451
                    }
-
 
452
                }
-
 
453
            }
-
 
454
            irnRetrier.retryAll(invoiceNumbers);
-
 
455
            System.exit(0);
-
 
456
        }
438
        if (args.containsOption("closeMovementPO")) {
457
        if (args.containsOption("closeMovementPO")) {
439
            if (!args.containsOption("pos") || !args.containsOption("email")) {
458
            if (!args.containsOption("pos") || !args.containsOption("email")) {
440
                LOGGER.error("closeMovementPO needs --pos=PO1,PO2 and --email=<closed by>; add --live to close"
459
                LOGGER.error("closeMovementPO needs --pos=PO1,PO2 and --email=<closed by>; add --live to close"
441
                        + " (default is a dry run)");
460
                        + " (default is a dry run)");
442
                System.exit(1);
461
                System.exit(1);