Subversion Repositories SmartDukaan

Rev

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

Rev 23487 Rev 23489
Line 383... Line 383...
383
			retailer.setType(RetailerType.UNREGISTERED_SHOP);
383
			retailer.setType(RetailerType.UNREGISTERED_SHOP);
384
		}else{
384
		}else{
385
			retailer.setType(RetailerType.GSTIN);
385
			retailer.setType(RetailerType.GSTIN);
386
		}
386
		}
387
		if(updateRetailerRequest.getDocumentId() > 0){
387
		if(updateRetailerRequest.getDocumentId() > 0){
-
 
388
			if(retailer.getDocumentId() != null) {
-
 
389
				documentRepository.deleteById(retailer.getDocumentId());
-
 
390
			}
388
			retailer.setDocumentId(updateRetailerRequest.getDocumentId());
391
			retailer.setDocumentId(updateRetailerRequest.getDocumentId());
-
 
392
			documentRepository.markDocumentAsPersisted(updateRetailerRequest.getDocumentId());
389
		}
393
		}
390
		retailerRepository.persist(retailer);
394
		retailerRepository.persist(retailer);
391
		return retailer;
395
		return retailer;
392
	}
396
	}
393
	
397
	
Line 525... Line 529...
525
	
529
	
526
	private void createOrUpdateShop(Shop shop, CustomShop customShop, int retailerId, Address sameAsRetailerAddressValue) throws ProfitMandiBusinessException{
530
	private void createOrUpdateShop(Shop shop, CustomShop customShop, int retailerId, Address sameAsRetailerAddressValue) throws ProfitMandiBusinessException{
527
		shop.setRetailerId(retailerId);
531
		shop.setRetailerId(retailerId);
528
		shop.setName(customShop.getName());
532
		shop.setName(customShop.getName());
529
		if(customShop.getDocumentId() > 0){
533
		if(customShop.getDocumentId() > 0){
-
 
534
			if(shop.getDocumentId() != null) {
-
 
535
				documentRepository.deleteById(shop.getDocumentId());
-
 
536
			}
530
			shop.setDocumentId(customShop.getDocumentId());
537
			shop.setDocumentId(customShop.getDocumentId());
531
			documentRepository.markDocumentAsPersisted(customShop.getDocumentId());
538
			documentRepository.markDocumentAsPersisted(customShop.getDocumentId());
532
		}
539
		}
533
		if(shop.getAddressId() == null){
540
		if(shop.getAddressId() == null){
534
			Address address = null;
541
			Address address = null;