mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-10 00:34:17 -04:00
* fix: Add missing $img_tag variable in Sales::getSendPdf() The receipt_email.php view expects $img_tag but getSendPdf() wasn't passing it. This caused 'Undefined variable $img_tag' error when sending receipt emails. Closes #4514 * refactor: Extract img_tag building into helper method Refactored duplicate img_tag building code into _build_img_tag helper method. Both getSendPdf and getSendReceipt now use this shared method. * refactor: Move logo-related methods to Email_lib Moved buildLogoImgTag and getLogoMimeType methods to Email_lib library where they logically belong alongside email-related functionality. This removes duplicate code and centralizes email-related helpers. Sales controller now uses email_lib->buildLogoImgTag() and email_lib->getLogoMimeType() instead of private methods. * fix: Address CodeRabbit review comments - buildLogoImgTag now uses getLogoMimeType for actual MIME type instead of hardcoding image/png - getLogoMimeType returns empty string instead of false for consistency - Consolidated logo path/exists check logic between both methods --------- Co-authored-by: Ollama <ollama@steganos.dev>