package com.reallinkbilling.update;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.interceptor.SessionAware;

import com.reallinkbilling.db.GetDBConnection;
import com.reallinkbilling.resource.GetListResource;
import com.reallinkbilling.utils.GetAccountListForDrCr;
import com.opensymphony.xwork2.ActionSupport;

public class UpdateSettings extends ActionSupport implements SessionAware{

	/**
	 * 
	 */
	private static final long serialVersionUID = -8595377243671444313L;
	
	private HttpSession session;
	private String addDuplicateItems;
	private String addDiscountColumn;
	private String addQRCode;
	private String addGSTDetails;
	private String addGSTNumber;
	private String addMessage;
	private String billMessage;
	private String addCreditAmountToBill;
	private String billMessageFont;
	private String showTotalQuantity;
	private String sendBillMessageToOwner;
	private String sendCustCreditReceiveMessageToOwner;
	private String defaultWhatsAppNumber;
	private String sendWhatsAppMessage;
	private String sendWhatsAppMessageType;
	
	private String duplicateItemsDefault;
	private String discountColumnDefault;
	private String qrCodeDefault;
	private String gstDetailsDefault;
	private String messageDefault;
	private String addGstNumberDefault;
	private String addCreditAmountToBillDefault;
	private String billMessageFontDefault;
	private String showTotalQuantityDefault;
	private String sendBillSMSToOwnerDefault;
	private String sendCustCreditReceiveSMSToOwnerDefault;
	private String defaultRateType;
	private String addLabourCharges;
	private String defaultBillType;
	private String addQuantity2Default;
	private String defaultA5PrintOriaentation;
	private String addPageHeaderDefault;
	private String defaultDiscountType;
	private String enableSalesmanCommission;
	private String enableCounterFoilPrinting;
	private String defaultWhatsAppNumberDefault;
	private String sendWhatsAppMessageDefault;
	private String sendWhatsAppMessageTypeDefault;

	private Map<String,String> defaultA5OrientationList = new HashMap<String,String>();
	

	private String defaultCollAccId;
	private String addLeftSideLogoDefault;
	private String addRightSideLogoDefault;
	private String addIntroLineChoiceDefault;
	
	private Map<String,String> addDuplicateItemsToBill = new HashMap<String,String>();
	private Map<String,String> addDiscountColumnToBill = new HashMap<String,String>();
	private Map<String,String> addQRCodeToBill = new HashMap<String,String>();
	private Map<String,String> addGSTDetailsToBill = new HashMap<String,String>();
	private Map<String,String> addMessageToBill = new HashMap<String,String>();
	private Map<String,String> addGSTNumberToBill = new HashMap<String,String>();
	
	private Map<String,String> addCreditAmountToBillList = new HashMap<String,String>();
	private Map<String,String> billMessageFontList = new HashMap<String,String>();	
	private Map<String,String> showTotalQuantityList = new HashMap<String,String>();
	private Map<String,String> sendBillSMStoOwnerList = new HashMap<String,String>();
	private Map<String,String> sendcustCreditReceiveSMStoOwnerList = new HashMap<String,String>();
	private Map<String,String> sendWhatsAppMessageList = new HashMap<String,String>();
	private Map<String,String> sendWhatsAppMessageTypeList = new HashMap<String,String>();
	private Map<String,String> rateTypeList = new HashMap<String,String>();
	private Map<String,String> addLabourChargesList = new HashMap<String,String>();
	private Map<String,String> defaultBillTypeList = new HashMap<String,String>();
	private Map<String,String> enableSalesmanCommissionList = new HashMap<String,String>();
	
	private Map<String,String> addLeftSideLogoChoiceList = new HashMap<String,String>();
	private Map<String,String> addRightSideLogoChoiceList = new HashMap<String,String>();
	private Map<String,String> addHeaderIntroLineChoiceList = new HashMap<String,String>();
	private Map<String,String> defaultCollAccountIdList = new HashMap<String,String>();
	private Map<String,String> defaultAddPageHeaderList = new HashMap<String,String>();

	private Map<String,String> defaultDiscountTypeList = new HashMap<String,String>();

	private Map<String,String> thermalPrintHeaderTypeList = new HashMap<String,String>();

	


	private SessionMap<String,Object> sessionMap;  
	
	private File qrCodeImage;
	private File leftLogoImage;
	private File rightLogoImage;
	
	private File thermalPrintHeaderImage;
	private String thermalPrintHeaderType;
	
	private String bankingName;
	private String bankName;
	private String branchName;
	private String accountNumber;
	private String ifscCode;
	private String micrCode;
	private String upiId;
	
