Whatsapp integration code

PHOTO EMBED

Wed Apr 23 2025 11:26:42 GMT+0000 (Coordinated Universal Time)

Saved by @Pooja

void SalesOrder.SO_Acknowledgment_Whatsapp(int soid)
{
	//soid = 143536000022873024;
	info soid;
	salesdetails = Sales_Order[ID == soid];
	//mobileno = Customers[ID == salesdetails.Customer_Name].Phone_Number1;
	getsoack = Sales_Order_Acknowledgement[Sales_Order_No == soid] sort by ID desc;
	mobileno = getsoack.Phone_No;
	grandtotal = 0;
	if(salesdetails.count() > 0 && salesdetails.Sales_Type == "Direct Order")
	{
		grandtotal = ifnull(salesdetails.Grand_Total.round(2),"");
		somap = Map();
		somap.put("sonumber",ifnull(salesdetails.Sale_Order_No,""));
		somap.put("sodate",ifnull(salesdetails.Sale_Order_Date,""));
		somap.put("grandtotal",ifnull(grandtotal,""));
		somap.put("expshipdate",ifnull(salesdetails.Expected_Shipment_Date,""));
		somap.put("custname",ifnull(getsoack.Contact_Name,""));
		//	mesg="Thank you for your order with Carrier Wheels Pvt. Ltd.!  We've received your order" + ifnull(salesdetails.Sale_Order_No,"")  + " , placed on " + ifnull(salesdetails.Sale_Order_Date,"") + ", amounting to " +ifnull(grandtotal,"")+ " .  The estimated delivery is "+ ifnull(salesdetails.Expected_Shipment_Date,"") + ". Please find the sales order attached for your reference. For any questions, feel free to contact us at " + " +91 7456973939. "+ " Thanks again for choosing Carrier Wheels Pvt. Ltd.! ";
		//info mesg;
		whatsapp_manager.WhatsappMsg_ERP_Salesorder_Acknowledgment(mobileno.tostring(),somap);
		sendmail
		[
			from :"erp@carrierwheels.com"
			to :"parthasarathy.m@synprosoft.com"
			subject :"sales order acknowledgement  " + mobileno
			message :"sales order acknowledgement email" + mobileno + "--- " + somap
		]
	}
}

//Button code
void SalesOrder.Send_Whatsapp_SO_Acknowledment(int ID)
{
	openUrl("#Form:Sales_Order_Acknowledgement?Sales_Order_recid=" + input.ID + "&Form_Mode=Whatsapp","popup window","height=<200>,width=<200>");
}
content_copyCOPY