Snippets Collections
class MockApiService implements ApiService {
  @override
  Future<String> fetchUserName() async {
    return "Mock User"; // Fake data, no delay
  }
}

void main() {
  // For testing, inject the mock
  runApp(
    MaterialApp(
      home: Scaffold(
        body: UserWidget(apiService: MockApiService()),
      ),
    ),
  );
}
void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: UserWidget(apiService: ApiService()),
      ),
    ),
  );
}
class UserWidget extends StatelessWidget {
  final ApiService apiService; // Dependency injected

  UserWidget({required this.apiService});

  @override
  Widget build(BuildContext context) {
    return FutureBuilder<String>(
      future: apiService.fetchUserName(),
      builder: (context, snapshot) {
        if (snapshot.hasData) {
          return Text("User: ${snapshot.data}");
        }
        return CircularProgressIndicator();
      },
    );
  }
}
class UserWidget extends StatelessWidget {
  final ApiService apiService = ApiService(); // Hardcoded dependency

  @override
  Widget build(BuildContext context) {
    return FutureBuilder<String>(
      future: apiService.fetchUserName(),
      builder: (context, snapshot) {
        if (snapshot.hasData) {
          return Text("User: ${snapshot.data}");
        }
        return CircularProgressIndicator();
      },
    );
  }
}
class ApiService {
  Future<String> fetchUserName() async {
    // Simulate an API call
    await Future.delayed(Duration(seconds: 1));
    return "John Doe";
  }
}
$ git remote -v
> origin    https://github.com/YOUR-USERNAME/YOUR-FORK.git (fetch)
> origin    https://github.com/YOUR-USERNAME/YOUR-FORK.git (push)
> upstream  https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch)
> upstream  https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (push)
msiexec.exe /package PowerShell-7.5.0-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1 ADD_PATH=1
Imagine a shopping platform where products never run out, browsing is lightning-fast, and checkout is as easy as a single click. Our Amazon Clone online store brings you an unmatched shopping experience with a wide range of products, smart recommendations, and smooth navigation. Whether you’re searching for the latest gadgets, fashion, or daily essentials, everything is just a tap away!
Why You’ll Like It?
 Infinite Choices – Browse an endless catalog of products.
 Fast & Easy Search – Find what you need instantly.
 Safe & Secure Payments – Shop with confidence.

Visit now >> https://www.beleaftechnologies.com/amazon-clone
Whatsapp :  +91 8056786622
Email id :  business@beleaftechnologies.com
Telegram : https://telegram.me/BeleafSoftTech 
<lightning-input class="searchBar" data-id="searchBar" type="search" variant="label-hidden" placeholder="Search..."
                onmouseout={handleSearch}>
            </lightning-input>
            <div class="tooltip-pointer">
                <div class="tooltip-content">
                    {searchAttributesText}
                </div>
            </div>

.tooltip-pointer {
    position: absolute;
    z-index: 7000;
    /* opacity: 0;
    visibility: hidden; */
    margin-top: 3rem;
    width: 13.5rem;
    padding: 0.5rem;
    background-color: #003366;
    text-align: left;
    color: white;
}

/* Show tooltip on hover */
.searchBar:hover .tooltip-pointer {
    opacity: 1;
    visibility: visible;
}

/* Triangle pointer at the top of tooltip */
.tooltip-pointer:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #003366;
}

.tooltip-content {
    font-size: 13px;
    line-height: 1.5;
}

Teamwork has acquired impeccable recognition among premium firms as the best PR firm in Delhi NCR. We have been providing excellent public relations services in India for years and our PR professionals always focus on result-oriented campaigns. A separate department for everything allows Teamwork to develop ideas and strategies like no other.
Get a feature-rich, scalable, and fully customizable betting platform with live odds, casino games, and secure payments—all modeled after BET365.

Developed by COINSQUEENS – Experts in iGaming Solutions.

Start your betting business today.

For more info:
Call/Whatsapp - +91 87540 53377
Email:sales@coinsqueen.com
Visit https://www.coinsqueens.com/blog/bet365-clone-script 

<%{
	fetinst = Installation[ID == input.rec].ID;
	fetinst1 = Installation[ID == input.rec];
	fetciv = Civil_Work_Detail1[Installation == input.rec].ID;
	fetearth = Product_Details_Check_List[Installation == input.rec].ID;
	fetinst = Installation_SPQ1[Installation == input.rec].ID;
	fetfcc = Final_Connection[Installation == input.rec].ID;
	fetkwh = Kwh_Line_Item_Form[Installation == input.rec].ID;
	fetfccomp = Final_Connection_Checklist_Individual_Yes_No[Installation_Assignment == input.rec].ID;
	fetgin = GIN_ID_Status[Installation == input.rec].ID;
	fetgin1 = GIN_ID_Status[Installation == input.rec];
	fetinstass = Installation_Assignment[Installation == input.rec];
	ginform = Gin_Form[GIN_ID_Status1 == fetgin];
	data = Installation_SPQ1[Installation == input.rec];
	%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <style>
        body.custom-links-page {
            font-family: 'Arial', sans-serif;
            background-color: #f8f8f8;
            margin: 0;
            padding: 10px;
        }

        body.custom-links-page h1 {
            color: #333;
            text-align: center;
        }

        .group-container {
            background-color: #14638e;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            margin-bottom: 10px;
            padding: 10px;
            overflow: hidden;
        }

        .subgroup-container {
            background-color: #f2f2f2;
            border-radius: 8px;
            margin-bottom: 10px;
            padding: 10px;
            overflow: hidden;
        }

        .column {
            width: 33.33%;
            float: left;
            box-sizing: border-box;
            padding: 0 5px;
			margin-right: 10%;
        }
.column1 {
            width: 33.33%;
            float: left;
            box-sizing: border-box;
            padding: 0 5px;
        }
        .column ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }

        .column li {
            margin-bottom: 10px;
            border-bottom: 1px solid #ddd;
            padding-bottom: 5px;
        }

        .column a {
            text-decoration: none;
            color: #14638e;
            font-weight: bold;
            transition: color 0.3s ease;
        }

        .column a:hover {
            color: #da251c;
        }


        .column b:hover {
            color: #da251c;
        }

        @media only screen and (max-width: 767px) {
            .column {
                width: 100%;
                float: none;
                margin-bottom: 15px;
            }
        }
    </style>
</head>
<body class="custom-links-page">

    <div class="group-container">
	<h2 style="text-align: center">CHECKLIST</h2>

        <div class="subgroup-container">

			<div class="column">            
                <ul>
<%
	if(fetinst1.No_of_Civil_Work > 0)
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Civil_Work_Detail1?recLinkID=<%=fetciv%>&Redirect=RM&viewLinkName=All_Civil_Work_Details1" target="_blank">Civil Work Checklist</a></li>
<%
	}
	if(fetinst1.No_of_Civil_Work <= 0 || fetinst1.No_of_Civil_Work == null)
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Civil_Work_Detail1?recLinkID=<%=fetciv%>&Redirect=RM&viewLinkName=All_Civil_Work_Details1" target="_blank">Civil Work Checklist</a></li>
<%
	}
	if(fetinst1.No_of_Earthing1 > 0)
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Product_Details_Check_List?recLinkID=<%=fetearth%>&Redirect=RM&viewLinkName=Product_Details_Check_List_Report" target="_blank">Earthing Checklist</a></li>
<%
	}
	if(fetinst1.No_of_Earthing1 <= 0 || fetinst1.No_of_Earthing1 == null)
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Product_Details_Check_List?recLinkID=<%=fetearth%>&Redirect=RM&viewLinkName=Product_Details_Check_List_Report" target="_blank">Earthing Checklist</a></li>
<%
	}
	%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Installation_SPQ1?recLinkID=<%=fetinst1.Installation_SPQ1%>&Redirect=RM&viewLinkName=Installation_SPQ1_Report&Backend_hide_subform=true" target="_blank">Installation Checklist</a></li>
<%
	if(fetinst1.No_of_7_7_KWh_Chargers > 0)
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:kwh_Line_Items?Installation=<%=input.rec%>" target="_blank">View 7.7KWh Checklist</a></li>
<%
	}
	if(fetinst1.No_of_7_7_KWh_Chargers <= 0 || fetinst1.No_of_7_7_KWh_Chargers == null)
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:kwh_Line_Items?Installation=<%=input.rec%>" target="_blank">View 7.7KWh Checklist</a></li>
<%
	}
	if(fetinstass.New_Status_Final_Connection != "Vendor assignment pending" || fetinstass.New_Status_Final_Connection == null && fetinst1.Final_Connection != null)
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Final_Connection?recLinkID=<%=fetinst1.Final_Connection%>&Redirect=RM&viewLinkName=All_Final_Connections&zc_LoadIn=dialog" >Final Connection Checklist</a></li>
<%
	}
	if(fetinstass.New_Status_Final_Connection == "Vendor assignment pending" || fetinstass.New_Status_Final_Connection != null || fetinst1.Final_Connection == null)
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Final_Connection?recLinkID=<%=fetfcc%>&Redirect=RM&viewLinkName=All_Final_Connections&zc_LoadIn=dialog">Final Connection Checklist</a></li>
<%
	}
	if(fetinst1.Final_Connection_Checklist_Individual_Yes_No_Multiple == null && fetinst1.Final_Connection_Status == "Final Connection Pending")
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Final_Connection_Checklist_Individual_Yes_No?Installation_Assignment=<%=fetinst1.Installation_Assignment%>&zc_LoadIn=dialog">FC needs to be completed?</a></li>
<%
	}
	if(fetinst1.Final_Connection_Status == "Final Connection Completed" || fetinst1.Final_Connection_Checklist_Individual_Yes_No_Multiple != null)
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Final_Connection_Checklist_Individual_Yes_No?Installation_Assignment=<%=fetfccomp%>" target="_blank">FC needs to be completed?</a></li>
<%
	}
	%>
<!-- Below code is for Proceed for Activation button code-->
<%
	if(fetinst1.Status4 == "Open")
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Copy_of_Approval?Installation_ID=<%=input.rec%>&zc_LoadIn=dialog">Approve</a></li>
<%
	}
	if(fetinst1.Status4 != "Open")
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:Network_Engineer_Approval?fetinst1.GIN_ID_Status<%=fetgin%>" target="_blank">Approve</a></li>
<%
	}
	%>
</ul>
            </div>
			<div class="column">            
                <ul>
				<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:All_Civil_Work_Details1?Installation=<%=input.rec%>" target="_blank">Export Civilwork Checklist</a></li>
				<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:Product_Details_Check_List_Report?Installation=<%=input.rec%>" target="_blank">Export Earthing Checklist</a></li>
				<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:Installation_SPQ1_Report?Installation=<%=input.rec%>" target="_blank">Export Installation Checklist</a></li>
				<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:kwh_Line_Items?Installation=<%=input.rec%>" target="_blank">Export 7.7KWh Checklist</a></li>
					<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Report:All_Final_Connections?Installation=<%=input.rec%>" target="_blank">Export Final Connection Checklist</a></li>
					<li><br></li>
<%
	if(fetinst1.Status4 != "Rejected")
	{
		%>
<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Reject_Remarks_For_Rm?Installation=<%=input.rec%>&zc_LoadIn=dialog" >Reject</a></li>
<%
	}
	if(fetinst1.Status4 == "Rejected")
	{
		%>
<li><b href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Reject_Remarks_For_Rm?Installation=<%=input.rec%>&zc_LoadIn=dialog">Reject</a></li>
<%
	}
	%>
<!--<li><a href="https://creatorapp.zoho.in/atherenergy/environment/development/atherops/#Form:Test_Approval?Installation_ID=<%=input.rec%>&zc_LoadIn=dialog">Test</a></li>
</ul>-->
            </div>
			 </div>
			
			

