</tr> <?php } ?> <?php } if ($billingaddresses->debitor_money_transfer_number > 0) { ?> <tr> <td width="100" align="left"><label for="debitor_money_transfer_number"><?php echo JText::_('COM_REDSHOP_DEBITOR_MONEY_TRANSFER_NUMBER'); ?> :</label></td> <td><?php echo $billingaddresses->debitor_money_transfer_number; ?> </td> </tr> <?php } if ($billingaddresses->is_company == 1) { echo $extrafields = $extra_field->list_all_field_display(8, $billingaddresses->users_info_id); } else { echo $extrafields = $extra_field->list_all_field_display(7, $billingaddresses->users_info_id); } ?> </table>
$thumbtype = "manufacturer/"; } $thumbUrl = RedShopHelperImages::getImagePath($media_image[$m]->media_name, '', 'thumb', $thumbtype, $mw_thumb, $mh_thumb, USE_IMAGE_SIZE_SWAPPING); $thum_image = "<a title='" . $altText . "' class=\"modal\" href='" . REDSHOP_FRONT_IMAGES_ABSPATH . $maintype . $media_image[$m]->media_name . "' rel=\"{handler: 'image', size: {}}\">\n\t\t\t\t<img alt='" . $altText . "' title='" . $altText . "' src='" . $thumbUrl . "'></a>"; } } $template_desc = str_replace("{manufacturer_image}", $thum_image, $template_desc); } $manlink = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $row->manufacturer_id . '&Itemid=' . $Itemid); $manproducts = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=products&mid=' . $row->manufacturer_id . '&Itemid=' . $Itemid); $template_desc = str_replace("{manufacturer_name}", $row->manufacturer_name, $template_desc); // Replace Manufacturer URL if (strstr($template_desc, "{manufacturer_url}")) { $manufacturer_url = "<a href='" . $row->manufacturer_url . "'>" . $row->manufacturer_url . "</a>"; $template_desc = str_replace("{manufacturer_url}", $manufacturer_url, $template_desc); } // Extra field display $extraFieldName = $extraField->getSectionFieldNameArray(10, 1, 1); $template_desc = $producthelper->getExtraSectionTag($extraFieldName, $row->manufacturer_id, "10", $template_desc); $template_desc = str_replace("{manufacturer_description}", $row->manufacturer_desc, $template_desc); if (strstr($template_desc, "{manufacturer_extra_fields}")) { $manufacturer_extra_fields = $extra_field->list_all_field_display(10, $row->manufacturer_id); $template_desc = str_replace("{manufacturer_extra_fields}", $manufacturer_extra_fields, $template_desc); } $template_desc = str_replace("{manufacturer_link}", $manlink, $template_desc); $template_desc = str_replace("{manufacturer_allproductslink}", $manproducts, $template_desc); $template_desc = str_replace("{manufacturer_allproductslink_lbl}", JText::_('COM_REDSHOP_MANUFACTURER_ALLPRODUCTSLINK_LBL'), $template_desc); $template_desc = $redTemplate->parseredSHOPplugin($template_desc); echo "<div style='float:left;'>"; echo eval("?>" . $template_desc . "<?php "); echo "</div>";
} // For redCRM user bulk order functionality if (isset($this->userdata->debitor_id) && $this->userdata->debitor_id != "" && $this->userdata->debitor_id != 0) { $bulkorder_link = "<a href='" . JRoute::_('index.php?option=com_redcrm&view=bulk_order&Itemid=' . $Itemid) . "'>" . JText::_('COM_REDSHOP_BULK_ORDER_LINK') . "</a>"; $bulkorder_image = '<img src="' . $url . 'administrator/components/com_redcrm/assets/images/bulk_order16.png" align="absmiddle">'; $template_desc = str_replace('{bulkorder_image}', $bulkorder_image, $template_desc); $template_desc = str_replace('{bulkorder_title}', JText::_('COM_REDSHOP_BULK_ORDER'), $template_desc); $template_desc = str_replace('{bulkorder_link}', $bulkorder_link, $template_desc); } else { $template_desc = str_replace('{bulkorder_image}', "", $template_desc); $template_desc = str_replace('{bulkorder_title}', "", $template_desc); $template_desc = str_replace('{bulkorder_link}', "", $template_desc); } $is_company = $this->userdata->is_company; if ($is_company == 1) { $extrafields = $extra_field->list_all_field_display(8, $this->userdata->users_info_id); } else { $extrafields = $extra_field->list_all_field_display(7, $this->userdata->users_info_id); } $template_desc = str_replace('{customer_custom_fields}', $extrafields, $template_desc); if (strstr($template_desc, "{reserve_discount}")) { $reserve_discount = $model->getReserveDiscount(); $reserve_discount = $producthelper->getProductFormattedPrice($reserve_discount); $template_desc = str_replace('{reserve_discount}', $reserve_discount, $template_desc); $template_desc = str_replace('{reserve_discount_lbl}', JText::_('COM_REDSHOP_RESERVED_DISCOUNT_LBL'), $template_desc); } if (strstr($template_desc, "{order_loop_start}") && strstr($template_desc, "{order_loop_end}")) { $oder_image = '<img src="' . REDSHOP_ADMIN_IMAGES_ABSPATH . 'order16.png" align="absmiddle">'; $template_desc = str_replace('{order_image}', $oder_image, $template_desc); $template_desc = str_replace('{order_title}', JText::_('COM_REDSHOP_ORDER_INFORMATION'), $template_desc); $orderslist = $order_functions->getUserOrderDetails($user->id);
echo $billing->ean_number; ?> </td> </tr> <!-- <tr> <td width="100" align="right"><?php echo JText::_('COM_REDSHOP_REQUISITION_NUMBER'); ?> :</td> <td><?php echo $billing->requisition_number != "" ? $billing->requisition_number : "N/A"; ?> </td> </tr>--> <?php $fields = $extra_field->list_all_field_display(8, $billing->users_info_id); } else { $fields = $extra_field->list_all_field_display(7, $billing->users_info_id); } echo $fields; ?> <tr> <td colspan="2"> <?php if (!$tmpl) { ?> <a class="modal" href="index.php?tmpl=component&option=com_redshop&view=order_detail&layout=billing&cid[]=<?php echo $order_id; ?> "
$billadd .= JText::_('COM_REDSHOP_YES'); } else { $billadd .= JText::_('COM_REDSHOP_NO'); } $billadd .= ' <br>'; } $billadd .= JText::_("USER_TAX_EXEMPT_REQUEST_LBL") . ' : '; if ($quotationDetail->requesting_tax_exempt == 1) { $billadd .= JText::_('COM_REDSHOP_YES'); } else { $billadd .= JText::_('COM_REDSHOP_NO'); } $billadd .= ' <br>'; } if ($quotationDetail->is_company == 1) { $billadd .= $extra_field->list_all_field_display(8, $quotationDetail->user_info_id, 1); } else { $billadd .= $extra_field->list_all_field_display(7, $quotationDetail->user_info_id, 1); } $billadd .= ' <br>'; } else { if (!isset($quotationDetail->user_info_id)) { $quotationDetail->user_info_id = 0; } if ($quotationDetail->quotation_email != "") { $billadd .= JText::_("COM_REDSHOP_EMAIL") . ' : ' . $quotationDetail->quotation_email . '<br>'; } } if (strstr($quotation_template, "{quotation_custom_field_list}")) { $billadd .= $extra_field->list_all_field_display(16, $quotationDetail->user_info_id, 1, $quotationDetail->quotation_email); $quotation_template = str_replace("{quotation_custom_field_list}", "", $quotation_template);
public function sendQuotationMail($quotation_id, $status = 0) { $uri = JURI::getInstance(); $url = $uri->root(); $redconfig = new Redconfiguration(); $producthelper = new producthelper(); $extra_field = new extra_field(); $quotationHelper = new quotationHelper(); $config = JFactory::getConfig(); $mailinfo = $this->getMailtemplate(0, "quotation_mail"); $mailbcc = array(); if (count($mailinfo) > 0) { $message = $mailinfo[0]->mail_body; $subject = $mailinfo[0]->mail_subject; if (trim($mailinfo[0]->mail_bcc) != "") { $mailbcc = explode(",", $mailinfo[0]->mail_bcc); } } else { return false; } $template_start = ""; $template_end = ""; $template_middle = ""; $cart = ''; $template_sdata = explode('{product_loop_start}', $message); $extraField = new extraField(); $fieldArray = $extraField->getSectionFieldList(17, 0, 0); if (count($template_sdata) > 0) { $template_start = $template_sdata[0]; if (count($template_sdata) > 1) { $template_edata = explode('{product_loop_end}', $template_sdata[1]); if (count($template_edata) > 1) { $template_end = $template_edata[1]; } if (count($template_edata) > 0) { $template_middle = $template_edata[0]; } } } $row = $quotationHelper->getQuotationDetail($quotation_id); if (count($row) <= 0) { return false; } $rowitem = $quotationHelper->getQuotationProduct($quotation_id); for ($i = 0; $i < count($rowitem); $i++) { $product_id = $rowitem[$i]->product_id; $product = $producthelper->getProductById($product_id); $product_name = "<div class='product_name'>" . $rowitem[$i]->product_name . "</div>"; $product_total_price = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_price * $rowitem[$i]->product_quantity) . "</div>"; $product_price = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_price) . "</div>"; $product_price_excl_vat = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_excl_price) . "</div>"; $product_quantity = '<div class="update_cart">' . $rowitem[$i]->product_quantity . '</div>'; $product_total_price_excl_vat = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_excl_price * $rowitem[$i]->product_quantity) . "</div>"; $cart_mdata = $template_middle; $wrapper_name = ""; if ($rowitem[$i]->product_wrapperid) { $wrapper = $producthelper->getWrapper($product_id, $rowitem[$i]->product_wrapperid); if (count($wrapper) > 0) { $wrapper_name = $wrapper[0]->wrapper_name; } $wrapper_name = JText::_('COM_REDSHOP_WRAPPER') . ": " . $wrapper_name; } $product_image_path = ''; if ($product->product_full_image) { if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) { $product_image_path = $product->product_full_image; } else { if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) { $product_image_path = PRODUCT_DEFAULT_IMAGE; } } } else { if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) { $product_image_path = PRODUCT_DEFAULT_IMAGE; } } if ($product_image_path) { $thumbUrl = RedShopHelperImages::getImagePath($product_image_path, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING); $product_image = "<div class='product_image'><img src='" . $thumbUrl . "'></div>"; } else { $product_image = "<div class='product_image'></div>"; } $cart_mdata = str_replace("{product_name}", $product_name, $cart_mdata); $cart_mdata = str_replace("{product_s_desc}", $product->product_s_desc, $cart_mdata); $cart_mdata = str_replace("{product_thumb_image}", $product_image, $cart_mdata); $product_note = "<div class='product_note'>" . $wrapper_name . "</div>"; $cart_mdata = str_replace("{product_wrapper}", $product_note, $cart_mdata); $product_userfields = $quotationHelper->displayQuotationUserfield($rowitem[$i]->quotation_item_id, 12); $cart_mdata = str_replace("{product_userfields}", $product_userfields, $cart_mdata); $cart_mdata = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $cart_mdata); $cart_mdata = str_replace("{product_number}", $product->product_number, $cart_mdata); $cart_mdata = str_replace("{product_attribute}", $producthelper->makeAttributeQuotation($rowitem[$i]->quotation_item_id, 0, $rowitem[$i]->product_id, $row->quotation_status), $cart_mdata); $cart_mdata = str_replace("{product_accessory}", $producthelper->makeAccessoryQuotation($rowitem[$i]->quotation_item_id, $row->quotation_status), $cart_mdata); // ProductFinderDatepicker Extra Field Start $cart_mdata = $producthelper->getProductFinderDatepickerValue($cart_mdata, $product_id, $fieldArray); // ProductFinderDatepicker Extra Field End if ($row->quotation_status == 1 && !SHOW_QUOTATION_PRICE) { $cart_mdata = str_replace("{product_price_excl_vat}", "", $cart_mdata); $cart_mdata = str_replace("{product_price}", " ", $cart_mdata); $cart_mdata = str_replace("{product_total_price}", " ", $cart_mdata); $cart_mdata = str_replace("{product_subtotal_excl_vat}", " ", $cart_mdata); } else { $cart_mdata = str_replace("{product_price_excl_vat}", $product_price_excl_vat, $cart_mdata); $cart_mdata = str_replace("{product_price}", $product_price, $cart_mdata); $cart_mdata = str_replace("{product_total_price}", $product_total_price, $cart_mdata); $cart_mdata = str_replace("{product_subtotal_excl_vat}", $product_total_price_excl_vat, $cart_mdata); } $cart_mdata = str_replace("{product_quantity}", $product_quantity, $cart_mdata); $cart .= $cart_mdata; } $message = $template_start . $cart . $template_end; $search[] = "{quotation_note}"; $replace[] = $row->quotation_note; $search[] = "{shopname}"; $replace[] = SHOP_NAME; $search[] = "{quotation_id}"; $replace[] = $row->quotation_id; $search[] = "{quotation_number}"; $replace[] = $row->quotation_number; $search[] = "{quotation_date}"; $replace[] = $redconfig->convertDateFormat($row->quotation_cdate); $search[] = "{quotation_status}"; $replace[] = $quotationHelper->getQuotationStatusName($row->quotation_status); $billadd = ''; if ($row->user_id != 0) { $message = $this->_carthelper->replaceBillingAddress($message, $row); } else { if ($row->quotation_email != "") { $billadd .= JText::_("COM_REDSHOP_EMAIL") . ' : ' . $row->quotation_email . '<br />'; } $message = str_replace("{billing_address_information_lbl}", JText::_('COM_REDSHOP_BILLING_ADDRESS_INFORMATION_LBL'), $message); if (strstr($message, "{quotation_custom_field_list}")) { $billadd .= $extra_field->list_all_field_display(16, $row->user_info_id, 1, $row->quotation_email); $message = str_replace("{quotation_custom_field_list}", "", $message); } else { $message = $extra_field->list_all_field_display(16, $row->user_info_id, 1, $row->quotation_email, $message); } } $search[] = "{billing_address}"; $replace[] = $billadd; $total_lbl = ''; $subtotal_lbl = ''; $vat_lbl = ''; if ($row->quotation_status != 1 || $row->quotation_status == 1 && SHOW_QUOTATION_PRICE) { $total_lbl = JText::_('COM_REDSHOP_TOTAL_LBL'); $subtotal_lbl = JText::_('COM_REDSHOP_QUOTATION_SUBTOTAL'); $vat_lbl = JText::_('COM_REDSHOP_QUOTATION_VAT'); } $message = str_replace('{total_lbl}', $total_lbl, $message); $message = str_replace('{quotation_subtotal_lbl}', $subtotal_lbl, $message); $message = str_replace('{quotation_vat_lbl}', $vat_lbl, $message); $message = $this->_carthelper->replaceLabel($message); $search[] = "{quotation_note}"; $replace[] = $row->quotation_note; if ($row->quotation_status == 1 && !SHOW_QUOTATION_PRICE) { $quotation_subtotal = " "; $quotation_total = " "; $quotation_discount = " "; $quotation_vat = " "; $quotation_subtotal_excl_vat = ""; } else { $tax = $row->quotation_tax; if (VAT_RATE_AFTER_DISCOUNT) { $Discountvat = VAT_RATE_AFTER_DISCOUNT * $row->quotation_discount / (1 + VAT_RATE_AFTER_DISCOUNT); $row->quotation_discount = $row->quotation_discount - $Discountvat; $tax = $tax - $Discountvat; } if (VAT_RATE_AFTER_DISCOUNT) { $sp_discount = $row->quotation_special_discount * ($row->quotation_subtotal + $row->quotation_tax) / 100; $Discountspvat = $sp_discount * VAT_RATE_AFTER_DISCOUNT / (1 + VAT_RATE_AFTER_DISCOUNT); $DiscountspWithotVat = $sp_discount - $Discountspvat; $row->quotation_discount = $row->quotation_discount + $DiscountspWithotVat; $tax = $tax - $Discountspvat; } $quotation_subtotal_excl_vat = $producthelper->getProductFormattedPrice($row->quotation_subtotal); $quotation_subtotal_minus_discount = $producthelper->getProductFormattedPrice($row->quotation_subtotal - $row->quotation_discount); $quotation_subtotal = $producthelper->getProductFormattedPrice($row->quotation_subtotal); $quotation_total = $producthelper->getProductFormattedPrice($row->quotation_total); $quotation_discount = $producthelper->getProductFormattedPrice($row->quotation_discount); $quotation_vat = $producthelper->getProductFormattedPrice($row->quotation_tax); } $search[] = "{quotation_subtotal}"; $replace[] = $quotation_subtotal; $search[] = "{quotation_total}"; $replace[] = $quotation_total; $search[] = "{quotation_subtotal_minus_discount}"; $replace[] = $quotation_subtotal_minus_discount; $search[] = "{quotation_subtotal_excl_vat}"; $replace[] = $quotation_subtotal_excl_vat; $search[] = "{quotation_discount}"; $replace[] = $quotation_discount; $search[] = "{quotation_vat}"; $replace[] = $quotation_vat; $quotationdetailurl = JURI::root() . 'index.php?option=com_redshop&view=quotation_detail&quoid=' . $quotation_id . '&encr=' . $row->quotation_encrkey; $search[] = "{quotation_detail_link}"; $replace[] = "<a href='" . $quotationdetailurl . "'>" . JText::_("COM_REDSHOP_QUOTATION_DETAILS") . "</a>"; $message = str_replace($search, $replace, $message); $message = $this->imginmail($message); $email = $row->quotation_email; // Set the e-mail parameters $from = $config->getValue('mailfrom'); $fromname = $config->getValue('fromname'); $body = $message; $subject = str_replace($search, $replace, $subject); // Send the e-mail if ($email != "") { $bcc = null; if (trim(ADMINISTRATOR_EMAIL) != '') { $bcc = explode(",", trim(ADMINISTRATOR_EMAIL)); } $bcc = array_merge($bcc, $mailbcc); if (!JUtility::sendMail($from, $fromname, $email, $subject, $body, 1, null, $bcc)) { $this->setError('ERROR_SENDING_QUOTATION_MAIL'); } } if ($status != 0) { $quotationHelper->updateQuotationStatus($quotation_id, $status); } return true; }
echo $this->quotationuser->vat_number; ?> </td> </tr> <tr> <td><?php echo JText::_('COM_REDSHOP_TAX_EXEMPT'); ?> :</td> <td><?php echo $this->quotationuser->tax_exempt; ?> </td> </tr> <?php $fields = $extra_field->list_all_field_display(8, $quotation->user_info_id); } else { $fields = $extra_field->list_all_field_display(7, $quotation->user_info_id); } echo $fields; } else { if (!isset($quotation->user_info_id)) { $quotation->user_info_id = 0; } ?> <tr> <td><?php echo JText::_('COM_REDSHOP_EMAIL'); ?> :</td> <td><?php