	public String execute() throws IOException{
		 
		String result = "login";
		session=ServletActionContext.getRequest().getSession(false); 
		
	        if(session==null || session.getAttribute("login")==null){ 
	        	addActionMessage("Please Login First !!!");
	        	result = "login";
	        }  
	        else{
	        	
	        	Connection connection = null;
				PreparedStatement preparedStatement= null;
				ResultSet  resultSet = null;
				
				String sql = "";
				String db = (String) this.getSessionMap().get("db");
				
				
				try
				{
					connection = GetDBConnection.getDBConnection(db);
					connection.setAutoCommit(false);

					if(this.getSendWhatsAppMessage() == null || this.getSendWhatsAppMessage().trim().isEmpty())
					{
						this.setSendWhatsAppMessage("TRUE");
					}
					if(this.getDefaultWhatsAppNumber() == null || this.getDefaultWhatsAppNumber().trim().isEmpty())
					{
						this.setDefaultWhatsAppNumber("9999999999");
					}
					if(this.getSendWhatsAppMessageType() == null || this.getSendWhatsAppMessageType().trim().isEmpty())
					{
						this.setSendWhatsAppMessageType("WITH_PDF");
					}
					
					String shopId = (String) this.getSessionMap().get("shopId");
		    		String shopCode = (String) this.getSessionMap().get("shopCode");
		    		
					sql ="UPDATE "
							+ "shop_settings "
							+ "SET "						
							+ "setting_value = ? "
							+ "WHERE "
							+ "setting_name = ? "
							+ "AND "
							+ "shop_id = ? "
					  		+ "AND "
					  		+ "shop_code = ?";
					
					Map<String,String> updateNameValueMap = new HashMap<String,String>();
					
					updateNameValueMap.put("add_duplicate_items_to_bill", this.getAddDuplicateItems());
					updateNameValueMap.put("add_discount_column_to_bill", this.getAddDiscountColumn());
					updateNameValueMap.put("add_QR_code_to_bill", this.getAddQRCode());
					updateNameValueMap.put("add_gst_details_to_bill", this.getAddGSTDetails());
					updateNameValueMap.put("add_message_to_bill", this.getAddMessage());
					updateNameValueMap.put("add_gst_number_to_bill", this.getAddGSTNumber());
					updateNameValueMap.put("bill_message", this.getBillMessage());
					updateNameValueMap.put("bill_message_font", this.getBillMessageFont());
					updateNameValueMap.put("add_credit_amount_to_bill", this.getAddCreditAmountToBill());
					updateNameValueMap.put("show_total_quantity", this.getShowTotalQuantity());
					updateNameValueMap.put("send_billing_message_to_owner", this.getSendBillMessageToOwner());
					updateNameValueMap.put("send_cust_credit_rec_message_to_owner", this.getSendCustCreditReceiveMessageToOwner());
					updateNameValueMap.put("default_rate_type", this.getDefaultRateType());
					updateNameValueMap.put("add_making_charge_column", this.getAddLabourCharges());
					updateNameValueMap.put("default_bill_type", this.getDefaultBillType());
					updateNameValueMap.put("add_quntity2", this.getAddQuantity2Default());
					updateNameValueMap.put("add_left_side_logo", this.getAddLeftSideLogoDefault());
					updateNameValueMap.put("add_right_side_logo", this.getAddRightSideLogoDefault());
					updateNameValueMap.put("add_header_intro_line", this.getAddIntroLineChoiceDefault());
					updateNameValueMap.put("default_account_to_collect", this.getDefaultCollAccId());
					updateNameValueMap.put("default_A5_print_orientation", this.getDefaultA5PrintOriaentation());
					updateNameValueMap.put("add_page_header_default", this.getAddPageHeaderDefault());
					updateNameValueMap.put("discount_type", this.getDefaultDiscountType());
					updateNameValueMap.put("enable_salesman_commission", this.getEnableSalesmanCommission());
					updateNameValueMap.put("enable_counter_foil_printing", this.getEnableCounterFoilPrinting());
					updateNameValueMap.put("THERMALPRINTHEADER", this.getThermalPrintHeaderType());
					updateNameValueMap.put("defaultWhatsAppNumber", this.getDefaultWhatsAppNumber());
					updateNameValueMap.put("sendWhatsAppMessage", this.getSendWhatsAppMessage());
					updateNameValueMap.put("sendWhatsAppMessageType", this.getSendWhatsAppMessageType());
					
					preparedStatement = connection.prepareStatement(sql);
					
					for(String name:updateNameValueMap.keySet())
					{
					
						preparedStatement.setString(1, updateNameValueMap.get(name));
						preparedStatement.setString(2, name);
						preparedStatement.setString(3, shopId);
						preparedStatement.setString(4, shopCode);
						
					
						preparedStatement.addBatch();
					}
					
					
					
					int []  rowsCountUpdated = preparedStatement.executeBatch();
					
					
					
					
					if(this.getThermalPrintHeaderImage() != null)
					{
						FileInputStream fis = null;
						
						  fis =  new FileInputStream(this.getThermalPrintHeaderImage());
						
						
						PreparedStatement updateThermalPrintImage = null;
						String thermalHadaerImageUpdateSQL = "UPDATE "
								+ "shop_info_master "
								+ "SET "
								+ "thermal_print_image_file = ? "
								+ "WHERE "
								+ "shop_id = ? "
								+ "AND "
								+ "shop_code = ?";
						
						updateThermalPrintImage = connection.prepareStatement(thermalHadaerImageUpdateSQL);
						updateThermalPrintImage.setBinaryStream(1, fis,(int)this.getThermalPrintHeaderImage().length() );
						updateThermalPrintImage.setString(2, shopId);
						updateThermalPrintImage.setString(3, shopCode);
						
						int k = updateThermalPrintImage.executeUpdate();
						
						if(k>0)
						{
							addActionMessage("Thermal Print image file updated successfully!");
						}
						else
						{
							addActionError("Thermal Print image not updated! Please try again!");
						}
						
						if(updateThermalPrintImage != null)
						{
							updateThermalPrintImage.close();
							updateThermalPrintImage = null;
						}
						
						if(fis != null)
						{
							fis.close();
							fis = null;
						}
						
					}
					
					
					
					if(this.getQrCodeImage() != null)
					{
						FileInputStream fis = null;
						
						  fis =  new FileInputStream(this.getQrCodeImage());
						
						
						PreparedStatement updateQRImage = null;
						String qrUpdateSQL = "UPDATE "
								+ "shop_info_master "
								+ "SET "
								+ "qr_code_file = ? "
								+ "WHERE "
								+ "shop_id = ? "
								+ "AND "
								+ "shop_code = ?";
						
						updateQRImage = connection.prepareStatement(qrUpdateSQL);
						updateQRImage.setBinaryStream(1, fis,(int)this.getQrCodeImage().length() );
						updateQRImage.setString(2, shopId);
						updateQRImage.setString(3, shopCode);
						
						int k = updateQRImage.executeUpdate();
						
						if(k>0)
						{
							addActionMessage("QR Code file updated successfully!");
						}
						else
						{
							addActionError("QR Code not updated! Please try again!");
						}
						
						if(updateQRImage != null)
						{
							updateQRImage.close();
							updateQRImage = null;
						}
						
						if(fis != null)
						{
							fis.close();
							fis = null;
						}
						
					}
					
					
					if(this.getLeftLogoImage() != null)
					{
						FileInputStream fis = null;
						
						  fis =  new FileInputStream(this.getLeftLogoImage());
						
						
						PreparedStatement updateLeftLogoImage = null;
						String leftLogoUpdateSQL = "UPDATE "
								+ "shop_info_master "
								+ "SET "
								+ "left_logo_file = ? "
								+ "WHERE "
								+ "shop_id = ? "
								+ "AND "
								+ "shop_code = ?";
						
						updateLeftLogoImage = connection.prepareStatement(leftLogoUpdateSQL);
						updateLeftLogoImage.setBinaryStream(1, fis,(int)this.getLeftLogoImage().length() );
						updateLeftLogoImage.setString(2, shopId);
						updateLeftLogoImage.setString(3, shopCode);
						
						int k = updateLeftLogoImage.executeUpdate();
						
						if(k>0)
						{
							addActionMessage("Left Logo file updated successfully!");
						}
						else
						{
							addActionError("Left Logo file not updated! Please try again!");
						}
						
						if(updateLeftLogoImage != null)
						{
							updateLeftLogoImage.close();
							updateLeftLogoImage = null;
						}
						
						if(fis != null)
						{
							fis.close();
							fis = null;
						}
						
					}
					
					
					if(this.getRightLogoImage() != null)
					{
						FileInputStream fis = null;
						
						  fis =  new FileInputStream(this.getRightLogoImage());
						
						
						PreparedStatement updateRightLogoImage = null;
						String rightLogoUpdateSQL = "UPDATE "
								+ "shop_info_master "
								+ "SET "
								+ "right_logo_file = ? "
								+ "WHERE "
								+ "shop_id = ? "
								+ "AND "
								+ "shop_code = ?";
						
						updateRightLogoImage = connection.prepareStatement(rightLogoUpdateSQL);
						updateRightLogoImage.setBinaryStream(1, fis,(int)this.getRightLogoImage().length() );
						updateRightLogoImage.setString(2, shopId);
						updateRightLogoImage.setString(3, shopCode);
						
						int k = updateRightLogoImage.executeUpdate();
						
						if(k>0)
						{
							addActionMessage("Right Logo file updated successfully!");
						}
						else
						{
							addActionError("Right Logo file not updated! Please try again!");
						}
						
						if(updateRightLogoImage != null)
						{
							updateRightLogoImage.close();
							updateRightLogoImage = null;
						}
						
						if(fis != null)
						{
							fis.close();
							fis = null;
						}
						
					}
					
					 @SuppressWarnings("unchecked")
					HashMap<String,String> shopSettingsMap = (HashMap<String, String>) this.getSessionMap().get("shop_settings");
						
						
					if(rowsCountUpdated.length == updateNameValueMap.size())
					{
						shopSettingsMap.replace("add_duplicate_items_to_bill", this.getAddDuplicateItems());						
						shopSettingsMap.replace("add_discount_column_to_bill", this.getAddDiscountColumn());
						shopSettingsMap.replace("add_QR_code_to_bill", this.getAddQRCode());
						shopSettingsMap.replace("add_gst_details_to_bill", this.getAddGSTDetails());
						shopSettingsMap.replace("add_message_to_bill", this.getAddMessage());
						shopSettingsMap.replace("add_gst_number_to_bill", this.getAddGSTNumber());
						shopSettingsMap.replace("bill_message", this.getBillMessage());		
						shopSettingsMap.replace("bill_message_font", this.getBillMessageFont());
						shopSettingsMap.replace("add_credit_amount_to_bill", this.getAddCreditAmountToBill());		
						shopSettingsMap.replace("show_total_quantity", this.getShowTotalQuantity());
						shopSettingsMap.replace("send_billing_message_to_owner", this.getSendBillMessageToOwner());	
						shopSettingsMap.replace("send_cust_credit_rec_message_to_owner", this.getSendCustCreditReceiveMessageToOwner());		
						shopSettingsMap.replace("default_rate_type", this.getDefaultRateType());
						shopSettingsMap.replace("add_making_charge_column", this.getAddLabourCharges());
						shopSettingsMap.replace("default_bill_type", this.getDefaultBillType());					
						shopSettingsMap.replace("add_quntity2", this.getAddQuantity2Default());
						
						shopSettingsMap.replace("add_left_side_logo", this.getAddLeftSideLogoDefault());
						shopSettingsMap.replace("add_right_side_logo", this.getAddRightSideLogoDefault());
						shopSettingsMap.replace("add_header_intro_line", this.getAddIntroLineChoiceDefault());
						shopSettingsMap.replace("default_account_to_collect", this.getDefaultCollAccId());
						shopSettingsMap.replace("default_A5_print_orientation", this.getDefaultA5PrintOriaentation());
					shopSettingsMap.replace("add_page_header_default", this.getAddPageHeaderDefault());
				shopSettingsMap.replace("discount_type", this.getDefaultDiscountType());
				shopSettingsMap.replace("enable_salesman_commission", this.getEnableSalesmanCommission());
				shopSettingsMap.replace("enable_counter_foil_printing", this.getEnableCounterFoilPrinting());
					shopSettingsMap.replace("THERMALPRINTHEADER", this.getThermalPrintHeaderType());
					shopSettingsMap.replace("defaultWhatsAppNumber", this.getDefaultWhatsAppNumber());
					shopSettingsMap.replace("sendWhatsAppMessage", this.getSendWhatsAppMessage());
					shopSettingsMap.replace("sendWhatsAppMessageType", this.getSendWhatsAppMessageType());
						
						this.getSessionMap().put("shop_settings",shopSettingsMap);
						this.getSessionMap().put("sendWhatsAppMessage", this.getSendWhatsAppMessage());
						this.getSessionMap().put("defaultWhatsAppNumber", this.getDefaultWhatsAppNumber());
						this.getSessionMap().put("sendWhatsAppMessageType", this.getSendWhatsAppMessageType());
						 
						 
						 
						 if(preparedStatement != null)
						 {
							 preparedStatement.close();
							 preparedStatement = null;
						 }
						 
						 
						 sql = "UPDATE "
						 		+ "shop_bank_details_master "
						 		+ "SET "
						 		+ "shop_banking_name = ?,"
						 		+ "bank_name = ?,"
						 		+ "bank_branch_name = ?,"
						 		+ "account_number = ?,"
						 		+ "IFSC_code =  ?,"
						 		+ "micr_code =?,"
						 		+ "upi_id = ? "
						 		+ "WHERE "
						 		+ "shop_id = ? "
						 		+ "AND "
						 		+ "shop_code = ?";
						 
						 preparedStatement = connection.prepareStatement(sql);
						 
						 preparedStatement.setString(1, this.getBankingName());
						 preparedStatement.setString(2, this.getBankName());
						 preparedStatement.setString(3, this.getBranchName());
						 preparedStatement.setString(4, this.getAccountNumber());
						 preparedStatement.setString(5, this.getIfscCode());
						 preparedStatement.setString(6, this.getMicrCode());
						 preparedStatement.setString(7, "NA");
						 preparedStatement.setString(8, shopId);
						 preparedStatement.setString(9, shopCode);
						 
						 
						 preparedStatement.executeUpdate();
						 
						 
							Map<String,String> bankDetails = new LinkedHashMap<String,String>();
							
							bankDetails.put("bankingname",this.getBankingName());
							bankDetails.put("bankname",this.getBankName());
							bankDetails.put("branchname",this.getBranchName());
							bankDetails.put("accnumber",this.getAccountNumber());
							bankDetails.put("ifsccode", this.getIfscCode());
							bankDetails.put("micrcode",this.getMicrCode());
							
							
							this.getSessionMap().replace("bank_details", bankDetails);
						 
						 
						 
						connection.commit();
						result = SUCCESS;
						addActionMessage("Settings updated successfully!");
					}
					else
					{
						connection.rollback();
						result = "error";
						addActionError("Settings not updated! Please try again!");
					}
					
					
				}catch (SQLException e) {
					try {
						connection.rollback();
					} catch (SQLException e1) {
						// TODO Auto-generated catch block
						//e1.printStackTrace();
					}
					result = "error";
					
					addActionError(e.getErrorCode()+" || "+e.getMessage() +" ||1 Cannot load page !");
				}finally {
					if(resultSet !=null)
					{
						try {resultSet.close(); resultSet = null;} catch (SQLException e) {}
					}
					if(preparedStatement != null)
					{
						try {preparedStatement.close(); preparedStatement = null;} catch (SQLException e) {}
					}
					if(connection != null)
					{
						
						try {connection.close();
						 connection = null;
						}catch (SQLException e) {}
					}
				}
	        }
	        
	        
	       
	        
	        return result;
	}