</body>
</html>
<%

}%>
void Books.create_bills(int ids)
{
	billdata = Bills[ID == input.ids];
	if(billdata.Books_Bill_ID.isEmpty() == true)
	{
		getID = Bills[ID != null] sort by Books_Bill_ID desc;
		if(getID.count() == 0)
		{
			billdata.Books_Bill_ID="Bill-001";
		}
		else
		{
			var1 = getID.Books_Bill_ID.getsuffix("Bill-");
			if(var1.isEmpty() || !var1.isNumber())
			{
				var2 = 1;
			}
			else
			{
				var2 = var1.tolong() + 1;
			}
			autoList = var2.toString().length();
			TarnsList = {1:"Bill-00",2:"Bill-0",3:"Bill-"};
			billdata.Books_Bill_ID=TarnsList.get(autoList) + var2;
			billnum = TarnsList.get(autoList) + var2;
		}
	}
	// Create Bill Process to Books
	iternal_inv = Internal_Invoice[ID == billdata.Bill_Id1];
	test = billdata.Partner_Details.Zoho_books_ID;
	var_par = Partner_Details[Partner_Entity_Name == billdata.Vendor_Name];
	vendordet = Partner_Onboarding_and_KYC[Partner_Entity_Name == billdata.Vendor_Name];
	book = vendordet.Zoho_Book_vendor_ID;
	info book;
	item_list = List();
	item_map = Map();
	item_map.put("rate",billdata.Total_Amount);
	item_map.put("account_id",2293182000000041035);
	item_map.put("bill_number",billnum);
	// // 	check the GST details from zoho books 
	vendorDetailsResponse = invokeurl
	[
		url :"https://www.zohoapis.in/books/v3/contacts/" + book + "?organization_id=60036667486"
		type :GET
		connection:"zoho_books_connection"
	];
	vendorDetails = vendorDetailsResponse.get("contact");
	gstTreatment = vendorDetails.get("gst_treatment");
	info "GST Treatment: " + gstTreatment;
	// 	   taxResponse = invokeurl
	// 	[
	// 	    url :"https://www.zohoapis.in/books/v3/settings/taxes?organization_id=60036667486"
	// 	    type :GET
	// 	    connection:"zoho_books_connection"
	// 	];
	// 	info taxResponse;
	if(gstTreatment != null)
	{
		item_map.put("gst_treatment_code","out_of_scope");
	}
	item_list.add(item_map);
	Head1 = Map();
	if(billdata.Contracting_organisation == "USDC")
	{
		Head1.put("branch_id",2293182000000188007);
	}
	if(billdata.Contracting_organisation == "Jain University")
	{
		Head1.put("branch_id",2293182000000188048);
	}
	Head1.put("reference_number",billdata.Bill_Id1.Internal_Invoice_ID);
	Head1.put("bill_number",billdata.Books_Bill_ID);
	Head1.put("notes",billdata.Order_Number);
	Head1.put("date_formatted",zoho.currentdate);
	Head1.put("is_draft",true);
	Head1.put("vendor_id",book);
	Head1.put("line_items",item_list);
	//Head1.put("tax_total",billdata.GST_Amount);
	Head1.put("total",billdata.Total_Amount);
	custom_field_list = List();
	customfields = Map();
	customfields.put("api_name","cf_internal_invoice_id");
	customfields.put("value",iternal_inv.ID);
	custom_field_list.add(customfields);
	Head1.put("custom_fields",custom_field_list);
	info customfields;
	var = invokeurl
	[
		url :"https://www.zohoapis.in/books/v3/bills?organization_id=60036667486"
		type :POST
		parameters:Head1.toString()
		connection:"zoho_books_connection"
	];
	info "Bill Creation API Status " + var;
	if(var.get("code") == 0 && var.get("bill") != null)
	{
		// 				/*create record in New Bill*/
		if(var.get("code") == 0 && var.get("bill") != null)
		{
			getBill = var.get("bill");
			addNewBills = insert into New_Bills
			[
				Bill_ID=getBill.get("bill_number")
				Bill_Date=getBill.get("date").toString("dd-mm-YYYY")
				Bill_Status=getBill.get("status")
				Total_Amount=getBill.get("total")
				Vendor_Name=getBill.get("vendor_name")
				Zoho_books_ID=getBill.get("bill_id")
				Internal_Invoice=billdata.Bill_Id1
				Added_User=zoho.loginuser
			];
		}
	}
	billcreateform = Create_Bill[Bills == input.ids];
	// 	invoicebackend = Create_Bill[CP_Internal_Invoice_Backend.inp]
	if(var.getJson("code") == 0)
	{
		for each  recs12 in billcreateform.CP_Internal_Invoice_Backend
		{
			recs12.Bill_Creation_Status="Yes";
		}
		iternal_inv.Invoice_Amount=ifnull(iternal_inv.Invoice_Amount,0) + ifnull(billdata.Total_Amount,0);
		billcreateform.Bill_Creation_Status="Yes";
		billdata.Bill_Creation_Status="Yes";
		bills = var.get("bill");
		bills_id = bills.getJSON("bill_id");
		total1 = bills.getJSON("total");
		iternal_inv.Books_Bill_ID=bills_id;
		// 		info bills_id;
		file = invokeurl
		[
			url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/All_Bills/" + billdata.ID + "/External_Invoice/download"
			type :GET
			connection:"zoho_oauth_connection"
		];
		file.setparamname("attachment");
		info "download files " + file;
		response = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/bills/" + bills_id + "/attachment?organization_id=60036667486"
			type :POST
			files:file
			connection:"zoho_books_connection1"
		];
		// 		info file;
		billdata.Zoho_Books_Id=bills_id;
		billdata.Total_Invoice_Amount_Incl_GST=total1;
		var_bill = var.get("bill").getJSON("reference_number");
		info "var_bill" + var_bill;
		// 		openUrl("#Report:Associated_Bill?Internal_Invoice_ID=" + var_bill,"same window");
		iternal_inv = Internal_Invoice[ID == billdata.Bill_Id1];
		iternal_inv.Balance_Amount=billdata.Balance_Amount;
		// iternal_inv.Total_Amount=input.Total_Amount;
		iternal_inv.Total_Amount=ifnull(iternal_inv.Total_Amount,0) + billdata.Total_Amount;
		iternal_inv.Balance_Amount=billdata.Accumulated_Commission_Amount - ifnull(iternal_inv.Total_Amount,0);
		iternal_inv.External_Invoice="";
		iternal_inv.Status="New";
		/*Sending mail to CP*/
		// 		sendmail
		// 		[
		// 			from :zoho.adminuserid
		// 			to :billdata.CP_Details1.Partner_Entity_Name,"vimal@techvaria.com"
		// 			subject :"CP Invoice Verification Successfull"
		// 			message :"CP invoice Verification Done and Submitted to Finance team"
		// 		]
		totalAmount = 0;
		item_list = List();
		hard_lst = {1,2};
		for each  split in hard_lst
		{
			if(split == 1)
			{
				get_creator_amount = billdata.Total_Amount;
				get_credit_debit = "debit";
				get_creator_Description = "Comments";
				item_map = Map();
				item_map.put("amount",get_creator_amount);
				item_map.put("debit_or_credit",get_credit_debit);
				item_map.put("account_id",2293182000000114065);
				// 				2293182000000114073
				item_map.put("customer_id",book);
			}
			if(split == 2)
			{
				get_creator_amount = billdata.Total_Amount;
				get_credit_debit = "credit";
				get_creator_Description = "Test";
				item_map = Map();
				item_map.put("amount",get_creator_amount);
				item_map.put("debit_or_credit",get_credit_debit);
				item_map.put("account_id",2293182000000114073);
				item_map.put("customer_id",book);
			}
			item_list.add(item_map);
		}
		mymap = Map();
		if(billdata.Contracting_organisation == "USDC")
		{
			mymap.put("branch_id",2293182000000188007);
		}
		if(billdata.Contracting_organisation == "Jain University")
		{
			mymap.put("branch_id",2293182000000188048);
		}
		mymap.put("journal_date",zoho.currentdate.toString("yyyy-MM-dd"));
		mymap.put("reference_number",billdata.Order_Number);
		mymap.put("notes","test");
		mymap.put("line_items",item_list);
		mymap.put("total",billdata.Total_Invoice_Amount_Incl_GST);
		//mymap.put("tax_total",billdata.GST_Amount);
		responseBooks = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/journals?organization_id=60036667486"
			type :POST
			parameters:mymap.toString()
			connection:"zoho_books_connection1"
		];
		getJournal = responseBooks.get("journal");
		Zoho_Books_ID = getJournal.get("journal_id");
		file = invokeurl
		[
			url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/All_Bills/" + billdata.ID + "/External_Invoice/download"
			type :GET
			connection:"zoho_oauth_connection"
		];
		file.setparamname("attachment");
		response = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/journals/" + Zoho_Books_ID + "/attachment?organization_id=60036667486"
			type :POST
			files:file
			connection:"zoho_books_connection1"
		];
	}
	else
	{
		for each  recs123 in billcreateform.CP_Internal_Invoice_Backend
		{
			recs123.Bill_Creation_Status="No";
			recs123.Bill_Creation_Error_Message=var;
		}
		billcreateform.Bill_Creation_Status="No";
		billcreateform.Bill_Creation_Error_Message=var;
		billdata.Bill_Creation_Status="No";
		billdata.Bill_Creation_Error_Message=var;
	}
}
<%{
	%>
<style>
.zc-pb-embed-placeholder-content
{
	font-size: 18px;
	margin-top: 15px !important;
	align: center;
}
.margin
{
	margin-top: 18px !important;
	margin-bottom: 18px !important;
}
.zcpopup.compact .popupbox-wraper .popupbox 
{
width: 60%!important;
max-height: 90%;
height: 80%!important;
overflow: auto;
background: #fff;
}
// a:hover{
// 	background:red;
// }
// button:hover {
// 	background-color:red;
// }
</style>
<%
	// 	ord = Order[Invoice == id.toLong()].Order;
	%>
<div class="zc-pb-embed-placeholder-content">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
	<div class="zc-pb-embed-placeholder-content">&nbsp;&nbsp;&nbsp;&nbsp<%=input.id1%> &nbsp;</div>
	<div style="clear:both" align = "center" class="margin">
	<span>
				<button style="background-color: #5C94C2;
			    border: none;
			    color: white;
			 	padding: 8px 24px;
			    text-align: center;
			    text-decoration: none;
			    display: inline-block;
			    font-size: 12px;
				font-color:#e7e7e7;
			    margin: 4px 2px;
			    cursor: pointer;
			    ">
				<a href="#Script:dialog.close","same window"><font size="4"color="white">Close</font></a></button></span>
		</div>
<%

}%>
void Integrations_to_books.ItemsToBooks_New(int itmid)
{
	fet_itm = Item_Master[ID == input.itmid];
	fetorg = Organization_Master[Organization_Code == fet_itm.Organization_Code.Organization_Code];
	orgid = fetorg.Organization_Code;
	fetapp = Approval[Item_ID.Item_Code == fet_itm.Item_Code];
	app = Approval[Organization_Name == fet_itm.Organization_Name && Item_ID.Item_Code == fet_itm.Item_Code];
	fet_itm.Status="Active";
	if(fet_itm.Item_Type == "Service")
	{
		mattype = "service";
	}
	else
	{
		mattype = "goods";
	}
	itmmap = Map();
	itmmap.put("name",fet_itm.Item_Name);
	itmmap.put("sku",fet_itm.Item_Code);
	itmmap.put("product_type",mattype);
	itmmap.put("unit",fet_itm.UOM);
	if(fet_itm.Selling_Price != null)
	{
		itmmap.put("rate",ifnull(fet_itm.Selling_Price,0.00));
		itmmap.put("description",fet_itm.Selling_Description);
		itmmap.put("account_name",fet_itm.Account.Accounts_Type);
		//itmmap.put("purchase_description",fet_itm.Specification);
	}
	if(fet_itm.Cost_Price != null)
	{
		itmmap.put("purchase_rate",ifnull(fet_itm.Cost_Price,0.00));
		itmmap.put("purchase_description",fet_itm.Purchase_Description);
		itmmap.put("account_name",fet_itm.Account.Accounts_Type);
		//itmmap.put("purchase_description",fet_itm.Specification);
	}
	if(fetapp.Do_You_want_to_create_Item_for_other_organization == "No")
	{
		response_books = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/items?organization_id=" + orgid
			type :POST
			parameters:itmmap.toString()
			connection:"books"
		];
		info response_books;
		for each  rec1 in app.Organization_Name
		{
			if(0 == response_books.get("code"))
			{
				contect_Data = response_books.get("item");
				zbid = contect_Data.get("item_id");
			}
			// 			ins = insert into Item_Master_Books_Details
			// 			[
			// 				Type_field="Item"
			// 				Added_User=zoho.loginuser
			// 				Organization_Name=rec1.ID
			// 				Item_Master_ID=fet_itm.ID
			// 				Organization_Code=rec1.ID
			// 				Item_Books_ID=zbid
			// 			];
		}
	}
	if(fetapp.Do_You_want_to_create_Item_for_other_organization == "Yes")
	{
		for each  rec in app.Organization_Name
		{
			org = rec.Organization_Code;
			resp = invokeurl
			[
				url :"https://www.zohoapis.in/books/v3/items?organization_id=" + org
				type :POST
				parameters:itmmap.toString()
				connection:"books"
			];
			info resp;
			if(0 == resp.get("code"))
			{
				contect_Data = resp.get("item");
				zbid = contect_Data.get("item_id");
			}
			// 			ins = insert into Item_Master_Books_Details
			// 			[
			// 				Type_field="Item"
			// 				Added_User=zoho.loginuser
			// 				Organization_Name=rec.ID
			// 				Item_Master_ID=fet_itm.ID
			// 				Organization_Code=rec.ID
			// 				Item_Books_ID=zbid
			// 			];
		}
	}
	//266977000000445214
}
void Integrations_to_books.CreditnotesTobooks(int id)
{
	sal = Sales_Order[ID == input.id];
	inv_det = Invoice[Sales_Order_ID == sal];
	// 	info "org "+sal.Organization;
	fetorg = Organization_Master[ID == sal.Organization];
	// 	info fetorg.Organization_Name;
	// 	if(inv_det.Books_Invoice_ID == null || inv_det.Books_Invoice_ID == "")
	// 	{
	// 		info "Error: Invoice ID is missing. Cannot proceed.";
	// 		return;
	// 	}
	// 	else
	// 	{
	// 		info "Invoice ID: " + inv_det.Books_Invoice_ID;
	// 		invid = inv_det.Books_Invoice_ID;
	// 	}
	fetbks = Account_Master_Books_Details[Account_Master_ID == sal.Customer_Name];
	// 	info fetbks.Organization_Code.Organization_Code;
	// 	info fetorg.Organization_Code;
	for each  rec1 in fetbks
	{
		if(rec1.Organization_Code.Organization_Code == fetorg.Organization_Code)
		{
			conbks = rec1.Books_ID;
			//info conbks;
		}
		//info itmbks;
		//	info rec1.Organization_Code.Organization_Code;
	}
	sodate = zoho.currentdate.toString("yyyy-MM-dd");
	main_data = Map();
	main_data.put("customer_id",conbks);
	main_data.put("reference_number",sal.Sales_Order);
	//main_data.put("reference_invoice_type","b2c_others");
	// 	b2c_large
	// 	main_data.put("is_invoice_type_standalone",true);
	// 	main_data.put("creditnote_number",sal.Sales_Order);
	main_data.put("date",sodate);
	// 	invoice_list = List();
	// 	invoice_map = Map();
	// 	invoice_map.put("invoice_id","");
	// 	invoice_map.put("invoice_number","");
	// 	invoice_list.add(invoice_map);
	// 	main_data.put("invoices",invoice_list);
	// 	info invoice_map;
	//  Line Items
	Line_list = List();
	for each  line_data in sal.Order_Details
	{
		item_data = Item_Master[ID == line_data.Item_Name];
		itm = Item_Master_Books_Details[Item_Master_ID == item_data.ID];
		for each  rec in itm
		{
			if(rec.Organization_Code.Organization_Code == fetorg.Organization_Code)
			{
				itmbks = rec.Item_Books_ID;
			}
			//	info itmbks;
			//info rec.Organization_Code.Organization_Code;
		}
		//	info fetorg.Organization_Code;
		line_map = Map();
		// 		Align the line Details
		line_map.put("item_id",itmbks);
		break;
	}
	line_map.put("quantity",1);
	// 		line_map.put("description","test");
	line_map.put("rate",sal.Grand_Total);
	Line_list.add(line_map);
	main_data.put("line_items",Line_list);
	info main_data;
	response_books = invokeurl
	[
		url :"https://www.zohoapis.in/books/v3/creditnotes?organization_id=" + fetorg.Organization_Code
		type :POST
		parameters:main_data.toString()
		connection:"books"
	];
	info response_books;
	if(response_books.get("code") == 0)
	{
		sal.SO_Status="SO Cancelled";
		invoice_data = response_books.get("creditnote");
		sal.CreditNote_Books_ID=invoice_data.get("creditnote_id");
		sal.Creditnote_No=invoice_data.get("creditnote_number");
		sal.Credit_Note_Status="Credit Note Integrated";
		for each  rec_items in sal.Order_Details
		{
			if(rec_items.Service_Details == "Item")
			{
				// 				num = randomnumber(1,9999);
				count3 = Transit_Inventory[ID != null];
				num = count3.count() + 1;
				info "if ";
				data_add = insert into Transit_Inventory
				[
					Added_User=zoho.loginuser
					Item_Name=rec_items.Item_Name
					Quantity=rec_items.Qty
					Date_field=zoho.currentdate
					Rate=sal.Grand_Total
					Deal_ID=sal.Deal_ID
					Transit_Inventory_Number=num
				];
				info data_add;
				sendmail
				[
					from :zoho.adminuserid
					to :"vimal@techvaria.com"
					subject :"item transit"
					message :"transit id " + data_add
				]
			}
		}
	}
	else
	{
		info "Error in API Response: " + response_books;
	}
}
void Integrations_to_books.CancelInvoiceinBooks(int soid)
{
	fetch_inv = Invoice[ID == input.soid];
	fetorg = Organization_Master[ID == fetch_inv.Organization];
	//fetch_so.SO_Status="SO Cancelled";
	mymap = Map();
	stts = "void";
	mymap.put("status",stts);
	books_id = fetch_inv.Books_Invoice_ID;
	test_map = Map();
	header_data = Map();
	header_data.put("content-type","application/json");
	void_so = invokeurl
	[
		url :"https://www.zohoapis.in/books/v3/invoices/" + books_id + "/status/void?organization_id=" + fetorg.Organization_Code
		type :POST
		parameters:test_map
		headers:header_data
		connection:"books"
	];
	thisapp.Integrations_to_books.CancelSOBooks(fetch_inv.Sales_Order_ID);
	// 	info void_so;
}
void Integrations_to_books.AccountsToBooks_New(int accid)
{
	account_data = Account_Master[ID == input.accid];
	fetorg = Organization_Master[Organization_Code == account_data.Organization_Name.Organization_Code];
	orgid = fetorg.Organization_Code;
	fetapp = Approval[Account_ID.Account_ID == account_data.Account_ID];
	//main map
	custom_map = Map();
	custom_map.put("address",account_data.Address.address_line_1);
	custom_map.put("street2",account_data.Address.address_line_2);
	custom_map.put("city",account_data.Address.district_city);
	custom_map.put("state",account_data.Address.state_province);
	custom_map.put("country",account_data.Address.country);
	custom_map.put("zip",account_data.Address.postal_Code);
	//main mapping	
	main_map = Map();
	main_map.put("phone",account_data.Account_Number);
	main_map.put("contact_name",account_data.Account_Name);
	main_map.put("company_name",account_data.Account_Name);
	main_map.put("billing_address",custom_map);
	main_map.put("shipping_address",custom_map);
	main_map.put("email",account_data.Account_Mail);
	main_map.put("contact_type","customer");
	cont_list = List();
	primary_cont_pers = Map();
	primary_cont_pers.put("first_name",account_data.Account_Name);
	primary_cont_pers.put("phone",account_data.Account_Number);
	// 	primary_cont_pers.put("email",account_data.Account_Mail);
	cont_list.add(primary_cont_pers);
	//secndary Contact persons updated.
	if(account_data.Contact_Person_Details != null)
	{
		for each  contacts_val in account_data.Contact_Person_Details
		{
			cont_pers = Map();
			cont_pers.put("first_name",contacts_val.Contact_Person);
			cont_pers.put("phone",contacts_val.Phone_Number);
			// 			cont_pers.put("email",contacts_val.Email);
			cont_pers.put("designation",contacts_val.Designation);
			cont_pers.put("department",contacts_val.Department.Department);
			cont_list.add(cont_pers);
		}
	}
	main_map.put("contact_persons",cont_list);
	app = Approval[Organization_Name == fetapp.Organization_Name && Account_ID == fetapp.Account_ID];
	if(fetapp.Do_you_want_to_create_Customer_Vendor_for_other_organization == "Yes")
	{
		for each  rec in app.Organization_Name
		{
			org = rec.Organization_Code;
			info org;
			info rec.Organization_Name;
			resp = zoho.books.createRecord("contacts",org,main_map,"books");
			info "else books response " + resp;
			res_code = resp.get("code").toLong();
			if(res_code == 0)
			{
				for each  vart1 in account_data.Account_Master_Books_Details
				{
					if(vart1.Organization_Name == rec && vart1.Type_field == "Customer")
					{
						books_id = resp.toMap().get("contact").toMap().get("contact_id");
						vart1.Books_ID=books_id;
						info books_id;
					}
				}
				contact_person_list = List();
				contact_person_list = resp.toMap().get("contact").toMap().get("contact_persons").toList();
				for each  contacts_1 in contact_person_list
				{
					contact_rec = contacts_1.toMap();
					contact_person_id = contact_rec.get("contact_person_id");
					for each  cont in account_data.Contact_Person_Details
					{
						cont.Contact_Person_Booksid=contact_person_id;
						updateContactPersonID = Contact_Person_Details[Account_Master_ID == input.accid];
						if(updateContactPersonID.count() > 0)
						{
							updateContactPersonID.Contact_Person_Booksid=contact_person_id;
						}
					}
				}
			}
			if(0 == resp.get("code"))
			{
				contect_Data = resp.get("contact");
				zbid = contect_Data.get("contact_id");
				ins = insert into Account_Master_Books_Details
				[
					Type_field="Customer"
					Added_User=zoho.loginuser
					Organization_Name=rec.ID
					Account_Master_ID=account_data.ID
					Organization_Code=rec.ID
					Books_ID=zbid
				];
			}
		}
	}
	else
	{
		resp = zoho.books.createRecord("contacts",orgid,main_map,"books");
		info "Create Books " + resp;
		res_code = resp.get("code").toLong();
		if(res_code == 0)
		{
			for each  rec1 in app.Organization_Name
			{
				contect_Data = resp.get("contact");
				zbid = contect_Data.get("contact_id");
				ins = insert into Account_Master_Books_Details
				[
					Type_field="Customer"
					Added_User=zoho.loginuser
					Organization_Name=rec1.ID
					Account_Master_ID=account_data.ID
					Organization_Code=rec1.ID
					Books_ID=zbid
				];
			}
			for each  vart in account_data.Account_Master_Books_Details
			{
				if(app.Organization_Name.contains(vart.Organization_Name) == true && vart.Type_field == "Customer")
				{
					books_id = resp.toMap().get("contact").toMap().get("contact_id");
					vart.Books_ID=books_id;
					info books_id;
				}
			}
			contact_person_list = List();
			contact_person_list = resp.toMap().get("contact").toMap().get("contact_persons").toList();
			for each  contacts_1 in contact_person_list
			{
				contact_rec = contacts_1.toMap();
				contact_person_id = contact_rec.get("contact_person_id");
				for each  cont in account_data.Contact_Person_Details
				{
					cont.Contact_Person_Booksid=contact_person_id;
					updateContactPersonID = Contact_Person_Details[Account_Master_ID == input.accid];
					if(updateContactPersonID.count() > 0)
					{
						updateContactPersonID.Contact_Person_Booksid=contact_person_id;
					}
				}
			}
		}
	}
}
<%{
	deal_id = input.Dealid;
	rec_id = input.scenario_id;
	Field_list = list();
	itmrfq = ITEM_RFQ[Deal_ID.Deal_ID1 == deal_id];
	for each  line_data in rec_id.toList(",")
	{
		Field_list.add(line_data);
	}
	// 	// 	Completed********************************************
	%>
<!DOCTYPE html>
			<html lang="en">
			<head>
			    <meta charset="UTF-8">
			    <meta name="viewport" content="width=device-width, initial-scale=1.0">
			    <title>Quotation Comparison</title>
			    <style>
			        /* Basic Styles */
			        body {
			            font-family: Arial, sans-serif;
			            margin: 0;
			            padding: 0;
			            background-color: #f4f4f4;
			            display: flex;
			//             flex-direction: column;
			//             align-items: center;
			            justify-content: flex-start;
			        }
			        header {
			            background-color: #004b87;
			            color: white;
			            padding: 15px;
			            text-align: center;
			            width: 100%;
			        }
			        header h1 {
			            margin: 0;
			            font-size: 28px;
			        }
			        .scenario-selection {
			            padding: 15px;
			            text-align: center;
			        }
			        .comparison-dashboard {
			            display: flex;
			            justify-content: space-around;
			            margin-top: 20px;
			            padding: 10px;
			        }
			        .scenario {
			            background-color: #fff;
			            padding: 20px;
			            border-radius: 8px;
			            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
			            width: 30%;
			        }
			        h3 {
			            text-align: center;
			        }
			        .key-data table {
			            width: 100%;
			            margin-top: 15px;
			            border-collapse: collapse;
			        }
			        .key-data th, .key-data td {
			            padding: 8px;
			            border: 1px solid #ddd;
			            text-align: left;
			        }
			        .actions {
			            text-align: center;
			            margin-top: 20px;
			        }
			        .actions button {
			            padding: 10px 20px;
			            font-size: 16px;
			            margin: 10px;
			            background-color: #004b87;
			            color: white;
			            border: none;
			            border-radius: 5px;
			            cursor: pointer;
			        }
			        .actions button:hover {
			            background-color: #003366;
			        }
			        /* Modal Styles */
			        .modal {
			            display: none;
			            position: fixed;
			            z-index: 1;
			            left: 0;
			            top: 0;
			            width: 100%;
			            height: 100%;
			            background-color: rgba(0, 0, 0, 0.5);
			        }
			        .modal-content {
			            background-color: white;
			            margin: 15% auto;
			            padding: 20px;
			            border-radius: 8px;
			            width: 40%;
			        }
			        .close {
			            color: #aaa;
			            font-size: 28px;
			            font-weight: bold;
			            cursor: pointer;
			            position: absolute;
			            right: 10px;
			            top: 5px;
			        }
			        .close:hover,
			        .close:focus {
			            color: black;
			            text-decoration: none;
			            cursor: pointer;
			        }
					.tr
   {
   border :1px solid black;
   border-collapse : collapse;
   font-size : 10.5px;
   height : 2px;
   }
   .td
   {
   border :1px solid black;
   border-collapse : collapse;
   font-size : 12px;
   height : 2px;
   }
   
   .th
   {
   border :1px solid black;
   border-collapse : collapse;
   font-size : 10.5px;
   height : 2px;
   background-color : lightsteelblue;
   }
			    </style>
			</head>

			    <div class="comparison-dashboard">
<%
	// 	***************************************
	for each  line_data in rec_id.toList(",")
	{
		fetch_scenario_Data = Scenario[ID == line_data];
		deal = fetch_scenario_Data.Deal;
		fet = Deal[ID == deal];
		if(fetch_scenario_Data.count() > 0)
		{
			data_map = Map();
			for each  line_Data in fetch_scenario_Data.Services
			{
				logistic_price = line_Data.Logistic_Price;
				if(logistic_price != null)
				{
					data_map.put("logistic_price",line_Data.Logistic_Price);
				}
				Supplier_Price = line_Data.Supplier_Price;
				if(Supplier_Price != null)
				{
					data_map.put("Supplier_Price",line_Data.Supplier_Price);
				}
				Target_Price = line_Data.Target_Price;
				if(Target_Price != null)
				{
					data_map.put("Target_Price",line_Data.Target_Price);
				}
				qty = line_Data.Qt_Quintal;
				if(qty != null)
				{
					data_map.put("qty",line_Data.Qt_Quintal);
				}
				Lab_Chargers = line_Data.Lab_Chargers;
				if(Lab_Chargers != null)
				{
					data_map.put("Lab_Chargers",line_Data.Lab_Chargers);
				}
				Branding_Quality_Charges = fetch_scenario_Data.Quality_Price;
				if(Branding_Quality_Charges != null)
				{
					data_map.put("Branding_Quality_Charges",fetch_scenario_Data.Quality_Price);
				}
				Selling_Price = fetch_scenario_Data.Selling_Price;
				if(Selling_Price != null)
				{
					data_map.put("Selling_Price",fetch_scenario_Data.Selling_Price);
				}
				Total_Cost = fetch_scenario_Data.Total_Cost1;
				if(Total_Cost != null)
				{
					data_map.put("Total_Cost",fetch_scenario_Data.Total_Cost1);
				}
				mois_percentage = fet.MOIS;
				if(mois_percentage != null)
				{
					data_map.put("mois_percentage",itmrfq.MOIS_Vendor);
				}
				length = fet.Length_field;
				if(length != null)
				{
					data_map.put("length",itmrfq.Length_Vendor);
				}
				trash = fet.Trash;
				if(length != null)
				{
					data_map.put("trash",itmrfq.Trash_Vendor);
				}
				rd = fet.RD;
				if(rd != null)
				{
					data_map.put("rd",itmrfq.RD_Vendor);
				}
				mic = fet.MIC;
				if(mic != null)
				{
					data_map.put("mic",itmrfq.MIC_Vendor);
				}
				brokerage_per_bale = fetch_scenario_Data.Brokerage1.Brokerage_Value;
				if(brokerage_per_bale != null)
				{
					data_map.put("brokerage_per_bale",fetch_scenario_Data.Brokerage1.Brokerage_Value);
				}
			}
			data_map.put("Item_name",line_Data.Item_Name.Item_Name);
		}
		// 		Fetch Data Goes Here 
		// 		***********************************
		%>
<div class="scenario" id="scenarioB">
			            <h3><%=fetch_scenario_Data.Scenario_ID%></h3>
			            <div class="key-data">
			                <table>
						<!--	<tr><th>Item</th><td><%=ifnull(data_map.get("Item_name"),"Name Empty")%></td></tr>-->
						<!--	<tr><th>Quantity</th><td><%=ifnull(data_map.get("qty"),0)%></td></tr>-->
			                 <!--   <tr><th>Target Price</th><td><%=ifnull(data_map.get("Target_Price"),0)%></td></tr>-->
			                    <tr><th>Purchase price </th><td><%=ifnull(data_map.get("Supplier_Price"),0)%></td></tr>
			                    <tr><th> Freight </th><td><%=ifnull(data_map.get("logistic_price"),0)%></td></tr>
			                    <tr><th>3rd Party Services</th><td><%=ifnull(data_map.get("Lab_Chargers"),0)%></td></tr>
								<tr><th>Branding / Quality Charges</th><td><%=ifnull(data_map.get("Branding_Quality_Charges"),0)%></td></tr>
								 <tr><th>Selling Price </th><td><%=ifnull(data_map.get("Selling_Price"),0)%></td></tr>
								  <tr><th>Total Cost</th><td><%=ifnull(data_map.get("Total_Cost"),0)%></td></tr>
								 <tr><th>Brokerage </th><td><%=ifnull(data_map.get("brokerage_per_bale"),0)%></td></tr>
								 <!-- <tr><th>No. of Bales</th><td><%=ifnull(data_map.get("num_bales"),0)%></td></tr>-->
			    				<tr><th>MOIS %</th><td><%=ifnull(data_map.get("mois_percentage"),0)%></td></tr>
			    				<tr><th>Length</th><td><%=ifnull(data_map.get("length"),"Not Provided")%></td></tr>
			    				<tr><th>Trash</th><td><%=ifnull(data_map.get("trash"),0)%></td></tr>
			   				    <tr><th>RD</th><td><%=ifnull(data_map.get("rd"),"Not Provided")%></td></tr>
			                    <tr><th>MIC</th><td><%=ifnull(data_map.get("mic"),"Not Provided")%></td></tr>
			                 <!--   <tr><th>Total Cost</th><td><%=ifnull(fetch_scenario_Data.Total_Cost1,0)%></td></tr>-->
			                    <tr><th>Delivery Time</th><td>12 days</td></tr>
			                </table>
			            </div>
			        </div>
<%
	}
	// 	***************************************
	fetch_scenario_Data = Scenario[ID == line_data];
	deal = fetch_scenario_Data.Deal;
	fet = Deal[ID == deal];
	if(fetch_scenario_Data.count() > 0)
	{
		data_map1 = Map();
		for each  line_Data in fetch_scenario_Data.Services
		{
			mois_percentage = fet.MOIS;
			if(mois_percentage != null)
			{
				data_map1.put("mois_percentage",itmrfq.MOIS_Vendor);
			}
			length = fet.Length_field;
			if(length != null)
			{
				data_map1.put("length",itmrfq.Length_Vendor);
			}
			trash = fet.Trash;
			if(length != null)
			{
				data_map1.put("trash",itmrfq.Trash_Vendor);
			}
			rd = fet.RD;
			if(rd != null)
			{
				data_map1.put("rd",itmrfq.RD_Vendor);
			}
			mic = fet.MIC;
			if(mic != null)
			{
				data_map1.put("mic",itmrfq.MIC_Vendor);
			}
			brokerage_per_bale = fetch_scenario_Data.Brokerage_Value12;
			if(brokerage_per_bale != null)
			{
				data_map1.put("brokerage_per_bale",fetch_scenario_Data.Brokerage_Value12);
			}
		}
		data_map1.put("Item_name",line_Data.Item_Name.Item_Name);
		// 		Fetch Data Goes Here 
		// 		***********************************
		%>
<div class="scenario" id="scenarioB">
			            <h3>Requested</h3>
			            <div class="key-data">
			                <table>
						<!--	<tr><th>Item</th><td><%=ifnull(data_map1.get("Item_name"),"Name Empty")%></td></tr>-->
						<!--	<tr><th>Quantity</th><td><%=ifnull(data_map1.get("qty"),0)%></td></tr>-->
			                 <!--   <tr><th>Target Price</th><td><%=ifnull(data_map1.get("Target_Price"),0)%></td></tr>-->
			                    <tr><th>Item</th><td><%=ifnull(data_map1.get("Item_name"),"Name Empty")%></td></tr>
			    				<tr><th>MOIS %</th><td><%=ifnull(data_map1.get("mois_percentage"),0)%></td></tr>
			    				<tr><th>Length</th><td><%=ifnull(data_map1.get("length"),"Not Provided")%></td></tr>
			    				<tr><th>Trash</th><td><%=ifnull(data_map1.get("trash"),0)%></td></tr>
			   				    <tr><th>RD</th><td><%=ifnull(data_map1.get("rd"),"Not Provided")%></td></tr>
			                    <tr><th>MIC</th><td><%=ifnull(data_map1.get("mic"),"Not Provided")%></td></tr>
			                 <!--   <tr><th>Total Cost</th><td><%=ifnull(fetch_scenario_Data.Total_Cost1,0)%></td></tr>-->
			                    <tr><th>Delivery Time</th><td>12 days</td></tr>
			                </table>
			            </div>
			        </div>
<%
	}
	%>
</tr>
<!-- Scenario 1 -->
			        <!-- Scenario 2 -->
			        <!-- Scenario 3 -->
			    </div>
			    <!-- Actions -->
			   <!-- <div class="actions"> -->
			     <!--   <button onclick="selectScenario()">Select Scenario</button-->
			      <!--  <button onclick="editScenario()">Edit Scenario</button-->
			   <!--     <button onclick="saveComparison()">Save Comparison</button-->
			     <!--   <button onclick="finalizeDeal()">Generate Final Deal</button-->
			    </div>
			    <!-- Scenario Creation Modal (Hidden) -->
<%

}%>
void defaultFunction(Scenario recID)
{
	recid_list = List();
	result = 0;
	poid = list();
	povendlist = list();
	for each  recval in recID
	{
		poid.add(recval);
		//info recval.Deal.Deal_ID1;
		povendlist.add(recval.Deal);
		//info povendlist;
	}
	for each  linerec in recID
	{
		recid_list.add(linerec.ID);
		line_list = List();
		senari_Data = Scenario[ID == linerec.ID];
		//	senari_Data.Scenario_ID=recid_list;
		for each  line_Data in senari_Data.Services
		{
			line_list.add(line_Data);
		}
		if(line_list.size() > 0)
		{
		}
		else
		{
			result = 1;
		}
	}
	if(result == 0 && povendlist.distinct().size() == 1)
	{
		openUrl("#Page:Quotation_Comparison_page?Deal_bg_id=" + senari_Data.Deal.ID + "&Deal_name=" + senari_Data.Deal_Name + "&Dealid=" + senari_Data.Deal.Deal_ID1 + "&scenario_id=" + recid_list + "&Select_Scenario=" + recid_list,"same window");
	}
	else if(result == 1)
	{
		info "Please review the record line items";
	}
	else
	{
		info "Select the same Deal ID.";
		//openUrl("#Page:Alert?id1=Select the same Deal ID.&zc_LoadIn=dialog","same window");
	}
}
<%{
	item_id = input.Item_ID;
	input.main_sc_id = input.main_sc_id;
	item_fetch = Scenario[ID == input.main_sc_id];
	dealid = input.Deal_ID;
	itmrfq = Scenario_Logistic_Quotation[Deal_ID1.Deal_ID1 == dealid];
	itmrfq1 = Scenario_Item_Quotations[Deal_ID1.Deal_ID1 == dealid];
	dealname = input.Deal_name;
	%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reports and Form Page</title>
    <style>
        /* Header Styles */
        header {
            background-color: #004b87;
            color: white;
            padding: 15px;
            text-align: center;
            position: relative; /* Allows positioning of button inside the header */
        }

        header h1 {
            margin: 0;
            font-size: 28px;
        }

        header p {
            margin: 5px 0 0;
            font-size: 16px;
        }

        /* Update Margin Button */
        .update {
            position: absolute;
            top: 10px; /* Distance from top */
            right: 20px; /* Distance from the right */
            z-index: 10; /* Ensure it appears above other content */
        }

        .update .create-btn {
            display: inline-block;
            background-color: #28a745; /* Green background */
            color: white;
            padding: 10px 20px;
            font-size: 16px;
            font-weight: bold;
            border: none;
            border-radius: 5px;
            text-decoration: none; /* Remove underline */
            transition: background-color 0.3s, transform 0.2s; /* Smooth transitions */
            cursor: pointer;
        }

        .update .create-btn:hover {
            background-color: #218838; /* Darker green on hover */
            transform: scale(1.05); /* Slightly enlarge on hover */
        }

        .update .create-btn.clicked {
            background-color: #1e7e34; /* Dark green when clicked */
            transform: scale(0.98); /* Slightly decrease size when clicked */
        }

        /* Full height for body and html to avoid scrolling */
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            width: 100%;
            background-color: #f4f7fc;
        }

        /* Main container fills entire viewport */
        .report-container {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: stretch;
            width: 100%;
            height: 50%;
            box-sizing: border-box;
        }

        /* Row for Reports */
        .report-row {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            height: 20%;
            overflow: hidden;
        }

        /* Report Box styling */
        .report-box {
            flex: 1;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            background-color: #f9f9f9;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 10%;
            box-sizing: border-box;
        }

        .report-box h3 {
            text-align: center;
            font-size: 16px;
            color: #333;
            margin-bottom: 8px;
        }

        .report-box .loading-text {
            text-align: center;
            font-size: 14px;
            color: #888;
        }

        /* Form Box Styling */
        .form-box {
            flex: 1;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            background-color: #f9f9f9;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            height: 20%;
            margin-top: 10px;
            box-sizing: border-box;
        }

        .form-box h3 {
            text-align: center;
            font-size: 16px;
            color: #333;
            margin-bottom: 8px;
        }

        .form-box .loading-text {
            text-align: center;
            font-size: 14px;
            color: #888;
        }
		
		.view-outer-wrapper {
    overflow-x: visible;
    g: 0;
    background-color: #fff;
}
 
