Subversion Repositories SmartDukaan

Rev

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

Rev 5208 Rev 5343
Line 599... Line 599...
599
        	return;
599
        	return;
600
		}
600
		}
601
        
601
        
602
        Sheet sheet = wb.getSheetAt(0);
602
        Sheet sheet = wb.getSheetAt(0);
603
        
603
        
604
        int indexAmount = 1;
-
 
605
        int indexAWB = 0;
604
        int indexAWB = 0;
-
 
605
        int indexAmount = 1;
-
 
606
        int indexComment = 2;
606
        
607
        
607
        Row firstRow = sheet.getRow(0);
608
        Row firstRow = sheet.getRow(0);
608
        logger.info("Cell count:" + firstRow.getPhysicalNumberOfCells());
609
        logger.info("Cell count:" + firstRow.getPhysicalNumberOfCells());
609
        
610
        
610
        TransactionClient tsc;
611
        TransactionClient tsc;
Line 614... Line 615...
614
			
615
			
615
        	tsc = new TransactionClient();
616
        	tsc = new TransactionClient();
616
        	in.shop2020.model.v1.order.TransactionService.Client transactionClient = tsc.getClient();
617
        	in.shop2020.model.v1.order.TransactionService.Client transactionClient = tsc.getClient();
617
        	
618
        	
618
	    	for (Row row: sheet)	{
619
	    	for (Row row: sheet)	{
619
	    		if(row.equals(firstRow))	continue;
620
	    		if(row.equals(firstRow)) {
-
 
621
	    			continue;
-
 
622
	    		}
620
	    		
623
	    		
621
	    		try {
624
				long awb = -1;
-
 
625
				
622
	    			if(row.getCell(indexAWB).getNumericCellValue() < 1)	break;
626
				if(row.getCell(indexAWB).getCellType() == 0) {
623
				} catch (NullPointerException e) {
627
					awb = (long) row.getCell(indexAWB).getNumericCellValue();
624
					break;
-
 
625
				}
628
				}
-
 
629
			    else if(row.getCell(indexAWB).getCellType() == 1) {
-
 
630
			    	awb = Long.parseLong(row.getCell(indexAWB).getStringCellValue());
626
	    		
631
			    }
-
 
632
				
-
 
633
				if(awb == -1) {
-
 
634
					continue;
-
 
635
				}
627
	    		long awb = (long) row.getCell(indexAWB).getNumericCellValue();
636
	    		else if(row.getCell(indexComment).getStringCellValue().equals("LOST SHIPMENT")) {
-
 
637
	    			logger.info("LOST SHIPMENT");
-
 
638
	    			continue;
628
	    		
639
	    		}
-
 
640
				
629
	    		try {
641
	    		try {
630
		    		long orderId = transactionClient.getOrderForAwb(Long.toString(awb)).getId();
642
		    		long orderId = transactionClient.getOrderForAwb(Long.toString(awb)).getId();
631
		    		double amount = row.getCell(indexAmount).getNumericCellValue();
643
		    		double amount = row.getCell(indexAmount).getNumericCellValue();
632
		    		logger.info("Aramex Settlement, Order Id: " + orderId + " Amount: " + amount);
644
		    		logger.info("Aramex Settlement, Order Id: " + orderId + " Amount: " + amount);
633
		    		
645