1/ C'ets plutôt embêttant et même problématique d'un point de vue comptable. Je propose d'ores et déjà des produtis qui ne seront en stock qu'en février 2008. Si un client m'achète un de ces produits et le paie par paypal, je ne peux pas ne le déclarer qu'en 2008 (problème de césure comptable). S'il n'est aps possible de modifier cela, ej pense que je vais em contenter de laisser le statut en "attente de paiement" pour ce moduel de paiement puis mettre à jour moi-même poru attribuer un numéro de facture. C'est déjà ce que je fais mais je prends parfois 2-3 jour spour mettre le statut à jour et j'ai des clients qui en comprennent pas pourquoi le statut reste "en attente de paiement" alors qu'ils otn déjà payé...
2/ Je n'ai encore fait qu'un petit test mais cela semble fonctionner. Voici comment j'ai modifié la premièr epartie de code relative à la contrib BATCH UPDATE STATUS dans admin/order.php
CODE
// Start Batch Update Status v0.4
if (isset($HTTP_POST_VARS['submit'])){
if (($HTTP_POST_VARS['submit'] == BUS_SUBMIT)&&(isset($HTTP_POST_VARS['new_status']))){ // Fair enough, let's update;)
$status = tep_db_prepare_input($HTTP_POST_VARS['new_status']);
if ($status == '') { // New status not selected
tep_redirect(tep_href_link(FILENAME_ORDERS),tep_get_all_get_params());
}
foreach ($HTTP_POST_VARS['update_oID'] as $this_orderID){
$order_updated = false;
$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, orders_numero_facture, orders_date_facture from " . TABLE_ORDERS . " where orders_id = '" . (int)$this_orderID . "'");
$check_status = tep_db_fetch_array($check_status_query);
$comments = "Batch status update";
if ($check_status['orders_status'] != $status) {
tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$this_orderID . "'");
if (AUTORISE_NUMERO_FACTURE == 'true') {
if (tep_db_input($status) == STATUT_GENERANT_FACTURE) {
$check_invoice_counter_query = tep_db_query("select invoice_counter from " . TABLE_INVOICE_COUNTER . " where invoice_id = '1'");
$check_invoice_counter = tep_db_fetch_array($check_invoice_counter_query);
$numero_facture = $check_invoice_counter['invoice_counter'] + 1;
if ($check_status['orders_numero_facture'] == 0) {
tep_db_query("update " . TABLE_INVOICE_COUNTER . " set invoice_counter = '" . $numero_facture . "' where invoice_id = '1'");
tep_db_query("update " . TABLE_ORDERS . " set orders_numero_facture = '" . $numero_facture . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
tep_db_query("update " . TABLE_ORDERS . " set orders_date_facture = now() where orders_id = '" . (int)$oID . "'");
} else {
$messageStack->add_session(WARNING_ORDER_WITH_NUMERO, 'warning');
}
}
}
$customer_notified ='0';
if (isset($HTTP_POST_VARS['notify'])) {
$notify_comments = '';
$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $this_orderID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $this_orderID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
$customer_notified = '1';
}
tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$this_orderID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");
$order_updated = true;
}
if ($order_updated == true) {
$messageStack->add_session("Order $this_orderID updated.", 'success');
} else {
$messageStack->add_session("Order $this_orderID not updated.", 'warning');
}
} // End foreach ID loop
}
tep_redirect(tep_href_link(FILENAME_ORDERS),tep_get_all_get_params());
}
// End Batch Update Status v0.4
if (isset($HTTP_POST_VARS['submit'])){
if (($HTTP_POST_VARS['submit'] == BUS_SUBMIT)&&(isset($HTTP_POST_VARS['new_status']))){ // Fair enough, let's update;)
$status = tep_db_prepare_input($HTTP_POST_VARS['new_status']);
if ($status == '') { // New status not selected
tep_redirect(tep_href_link(FILENAME_ORDERS),tep_get_all_get_params());
}
foreach ($HTTP_POST_VARS['update_oID'] as $this_orderID){
$order_updated = false;
$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, orders_numero_facture, orders_date_facture from " . TABLE_ORDERS . " where orders_id = '" . (int)$this_orderID . "'");
$check_status = tep_db_fetch_array($check_status_query);
$comments = "Batch status update";
if ($check_status['orders_status'] != $status) {
tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$this_orderID . "'");
if (AUTORISE_NUMERO_FACTURE == 'true') {
if (tep_db_input($status) == STATUT_GENERANT_FACTURE) {
$check_invoice_counter_query = tep_db_query("select invoice_counter from " . TABLE_INVOICE_COUNTER . " where invoice_id = '1'");
$check_invoice_counter = tep_db_fetch_array($check_invoice_counter_query);
$numero_facture = $check_invoice_counter['invoice_counter'] + 1;
if ($check_status['orders_numero_facture'] == 0) {
tep_db_query("update " . TABLE_INVOICE_COUNTER . " set invoice_counter = '" . $numero_facture . "' where invoice_id = '1'");
tep_db_query("update " . TABLE_ORDERS . " set orders_numero_facture = '" . $numero_facture . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
tep_db_query("update " . TABLE_ORDERS . " set orders_date_facture = now() where orders_id = '" . (int)$oID . "'");
} else {
$messageStack->add_session(WARNING_ORDER_WITH_NUMERO, 'warning');
}
}
}
$customer_notified ='0';
if (isset($HTTP_POST_VARS['notify'])) {
$notify_comments = '';
$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $this_orderID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $this_orderID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
$customer_notified = '1';
}
tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$this_orderID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");
$order_updated = true;
}
if ($order_updated == true) {
$messageStack->add_session("Order $this_orderID updated.", 'success');
} else {
$messageStack->add_session("Order $this_orderID not updated.", 'warning');
}
} // End foreach ID loop
}
tep_redirect(tep_href_link(FILENAME_ORDERS),tep_get_all_get_params());
}
// End Batch Update Status v0.4
3/ Je vais essayer de chipoter cela plus tard