.zc-pb-embedlive-container iframe {
    display: inline-block;
    vertical-align: top;
    height: 480px;
}
		

        /* Responsive Styles for Smaller Screens */
        @media (max-width: 768px) {
            .report-container {
                padding: 5px;
            }

            .report-row {
                flex-direction: column;
                height: auto;
            }

            .report-box {
                margin-bottom: 10px;
                min-height: 20px;
            }

            .form-box {
                width: 90%;
                height: auto;
                margin-top: 15px;
            }
			.popup {
				width: 300px;
				height: 150px;
				background-color: lightblue;
				position: relative;
				animation: fadeOut 5s forwards; /* Animation lasts 5 seconds */
			}
        }
    </style>
</head>
<body>

    <!-- Header Section -->
    <header>
        <h1>Scenario Selection</h1>
        <p>Deal ID: <span id="dealId"><%=dealid%></span></p>
		  <!-- Button to Open Popup -->
    <a href="#Form:Margin_Details?zc_LoadIn=dialog" 
       style="display: inline-block; 
              padding: 10px 20px; 
              background-color: #007bff; 
              color: white; 
              text-decoration: none; 
              border-radius: 5px; 
              text-align: center; 
              position: absolute; 
              top: 10px; 
              right: 20px; 
              font-size: 14px; 
              transition: background-color 0.3s, transform 0.2s;" 
       class="update-btn">
        Update Quality Price
    </a>
		


    <div class="report-container">
        <!-- Row for Reports -->
        <div class="report-row">
            <div class="report-box">
                <div  elName="zc-component" viewLinkName="Scenario_Item_Quotations1" params="zc_Header=true&zc_Footer=false&zc_SecHeader=false&Scenario_ID=<%=item_fetch.Scenario_ID%>&Deal_ID1=<%=dealid%>&zc_DuplRec=false&zc_EditRec=false&zc_DelRec=false&zc_ColMenu=false" style="height:300px;overflow:hidden;">
    <p class="loading-text">Loading View...</p>
