diff --git a/catalog/account_history.php b/catalog/account_history.php index 70a03f5..0c53a69 100644 --- a/catalog/account_history.php +++ b/catalog/account_history.php @@ -62,7 +62,7 @@ $orders_total = tep_count_customer_orders(); if ($orders_total > 0) { - $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC"; + $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, o.rdx_referencia_cliente as referencia_cliente, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC"; $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY); $history_query = tep_db_query($history_split->sql_query); $i = 0; @@ -90,6 +90,7 @@ ' . TEXT_ORDER_NUMBER . ' ' . $history['orders_id']; ?> ' . TEXT_ORDER_DATE . ' ' . tep_date_long($history['date_purchased']) ?> ' . TEXT_ORDER_PRODUCTS . ' ' . $products['count'] ?> + ' . TEXT_REF_CLIENTE . ' ' . $history['referencia_cliente']; ?> ' . TEXT_ORDER_STATUS . ' ' . $history['orders_status_name']; ?> ' . Ver /*tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW)*/ . ''; ?> diff --git a/catalog/account_history_info.php b/catalog/account_history_info.php index e6ac20a..4390b03 100644 --- a/catalog/account_history_info.php +++ b/catalog/account_history_info.php @@ -109,13 +109,24 @@ if (tep_not_null($order->delivery['shipdate'])){ ?> - +
delivery['shipdate']); ?> info['referencia_cliente'])){ +?> + +
+ + + info['referencia_cliente']; ?> + + diff --git a/catalog/admin/includes/languages/english/orders_status.php b/catalog/admin/includes/languages/english/orders_status.php index 4f44e17..f1e3e50 100644 --- a/catalog/admin/includes/languages/english/orders_status.php +++ b/catalog/admin/includes/languages/english/orders_status.php @@ -26,4 +26,8 @@ define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Delete Orders Status'); define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default order status can not be removed. Please set another order status as default, and try again.'); define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This order status is currently used in orders.'); define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This order status is currently used in the order status history.'); + +// Begin Rodax Software +define('TEXT_REF_CLIENTE', 'Ref. cliente:'); +// End Rodax Software ?> \ No newline at end of file diff --git a/catalog/admin/includes/languages/espanol/orders_status.php b/catalog/admin/includes/languages/espanol/orders_status.php index 46cb70b..6ed6a09 100644 --- a/catalog/admin/includes/languages/espanol/orders_status.php +++ b/catalog/admin/includes/languages/espanol/orders_status.php @@ -26,4 +26,8 @@ define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Eliminar Estado Pedido'); define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: El estado de pedido por defecto no se puede eliminar. Establezca otro estado de pedido predeterminado y pruebe de nuevo.'); define('ERROR_STATUS_USED_IN_ORDERS', 'Error: Este estado de pedido esta siendo usado actualmente.'); define('ERROR_STATUS_USED_IN_HISTORY', 'Error: Este estado de pedido se esta usando en algun histórico de algun pedido.'); + +// Begin Rodax Software +define('TEXT_REF_CLIENTE', 'Ref. cliente:'); +// End Rodax Software ?> \ No newline at end of file diff --git a/catalog/admin/includes/languages/german/orders_status.php b/catalog/admin/includes/languages/german/orders_status.php index 3d0ae58..a9d1325 100644 --- a/catalog/admin/includes/languages/german/orders_status.php +++ b/catalog/admin/includes/languages/german/orders_status.php @@ -26,4 +26,8 @@ define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Bestellstatus löschen'); define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Fehler: Der Standard-Bestellstatus kann nicht gelöscht werden. Bitte definieren Sie einen neuen Standard-Bestellstatus und wiederholen Sie den Vorgang.'); define('ERROR_STATUS_USED_IN_ORDERS', 'Fehler: Dieser Bestellstatus wird zur Zeit noch bei den Bestellungen verwendet.'); define('ERROR_STATUS_USED_IN_HISTORY', 'Fehler: Dieser Bestellstatus wird zur Zeit noch in der Bestellhistorie verwendet.'); + +// Begin Rodax Software +define('TEXT_REF_CLIENTE', 'Ref. cliente:'); +// End Rodax Software ?> \ No newline at end of file diff --git a/catalog/admin/orders.php b/catalog/admin/orders.php index 6b45693..0cc9c04 100644 --- a/catalog/admin/orders.php +++ b/catalog/admin/orders.php @@ -33,6 +33,8 @@ $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $status = tep_db_prepare_input($HTTP_POST_VARS['status']); $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); + + //$referencia_cliente = tep_db_prepare_input($HTTP_POST_VARS['referencia_cliente']); $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); @@ -55,7 +57,7 @@ $customer_notified = '1'; } - tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')"); + tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, rdx_referencia_cliente) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "', '" . tep_db_input($referencia_cliente) . "')"); $order_updated = true; } diff --git a/catalog/checkout_confirmation.php b/catalog/checkout_confirmation.php index d2cda86..abe6ef0 100644 --- a/catalog/checkout_confirmation.php +++ b/catalog/checkout_confirmation.php @@ -49,6 +49,12 @@ tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error=expired_arrival_date', 'SSL')); //ERR MSG ON NEXT PAGE } } + + // Referencia de cliente + if (!tep_session_is_registered('referencia_cliente')) tep_session_register('referencia_cliente'); + if (tep_not_null($HTTP_POST_VARS['referencia_cliente'])) { + $referencia_cliente = tep_db_prepare_input($HTTP_POST_VARS['referencia_cliente']); + } // End Rodax Software if (!tep_session_is_registered('payment')) tep_session_register('payment'); @@ -56,7 +62,7 @@ if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { - $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); + $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } // load the selected payment module @@ -161,12 +167,13 @@ info['shipping_method']; ?> + delivery['shipdate'])){ ?> - (' . TEXT_EDIT . ')'; ?> +
(' . TEXT_EDIT . ')'; ?> delivery['shipdate']); ?> @@ -174,8 +181,28 @@ + +info['referencia_cliente'])) { +?> + +
(' . TEXT_EDIT . ')'; ?> + + + info['referencia_cliente']; ?> + + + + + + + $order->info['order_status'], 'currency' => $order->info['currency'], 'rdx_ship_date' => $_SESSION['shipdate'], + 'rdx_referencia_cliente' => $_SESSION['referencia_cliente'], 'currency_value' => $order->info['currency_value']); tep_db_perform(TABLE_ORDERS, $sql_data_array); $insert_id = tep_db_insert_id(); @@ -265,11 +266,19 @@ if (isset($_SESSION['shipdate'])) { tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; // Begin Rodax Software + // shipdate if(isset($_SESSION["shipdate"])) { $email_order.="\n" . EMAIL_TEXT_ARRIVAL_DATE . "\n" . EMAIL_SEPARATOR . "\n" . strftime("%A, %d de %B de %Y",$_SESSION["shipdate"]) . "\n\n"; } + + // referencia de cliente + if(isset($_SESSION["referencia_cliente"])) { + $email_order.="\n" . EMAIL_TEXT_REFERENCIA_CLIENTE . "\n" . + EMAIL_SEPARATOR . "\n" . $_SESSION["referencia_cliente"] . "\n\n"; + } + // End Rodax Software } @@ -306,6 +315,7 @@ if (isset($_SESSION['shipdate'])) { tep_session_unregister('comments'); // Begin Rodax Software tep_session_unregister('shipdate'); // shipdate + tep_session_unregister('referencia_cliente'); // referencia de cliente // End Rodax Software diff --git a/catalog/checkout_shipping.php b/catalog/checkout_shipping.php index e43bfbb..50f83fd 100644 --- a/catalog/checkout_shipping.php +++ b/catalog/checkout_shipping.php @@ -104,7 +104,7 @@ unset($_GET['date']); } tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - } + } // End Rodax Software // process the selected shipping method @@ -114,6 +114,12 @@ $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } + // Referencia de cliente + if (!tep_session_is_registered('referencia_cliente')) tep_session_register('referencia_cliente'); + if (tep_not_null($HTTP_POST_VARS['referencia_cliente'])) { + $referencia_cliente = tep_db_prepare_input($HTTP_POST_VARS['referencia_cliente']); + } + if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { @@ -499,6 +505,37 @@ if(isset($_GET['date'])){ + + + + + + + +
:
+ + + + + + + +
+ + + + +
+
+ + + + + + + diff --git a/catalog/includes/classes/order.php b/catalog/includes/classes/order.php index 0686020..7818d49 100644 --- a/catalog/includes/classes/order.php +++ b/catalog/includes/classes/order.php @@ -32,7 +32,7 @@ $order_id = tep_db_prepare_input($order_id); - $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_telephone, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, rdx_ship_date from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); + $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_telephone, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, rdx_ship_date, rdx_referencia_cliente from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $order = tep_db_fetch_array($order_query); $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order"); @@ -60,6 +60,7 @@ 'date_purchased' => $order['date_purchased'], 'orders_status' => $order_status['orders_status_name'], 'last_modified' => $order['last_modified'], + 'referencia_cliente' => $order['rdx_referencia_cliente'], 'total' => strip_tags($order_total['text']), 'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']))); @@ -161,6 +162,7 @@ 'shipping_cost' => $shipping['cost'], 'subtotal' => 0, 'tax' => 0, + 'referencia_cliente' => $_SESSION['referencia_cliente'], //Rodax Software 'tax_groups' => array(), 'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : '')); diff --git a/catalog/includes/languages/english/account_history.php b/catalog/includes/languages/english/account_history.php index 675722b..2f380dd 100644 --- a/catalog/includes/languages/english/account_history.php +++ b/catalog/includes/languages/english/account_history.php @@ -25,4 +25,8 @@ define('TEXT_ORDER_COST', 'Order Cost:'); define('TEXT_VIEW_ORDER', 'View Order'); define('TEXT_NO_PURCHASES', 'You have not yet made any purchases.'); + +// Begin Rodax Software +define('TEXT_REF_CLIENTE', 'Ref. cliente:'); +// End Rodax Software ?> diff --git a/catalog/includes/languages/english/account_history_info.php b/catalog/includes/languages/english/account_history_info.php index 0755017..890820a 100644 --- a/catalog/includes/languages/english/account_history_info.php +++ b/catalog/includes/languages/english/account_history_info.php @@ -41,5 +41,6 @@ define('HEADING_DOWNLOAD', 'Download links'); // Begin Rodax Software define('HEADING_ARRIVAL_DATE','Shipment Arrival Date'); +define('HEADING_REFERENCIA_CLIENTE','Referencia de su cliente'); // End Rodax Software ?> diff --git a/catalog/includes/languages/english/checkout_confirmation.php b/catalog/includes/languages/english/checkout_confirmation.php index 7820dbf..42fc716 100644 --- a/catalog/includes/languages/english/checkout_confirmation.php +++ b/catalog/includes/languages/english/checkout_confirmation.php @@ -30,5 +30,6 @@ define('TEXT_EDIT', 'Edit'); // Begin Rodax Software define('HEADING_ARRIVAL_DATE','Arrival Date'); +define('HEADING_REFERENCIA_CLIENTE','Referencia de su cliente'); // End Rodax Software ?> diff --git a/catalog/includes/languages/english/checkout_shipping.php b/catalog/includes/languages/english/checkout_shipping.php index 636e45d..003243f 100644 --- a/catalog/includes/languages/english/checkout_shipping.php +++ b/catalog/includes/languages/english/checkout_shipping.php @@ -36,5 +36,6 @@ define('ERROR_HEADING','Error'); define('ERROR_EXPIRED_ARRIVAL_DATE','Your selected arrival date is no longer valid. Please select another.'); define('ERROR_NO_ARRIVAL_DATE','Please select a date for your shipment to arrive on.'); define('ERROR_NO_SHIPMENT_METHOD','Please select a shipment method.'); +define('TABLE_HEADING_REFERENCIA_CLIENTE', 'Referencia de su cliente (opcional)'); // End Rodax Software ?> diff --git a/catalog/includes/languages/espanol/account_history.php b/catalog/includes/languages/espanol/account_history.php index 3e9a187..9a73328 100644 --- a/catalog/includes/languages/espanol/account_history.php +++ b/catalog/includes/languages/espanol/account_history.php @@ -25,4 +25,8 @@ define('TEXT_ORDER_COST', 'Precio:'); define('TEXT_VIEW_ORDER', 'Ver pedido'); define('TEXT_NO_PURCHASES', 'No ha realizado ningun pedido aún.'); + +// Begin Rodax Software +define('TEXT_REF_CLIENTE', 'Ref. cliente:'); +// End Rodax Software ?> diff --git a/catalog/includes/languages/espanol/account_history_info.php b/catalog/includes/languages/espanol/account_history_info.php index 2a98198..1c401f1 100644 --- a/catalog/includes/languages/espanol/account_history_info.php +++ b/catalog/includes/languages/espanol/account_history_info.php @@ -41,6 +41,7 @@ define('HEADING_DOWNLOAD', 'Descarga tus productos aqui'); // Begin Rodax Software define('HEADING_ARRIVAL_DATE','Fecha de entrega prevista'); +define('HEADING_REFERENCIA_CLIENTE','Referencia de su cliente'); // End Rodax Software ?> diff --git a/catalog/includes/languages/espanol/checkout_confirmation.php b/catalog/includes/languages/espanol/checkout_confirmation.php index b14d38d..6866532 100644 --- a/catalog/includes/languages/espanol/checkout_confirmation.php +++ b/catalog/includes/languages/espanol/checkout_confirmation.php @@ -30,6 +30,7 @@ define('TEXT_EDIT', 'Cambiar'); // Begin Rodax Software define('HEADING_ARRIVAL_DATE','Fecha de entrega prevista'); +define('HEADING_REFERENCIA_CLIENTE','Referencia de su cliente'); // End Rodax Software diff --git a/catalog/includes/languages/espanol/checkout_shipping.php b/catalog/includes/languages/espanol/checkout_shipping.php index 6a8a932..0272cda 100644 --- a/catalog/includes/languages/espanol/checkout_shipping.php +++ b/catalog/includes/languages/espanol/checkout_shipping.php @@ -38,6 +38,7 @@ define('ERROR_HEADING','Error'); define('ERROR_EXPIRED_ARRIVAL_DATE','La fecha de entrega no es válida. Por favor, ind&oicute;quela correctamente.'); define('ERROR_NO_ARRIVAL_DATE','Por favor, indique una fecha prevista de entrega.'); define('ERROR_NO_SHIPMENT_METHOD','Please select a shipment method.'); +define('TABLE_HEADING_REFERENCIA_CLIENTE', 'Referencia de su cliente (opcional)'); // End Rodax Software ?> diff --git a/catalog/includes/languages/german/account_history.php b/catalog/includes/languages/german/account_history.php index 6155b24..fdc91a5 100644 --- a/catalog/includes/languages/german/account_history.php +++ b/catalog/includes/languages/german/account_history.php @@ -25,4 +25,8 @@ define('TEXT_ORDER_COST', 'Summe:'); define('TEXT_VIEW_ORDER', 'Bestellung ansehen'); define('TEXT_NO_PURCHASES', 'Sie haben noch keine Bestellungen getätigt.'); + +// Begin Rodax Software +define('TEXT_REF_CLIENTE', 'Ref. cliente:'); +// End Rodax Software ?> diff --git a/catalog/install/luisleon.sql b/catalog/install/luisleon.sql index ebadc8b..ad0100a 100644 --- a/catalog/install/luisleon.sql +++ b/catalog/install/luisleon.sql @@ -316,6 +316,7 @@ CREATE TABLE orders ( currency_value decimal(14,6), rdx_orders_id_local int, rdx_ship_date varchar(10), + rdx_referencia_cliente varchar(255), PRIMARY KEY (orders_id), KEY IDX_ORDERS_ID_LOCAL (rdx_orders_id_local) );