	@Override
	public void validate() {
		
		this.setDefaultCollAccountIdList(GetAccountListForDrCr.getAccountList(this.getSessionMap()));
		
		this.getDefaultDiscountTypeList().put("PERQUANTITY", "PER-QUANTITY");
    	this.getDefaultDiscountTypeList().put("PERCENTAGE", "PERCENTAGE");
    
    	
    	
		this.getThermalPrintHeaderTypeList().put("TEXT", "DEFAULT-TEXT");
		this.getThermalPrintHeaderTypeList().put("IMAGE", "IMAGE");
    	
		this.getAddDiscountColumnToBill().put("FALSE","DONT-ADD");
    	this.getAddDiscountColumnToBill().put("TRUE","ADD");
    	
    	this.getAddDuplicateItemsToBill().put("FALSE","DONT-ADD");
    	this.getAddDuplicateItemsToBill().put("TRUE","ADD");
    	
    	
    	this.getAddGSTDetailsToBill().put("FALSE","DONT-ADD");
    	this.getAddGSTDetailsToBill().put("TRUE","ADD");
    	
    	this.getAddGSTNumberToBill().put("FALSE","DONT-ADD");
    	this.getAddGSTNumberToBill().put("TRUE","ADD");
    	
    	this.getAddMessageToBill().put("FALSE","DONT-ADD");
    	this.getAddMessageToBill().put("TRUE","ADD");
    	
    	this.getAddQRCodeToBill().put("FALSE","DONT-ADD");
    	this.getAddQRCodeToBill().put("TRUE","ADD");
		
    	this.getSendBillSMStoOwnerList().put("FALSE", "DONT-SEND");
    	this.getSendBillSMStoOwnerList().put("TRUE", "SEND");
    	
    	this.getSendcustCreditReceiveSMStoOwnerList().put("FALSE", "DONT-SEND");
    	this.getSendcustCreditReceiveSMStoOwnerList().put("TRUE", "SEND");

		this.getSendWhatsAppMessageList().put("FALSE", "OFF");
		this.getSendWhatsAppMessageList().put("TRUE", "ON");
		this.getSendWhatsAppMessageTypeList().put("WITH_PDF", "WITH PDF");
		this.getSendWhatsAppMessageTypeList().put("TEXT_ONLY", "WITHOUT PDF (TEXT ONLY)");
    	
    	this.getAddLabourChargesList().put("FALSE", "DONT-ADD");
    	this.getAddLabourChargesList().put("TRUE", "ADD");

		this.getEnableSalesmanCommissionList().put("FALSE", "OFF");
		this.getEnableSalesmanCommissionList().put("TRUE", "ON");
    	
    	
    	this.getAddLeftSideLogoChoiceList().put("FALSE", "DONT-ADD");
    	this.getAddLeftSideLogoChoiceList().put("TRUE", "ADD");
    	
    	this.getAddRightSideLogoChoiceList().put("FALSE", "DONT-ADD");
    	this.getAddRightSideLogoChoiceList().put("TRUE", "ADD");
    	
		this.getAddHeaderIntroLineChoiceList().put("FALSE", "DONT-ADD");
		this.getAddHeaderIntroLineChoiceList().put("TRUE", "ADD");
		
		
		
		this.getDefaultA5OrientationList().put("PORTRAIT", "PORTRAIT");
		this.getDefaultA5OrientationList().put("LANDSCAPE", "LANDSCAPE");
	
		
		this.getDefaultAddPageHeaderList().put("FALSE", "DONT-ADD");
    	this.getDefaultAddPageHeaderList().put("TRUE", "ADD");
	
    	
    	this.setDefaultBillTypeList(GetListResource.GetBillTypeList());
	}
	public HttpSession getSession() {
		return session;
	}