</div>

            </div>
            <div class="report-box">
<%
	if(item_fetch.Scenario_ID != null && itmrfq1.Scenario_Status = "Scenario Selected")
	{
		%>
<div elName="zc-component" viewLinkName="Scenario_Logistic_Quotations" params="zc_Header=true&zc_Footer=false&zc_SecHeader=false&Scenario_ID=<%=item_fetch.Scenario_ID%>&ITEM_RFQ_ID=<%=itmrfq.ITEM_RFQ_ID%>&zc_DuplRec=false&zc_EditRec=false&zc_DelRec=false&zc_ColMenu=false"  style="height:300px;>
                    <p class="loading-text">Loading View...</p>
<%
	}
	%>
</div>
            </div>

            <div class="report-box">
                <div elName="zc-component" viewLinkName="Scenario_Lab_Quotations" params="zc_Header=true&zc_Footer=false&zc_SecHeader=false&Scenario_ID=<%=item_fetch.Scenario_ID%>&Deal_ID1=<%=dealid%>&zc_DuplRec=false&zc_EditRec=false&zc_DelRec=false&zc_ColMenu=false&zc_EditBulkRec=false" style="height:300px;>
                    <p class="loading-text">Loading View...</p>
                </div>
            </div>
        </div>

        <div class="form-box">
         <!--   <h3>Scenario Form</h3>-->
         <iframe src="https://creatorapp.zoho.in/dev07uat21/organic/Scenario/record-edit/Scenario_S/<%=input.main_sc_id%>?zc_Header=false&zc_Footer=false&zc_BtnBgClr=%23ADD8E6&zc_BtnMovrBgClr=%23008000" width="100%"  ></iframe>



        </div>
    </div>

</body>
</html>
<%

}%>
void defaultFunction.cp(Transactions trans)
{
	Transaction = Transactions[ID in trans];
	idsString = "[";
	for each  test in Transaction
	{
		if(idsString != "[")
		{
			idsString = idsString + ",";
		}
		idsString = idsString + test.ID.toString();
	}
	idsString = idsString + "]";
	getpartneremail = Partner_Onboarding_and_KYC[Partner_Entity_Name == trans.Partner_Entity_Name];
	// 	info getpartneremail.Partner_Representative_Email;
	// 	getpartneremail.Partner_Representative_Email
	getCP = Partner_Details[Partner_Entity_Name == trans.Partner_Entity_Name];
	// 	if(getCP.count() > 0)
	// 	{
	info "inside if";
	content = "<a href='https://creatorapp.zohopublic.in/centralisedprocurement_usdcglobal/usdc1/page-perma/Transaction_Pending_Approval_CP/kTwYJJK70T2DkWhuvCKmWgffFUU6yYwCnRsQSJv1rakuH7yeyOYRMrFhkq4pg9ECbgaMjfEHCGatEPypBy7BtO2JzbD9eOaWkr5y?ID=" + idsString + "'>Click here to View</a>";
	sendmail
	[
		from :zoho.adminuserid
		to :getpartneremail.Partner_Representative_Email
		cc:"indhu@techvaria.com","vimal@techvaria.com","pooja.s@techvaria.com"
		subject :"Action Required - New commission calculation initiated by " + trans.Contracting_organisation.Contracting_organisation + " for confirmation"
		message :"New commission calculation is initiated with " + trans.Contracting_organisation.Contracting_organisation + ".<br>" + content + "<br>" + "To view records and confirm the commission calculation."
	]
	// 	}
}
void Transactions.Calculate_Commission(int ids)
{
	transactiondet = Transactions[ID == input.ids];
	if(transactiondet.Validation_Check_Status == "Valid")
	{
		ratecard = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name];
		if(ratecard.count() == 0)
		{
			transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
			//transactiondet.Commission_Comments="Partner Entity Name is not matching with the rate card.";
		}
		else
		{
			ratecard1 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name && University_Name.University_Name == transactiondet.University_Name];
			if(ratecard1.count() == 0)
			{
				transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
				//transactiondet.Commission_Comments="University name is not matching with the rate card.";
			}
			else
			{
				ratecard2 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name && University_Name.University_Name == transactiondet.University_Name && Programs.Programs == transactiondet.Program];
				if(ratecard2.count() == 0)
				{
					transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
					//transactiondet.Commission_Comments="Program is not matching with the rate card.";
				}
				else
				{
					ratecard3 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name && University_Name.University_Name == transactiondet.University_Name && Programs.Programs == transactiondet.Program && Elective.Elective == transactiondet.Elective];
					if(ratecard3.count() == 0)
					{
						transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
						//transactiondet.Commission_Comments="Elective is not matching with the rate card.";
					}
					else
					{
						ratecard4 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name && University_Name.University_Name == transactiondet.University_Name && Programs.Programs == transactiondet.Program && Elective.Elective == transactiondet.Elective && CP_Approval_Status == "Approved"];
						if(ratecard4.count() == 0)
						{
							transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
							//transactiondet.Commission_Comments="Rate Card is not yet approved.";
						}
						else
						{
							// 							ratecard5 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name && University_Name.University_Name == transactiondet.University_Name && Programs.Programs == transactiondet.Program && Elective.Elective == transactiondet.Elective && CP_Approval_Status == "Approved" && Documentation_Status == transactiondet.Documentation_Status1];
							// 							if(ratecard5.count() == 0)
							// 							{
							// 								transactiondet.Commission_Comments="Documentation status is not matching with the rate card."; && Documentation_Status == transactiondet.Documentation_Status1
							// 							}
							// 							else
							// 							{
							ratecard_det = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == transactiondet.Partner_Entity_Name && University_Name.University_Name == transactiondet.University_Name && Programs.Programs == transactiondet.Program && Elective.Elective == transactiondet.Elective && CP_Approval_Status == "Approved"];
							// 	info ratecard_det.count();&&Documentation_Status == transactionde
							if(ratecard_det.count() == 0)
							{
								transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
								//transactiondet.Commission_Comments="No valid rate card details is available for this transaction.";
							}
							else
							{
								for each  recs in ratecard_det
								{
									if(transactiondet.Enrollment_Date >= recs.Effective_start_date && transactiondet.Enrollment_Date <= recs.Effective_end_date)
									{
										t1 = ifnull(transactiondet.Registration_fee,0) + ifnull(transactiondet.Exam_fee,0) + ifnull(transactiondet.Loan_subvention_charges,0);
										transactiondet.Eligible_fee=ifnull(transactiondet.Total_Fee,0) - t1;
										payout_percentage = recs.Payout;
										transactiondet.Accumulated_Commission_Amount=payout_percentage / 100 * transactiondet.Eligible_fee;
										transactiondet.Commission_Comments="Commission calculated successfully.";
										//	transactiondet.Commission_Comments="Commission Amount has been calculated.";
									}
									else
									{
										transactiondet.Commission_Comments="Invalid record, commission cannot be calculated.";
										//transactiondet.Commission_Comments="Effective start date and end date is not matched with the enrolment date.";
										// 			info "else";
									}
								}
							}
						}
					}
				}
			}
		}
	}
	// 	}
	else
	{
		transactiondet.Commission_Comments="This transaction is not valid and commission amount cannot be calculated.";
	}
}
void Transactions.get_Transaction_Validations(int getdata)
{
	getTransInfo = Transactions[ID == input.getdata];
	idsString = "";
	count = getTransInfo.count();
	startIndex = 0;
	// 	
	for each  test in getTransInfo
	{
		// Assign Transaction ID based on the index
		// 		if(startIndex < 1000)
		// 		{
		// 			test.Transaction="TNID-001";
		// 		}
		// 		else if(startIndex < 2000)
		// 		{
		// 			test.Transaction="TNID-002";
		// 		}
		// 		else if(startIndex < 3000)
		// 		{
		// 			test.Transaction="TNID-003";
		// 		}
		// 		else if(startIndex < 4000)
		// 		{
		// 			test.Transaction="TNID-004";
		// 		}
		// 		else if(startIndex < 5000)
		// 		{
		// 			test.Transaction="TNID-005";
		// 		}
		// 		info "Record ID: " + test.ID.toString() + " | Start Index: " + startIndex + " | Transaction: " + test.Transaction;
		startIndex = startIndex + 1;
		// Maintain ID String
		if(idsString != "")
		{
			idsString = idsString + ",";
		}
		idsString = idsString + test.ID.toString();
		// Generate Application Number
		// 		getID = Transactions[ID != null] sort by Application_No1 desc;
		// 		if(getID.count() == 0)
		// 		{
		// 			test.Application_No1="APP-001";
		// 		}
		// 		else
		// 		{
		// 			var1 = getID.Application_No1.getsuffix("APP-");
		// 			if(var1.isEmpty() || !var1.isNumber())
		// 			{
		// 				var2 = 1;
		// 			}
		// 			else
		// 			{
		// 				var2 = var1.toLong() + 1;
		// 			}
		// 			autoList = var2.toString().length();
		// 			TarnsList = {1:"APP-00",2:"APP-0",3:"APP-"};
		// 			test.Application_No1=TarnsList.get(autoList) + var2;
		// 		}
		// 		// Fetch Partner Category
		// 		getcategory = Partner_Enquiry[Partner_Entity_Name == test.Partner_Entity_Name];
		// 		// 		test.Partner_Category=getcategory.Partner_Category;
		// 		// Perform Validation Checks
		// 		for each  getValidation in Validation_Rule_Master[Partner_Category.Partner_Category == test.Partner_Category]
		// 		{
		// 			if(getValidation.count() > 0)
		// 			{
		// 				if(test.Documentation_Status == getValidation.Valid_Tags)
		// 				{
		// 					test.Document_Check=true;
		// 				}
		// 			}
		// 			else
		// 			{
		// 				test.Document_Check=false;
		// 			}
		// 		}
		// 		for each  getValidation in Validation_Rule_Master[Partner_Category.Partner_Category == test.Partner_Category]
		// 		{
		// 			if(getValidation.count() > 0)
		// 			{
		// 				if(test.Program == getValidation.Valid_Tags)
		// 				{
		// 					test.Program_check=true;
		// 				}
		// 			}
		// 			else
		// 			{
		// 				test.Program_check=false;
		// 			}
		// 		}
		// 		for each  getValidation in Validation_Rule_Master[Partner_Category.Partner_Category == test.Partner_Category]
		// 		{
		// 			if(getValidation.count() > 0)
		// 			{
		// 				if(test.Elective == getValidation.Valid_Tags)
		// 				{
		// 					test.Elective_Check=true;
		// 				}
		// 			}
		// 			else
		// 			{
		// 				test.Elective_Check=false;
		// 			}
		// 		}
		// 		// Final Validation Check
		// 		if(test.Document_Check == true && test.Elective_Check == true && test.Program_check == true)
		// 		{
		// 		test.Validation_Check_Status="Valid";
		// 		}
		// 		else
		// 		{
		// 			test.Validation_Check_Status="Invalid";
		// 		}
		// Fetch Partner Name
		//	partner = Partner_Details[Partner_ID == test.Partner_ID];
		//	test.Partner_Entity_Name=partner.Partner_Entity_Name;
		//fetch Address
		getAddress = Partner_Onboarding_and_KYC[Partner_Entity_Name == test.Partner_Entity_Name];
		test.Partner_Address=getAddress.Partner_Address;
		test.Partner_Category=getAddress.Partner_Category;
		ratecarddet1 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == test.Partner_Entity_Name];
		thisapp.Transactions.CreateTransactionID(test.ID);
		if(ratecarddet1.count() == 0)
		{
			test.Validation_Comments="Partner entity not onboarded in Partner Master Data. Complete onboarding process and re-initiate transactions.";
			//test.Validation_Comments="Partner Entity name is not matching with the rate card.";
			test.Validation_Check_Status="Invalid";
			//test.Transaction="";
		}
		else
		{
			ratecarddet2 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == test.Partner_Entity_Name && University_Name.University_Name == test.University_Name];
			if(ratecarddet2.count() == 0)
			{
				test.Validation_Comments="University not updated in masters. Update University Master and re-initiate transactions.";
				//test.Validation_Comments="University is not matching with the rate card.";
				test.Validation_Check_Status="Invalid";
				//test.Transaction="";
			}
			else
			{
				ratecarddet3 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == test.Partner_Entity_Name && University_Name.University_Name == test.University_Name && Elective.Elective == test.Elective];
				if(ratecarddet3.count() == 0)
				{
					test.Validation_Comments="Elective not updated in masters. Update Elective Master and re-initiate transactions.";
					//	test.Validation_Comments="Elective is not matching with the rate card.";
					test.Validation_Check_Status="Invalid";
					//test.Transaction="";
				}
				else
				{
					// 					info "program " + test.Program;
					// 					info "rate card program " + ratecarddet3.Programs.Programs;
					ratecarddet4 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == test.Partner_Entity_Name && University_Name.University_Name == test.University_Name && Elective.Elective == test.Elective && Programs.Programs == test.Program];
					if(ratecarddet4.count() == 0)
					{
						test.Validation_Comments="Program not updated in the master. Update Program Master and re-initiate transactions.";
						//test.Validation_Comments="Program is not matching with the rate card.";
						test.Validation_Check_Status="Invalid";
						//test.Transaction="";
					}
					else
					{
						ratecarddet5 = RATE_CARD[Partner_Entity_Name.Partner_Entity_Name == test.Partner_Entity_Name && University_Name.University_Name == test.University_Name && Elective.Elective == test.Elective && Programs.Programs == test.Program && CP_Approval_Status == "Approved"];
						// 						info "rate card 5 " + ratecarddet4;
						if(ratecarddet5.count() == 0)
						{
							test.Validation_Comments="Rate Card is not approved.";
							test.Validation_Check_Status="Invalid";
							//test.Transaction="";
						}
						else
						{
							validStatuses = {"Category A","Category B","Category C","Category D","Category E","Category F","L1 verified","L2 verified","Re-upload required"};
							if(!validStatuses.contains(test.Documentation_Status1.Document_Status))
							{
								test.Validation_Comments="Document Status is Invalid";
								test.Validation_Check_Status="Invalid";
							}
							else
							{
								/*Fetch Payout*/
								getPayout = RATE_CARD[Elective.Elective == test.Elective && Programs.Programs == test.Program && Partner_Entity_Name.Partner_Entity_Name == test.Partner_Entity_Name && University_Name.University_Name == test.University_Name && CP_Approval_Status == "Approved"];
								if(getPayout.count() > 0)
								{
									for each  recs in getPayout
									{
										getpartnerid = Partner_Onboarding_and_KYC[Partner_Entity_Name == recs.Partner_Entity_Name.Partner_Entity_Name];
										if(test.Enrollment_Date >= recs.Effective_start_date && test.Enrollment_Date <= recs.Effective_end_date)
										{
											test.Partner_ID=getpartnerid.Partner_ID;
											test.Contracting_organisation=getpartnerid.Contracting_organisation1;
											test.Validation_Check_Status="Valid";
											test.Validation_Comments="Ready for commission calculation.";
											// 										if(test.Validation_Check_Status == "Valid")
											// 										{
											// 										}
											/*create Transaction ID*/
											test.Payout=getPayout.Payout;
											//	info "info test id " + test.ID;
											// 										thisapp.Transactions.Trasaction_ID(test.ID);
										}
										else
										{
											test.Validation_Comments="No approved rate card found for the enrollment date.";
											//test.Validation_Comments="Effective start and end date is not macthing with the enrollment date.";
											test.Validation_Check_Status="Invalid";
											test.Transaction="";
										}
									}
								}
							}
						}
					}
				}
			}
		}
		// 		else
		// 		{
		// 			test.Validation_Check_Status="Invalid";
		// 		}
		// 		/* Fetch Partner ID*/
		getPartner = Partner_Details[Partner_Entity_Name == test.Partner_Entity_Name];
		if(getPartner.count() > 0)
		{
			test.Partner_ID=getPartner.Partner_ID;
		}
		// Redirect if validation status is not pending
		// 		if(test.Validation_Check_Status != "Pending")
		// 		{
		// 			openUrl("#Report:Transactions_Status","same window");
		// 		}
		// Set Internal Invoice Status
		test.Internal_Invoice_Status="Open";
		// CP Validation
		cp_mas = Partner_Details[Partner_Entity_Name == test.Partner_Entity_Name];
		if(cp_mas.count() > 0)
		{
			test.CP_Master_Validation="Success";
			test.Send_mail_to_CP="Yes";
		}
		else
		{
			test.CP_Master_Validation="Failure";
		}
		// Send Email if required
		if(getTransInfo.Send_mail_to_CP == "Yes" && getTransInfo.CP_Master_Validation == "Success")
		{
			getCP = Rate_Card_Master[Partner_Entity_Name == getTransInfo.Partner_Entity_Name];
			if(getCP.count() > 0)
			{
				Content = "<a href='https://creatorapp.zohopublic.in/centralisedprocurement_usdcglobal/usdc1/report-perma/Transactions_Status/ZpWz5PETb5DNQJuNmJHRxJmPvTtxJnr194fJAF5SgQDyQdymhZA3tj955m5eOFgXFhKWyWh57O8tWNw3WGDj4XYVEGfdCYP2P79G?ID=" + getTransInfo.ID + "'>Click here to View</a>";
				sendmail
				[
					from :zoho.adminuserid
					to :"vimal@techvaria.com"
					subject :"Review Transaction"
					message :"Dear " + getCP.Partner_Entity_Name + ",<br><br>Your Accumulated Commission Calculation was successful.<br><br>Please take a moment to review the details and let us know if you have any questions or concerns.<br><br>" + Content + "<br><br>If you require further information or clarification, feel free to reach out to us.<br><br>Best Regards,<br>Team"
				]
			}
		}
	}
}
void RateCard.getValidations(int ids)
{
	RateCardID = RATE_CARD[ID == input.ids];
	if(RateCardID.CP_Validation == "" || RateCardID.CP_Validation == "Failure")
	{
		//	info "inside if ";
		verification_inv = RATE_CARD[ID in RateCardID];
		idsString = "";
		Internal_User = zoho.loginuserid;
		getID = RATE_CARD[ID != null] sort by Rate_Card_ID desc;
		var2 = 0;
		if(getID == null)
		{
			var2 = 1;
		}
		else
		{
			lastRateCardID = getID.Rate_Card_ID;
			suffix = lastRateCardID.getsuffix("RA-");
			if(!suffix.isEmpty())
			{
				var2 = suffix.toLong() + 1;
			}
			else
			{
				var2 = 1;
			}
		}
		for each  test in verification_inv
		{
			// Append IDs to idsString
			if(idsString != "")
			{
				idsString = idsString + ",";
			}
			idsString = idsString + test.ID.toString();
			autoList = var2.toString().length();
			RateList = {1:"RA-00",2:"RA-0",3:"RA-"};
			Rate_Card_ID = RateList.get(autoList) + var2;
			test.Rate_Card_ID=Rate_Card_ID;
			var2 = var2 + 1;
			// 			cp_mas = Rate_Card_Master[Partner_Entity_Name == test.Partner_Entity_Name.Partner_Entity_Name && Contracting_organisation == test.Contracting_organisation];
			// 			if(cp_mas.count() > 0)
			// 			{
			// 				test.CP_Validation="Success";
			// 			}
			// 			else
			// 			{
			// 				test.CP_Validation="Failure";
			// 			}
			cp_mas = Partner_Onboarding_and_KYC[Partner_Entity_Name == test.Partner_Entity_Name.Partner_Entity_Name && Contracting_organisation1 == test.Contracting_organisation];
			// 			cp_mas = Partner_Details[Partner_Entity_Name == test.Partner_Entity_Name.Partner_Entity_Name && Contracting_organisation == test.Contracting_organisation];
			// 			masterdata = Partner_Onboarding_and_KYC[Partner_Entity_Name == test.pa]
			//	info "partner name " + test.Partner_Entity_Name.Partner_Entity_Name;
			//	info "org " + test.Contracting_organisation;
			if(cp_mas.count() > 0)
			{
				test.CP_Validation="Success";
			}
			else
			{
				test.CP_Validation="Failure";
				test.Validation_Comments="Contracting organisation does not match as per Partner Master Data. Rectify the data and re-initiate rate card import.";
			}
			// 			if(test.CP_Validation = "Success")
			// 			{
			getPartnerInfo = Partner_Onboarding_and_KYC[Partner_Entity_Name == test.Partner_Entity_Name.Partner_Entity_Name];
			if(getPartnerInfo.count() > 0)
			{
				//		info "PARTNERID"+ getPartnerInfo.Partner_ID;
				test.Partner_Unique_ID=getPartnerInfo.Partner_ID;
			}
			//	}
		}
		// 		openUrl("https://creatorapp.zoho.in/centralisedprocurement_usdcglobal/usdc1/#Report:Approved_Rate_Card_By_Internal_User","same window");
	}
	else
	{
		info "This RateCard was already validate";
	}
	thisapp.RateCard.getRateCardMaster(input.ids);
}
void RateCard.Generate_ratecard_id(int ids)
{
	verification_inv = RATE_CARD[ID == input.ids];
	getID = RATE_CARD[ID != null] sort by Rate_Card_ID desc;
	if(getID == null)
	{
		var2 = 1;
	}
	else
	{
		lastRateCardID = getID.Rate_Card_ID;
		suffix = lastRateCardID.getsuffix("RA-");
		if(!suffix.isEmpty())
		{
			var2 = suffix.toLong() + 1;
		}
		else
		{
			var2 = 1;
		}
	}
	for each  test in verification_inv
	{
		partnerdet = Partner_Onboarding_and_KYC[Partner_Entity_Name == test.Partner_Entity_Name.Partner_Entity_Name];
		autoList = var2.toString().length();
		RateList = {1:"RA-00",2:"RA-0",3:"RA-"};
		Rate_Card_ID = RateList.get(autoList) + var2;
		// 		info Rate_Card_ID;
		test.Rate_Card_ID=Rate_Card_ID;
		test.Partner_Unique_ID=partnerdet.Partner_ID;
	}
}
void Test1.testpayment(int id)
{
	fetpay = Payment_form[ID == id];
	fetinv = Internal_Invoice[ID == fetpay.CP_Internal_Invoice_ID];
	cp_invoice_id = fetpay.CP_Internal_Invoice_ID;
	all_payments = Payment_form[CP_Internal_Invoice_ID == cp_invoice_id];
	pay = 0;
	for each  rec in all_payments
	{
		pay = pay + rec.Payment_Amount.toDecimal();
	}
	fetinv.Paid_Amount=pay;
}
void Books.create_bills(int ids)
{
	billdata = Bills[ID == input.ids];
	if(billdata.Books_Bill_ID.isEmpty() == true)
	{
		getID = Bills[ID != null] sort by Books_Bill_ID desc;
		if(getID.count() == 0)
		{
			billdata.Books_Bill_ID="Bill-001";
		}
		else
		{
			var1 = getID.Books_Bill_ID.getsuffix("Bill-");
			if(var1.isEmpty() || !var1.isNumber())
			{
				var2 = 1;
			}
			else
			{
				var2 = var1.tolong() + 1;
			}
			autoList = var2.toString().length();
			TarnsList = {1:"Bill-00",2:"Bill-0",3:"Bill-"};
			billdata.Books_Bill_ID=TarnsList.get(autoList) + var2;
			billnum = TarnsList.get(autoList) + var2;
		}
	}
	// Create Bill Process to Books
	iternal_inv = Internal_Invoice[ID == billdata.Bill_Id1];
	test = billdata.Partner_Details.Zoho_books_ID;
	var_par = Partner_Details[Partner_Entity_Name == billdata.Vendor_Name];
	vendordet = Partner_Onboarding_and_KYC[Partner_Entity_Name == billdata.Vendor_Name];
	book = vendordet.Zoho_Book_vendor_ID;
	info book;
	item_list = List();
	item_map = Map();
	item_map.put("rate",billdata.Total_Amount);
	item_map.put("account_id",2293182000000041035);
	item_map.put("bill_number",billnum);
	// // 	check the GST details from zoho books 
	vendorDetailsResponse = invokeurl
	[
		url :"https://www.zohoapis.in/books/v3/contacts/" + book + "?organization_id=60036667486"
		type :GET
		connection:"zoho_books_connection"
	];
	vendorDetails = vendorDetailsResponse.get("contact");
	gstTreatment = vendorDetails.get("gst_treatment");
	info "GST Treatment: " + gstTreatment;
	// 	   taxResponse = invokeurl
	// 	[
	// 	    url :"https://www.zohoapis.in/books/v3/settings/taxes?organization_id=60036667486"
	// 	    type :GET
	// 	    connection:"zoho_books_connection"
	// 	];
	// 	info taxResponse;
	if(gstTreatment != null)
	{
		item_map.put("gst_treatment_code","out_of_scope");
	}
	item_list.add(item_map);
	Head1 = Map();
	if(billdata.Contracting_organisation == "USDC")
	{
		Head1.put("branch_id",2293182000000188007);
	}
	if(billdata.Contracting_organisation == "Jain University")
	{
		Head1.put("branch_id",2293182000000188048);
	}
	Head1.put("reference_number",billdata.Bill_Id1.Internal_Invoice_ID);
	Head1.put("bill_number",billdata.Books_Bill_ID);
	Head1.put("notes",billdata.Order_Number);
	Head1.put("date_formatted",zoho.currentdate);
	Head1.put("is_draft",true);
	Head1.put("vendor_id",book);
	Head1.put("line_items",item_list);
	//Head1.put("tax_total",billdata.GST_Amount);
	Head1.put("total",billdata.Total_Amount);
	custom_field_list = List();
	customfields = Map();
	customfields.put("api_name","cf_internal_invoice_id");
	customfields.put("value",iternal_inv.ID);
	custom_field_list.add(customfields);
	Head1.put("custom_fields",custom_field_list);
	info customfields;
	var = invokeurl
	[
		url :"https://www.zohoapis.in/books/v3/bills?organization_id=60036667486"
		type :POST
		parameters:Head1.toString()
		connection:"zoho_books_connection"
	];
	info "Bill Creation API Status " + var;
	if(var.get("code") == 0 && var.get("bill") != null)
	{
		// 				/*create record in New Bill*/
		if(var.get("code") == 0 && var.get("bill") != null)
		{
			getBill = var.get("bill");
			addNewBills = insert into New_Bills
			[
				Bill_ID=getBill.get("bill_number")
				Bill_Date=getBill.get("date").toString("dd-mm-YYYY")
				Bill_Status=getBill.get("status")
				Total_Amount=getBill.get("total")
				Vendor_Name=getBill.get("vendor_name")
				Zoho_books_ID=getBill.get("bill_id")
				Internal_Invoice=billdata.Bill_Id1
				Added_User=zoho.loginuser
			];
		}
	}
	billcreateform = Create_Bill[Bills == input.ids];
	// 	invoicebackend = Create_Bill[CP_Internal_Invoice_Backend.inp]
	if(var.getJson("code") == 0)
	{
		for each  recs12 in billcreateform.CP_Internal_Invoice_Backend
		{
			recs12.Bill_Creation_Status="Yes";
		}
		iternal_inv.Invoice_Amount=ifnull(iternal_inv.Invoice_Amount,0) + ifnull(billdata.Total_Amount,0);
		billcreateform.Bill_Creation_Status="Yes";
		billdata.Bill_Creation_Status="Yes";
		bills = var.get("bill");
		bills_id = bills.getJSON("bill_id");
		total1 = bills.getJSON("total");
		iternal_inv.Books_Bill_ID=bills_id;
		// 		info bills_id;
		file = invokeurl
		[
			url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/All_Bills/" + billdata.ID + "/External_Invoice/download"
			type :GET
			connection:"zoho_oauth_connection"
		];
		file.setparamname("attachment");
		info "download files " + file;
		response = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/bills/" + bills_id + "/attachment?organization_id=60036667486"
			type :POST
			files:file
			connection:"zoho_books_connection1"
		];
		// 		info file;
		billdata.Zoho_Books_Id=bills_id;
		billdata.Total_Invoice_Amount_Incl_GST=total1;
		var_bill = var.get("bill").getJSON("reference_number");
		info "var_bill" + var_bill;
		// 		openUrl("#Report:Associated_Bill?Internal_Invoice_ID=" + var_bill,"same window");
		iternal_inv = Internal_Invoice[ID == billdata.Bill_Id1];
		iternal_inv.Balance_Amount=billdata.Balance_Amount;
		// iternal_inv.Total_Amount=input.Total_Amount;
		iternal_inv.Total_Amount=ifnull(iternal_inv.Total_Amount,0) + billdata.Total_Amount;
		iternal_inv.Balance_Amount=billdata.Accumulated_Commission_Amount - ifnull(iternal_inv.Total_Amount,0);
		iternal_inv.External_Invoice="";
		iternal_inv.Status="New";
		/*Sending mail to CP*/
		// 		sendmail
		// 		[
		// 			from :zoho.adminuserid
		// 			to :billdata.CP_Details1.Partner_Entity_Name,"vimal@techvaria.com"
		// 			subject :"CP Invoice Verification Successfull"
		// 			message :"CP invoice Verification Done and Submitted to Finance team"
		// 		]
		totalAmount = 0;
		item_list = List();
		hard_lst = {1,2};
		for each  split in hard_lst
		{
			if(split == 1)
			{
				get_creator_amount = billdata.Total_Amount;
				get_credit_debit = "debit";
				get_creator_Description = "Comments";
				item_map = Map();
				item_map.put("amount",get_creator_amount);
				item_map.put("debit_or_credit",get_credit_debit);
				item_map.put("account_id",2293182000000114065);
				// 				2293182000000114073
				item_map.put("customer_id",book);
			}
			if(split == 2)
			{
				get_creator_amount = billdata.Total_Amount;
				get_credit_debit = "credit";
				get_creator_Description = "Test";
				item_map = Map();
				item_map.put("amount",get_creator_amount);
				item_map.put("debit_or_credit",get_credit_debit);
				item_map.put("account_id",2293182000000114073);
				item_map.put("customer_id",book);
			}
			item_list.add(item_map);
		}
		mymap = Map();
		if(billdata.Contracting_organisation == "USDC")
		{
			mymap.put("branch_id",2293182000000188007);
		}
		if(billdata.Contracting_organisation == "Jain University")
		{
			mymap.put("branch_id",2293182000000188048);
		}
		mymap.put("journal_date",zoho.currentdate.toString("yyyy-MM-dd"));
		mymap.put("reference_number",billdata.Order_Number);
		mymap.put("notes","test");
		mymap.put("line_items",item_list);
		mymap.put("total",billdata.Total_Invoice_Amount_Incl_GST);
		//mymap.put("tax_total",billdata.GST_Amount);
		responseBooks = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/journals?organization_id=60036667486"
			type :POST
			parameters:mymap.toString()
			connection:"zoho_books_connection1"
		];
		getJournal = responseBooks.get("journal");
		Zoho_Books_ID = getJournal.get("journal_id");
		file = invokeurl
		[
			url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/All_Bills/" + billdata.ID + "/External_Invoice/download"
			type :GET
			connection:"zoho_oauth_connection"
		];
		file.setparamname("attachment");
		response = invokeurl
		[
			url :"https://www.zohoapis.in/books/v3/journals/" + Zoho_Books_ID + "/attachment?organization_id=60036667486"
			type :POST
			files:file
			connection:"zoho_books_connection1"
		];
	}
	else
	{
		for each  recs123 in billcreateform.CP_Internal_Invoice_Backend
		{
			recs123.Bill_Creation_Status="No";
			recs123.Bill_Creation_Error_Message=var;
		}
		billcreateform.Bill_Creation_Status="No";
		billcreateform.Bill_Creation_Error_Message=var;
		billdata.Bill_Creation_Status="No";
		billdata.Bill_Creation_Error_Message=var;
	}
}
var_org = organization.get("organization_id");
aaa = vendor_payment.get("payment_id");
amount = vendor_payment.get("amount");
paymentnumber = vendor_payment.get("payment_number");
dateformatted = vendor_payment.getJSON("date_formatted");
branch = vendor_payment.getJSON("branch_name");
refno = vendor_payment.getJSON("reference_number");
//billID = vendor_payment.get("bills").get(0).get("bill_id");
tbill = vendor_payment.getJSON("bills");
resp = invokeurl
[
	url :"https://www.zohoapis.in/books/v3/vendorpayments/" + aaa + "?organization_id=" + var_org
	type :GET
	connection:"books"
];
// info resp;
item_list = List();
for each  rec in tbill
{
	billID = rec.get("bill_id");
	billnum = rec.get("bill_number");
	amtapp = rec.get("amount_applied");
	// Get amount from the bill
	paymentid = rec.get("bill_payment_id");
	info "PAYMENTID: " + paymentid;
	info "AmtApp: " + amtapp;
	// Store amount in item_map for tracking
	item_map = Map();
	item_map.put("Bill_ID",billID);
	item_map.put("Payment_Amount",amtapp);
	item_map.put("Payment_Utr",zoho.currentdate);
	item_map.put("Payment_Number",paymentnumber);
	item_map.put("Branch",branch);
	item_map.put("Reference_Number",refno);
	item_list.add(item_map);
	response = invokeurl
	[
		url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/All_Bills?Zoho_Books_Id=" + billID
		type :GET
		connection:"creator"
	];
	payres = invokeurl
	[
		url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/All_Payments?Bill_Payment_ID=" + paymentid
		type :GET
		connection:"creator"
	];
	payvar = payres.get("data");
	varre = response.get("data");
	booksbilldata = zoho.books.getRecordsByID("bills","60036667486",billID,"books");
	crtrid = booksbilldata.getJSON("bill").getJSON("custom_fields");
	//info "BooksData"+booksbilldata;
	amount = booksbilldata.getJSON("payments");
	//info "Amount"+billID;
	for each  cfid in crtrid
	{
		if(cfid.getJSON("field_id") == "2293182000002730100")
		{
			crtrinvid = cfid.getJSON("value_formatted");
			info "INVID" + crtrinvid;
		}
	}
	// If payment record does not exist, create a new one	
	if(payvar.size() == 0)
	{
		creator_id1 = varre.getJSON("ID");
		paymap = Map();
		paymap.put("Payment_Amount",amtapp);
		paymap.put("Bill_ID",billID);
		paymap.put("Bill_No",billnum);
		paymap.put("Payment_Utr",zoho.currentdate);
		paymap.put("Payment_Number",paymentnumber);
		paymap.put("Branch",branch);
		paymap.put("Bill_Payment_ID",paymentid);
		paymap.put("Reference_Number",refno);
		paymap.put("Zoho_book_id",aaa);
		paymap.put("Bills",creator_id1);
		paymap.put("Zoho_book_id",aaa);
		paymap.put("CP_Internal_Invoice_ID",crtrinvid);
		info "Creating Payment Record: " + paymap;
		otherParams = Map();
		createPaymentres = zoho.creator.createRecord("centralisedprocurement_usdcglobal","usdc1","Payment_form",paymap,otherParams,"creator");
	}
	else
	{
		upmap = Map();
		upothermap = Map();
		getpaymentResponse1 = zoho.creator.getRecords("centralisedprocurement_usdcglobal","usdc1","All_Payments","Bill_Payment_ID ==\"" + paymentid + "\"",1,200,"creator");
		newresponse1 = getpaymentResponse1.getJson("data");
		upmap.put("Payment_Amount",amtapp);
		upmap.put("Bill_ID",billID);
		upmap.put("CP_Internal_Invoice_ID",crtrinvid);
		updatePayment1 = zoho.creator.updateRecord("centralisedprocurement_usdcglobal","usdc1","All_Payments",newresponse1.getJson("ID"),upmap,upothermap,"creator");
		info "Updated Payment Record: " + updatePayment1;
	}
	resp1 = invokeurl
	[
		url :"https://www.zohoapis.in/creator/v2.1/data/centralisedprocurement_usdcglobal/usdc1/report/Associated_Bill?ID=" + crtrinvid
		type :GET
		connection:"creator"
	];
	if(resp1.get("code") == 3000)
	{
		info "RESP1" + resp1;
		pdamt = resp1.getJSON("data").getJSON("Paid_Amount").toNumber();
		pdamt = pdamt + amtapp.toDecimal();
		info "PaidAMOUNT" + pdamt;
		mps = Map();
		Other = Map();
		//mps.put("Paid_Amount",amtapp.toDecimal().round(2));
		// 	info mps;
		upcreatorrec = zoho.creator.updateRecord("centralisedprocurement_usdcglobal","usdc1","Admin_Associated_Bill",crtrinvid,mps,Other,"creator");
		//info "CRT" + upcreatorrec;
	}
}
sendmail
[
	from :zoho.adminuserid
	to :"pooja.s@techvaria.com"
	subject :"Payment Test"
	message :upcreatorrec + "-" + mps
]
A white-label BET365 clone script is a customizable, ready-to-launch betting platform that replicates BET365’s key features—real-time odds, live streaming, and multi-language support.
At Coinsqueens, we build secure, scalable, and user-friendly BET365 clone platforms tailored to your business goals using the latest technology.
Know More:
For more info:
Call/Whatsapp - +91 87540 53377
Email:sales@coinsqueen.com
Visit https://www.coinsqueens.com/blog/bet365-clone-script 
photo_str = input.Image_Pan;
photo_str = photo_str.replaceFirst("sharedBy",zoho.adminuser);
photo_str = photo_str.replaceFirst("appLinkName",zoho.appname);
photo_str = photo_str.replaceFirst("viewLinkName","KYC");
photo_str = photo_str.replaceFirst("fieldName",input.ID + "/Image_Pan");
photo_str = photo_str.replaceFirst("image","image-download");
photo_str = photo_str.replaceFirst("<img","<img width='100' height='100' ");
input.PAN_Card_img = photo_str;
photo_str1 = input.Certificate_of_Incorporation2;
photo_str1 = photo_str1.replaceFirst("sharedBy",zoho.adminuser);
photo_str1 = photo_str1.replaceFirst("appLinkName",zoho.appname);
photo_str1 = photo_str1.replaceFirst("viewLinkName","KYC");
photo_str1 = photo_str1.replaceFirst("fieldName",input.ID + "/Certificate_of_Incorporation2");
photo_str1 = photo_str1.replaceFirst("image","image-download");
photo_str1 = photo_str1.replaceFirst("<img","<img width='100' height='100' ");
input.Certificate_of_Incorporation = photo_str1;
photo_str2 = input.Partnership_Deed;
photo_str2 = photo_str2.replaceFirst("sharedBy",zoho.adminuser);
photo_str2 = photo_str2.replaceFirst("appLinkName",zoho.appname);
photo_str2 = photo_str2.replaceFirst("viewLinkName","KYC");
photo_str2 = photo_str2.replaceFirst("fieldName",input.ID + "/Partnership_Deed");
photo_str2 = photo_str2.replaceFirst("image","image-download");
photo_str2 = photo_str2.replaceFirst("<img","<img width='100' height='100' ");
input.Partnership_Deed1_Img = photo_str2;
photo_str3 = input.Partnership_Deed1;
photo_str3 = photo_str3.replaceFirst("sharedBy",zoho.adminuser);
photo_str3 = photo_str3.replaceFirst("appLinkName",zoho.appname);
photo_str3 = photo_str3.replaceFirst("viewLinkName","KYC");
photo_str3 = photo_str3.replaceFirst("fieldName",input.ID + "/Partnership_Deed1");
photo_str3 = photo_str3.replaceFirst("image","image-download");
photo_str3 = photo_str3.replaceFirst("<img","<img width='100' height='100' ");
input.Partnership_Deed1_Img = photo_str3;
photo_str4 = input.Proprietorship_Declaration1;
photo_str4 = photo_str4.replaceFirst("sharedBy",zoho.adminuser);
photo_str4 = photo_str4.replaceFirst("appLinkName",zoho.appname);
photo_str4 = photo_str4.replaceFirst("viewLinkName","KYC");
photo_str4 = photo_str4.replaceFirst("fieldName",input.ID + "/Proprietorship_Declaration1");
photo_str4 = photo_str4.replaceFirst("image","image-download");
photo_str4 = photo_str4.replaceFirst("<img","<img width='100' height='100' ");
input.Proprietorship_Declaration_Img = photo_str4;
photo_str5 = input.Permanent_Establishment1;
photo_str5 = photo_str5.replaceFirst("sharedBy",zoho.adminuser);
photo_str5 = photo_str5.replaceFirst("appLinkName",zoho.appname);
photo_str5 = photo_str5.replaceFirst("viewLinkName","KYC");
photo_str5 = photo_str5.replaceFirst("fieldName",input.ID + "/Permanent_Establishment1");
photo_str5 = photo_str5.replaceFirst("image","image-download");
photo_str5 = photo_str5.replaceFirst("<img","<img width='100' height='100' ");
input.Permanent_Establishment_Img = photo_str5;
photo_str6 = input.Cancelled_Cheque;
photo_str6 = photo_str6.replaceFirst("sharedBy",zoho.adminuser);
photo_str6 = photo_str6.replaceFirst("appLinkName",zoho.appname);
photo_str6 = photo_str6.replaceFirst("viewLinkName","KYC");
photo_str6 = photo_str6.replaceFirst("fieldName",input.ID + "/Cancelled_Cheque");
photo_str6 = photo_str6.replaceFirst("image","image-download");
photo_str6 = photo_str6.replaceFirst("<img","<img width='100' height='100' ");
input.Cancelled_Cheque_img = photo_str6;
photo_str7 = input.GST_Registration_Certificate;
photo_str7 = photo_str7.replaceFirst("sharedBy",zoho.adminuser);
photo_str7 = photo_str7.replaceFirst("appLinkName",zoho.appname);
photo_str7 = photo_str7.replaceFirst("viewLinkName","KYC");
photo_str7 = photo_str7.replaceFirst("fieldName",input.ID + "/GST_Registration_Certificate");
photo_str7 = photo_str7.replaceFirst("image","image-download");
photo_str7 = photo_str7.replaceFirst("<img","<img width='100' height='100' ");
input.Gst_regestration_img = photo_str7;
photo_str8 = input.Additional_documents;
photo_str8 = photo_str8.replaceFirst("sharedBy",zoho.adminuser);
photo_str8 = photo_str8.replaceFirst("appLinkName",zoho.appname);
photo_str8 = photo_str8.replaceFirst("viewLinkName","KYC");
photo_str8 = photo_str8.replaceFirst("fieldName",input.ID + "/Additional_documents");
photo_str8 = photo_str8.replaceFirst("image","image-download");
photo_str8 = photo_str8.replaceFirst("<img","<img width='100' height='100' ");
input.Additional_documents_img = photo_str8;
photo_str9 = input.Policy_Document_Data_Privacy;
photo_str9 = photo_str9.replaceFirst("sharedBy",zoho.adminuser);
photo_str9 = photo_str9.replaceFirst("appLinkName",zoho.appname);
photo_str9 = photo_str9.replaceFirst("viewLinkName","KYC");
photo_str9 = photo_str9.replaceFirst("fieldName",input.ID + "/Policy_Document_Data_Privacy");
photo_str9 = photo_str9.replaceFirst("image","image-download");
photo_str9 = photo_str9.replaceFirst("<img","<img width='100' height='100' ");
input.Policy_Document_Img = photo_str9;
photo_str10 = input.Policy_Document_Confidentality_Of_Information;
photo_str10 = photo_str10.replaceFirst("sharedBy",zoho.adminuser);
photo_str10 = photo_str10.replaceFirst("appLinkName",zoho.appname);
photo_str10 = photo_str10.replaceFirst("viewLinkName","KYC");
photo_str10 = photo_str10.replaceFirst("fieldName",input.ID + "/Policy_Document_Confidentality_Of_Information");
photo_str10 = photo_str10.replaceFirst("image","image-download");
photo_str10 = photo_str10.replaceFirst("<img","<img width='100' height='100' ");
input.Policy_Document1_Img = photo_str10;
photo_str11 = input.Partnership_Deed;
photo_str11 = photo_str11.replaceFirst("sharedBy",zoho.adminuser);
photo_str11 = photo_str11.replaceFirst("appLinkName",zoho.appname);
photo_str11 = photo_str11.replaceFirst("viewLinkName","KYC");
photo_str11 = photo_str11.replaceFirst("fieldName",input.ID + "/Partnership_Deed");
photo_str11 = photo_str11.replaceFirst("image","image-download");
photo_str11 = photo_str11.replaceFirst("<img","<img width='100' height='100' ");
input.Partnership_deed_img = photo_str2;
This Power BI Tutorial guides you through data visualization, reporting, and analytics using Microsoft Power BI. Learn how to connect data sources, create interactive dashboards, and generate insightful reports. Whether you're a beginner or an advanced user, this tutorial covers key features like DAX, Power Query, and AI-powered analytics for effective data-driven decision-making.
var pageLink = $(".sidebar"); // Select the section
    var initialTop = pageLink.offset().top; // Store the initial position
    var stickyPosition = initialTop - 120; // Activate sticky when reaching 120px

    $(window).scroll(function () {
      var scrollTop = $(window).scrollTop(); // Current scroll position

      if (scrollTop >= stickyPosition) {
        pageLink.addClass("sticky").css("transition", "300ms");
        pageLink.parents("div").css("overflow", "visible"); // Apply to all parent divs
      }
      // Remove sticky class when scrolled back to original position
      else if (scrollTop < initialTop) {
        pageLink.removeClass("sticky").css("transition", "300ms");
      }
    }); 