	public void setSession(HttpSession session) {
		this.session = session;
	}


				
	public void setSession(Map<String, Object> map) {
		// TODO Auto-generated method stub
		 sessionMap=(SessionMap<String, Object>)map;  
		
	}

	

	public SessionMap<String, Object> getSessionMap() {
		return sessionMap;
	}


	public void setSessionMap(SessionMap<String, Object> sessionMap) {
		this.sessionMap = sessionMap;
	}



	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getAddDuplicateItems() {
		return addDuplicateItems;
	}

	public void setAddDuplicateItems(String addDuplicateItems) {
		this.addDuplicateItems = addDuplicateItems;
	}

	public String getAddDiscountColumn() {
		return addDiscountColumn;
	}

	public void setAddDiscountColumn(String addDiscountColumn) {
		this.addDiscountColumn = addDiscountColumn;
	}

	public String getAddQRCode() {
		return addQRCode;
	}

	public void setAddQRCode(String addQRCode) {
		this.addQRCode = addQRCode;
	}

	public String getAddGSTDetails() {
		return addGSTDetails;
	}

	public void setAddGSTDetails(String addGSTDetails) {
		this.addGSTDetails = addGSTDetails;
	}

	public String getAddGSTNumber() {
		return addGSTNumber;
	}

	public void setAddGSTNumber(String addGSTNumber) {
		this.addGSTNumber = addGSTNumber;
	}

	public String getAddMessage() {
		return addMessage;
	}

	public void setAddMessage(String addMessage) {
		this.addMessage = addMessage;
	}

	public String getBillMessage() {
		return billMessage;
	}

	public void setBillMessage(String billMessage) {
		this.billMessage = billMessage;
	}

	public Map<String, String> getAddDuplicateItemsToBill() {
		return addDuplicateItemsToBill;
	}

	public void setAddDuplicateItemsToBill(Map<String, String> addDuplicateItemsToBill) {
		this.addDuplicateItemsToBill = addDuplicateItemsToBill;
	}

	public Map<String, String> getAddDiscountColumnToBill() {
		return addDiscountColumnToBill;
	}

	public void setAddDiscountColumnToBill(Map<String, String> addDiscountColumnToBill) {
		this.addDiscountColumnToBill = addDiscountColumnToBill;
	}

	public Map<String, String> getAddQRCodeToBill() {
		return addQRCodeToBill;
	}

	public void setAddQRCodeToBill(Map<String, String> addQRCodeToBill) {
		this.addQRCodeToBill = addQRCodeToBill;
	}

	public Map<String, String> getAddGSTDetailsToBill() {
		return addGSTDetailsToBill;
	}

	public void setAddGSTDetailsToBill(Map<String, String> addGSTDetailsToBill) {
		this.addGSTDetailsToBill = addGSTDetailsToBill;
	}