Discover the best Online R Compilers for instant coding, testing, and debugging. Whether you're a beginner or an experienced data scientist, these web-based tools offer seamless execution, syntax highlighting, and real-time collaboration. Explore top R compilers with features like cloud storage, package support, and fast processing. Optimize your workflow with the best online R coding environments available today. Start coding in R instantly—no installation required!
End-to-end MEV Bot Development solutions are designed for smart investors and businesses. Trade effortlessly for big profits. Our skilled staff is most likely available to help you in making the greatest trade! Join us and experience consistent success. Discover the possibilities of MEV Bot Development and explore profitable opportunities with experienced guidance every step of the way.
Let's be real - the crypto space is booming, and it is not slowing down any time soon. If you are someone like me - curious, entrepreneurial, and always looking ahead - then you have probably noticed how p2p crypto exchanges are quickly becoming the heart of decentralized trading.

Gone are the days when users were happy to rely on traditional centralized platforms with their long KYC checks, frozen accounts, and high fees. People want freedom. They want control. They want options. And that's exactly what peer-to-peer (P2P) crypto exchange offer.

But here's the thing - not all P2P exchanges are created equal. With new platforms popping up every month, it is easy to get overwhelmed. So, if you are creating a platform, investing in one, or just trading, knowing how to choose the best p2p crypto exchange in 2025 is more important than ever.

Let me walk you through how i would do it, based on experience, observation, and a little bit of that entrepreneurial gut instinct.

1. Check the Security Like It's Your Vault

The first thing I always look for? Security.

Think about it - P2P means you are directly dealing with another person, so you need a platform that has rock-solid protection in place. Look for exchanges that offer multi-signature wallets, escrow services, end-to-end encryption, and a transparent dispute resolution system.

If an exchange can't make you feel like your assets are safe there, it doesn't belong on your top 10 list.

2. User Interface: Simple, Smooth, Stress-Free

No matter how advanced the backend is, if the platform looks like it’s stuck in 2017, people won’t use it. Trust me.

In 2025, user experience is king. The best P2P platforms should be clean, intuitive, and mobile-friendly. Whether you're a newbie or a seasoned trader, you should be able to navigate the platform without Googling every other term.

Pro tip: A strong UI often shows that the team behind it actually listens to its users.

3. Liquidity and Trade Volume

Let’s not forget—a P2P exchange without liquidity is just a pretty website. If you can’t find buyers or sellers quickly, it defeats the whole purpose of “peer-to-peer.”

When ranking top P2P exchanges, always consider:

How many active traders are on the platform daily?
Are there enough listings for different cryptos?
Is the spread (price difference) reasonable?

High liquidity = fast trades, better prices, and happy users.