	public Map<String, String> getAddMessageToBill() {
		return addMessageToBill;
	}

	public void setAddMessageToBill(Map<String, String> addMessageToBill) {
		this.addMessageToBill = addMessageToBill;
	}

	public Map<String, String> getAddGSTNumberToBill() {
		return addGSTNumberToBill;
	}

	public void setAddGSTNumberToBill(Map<String, String> addGSTNumberToBill) {
		this.addGSTNumberToBill = addGSTNumberToBill;
	}

	public File getQrCodeImage() {
		return qrCodeImage;
	}

	public void setQrCodeImage(File qrCodeImage) {
		this.qrCodeImage = qrCodeImage;
	}

	

	public String getBillMessageFont() {
		return billMessageFont;
	}

	public void setBillMessageFont(String billMessageFont) {
		this.billMessageFont = billMessageFont;
	}

	public String getShowTotalQuantity() {
		return showTotalQuantity;
	}

	public void setShowTotalQuantity(String showTotalQuantity) {
		this.showTotalQuantity = showTotalQuantity;
	}

	public String getDuplicateItemsDefault() {
		return duplicateItemsDefault;
	}

	public void setDuplicateItemsDefault(String duplicateItemsDefault) {
		this.duplicateItemsDefault = duplicateItemsDefault;
	}

	public String getDiscountColumnDefault() {
		return discountColumnDefault;
	}

	public void setDiscountColumnDefault(String discountColumnDefault) {
		this.discountColumnDefault = discountColumnDefault;
	}

	public String getQrCodeDefault() {
		return qrCodeDefault;
	}

	public void setQrCodeDefault(String qrCodeDefault) {
		this.qrCodeDefault = qrCodeDefault;
	}

	public String getGstDetailsDefault() {
		return gstDetailsDefault;
	}

	public void setGstDetailsDefault(String gstDetailsDefault) {
		this.gstDetailsDefault = gstDetailsDefault;
	}

	public String getMessageDefault() {
		return messageDefault;
	}

	public void setMessageDefault(String messageDefault) {
		this.messageDefault = messageDefault;
	}

	public String getAddGstNumberDefault() {
		return addGstNumberDefault;
	}

	public void setAddGstNumberDefault(String addGstNumberDefault) {
		this.addGstNumberDefault = addGstNumberDefault;
	}

	public String getAddCreditAmountToBillDefault() {
		return addCreditAmountToBillDefault;
	}

	public void setAddCreditAmountToBillDefault(String addCreditAmountToBillDefault) {
		this.addCreditAmountToBillDefault = addCreditAmountToBillDefault;
	}

	public String getBillMessageFontDefault() {
		return billMessageFontDefault;
	}

	public void setBillMessageFontDefault(String billMessageFontDefault) {
		this.billMessageFontDefault = billMessageFontDefault;
	}

	public String getShowTotalQuantityDefault() {
		return showTotalQuantityDefault;
	}

	public void setShowTotalQuantityDefault(String showTotalQuantityDefault) {
		this.showTotalQuantityDefault = showTotalQuantityDefault;
	}


	public String getAddCreditAmountToBill() {
		return addCreditAmountToBill;
	}

	public void setAddCreditAmountToBill(String addCreditAmountToBill) {
		this.addCreditAmountToBill = addCreditAmountToBill;
	}

	public Map<String, String> getAddCreditAmountToBillList() {
		return addCreditAmountToBillList;
	}

	public void setAddCreditAmountToBillList(Map<String, String> addCreditAmountToBillList) {
		this.addCreditAmountToBillList = addCreditAmountToBillList;
	}

	public Map<String, String> getBillMessageFontList() {
		return billMessageFontList;
	}

	public void setBillMessageFontList(Map<String, String> billMessageFontList) {
		this.billMessageFontList = billMessageFontList;
	}

	public Map<String, String> getShowTotalQuantityList() {
		return showTotalQuantityList;
	}

	public void setShowTotalQuantityList(Map<String, String> showTotalQuantityList) {
		this.showTotalQuantityList = showTotalQuantityList;
	}

	public String getSendBillMessageToOwner() {
		return sendBillMessageToOwner;
	}

	public void setSendBillMessageToOwner(String sendBillMessageToOwner) {
		this.sendBillMessageToOwner = sendBillMessageToOwner;
	}

	public Map<String, String> getSendBillSMStoOwnerList() {
		return sendBillSMStoOwnerList;
	}

	public void setSendBillSMStoOwnerList(Map<String, String> sendBillSMStoOwnerList) {
		this.sendBillSMStoOwnerList = sendBillSMStoOwnerList;
	}

	public String getSendBillSMSToOwnerDefault() {
		return sendBillSMSToOwnerDefault;
	}

	public void setSendBillSMSToOwnerDefault(String sendBillSMSToOwnerDefault) {
		this.sendBillSMSToOwnerDefault = sendBillSMSToOwnerDefault;
	}

	public String getSendCustCreditReceiveSMSToOwnerDefault() {
		return sendCustCreditReceiveSMSToOwnerDefault;
	}

	public void setSendCustCreditReceiveSMSToOwnerDefault(String sendCustCreditReceiveSMSToOwnerDefault) {
		this.sendCustCreditReceiveSMSToOwnerDefault = sendCustCreditReceiveSMSToOwnerDefault;
	}

	public Map<String, String> getSendcustCreditReceiveSMStoOwnerList() {
		return sendcustCreditReceiveSMStoOwnerList;
	}

	public void setSendcustCreditReceiveSMStoOwnerList(Map<String, String> sendcustCreditReceiveSMStoOwnerList) {
		this.sendcustCreditReceiveSMStoOwnerList = sendcustCreditReceiveSMStoOwnerList;
	}

	public String getSendCustCreditReceiveMessageToOwner() {
		return sendCustCreditReceiveMessageToOwner;
	}

	public void setSendCustCreditReceiveMessageToOwner(String sendCustCreditReceiveMessageToOwner) {
		this.sendCustCreditReceiveMessageToOwner = sendCustCreditReceiveMessageToOwner;
	}

	public String getDefaultWhatsAppNumber() {
		return defaultWhatsAppNumber;
	}

	public void setDefaultWhatsAppNumber(String defaultWhatsAppNumber) {
		this.defaultWhatsAppNumber = defaultWhatsAppNumber;
	}

	public String getSendWhatsAppMessage() {
		return sendWhatsAppMessage;
	}

	public void setSendWhatsAppMessage(String sendWhatsAppMessage) {
		this.sendWhatsAppMessage = sendWhatsAppMessage;
	}

	public String getDefaultWhatsAppNumberDefault() {
		return defaultWhatsAppNumberDefault;
	}

	public void setDefaultWhatsAppNumberDefault(String defaultWhatsAppNumberDefault) {
		this.defaultWhatsAppNumberDefault = defaultWhatsAppNumberDefault;
	}

	public String getSendWhatsAppMessageDefault() {
		return sendWhatsAppMessageDefault;
	}

	public void setSendWhatsAppMessageDefault(String sendWhatsAppMessageDefault) {
		this.sendWhatsAppMessageDefault = sendWhatsAppMessageDefault;
	}

	public Map<String, String> getSendWhatsAppMessageList() {
		return sendWhatsAppMessageList;
	}

	public void setSendWhatsAppMessageList(Map<String, String> sendWhatsAppMessageList) {
		this.sendWhatsAppMessageList = sendWhatsAppMessageList;
	}

	public String getSendWhatsAppMessageType() {
		return sendWhatsAppMessageType;
	}

	public void setSendWhatsAppMessageType(String sendWhatsAppMessageType) {
		this.sendWhatsAppMessageType = sendWhatsAppMessageType;
	}

	public String getSendWhatsAppMessageTypeDefault() {
		return sendWhatsAppMessageTypeDefault;
	}

	public void setSendWhatsAppMessageTypeDefault(String sendWhatsAppMessageTypeDefault) {
		this.sendWhatsAppMessageTypeDefault = sendWhatsAppMessageTypeDefault;
	}

	public Map<String, String> getSendWhatsAppMessageTypeList() {
		return sendWhatsAppMessageTypeList;
	}

	public void setSendWhatsAppMessageTypeList(Map<String, String> sendWhatsAppMessageTypeList) {
		this.sendWhatsAppMessageTypeList = sendWhatsAppMessageTypeList;
	}

	public String getDefaultRateType() {
		return defaultRateType;
	}

	public void setDefaultRateType(String defaultRateType) {
		this.defaultRateType = defaultRateType;
	}

	public Map<String, String> getRateTypeList() {
		return rateTypeList;
	}

	public void setRateTypeList(Map<String, String> rateTypeList) {
		this.rateTypeList = rateTypeList;
	}

	public Map<String, String> getAddLabourChargesList() {
		return addLabourChargesList;
	}

	public void setAddLabourChargesList(Map<String, String> addLabourChargesList) {
		this.addLabourChargesList = addLabourChargesList;
	}

	public String getAddLabourCharges() {
		return addLabourCharges;
	}

	public void setAddLabourCharges(String addLabourCharges) {
		this.addLabourCharges = addLabourCharges;
	}

	public String getDefaultBillType() {
		return defaultBillType;
	}

	public void setDefaultBillType(String defaultBillType) {
		this.defaultBillType = defaultBillType;
	}

	public Map<String, String> getDefaultBillTypeList() {
		return defaultBillTypeList;
	}

	public void setDefaultBillTypeList(Map<String, String> defaultBillTypeList) {
		this.defaultBillTypeList = defaultBillTypeList;
	}

	public String getAddQuantity2Default() {
		return addQuantity2Default;
	}

	public void setAddQuantity2Default(String addQuantity2Default) {
		this.addQuantity2Default = addQuantity2Default;
	}

	public String getBankingName() {
		return bankingName;
	}

	public void setBankingName(String bankingName) {
		this.bankingName = bankingName;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getIfscCode() {
		return ifscCode;
	}

	public void setIfscCode(String ifscCode) {
		this.ifscCode = ifscCode;
	}

	public String getMicrCode() {
		return micrCode;
	}

	public void setMicrCode(String micrCode) {
		this.micrCode = micrCode;
	}

	public String getUpiId() {
		return upiId;
	}

	public void setUpiId(String upiId) {
		this.upiId = upiId;
	}

	public String getAddLeftSideLogoDefault() {
		return addLeftSideLogoDefault;
	}

	public void setAddLeftSideLogoDefault(String addLeftSideLogoDefault) {
		this.addLeftSideLogoDefault = addLeftSideLogoDefault;
	}

	public String getAddRightSideLogoDefault() {
		return addRightSideLogoDefault;
	}

	public void setAddRightSideLogoDefault(String addRightSideLogoDefault) {
		this.addRightSideLogoDefault = addRightSideLogoDefault;
	}

	public String getAddIntroLineChoiceDefault() {
		return addIntroLineChoiceDefault;
	}

	public void setAddIntroLineChoiceDefault(String addIntroLineChoiceDefault) {
		this.addIntroLineChoiceDefault = addIntroLineChoiceDefault;
	}

	public Map<String, String> getAddLeftSideLogoChoiceList() {
		return addLeftSideLogoChoiceList;
	}

	public void setAddLeftSideLogoChoiceList(Map<String, String> addLeftSideLogoChoiceList) {
		this.addLeftSideLogoChoiceList = addLeftSideLogoChoiceList;
	}

	public Map<String, String> getAddRightSideLogoChoiceList() {
		return addRightSideLogoChoiceList;
	}

	public void setAddRightSideLogoChoiceList(Map<String, String> addRightSideLogoChoiceList) {
		this.addRightSideLogoChoiceList = addRightSideLogoChoiceList;
	}

	public Map<String, String> getAddHeaderIntroLineChoiceList() {
		return addHeaderIntroLineChoiceList;
	}

	public void setAddHeaderIntroLineChoiceList(Map<String, String> addHeaderIntroLineChoiceList) {
		this.addHeaderIntroLineChoiceList = addHeaderIntroLineChoiceList;
	}

	public File getLeftLogoImage() {
		return leftLogoImage;
	}

	public void setLeftLogoImage(File leftLogoImage) {
		this.leftLogoImage = leftLogoImage;
	}

	public File getRightLogoImage() {
		return rightLogoImage;
	}

	public void setRightLogoImage(File rightLogoImage) {
		this.rightLogoImage = rightLogoImage;
	}

	public Map<String, String> getDefaultCollAccountIdList() {
		return defaultCollAccountIdList;
	}

	public void setDefaultCollAccountIdList(Map<String, String> defaultCollAccountIdList) {
		this.defaultCollAccountIdList = defaultCollAccountIdList;
	}

	public String getDefaultCollAccId() {
		return defaultCollAccId;
	}

	public void setDefaultCollAccId(String defaultCollAccId) {
		this.defaultCollAccId = defaultCollAccId;
	}

	public String getDefaultA5PrintOriaentation() {
		return defaultA5PrintOriaentation;
	}

	public void setDefaultA5PrintOriaentation(String defaultA5PrintOriaentation) {
		this.defaultA5PrintOriaentation = defaultA5PrintOriaentation;
	}

	public Map<String, String> getDefaultA5OrientationList() {
		return defaultA5OrientationList;
	}

	public void setDefaultA5OrientationList(Map<String, String> defaultA5OrientationList) {
		this.defaultA5OrientationList = defaultA5OrientationList;
	}

	public String getAddPageHeaderDefault() {
		return addPageHeaderDefault;
	}

	public void setAddPageHeaderDefault(String addPageHeaderDefault) {
		this.addPageHeaderDefault = addPageHeaderDefault;
	}

	public Map<String, String> getDefaultAddPageHeaderList() {
		return defaultAddPageHeaderList;
	}

	public void setDefaultAddPageHeaderList(Map<String, String> defaultAddPageHeaderList) {
		this.defaultAddPageHeaderList = defaultAddPageHeaderList;
	}

	public String getDefaultDiscountType() {
		return defaultDiscountType;
	}

	public void setDefaultDiscountType(String defaultDiscountType) {
		this.defaultDiscountType = defaultDiscountType;
	}

	public String getEnableSalesmanCommission() {
		return enableSalesmanCommission;
	}

	public void setEnableSalesmanCommission(String enableSalesmanCommission) {
		this.enableSalesmanCommission = enableSalesmanCommission;
	}

	public String getEnableCounterFoilPrinting() {
		return enableCounterFoilPrinting;
	}

	public void setEnableCounterFoilPrinting(String enableCounterFoilPrinting) {
		this.enableCounterFoilPrinting = enableCounterFoilPrinting;
	}

	public Map<String, String> getEnableSalesmanCommissionList() {
		return enableSalesmanCommissionList;
	}

	public void setEnableSalesmanCommissionList(Map<String, String> enableSalesmanCommissionList) {
		this.enableSalesmanCommissionList = enableSalesmanCommissionList;
	}

	public Map<String, String> getDefaultDiscountTypeList() {
		return defaultDiscountTypeList;
	}

	public void setDefaultDiscountTypeList(Map<String, String> defaultDiscountTypeList) {
		this.defaultDiscountTypeList = defaultDiscountTypeList;
	}

	public Map<String, String> getThermalPrintHeaderTypeList() {
		return thermalPrintHeaderTypeList;
	}

	public void setThermalPrintHeaderTypeList(Map<String, String> thermalPrintHeaderTypeList) {
		this.thermalPrintHeaderTypeList = thermalPrintHeaderTypeList;
	}

	public File getThermalPrintHeaderImage() {
		return thermalPrintHeaderImage;
	}

	public void setThermalPrintHeaderImage(File thermalPrintHeaderImage) {
		this.thermalPrintHeaderImage = thermalPrintHeaderImage;
	}

	public String getThermalPrintHeaderType() {
		return thermalPrintHeaderType;
	}

	public void setThermalPrintHeaderType(String thermalPrintHeaderType) {
		this.thermalPrintHeaderType = thermalPrintHeaderType;
	}

	
	
	
	
}