4. Payment Options: The More, the Merrier

One of the biggest wins for P2P exchanges is payment flexibility. Some users want to pay with PayPal. Others prefer bank transfers or even gift cards.

The best platforms support multiple payment methods across different countries, making it easier for global users to get involved. When reviewing platforms, make sure they’re offering more than just the basics.

5. Reputation & Community Trust

Let’s talk reputation—because in the crypto space, trust is currency.

Top P2P exchanges usually have:

Positive user reviews
Active communities on Reddit, Telegram, or X (formerly Twitter)
Transparent teams or leadership behind them

If the platform is a ghost online or has shady reviews all over, you know what to do—exit stage left.

6. KYC Flexibility (But Legally Sound)

Here’s the tricky part. Some users love anonymity, while others are okay with KYC for security. The best exchanges in 2025 will strike a balance—offering tiered KYC levels or region-specific compliance, while still protecting privacy where possible.

Don’t go for extremes. Go for balance.

7. Dispute Resolution That Actually Works

Sometimes, things go sideways. Maybe the seller didn’t send the crypto. Or maybe there was a payment glitch. What matters then is how the platform handles disputes.

Top-tier P2P platforms will have:

Escrow protection
Fast and fair dispute handling
A responsive support team

Because in a peer-to-peer setup, how well the platform mediates trust is everything.

8. Fees That Make Sense

Now, we all want low fees—but be careful. If a platform is too cheap, they might be cutting corners somewhere else.

Look for exchanges with:

Transparent fee structures
Competitive rates
No hidden charges

And remember, value > price. It’s better to pay a small fee for a smooth, safe transaction than to risk your crypto with a shady “free” platform.

9. Global Reach, Local Touch

2025 is the year of global adoption, but that doesn’t mean ignoring local markets. The top exchanges will support:

Multiple languages
Localized currencies
Region-specific features

If a platform wants to lead, it can’t be one-size-fits-all. It has to speak the language of its users—literally and culturally.

10. Innovation & Roadmap Vision

Last but not least—look at the vision.

The best platforms aren’t just coasting—they’re innovating. Maybe it’s integrating AI for fraud detection, or building cross-chain swaps, or launching governance tokens for community voting.

Ask this: Where is this platform heading in the next 2 years?
Because if you're picking a top exchange, you want to ride with those who are driving forward—not stuck in neutral.

Final Thoughts


So there you have it—10 things I look at when choosing or recommending a top P2P crypto exchange in 2025. Whether you’re a trader, an investor, or a builder, remember this: great platforms don’t just offer transactions—they offer trust, speed, and future-readiness.

We’re stepping into a world where peer-to-peer trading will be as common as sending a text. The top platforms of this era won’t just keep up—they’ll lead the way.

And if you’re someone who dreams of launching your own P2P exchange? I say go for it. The tools are out there. The market is ready. All it takes is the right strategy—and maybe a little inspiration from platforms like these.

Let’s build the future, one peer-to-peer transaction at a time.
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":cute-sun: Boost Days - What's On This Week :cute-sun:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering:* \n\n :hotcrossbun:Chocolate Hotcross Bun Cookies  \n\n :passionfruit: Lemon Passionfruit Coconut Slice \n\n *Weekly Café Special:* _Salted Caramel Latte_"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 16th April :calendar-date-16:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":hands: *Global All Hands* From 11am in the Level 3 Breakout Space \n\n \n\n :lunch: *Light Lunch*: Provided by Kartel Catering from *12pm* \n\n"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 17th April :calendar-date-17:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned for more fun throughout the year. :party-wx:"
			}
		}
	]
}
details {
  overflow: hidden;
}

details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

details::details-content {
  block-size: 0;
  transition:
    block-size 0.3s ease,
    content-visibility 0.3s ease;
  transition-behavior: allow-discrete;
}

details[open]::details-content {
  block-size: auto;
}

details > summary svg {
  transition: transform 0.1s ease;
}

details[open] > summary svg {
  transform: rotate(90deg);
}
star

Sun Apr 13 2025 18:19:22 GMT+0000 (Coordinated Universal Time) https://getgems.io/collection/EQBG-g6ahkAUGWpefWbx-D_9sQ8oWbvy6puuq78U2c4NUDFS/EQB9OVZtapC96xAt6yLf6EZKc02KrBVj7x1XwqXW9fLnub4o

@GADJI123

star

Sun Apr 13 2025 17:06:25 GMT+0000 (Coordinated Universal Time) https://giseo.rkomi.ru/app/school/studentdiary/

@nikitos06062011

star

Sun Apr 13 2025 17:03:37 GMT+0000 (Coordinated Universal Time) https://giseo.rkomi.ru/app/school/studentdiary/

@nikitos06062011

star

Sun Apr 13 2025 07:31:07 GMT+0000 (Coordinated Universal Time)

@manish23 #flutter

star

Sun Apr 13 2025 07:26:36 GMT+0000 (Coordinated Universal Time)

@manish23 #flutter

star

Sun Apr 13 2025 07:24:41 GMT+0000 (Coordinated Universal Time)

@manish23 #flutter

star

Sun Apr 13 2025 07:21:10 GMT+0000 (Coordinated Universal Time)

@manish23 #flutter

star

Sun Apr 13 2025 07:17:57 GMT+0000 (Coordinated Universal Time)

@manish23 #flutter

star

Sat Apr 12 2025 22:26:36 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo

@Mido4477

star

Sat Apr 12 2025 21:08:15 GMT+0000 (Coordinated Universal Time)

@v1ral_ITS

star

Sat Apr 12 2025 17:18:40 GMT+0000 (Coordinated Universal Time)

@freepythoncode ##python #coding #python #forloop

star

Sat Apr 12 2025 12:49:08 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/amazon-clone

@raydensmith #amazon #clone #e-commerce

star

Fri Apr 11 2025 21:53:35 GMT+0000 (Coordinated Universal Time)

@gbritgs

star

Fri Apr 11 2025 10:25:29 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/best-crypto-wallets/

@CharleenStewar #top10cryptowallets #bestcryptowallets #cryptobusiness

star

Fri Apr 11 2025 10:07:23 GMT+0000 (Coordinated Universal Time) https://www.kryptobees.com/blog/fantasy-sports-app-development

@Franklinclas

star

Fri Apr 11 2025 10:05:51 GMT+0000 (Coordinated Universal Time) https://www.groupteamwork.com/pr-agency-in-delhi/

@smriti1133 #prcompany in delhi #bestpr agency in delhi #prfirms in delhi #publicrelations agency in delhi #publicrelations firm in delhi

star

Fri Apr 11 2025 09:26:58 GMT+0000 (Coordinated Universal Time) https://www.coinsqueens.com/blog/bet365-clone-script

@athenapetridis #gaming #bet365clone #scinlinebetting

star

Fri Apr 11 2025 07:29:35 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 05:05:18 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:25:47 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:21:27 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:20:21 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:19:16 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:17:44 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:16:48 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:15:45 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:14:01 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:10:48 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:09:34 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:08:41 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:06:28 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:05:59 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:05:10 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 04:03:22 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Fri Apr 11 2025 03:56:56 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Thu Apr 10 2025 22:47:23 GMT+0000 (Coordinated Universal Time)

@javacha

star

Thu Apr 10 2025 14:04:09 GMT+0000 (Coordinated Universal Time) https://www.coinsqueens.com/blog/bet365-clone-script

@athenapetridis #gaming #bet365clone #scinlinebetting

star

Thu Apr 10 2025 11:18:35 GMT+0000 (Coordinated Universal Time) https://www.kryptobees.com/blog/paxful-clone-script

@Franklinclas

star

Thu Apr 10 2025 08:41:04 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Thu Apr 10 2025 08:35:14 GMT+0000 (Coordinated Universal Time) https://www.tpointtech.com/power-bi

@tpointtechedu

star

Thu Apr 10 2025 08:34:17 GMT+0000 (Coordinated Universal Time) https://www.tpointtech.com/power-bi

@tpointtechedu

star

Thu Apr 10 2025 07:12:01 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css #html

star

Thu Apr 10 2025 06:51:48 GMT+0000 (Coordinated Universal Time) https://www.tpointtech.com/compiler/r

@tpointtechedu

star

Thu Apr 10 2025 06:50:52 GMT+0000 (Coordinated Universal Time) https://www.tpointtech.com/compiler/r

@tpointtechedu

star

Thu Apr 10 2025 06:46:43 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/blog/mev-bot-development

@Seraphina

star

Thu Apr 10 2025 06:42:00 GMT+0000 (Coordinated Universal Time) https://maticz.com/best-p2p-crypto-exchanges

@jamielucas #bestp2pcryptoexchange

star

Thu Apr 10 2025 06:37:43 GMT+0000 (Coordinated Universal Time) https://www.tpointtech.com/sql-tutorial

@elizabeth ##sql-tutorial ##sql-full-form ##education

star

Thu Apr 10 2025 06:36:49 GMT+0000 (Coordinated Universal Time) https://www.tpointtech.com/how-to-create-a-thread-in-java

@jonhill #java #java-tutorial

star

Thu Apr 10 2025 05:38:13 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Wed Apr 09 2025 16:14:38 GMT+0000 (Coordinated Universal Time)

@StephenThevar #css

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension