14 if (!defined(
'IN_PEEL')) {
28 if(empty($bill_number_format) && $generate_bill_number_if_empty){
30 $bill_number_format =
vb(
$GLOBALS[
'site_parameters'][
'format_numero_facture']);
32 if (!empty($bill_number_format) && !empty(
$id)) {
35 preg_match_all(
'#\[(.*?)\]#', $bill_number_format, $matches);
36 $tag_names = $matches[1];
37 if (!empty($tag_names)) {
40 foreach($tag_names as $this_key => $this_item) {
42 $temp = explode(
',', $this_item);
44 $tag_full_names_by_colum[$temp[0]][] = $this_item;
45 if (!empty($temp[1])) {
46 $number_zero_fill_by_tag_name[$this_item] = $temp[1];
48 if ($temp[0] !=
'++') {
50 $column_names[] = $temp[0];
53 if (!empty($column_names)) {
54 $custom_template_tags = array();
61 foreach(
$result as $this_column => $this_value) {
62 foreach($tag_full_names_by_colum[$this_column] as $this_tag_name) {
63 if (!empty($number_zero_fill_by_tag_name[$this_tag_name])) {
65 $this_value = str_pad($this_value, intval($number_zero_fill_by_tag_name[$this_tag_name]), 0, STR_PAD_LEFT);
67 $custom_template_tags[$this_tag_name] = $this_value;
75 if (!empty($tag_full_names_by_colum[
'++'])) {
86 $last_number =
$result[
'max_numero_part'];
90 $bill_number_format_incremented_part = 1 + $last_number;
91 foreach($tag_full_names_by_colum[
'++'] as $this_tag_name) {
93 if (!empty($number_zero_fill_by_tag_name[$this_tag_name])) {
95 $bill_number_format_incremented_part = str_pad($bill_number_format_incremented_part, $number_zero_fill_by_tag_name[$this_tag_name], 0, STR_PAD_LEFT);
98 $bill_number_format = $bill_number_format_begin . $bill_number_format_incremented_part . $bill_number_format_end;
102 return $bill_number_format;
117 if(empty(
$data[
'datetime'])) {
118 $data[
'datetime'] = date(
'Y-m-d H:i:s', time());
122 $data[
'orders_id'] = $order_id;
126 $data[
'reference'] = date(
'dmY') .
vb(
$GLOBALS[
'site_parameters'][
'transaction_reference_site_part'],
MDP(3)) . date(
'His') .
MDP(8);
127 foreach(
$data as $item => $value) {
128 if(in_array($item, $allowed_fields)) {
133 unset($sql_set[
'id']);
135 FROM peel_transactions t
139 query(
"UPDATE peel_transactions
140 SET " . implode(
',', $sql_set) .
"
143 query(
"INSERT INTO peel_transactions
144 SET " . implode(
',', $sql_set) .
"");
147 if (!empty($sql_set[
'reimbursement']) &&
vb(
$data[
'MONTANT_DEBIT']) > 0) {
148 $template_technical_code =
'reimbursement_debit';
149 }
elseif (!empty($sql_set[
'cash']) &&
vb(
$data[
'MONTANT_CREDIT']) > 0) {
150 $template_technical_code =
'cash_credit';
151 }
elseif (!empty($sql_set[
'wire']) &&
vb(
$data[
'MONTANT_CREDIT']) > 0) {
152 $template_technical_code =
'wire_credit';
153 }
elseif (!empty($sql_set[
'wire']) &&
vb(
$data[
'MONTANT_DEBIT']) > 0) {
154 $template_technical_code =
'wire_debit';
156 if (!empty($template_technical_code)) {
162 call_module_hook(
'accounting_insert_transaction', array(
'order_id' => $order_id,
'technical_code' => $technical_code,
'data' =>
$data));
178 function update_order_payment_status($order_id, $status_or_is_payment_validated, $allow_update_paid_orders =
true, $statut_livraison_new = null, $delivery_tracking = null, $no_stock_decrement_already_done =
false, $payment_technical_code=null)
181 $sql_set_array = array();
183 if ($status_or_is_payment_validated ===
true) {
185 $statut_paiement_new =
'completed';
187 send_mail_product_download($order_id);
189 }
elseif ($status_or_is_payment_validated ===
false) {
191 $statut_paiement_new =
'cancelled';
192 }
elseif(is_numeric($status_or_is_payment_validated)) {
194 $sql =
'SELECT p.technical_code
195 FROM peel_statut_paiement p
196 WHERE technical_code!="" AND id=' . intval($status_or_is_payment_validated) .
' AND ' .
get_filter_site_cond(
'statut_paiement',
'p');
199 $statut_paiement_new =
$result[
'technical_code'];
201 $payment_status_by_legacy_id_compatibility_array = array(0 =>
"discussed", 1 =>
"pending", 2 =>
"being_checked", 3 =>
"completed", 6 =>
"cancelled", 9 =>
"refunded");
202 $statut_paiement_new = $payment_status_by_legacy_id_compatibility_array[intval($status_or_is_payment_validated)];
204 }
elseif(!empty($status_or_is_payment_validated)) {
205 $statut_paiement_new = $status_or_is_payment_validated;
207 $statut_paiement_new = null;
209 $sql =
'SELECT p.id, p.technical_code
210 FROM peel_statut_paiement p
214 $payment_status_id_by_technical_code_array[
$result[
'technical_code']] = $result[
'id'];
218 if(is_numeric($statut_livraison_new)) {
220 $sql =
'SELECT l.technical_code
221 FROM peel_statut_livraison l
222 WHERE technical_code!="" AND id=' . intval($statut_livraison_new) .
' AND ' .
get_filter_site_cond(
'statut_livraison',
'l');
225 $statut_livraison_new =
$result[
'technical_code'];
227 $livraison_status_by_legacy_id_compatibility_array = array(0 =>
"discussed", 1 =>
"processing", 3 =>
"dispatched", 6 =>
"cancelled", 9 =>
"waiting_for_supply");
228 $statut_livraison_new = $livraison_status_by_legacy_id_compatibility_array[intval($statut_livraison_new)];
231 $sql =
'SELECT l.id, l.technical_code
232 FROM peel_statut_livraison l
236 $delivery_status_id_by_technical_code_array[
$result[
'technical_code']] = $result[
'id'];
240 $sql =
"SELECT c.*, sp.technical_code AS statut_paiement, sl.technical_code AS statut_livraison
241 FROM peel_commandes c
242 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
243 LEFT JOIN peel_statut_livraison sl ON sl.id=c.id_statut_livraison AND " .
get_filter_site_cond(
'statut_livraison',
'sl') .
"
248 if (empty(
$GLOBALS[
'site_parameters'][
'payment_status_create_bill']) || in_array($statut_paiement_new, explode(
',',
$GLOBALS[
'site_parameters'][
'payment_status_create_bill']))) {
252 query(
"UPDATE peel_commandes
257 query(
"UPDATE peel_commandes
258 SET f_datetime = '" . date(
'Y-m-d H:i:s', time()) .
"'
259 WHERE id = '" . intval($order_id) .
"' AND f_datetime LIKE '0000-00-00%' AND " .
get_filter_site_cond(
'commandes') .
"");
261 if (!empty($payment_technical_code)) {
263 $sql=
"UPDATE peel_commandes
266 if(!in_array($statut_paiement_new, array(
'being_checked',
'completed'))){
267 $sql.=
" AND paiement=''";
271 if ($statut_paiement_new !== null && in_array($statut_paiement_new, array(
'being_checked',
'completed')) && !in_array($commande[
'statut_paiement'], array(
'being_checked',
'completed'))) {
273 $output .= cree_cheque_cadeau($order_id);
275 if (!empty(
$GLOBALS[
'fonctionsfianet_sac']) && file_exists(
$GLOBALS[
'fonctionsfianet_sac'])) {
276 require_once(
$GLOBALS[
'fonctionsfianet_sac']);
278 send_fianet_sac($order_id);
281 $sql_set_array[] =
"a_timestamp='" . date(
'Y-m-d H:i:s', time()) .
"'";
284 $sql =
"SELECT pp.technical_code, pca.attributs_list, pca.reference, pca.quantite
285 FROM peel_produits pp
286 INNER JOIN peel_commandes_articles pca ON pca.produit_id = pp.id AND " .
get_filter_site_cond(
'commandes_articles',
'pca') .
"
287 INNER JOIN peel_commandes pc ON pc.id = pca.commande_id AND " .
get_filter_site_cond(
'commandes',
'pc') .
"
290 while ($product_ordered_infos =
fetch_assoc($query_t)) {
291 if (substr($product_ordered_infos[
'technical_code'], 0, strlen(
'annonce_g_')) ==
'annonce_g_' || substr($product_ordered_infos[
'technical_code'], 0, strlen(
'gold_credit_')) ==
'gold_credit_') {
292 if(substr($product_ordered_infos[
'technical_code'], 0, strlen(
'gold_credit_separated_')) ==
'gold_credit_separated_') {
295 $temp = end(explode(
'_', $product_ordered_infos[
'technical_code']));
297 if($lines_by_credit ==
'*') {
299 $lines_by_credit = 1;
302 $lines_by_credit = 1;
304 for(
$i=1;
$i<=$product_ordered_infos[
'quantite']*$lines_by_credit;
$i++) {
306 add_credit_gold_user($commande[
'id_utilisateur'], $product_ordered_infos[
'technical_code'], $commande[
'id']);
308 }
elseif (substr($product_ordered_infos[
'technical_code'], 0, strlen(
'ad_')) ==
'ad_' && $product_ordered_infos[
'quantite']>=1) {
310 $update_attributs =
'UPDATE peel_lot_vente
311 SET attributs_list=CONCAT(attributs_list,IF(attributs_list="", "", "§"), "'.nohtml_real_escape_string($product_ordered_infos[
'attributs_list']).
'")
312 WHERE ref ="' . intval($product_ordered_infos[
'reference']) .
'" ' .
get_filter_site_cond(
'lot_vente');
313 query($update_attributs);
319 $sql =
'SELECT technical_code
320 FROM peel_produits pp
321 INNER JOIN peel_commandes_articles pca ON pca.produit_id = pp.id AND ' .
get_filter_site_cond(
'commandes_articles',
'pca') .
'
322 INNER JOIN peel_commandes pc ON pc.id = pca.commande_id AND ' .
get_filter_site_cond(
'commandes',
'pc') .
'
325 while ($product_ordered_infos =
fetch_assoc($query_t)) {
326 if (substr($product_ordered_infos[
'technical_code'], 0, strlen(
'forfait_p_')) ==
'forfait_p_') {
328 $n_days = 30 * substr($product_ordered_infos[
'technical_code'], strlen(
'forfait_p_'));
329 $update_credit =
'UPDATE peel_utilisateurs
330 SET platinum_status ="YES", platinum_activation_date ="' . date(
'Y-m-d H:i:s') .
'", platinum_until =GREATEST(' . time() .
',platinum_until)+' . (3600 * 24 * $n_days).
'
331 WHERE id_utilisateur ="' . intval($commande[
'id_utilisateur']) .
'" AND ' .
get_filter_site_cond(
'utilisateurs') .
'';
332 query($update_credit);
337 if (!empty($payment_status_id_by_technical_code_array[$statut_paiement_new])) {
338 $sql_set_array[] =
"id_statut_paiement='" . intval($payment_status_id_by_technical_code_array[$statut_paiement_new]) .
"'";
340 if (!empty($delivery_status_id_by_technical_code_array[$statut_livraison_new])) {
341 $sql_set_array[] =
"id_statut_livraison='" . intval($delivery_status_id_by_technical_code_array[$statut_livraison_new]) .
"'";
343 if ($delivery_tracking !==null) {
346 }
elseif(!empty($commande[
'delivery_tracking'])) {
347 $delivery_tracking = $commande[
'delivery_tracking'];
349 if (!empty($sql_set_array) && ($allow_update_paid_orders || !in_array($commande[
'statut_paiement'], array(
'being_checked',
'completed')))) {
350 query(
'UPDATE peel_commandes
351 SET ' . implode(
', ', $sql_set_array) .
'
354 if ($statut_paiement_new !== null && $commande[
'statut_paiement'] != $statut_paiement_new) {
357 if (in_array($statut_paiement_new, array(
'cancelled',
'refunded')) && !in_array($commande[
'statut_paiement'], array(
'cancelled',
'refunded'))) {
359 if ($statut_paiement_new === null || $statut_paiement_new ===
'') {
361 query(
"UPDATE peel_commandes
362 SET id_statut_livraison=" . intval($delivery_status_id_by_technical_code_array[
'cancelled']) .
"
363 WHERE id='" . intval($order_id) .
"' AND id_statut_livraison!=" . intval($delivery_status_id_by_technical_code_array[
'dispatched']) .
" AND " .
get_filter_site_cond(
'commandes') .
"");
373 $payment_status_decrement_stock_array = explode(
',',
$GLOBALS[
'site_parameters'][
'payment_status_decrement_stock']);
375 $want_decrement = in_array($statut_paiement_new, $payment_status_decrement_stock_array);
376 $ex_decrement = in_array($commande[
'statut_paiement'], $payment_status_decrement_stock_array);
381 $already_decrement = (!$no_stock_decrement_already_done && $ex_decrement);
382 if(($want_decrement && !$already_decrement) || (!$want_decrement && $already_decrement)){
384 if (!empty($product_infos_array)) {
385 foreach ($product_infos_array as $this_ordered_product) {
386 if ($this_ordered_product[
'etat_stock'] == 1) {
387 if ($want_decrement && !$already_decrement) {
391 $this_order_stock = decremente_stock($this_ordered_product[
'produit_id'], $this_ordered_product[
'couleur_id'], $this_ordered_product[
'taille_id'], $this_ordered_product[
'quantite']);
392 }
elseif (!$want_decrement && $already_decrement) {
394 incremente_stock($this_ordered_product[
'quantite']-$this_ordered_product[
'order_stock'], $this_ordered_product[
'produit_id'], $this_ordered_product[
'couleur_id'], $this_ordered_product[
'taille_id']);
396 $this_order_stock = 0;
398 if(isset($this_order_stock)){
399 query(
"UPDATE peel_commandes_articles
400 SET order_stock='".intval($this_order_stock).
"'
401 WHERE id='" . intval($this_ordered_product[
'id']) .
"' AND " .
get_filter_site_cond(
'commandes_articles'));
402 unset($this_order_stock);
409 if ($statut_livraison_new ==
'dispatched' && $commande[
'statut_livraison'] != $statut_livraison_new && !empty(
$GLOBALS[
'site_parameters'][
'mode_transport'])) {
414 query(
"UPDATE peel_commandes
415 SET e_datetime = '" . date(
'Y-m-d H:i:s', time()) .
"'
417 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_DELIVERY_EMAIL_SENT'], $commande[
'email'])))->fetch();
438 $_SESSION[
'session_commande'][
'code_postal1'] =
vb(
$frm[
'code_postal1']);
443 if (empty(
$_SESSION[
'session_commande'][
'is_socolissimo_order'])) {
447 $_SESSION[
'session_commande'][
'prenom2'] = (empty(
$frm[
'prenom2'])?
$frm[
'prenom1']:
$frm[
'prenom2']);
448 $_SESSION[
'session_commande'][
'contact2'] = (empty(
$frm[
'contact2'])?
$frm[
'contact1']:
$frm[
'contact2']);
450 $_SESSION[
'session_commande'][
'adresse2'] = (empty(
$frm[
'adresse2'])?
$frm[
'adresse1']:
$frm[
'adresse2']);
451 $_SESSION[
'session_commande'][
'code_postal2'] = (empty(
$frm[
'code_postal2'])?
$frm[
'code_postal1']:
$frm[
'code_postal2']);
457 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
458 foreach(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'] as $this_field => $this_title) {
459 if (isset(
$frm[$this_field])) {
461 $_SESSION[
'session_commande'][$this_field] =
$frm[$this_field];
465 $_SESSION[
'session_commande'][
'commande_interne'] =
vb(
$frm[
'commande_interne']);
466 $_SESSION[
'session_commande'][
'commentaires'] =
vb(
$frm[
'commentaires']);
467 $_SESSION[
'session_commande'][
'payment_technical_code'] =
vb(
$frm[
'payment_technical_code']);
468 if (
$_SESSION[
'session_commande'][
'payment_technical_code'] ==
'moneybookers') {
469 $_SESSION[
'session_commande'][
'moneybookers_payment_methods'] =
vb(
$frm[
'moneybookers_payment_methods']);
471 $_SESSION[
'session_commande'][
'moneybookers_payment_methods'] =
'';
487 $name_compatibility_array = array(
488 "paiement" =>
"payment_technical_code"
489 ,
"zone_tva" =>
"apply_vat"
490 ,
"zone_franco" =>
"zoneFranco"
491 ,
"produit_id" =>
"product_id"
492 ,
"couleur_id" =>
"couleurId"
493 ,
"taille_id" =>
"tailleId"
494 ,
"nom_produit" =>
"product_name"
495 ,
"option" =>
"prix_option"
496 ,
"option_ht" =>
"prix_option_ht");
499 if (empty($articles_array)) {
500 $articles_array = array();
503 if (!isset($order_infos[
'statut_paiement'])) {
504 $order_infos[
'statut_paiement'] =
'pending';
506 if (!isset($order_infos[
'statut_livraison'])) {
507 $order_infos[
'statut_livraison'] =
'discussed';
510 foreach($name_compatibility_array as $key => $value) {
512 if (isset($order_infos[$key])) {
514 $order_infos[$value] = $order_infos[$key];
516 unset($order_infos[$key]);
520 foreach(
vb($order_infos[
'adresses_fields_array'], array()) as $this_item) {
522 if ($this_item ==
'zip') {
523 $this_field =
'code_postal';
524 }
elseif($this_item ==
'telephone') {
525 $this_field =
'contact';
527 $this_field = $this_item;
529 if (!empty($order_infos[$this_item .
'_bill'])) {
530 $order_infos[$this_field .
'1'] = $order_infos[$this_item .
'_bill'];
532 if (!empty($order_infos[$this_item .
'_ship'])) {
533 $order_infos[$this_field .
'2'] = $order_infos[$this_item .
'_ship'];
538 foreach(
vb($order_infos[
'adresses_fields_array'], array()) as $this_item) {
539 if (empty($order_infos[$this_item .
'2']) && isset($order_infos[$this_item .
'1'])) {
540 $order_infos[$this_item .
'2'] = $order_infos[$this_item .
'1'];
545 if (!empty($order_infos[
'id'])) {
546 $statut_q =
query(
'SELECT c.id_statut_paiement, c.total_points, c.points_etat, c.o_timestamp, sp.technical_code AS statut_paiement
547 FROM peel_commandes c
548 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND ' .
get_filter_site_cond(
'statut_paiement',
'sp') .
'
549 WHERE c.id=' . intval($order_infos[
'id']) .
' AND ' .
get_filter_site_cond(
'commandes',
'c') .
'');
552 $order_infos_ex = null;
554 if (empty($order_infos[
'devise'])) {
556 $order_infos[
'devise'] =
$GLOBALS[
'site_parameters'][
'code'];
558 if (empty($order_infos[
'lang'])) {
559 $order_infos[
'lang'] =
$_SESSION[
'session_langue'];
561 $old_id_utilisateur = $order_infos[
'id_utilisateur'];
562 if(empty($order_infos[
'email'])) {
563 $order_infos[
'email'] =
vb($order_infos[
'email1']);
565 if(!isset($order_infos[
'site_id'])) {
567 $order_infos[
'site_id'] =
$GLOBALS[
'site_id'];
571 if(!empty($order_infos[
'email1'])){
575 if(!empty($searched_id_utilisateur)) {
576 $order_infos[
'id_utilisateur'] = $searched_id_utilisateur;
579 if (isset($order_infos[
'commande_interne'])) {
582 if (isset($order_infos[
'id_utilisateur'])) {
585 if (isset($order_infos[
'commentaires'])) {
588 if (isset($order_infos[
'commentaires_admin'])) {
593 if (isset($order_infos[
'total_option'])) {
596 if (isset($order_infos[
'a_timestamp'])) {
599 if (isset($order_infos[
'e_datetime'])) {
602 if (isset($order_infos[
'f_datetime'])) {
605 if (isset($order_infos[
'tva_total_option'])) {
611 if (isset($order_infos[
'code_promo'])) {
614 if (isset($order_infos[
'percent_remise_user'])) {
617 if (isset($order_infos[
'percent_code_promo'])) {
620 if (isset($order_infos[
'valeur_code_promo'])) {
623 if (isset($order_infos[
'total_remise'])) {
626 if (isset($order_infos[
'total_remise_ht'])) {
629 if (isset($order_infos[
'tva_total_remise'])) {
633 if (isset($order_infos[
'transport'])) {
640 if (isset($order_infos[
'total_points'])) {
643 if (isset($order_infos[
'total_poids'])) {
646 if (isset($order_infos[
'affilie'])) {
649 if (isset($order_infos[
'montant_affilie'])) {
652 if (isset($order_infos[
'statut_affilie'])) {
655 if (isset($order_infos[
'id_affilie'])) {
662 if (isset($order_infos[
'avoir'])) {
679 if (isset($order_infos[
'nom2'])) {
682 if (isset($order_infos[
'societe2'])) {
685 if (isset($order_infos[
'adresse2'])) {
688 if (isset($order_infos[
'code_postal2'])) {
691 if (isset($order_infos[
'ville2'])) {
694 if (isset($order_infos[
'pays2'])) {
697 if (isset($order_infos[
'email2'])) {
700 if (isset($order_infos[
'contact2'])) {
703 if (isset($order_infos[
'id_parrain'])) {
706 if (isset($order_infos[
'parrain'])) {
712 if (isset($order_infos[
'zoneFranco'])) {
721 , typeId = '" . intval(
vn($order_infos[
'typeId'])) .
"'
724 if (isset($order_infos[
'moneybookers_payment_methods'])) {
725 $set_sql .=
", moneybookers_payment_methods = '" .
real_escape_string(
vb($order_infos[
'moneybookers_payment_methods'])) .
"'";
727 $set_sql .=
", delivery_infos = '" .
real_escape_string(
vb($order_infos[
'delivery_infos'])) .
"'
731 if(!empty(
$_SESSION[
'session_commande'][
'xETTCode'])) {
738 if (!empty($order_infos[
'specific_field_sql_set'])) {
739 $set_sql .=
',' . implode(
',', $order_infos[
'specific_field_sql_set']);
741 if (!empty($order_infos[
'commandeid'])) {
743 $sql =
"UPDATE peel_commandes
745 WHERE id_utilisateur='" . intval($old_id_utilisateur) .
"' AND id='" . intval($order_infos[
'commandeid']) .
"' AND " .
get_filter_site_cond(
'commandes', null,
false, $order_infos[
'site_id'],
true) .
"";
746 $order_infos[
'o_timestamp'] = $order_infos_ex[
'o_timestamp'];
749 $code_facture =
vb($order_infos[
'code_facture']);
752 $code_facture =
MDP(10);
758 $sql =
"INSERT INTO peel_commandes
762 , o_timestamp = '" . date(
'Y-m-d H:i:s', time()) .
"' ";
763 $order_infos[
'o_timestamp'] = date(
'Y-m-d H:i:s', time());
766 if (empty($order_infos[
'commandeid'])) {
767 $order_infos[
'commandeid'] =
insert_id();
769 $order_id = $order_infos[
'commandeid'];
770 if(!empty($order_infos[
'numero']) && $order_infos[
'numero']!=
vb(
$GLOBALS[
'site_parameters'][
'format_numero_facture'])) {
777 query(
"UPDATE peel_commandes
779 WHERE id = '" . intval($order_id) .
"' AND " .
get_filter_site_cond(
'commandes', null,
false, $order_infos[
'site_id'],
true) .
"");
782 if (!empty($order_infos_ex)) {
787 foreach ($product_infos_array as $this_ordered_product) {
789 if ($this_ordered_product[
'etat_stock'] == 1 && in_array($order_infos_ex[
'statut_paiement'], explode(
',',
$GLOBALS[
'site_parameters'][
'payment_status_decrement_stock'])) ) {
790 incremente_stock($this_ordered_product[
'quantite'] - $this_ordered_product[
'order_stock'], $this_ordered_product[
'produit_id'], $this_ordered_product[
'couleur_id'], $this_ordered_product[
'taille_id']);
800 update_points($order_infos[
'total_points'],
vn($order_infos[
'points_etat']), $order_id, null);
803 query(
"DELETE FROM peel_commandes_articles
804 WHERE commande_id='" . intval($order_id) .
"' AND " .
get_filter_site_cond(
'commandes_articles'));
806 foreach ($articles_array as $article_infos) {
808 foreach($name_compatibility_array as $key => $value) {
810 if (isset($article_infos[$key])) {
812 $article_infos[$value] = $article_infos[$key];
814 unset($article_infos[$key]);
823 $product_object->set_configuration(
vn($article_infos[
'couleurId']),
vn($article_infos[
'tailleId']),
vb($article_infos[
'id_attribut']),
false,
true);
827 if (!empty($article_infos[
'id_attribut'])) {
829 }
elseif (!empty($article_infos[
'nom_attribut'])) {
830 $attribut = $article_infos[
'nom_attribut'];
834 $statut_envoi = (
$product_object->on_download == 1) ?
"En attente" :
"";
838 if (empty($article_infos[
'couleur'])) {
841 if (empty($article_infos[
'taille'])) {
844 if (!empty($article_infos[
'nom_produit'])) {
845 $article_infos[
'product_name'] = $article_infos[
'nom_produit'];
847 if (empty($article_infos[
'product_name'])) {
850 if (empty($article_infos[
'reference'])) {
853 $sql =
"INSERT INTO peel_commandes_articles SET
855 , commande_id = '" . intval($order_id) .
"'
858 if (isset($article_infos[
'reference'])) {
863 if (isset($article_infos[
'couleur'])) {
866 if (isset($article_infos[
'taille'])) {
869 if (isset($article_infos[
'couleurId'])) {
872 if (isset($article_infos[
'tailleId'])) {
881 if (isset($article_infos[
'percent_remise_produit'])) {
884 if (isset($article_infos[
'remise'])) {
887 if (isset($article_infos[
'remise_ht'])) {
896 if (isset($article_infos[
'points'])) {
899 if (isset($article_infos[
'poids'])) {
903 if (isset($article_infos[
'email_check'])) {
943 if (is_numeric($order_infos[
'statut_livraison'])) {
945 $sql =
'SELECT l.technical_code
946 FROM peel_statut_livraison l
947 WHERE id=' . intval($order_infos[
'statut_livraison']) .
' AND ' .
get_filter_site_cond(
'statut_livraison',
'l');
950 $order_infos[
'statut_livraison'] =
$result[
'technical_code'];
956 $GLOBALS[
'output_create_or_update_order'] =
update_order_payment_status($order_id, $order_infos[
'statut_paiement'],
true, $order_infos[
'statut_livraison'],
vb($order_infos[
'delivery_tracking']),
true,
vb($order_infos[
'payment_technical_code']));
958 include_once(
$GLOBALS[
'dirroot'] .
'/modules/nexway/fonctions.php');
959 Nexway::create_order($order_infos, $articles_array);
972 $result =
query(
"SELECT c.*, sp.technical_code AS statut_paiement
973 FROM peel_commandes c
974 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
980 $custom_template_tags[
'ORDER_ID'] = $order_id;
982 $custom_template_tags[
'CIVILITE'] = $user[
'civilite'];
984 $custom_template_tags[
'TYPE'] = $order_object->type;
985 $custom_template_tags[
'COLIS'] = $order_object->delivery_tracking;
986 $custom_template_tags[
'DATE'] =
get_formatted_date($order_object->o_timestamp,
'short',
'long');
987 $custom_template_tags[
'MONTANT'] =
fprix($order_object->montant,
true);
988 $custom_template_tags[
'PAIEMENT'] =
get_payment_name($order_object->paiement);
992 $custom_template_tags[
'BOUGHT_ITEMS'] =
'';
993 $custom_template_tags[
'COMMENT'] = $order_object->commentaires;
996 foreach ($product_infos_array as $this_ordered_product) {
997 $custom_template_tags[
'BOUGHT_ITEMS'] .= $this_ordered_product[
"product_text"] .
"\n";
998 $custom_template_tags[
'BOUGHT_ITEMS'] .=
$GLOBALS[
'STR_QUANTITY'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " . $this_ordered_product[
"quantite"] .
"\n";
1001 foreach ($product_infos_array as $this_ordered_product) {
1002 if(!empty($this_ordered_product[
'technical_code'])) {
1003 send_email($order_object->email,
'',
'',
'confirm_ordered_'.$this_ordered_product[
'technical_code'], $custom_template_tags, null,
$GLOBALS[
'support_commande']);
1004 send_email(
$GLOBALS[
'support_commande'],
'',
'',
'confirm_ordered_'.$this_ordered_product[
'technical_code'], $custom_template_tags, null,
$GLOBALS[
'support_commande']);
1007 $template_technical_codes_array = array(
'email_commande_' . $order_object->paiement,
'email_commande');
1008 send_email($order_object->email,
'',
'', $template_technical_codes_array, $custom_template_tags, null,
$GLOBALS[
'support_commande']);
1009 send_email(
$GLOBALS[
'support_commande'],
'',
'', $template_technical_codes_array, $custom_template_tags, null,
$GLOBALS[
'support_commande']);
1010 if(!defined(
'IN_PEEL_ADMIN') || (defined(
'IN_PEEL_ADMIN') && !empty(
$GLOBALS[
'site_parameters'][
'send_email_order_in_admin']))) {
1029 $custom_template_tags[
'ORDER_ID'] = $order_id;
1030 $custom_template_tags[
'EMAIL'] = $order_object->email;
1031 $custom_template_tags[
'SITE'] =
$GLOBALS[
'site'];
1032 $custom_template_tags[
'MONTANT'] =
fprix($order_object->montant,
true);
1033 $custom_template_tags[
'O_TIMESTAMP'] =
get_formatted_date($order_object->o_timestamp);
1034 $custom_template_tags[
'PAIEMENT'] =
get_payment_name($order_object->paiement);
1035 $custom_template_tags[
'COMMENT'] = $order_object->commentaires;
1037 send_email(
$GLOBALS[
'support_commande'],
'',
'',
'send_mail_order_admin', $custom_template_tags, null,
$GLOBALS[
'support_commande']);
1048 $sql_paiement =
'SELECT p.nom_' .
$_SESSION[
'session_langue'] .
' AS nom
1049 FROM peel_paiement p
1051 $res_paiement =
query($sql_paiement);
1053 return $tab_paiement[
'nom'];
1067 static $payment_status_name_by_id;
1068 if (!isset($payment_status_name_by_id[
$id])) {
1069 $sql_paiement =
'SELECT p.nom_' .
$_SESSION[
'session_langue'] .
' AS nom
1070 FROM peel_statut_paiement p
1072 $res_paiement =
query($sql_paiement);
1076 $payment_status_name_by_id[
$id] =
$id;
1079 return $payment_status_name_by_id[
$id];
1090 $sql_livraison =
'SELECT nom_' .
$_SESSION[
'session_langue'] .
' AS nom
1091 FROM peel_statut_livraison
1093 $res_livraison =
query($sql_livraison);
1094 if ($tab_livraison =
fetch_assoc($res_livraison)) {
1096 }
elseif (!empty(
$GLOBALS[
'site_parameters'][
'mode_transport'])) {
1111 $sql_delivery =
'SELECT nom_' .
$_SESSION[
'session_langue'] .
' AS nom
1114 $res_delivery =
query($sql_delivery);
1116 return $tab_delivery[
'nom'];
1134 $add_for_free_delivery = array();
1136 if (!empty(
$GLOBALS[
'site_parameters'][
'nb_product']) &&
$GLOBALS[
'site_parameters'][
'nb_product'] <= $nb_product) {
1140 $add_for_free_delivery[
'products'] =
$GLOBALS[
'site_parameters'][
'nb_product'] - $nb_product;
1143 if (!empty($zone_id)) {
1144 $query =
query(
'SELECT z.on_franco, z.on_franco_amount, z.on_franco_reseller_amount, z.on_franco_nb_products
1149 if (!empty($result_zones[
'on_franco'])) {
1150 $amount_used = floatval((
check_if_module_active(
'reseller') && is_reseller()) ? $result_zones[
'on_franco_reseller_amount'] : $result_zones[
'on_franco_amount']);
1152 if ($amount_used <= round($total_price, 2)) {
1155 $add_for_free_delivery[
'amount'] = $amount_used - round($total_price, 2);
1158 if (!empty($result_zones[
'on_franco_nb_products'])) {
1160 if($result_zones[
'on_franco_nb_products'] <= $nb_product) {
1163 $add_for_free_delivery[
'products'] = $result_zones[
'on_franco_nb_products'] - $nb_product;
1169 if (empty($add_for_free_delivery[
'amount'])) {
1172 if (round($seuil_total_used, 2) > 0) {
1173 if(round($total_price, 2) >= round($seuil_total_used, 2)) {
1178 $add_for_free_delivery[
'amount'] = round($seuil_total_used, 2) - round($total_price, 2);
1182 return $add_for_free_delivery;
1201 static $delivery_cost_infos_by_weight_and_price_array;
1202 $delivery_cost_infos = array(
'cost_ht' => 0,
'tva' => 0);
1203 if (empty($nb_product)) {
1205 return $delivery_cost_infos;
1207 $key_weight_and_price = $type_id . $zone_id . $total_weight . $total_price;
1209 if ($add_for_free_delivery !== null && !empty(
$GLOBALS[
'site_parameters'][
'mode_transport'])) {
1210 if (!isset($delivery_cost_infos_by_weight_and_price_array[$key_weight_and_price])) {
1212 if(
$GLOBALS[
'site_parameters'][
'delivery_cost_calculation_mode'] ==
'nearest'){
1215 $order_by =
'IF(poids_max>0, poids_max, 100000000) ASC, IF(total_max>0, total_max, 100000000) ASC, tarif ASC';
1219 $order_by =
'tarif ASC';
1221 $tarifs_sql =
'SELECT tarif, poidsmax, totalmax, tva
1223 WHERE ' .
get_filter_site_cond(
'tarifs') .
' AND ' . (!empty($type_id)?
'type="' . intval($type_id) .
'"':
'tarif>0') . (!empty($zone_id)?
' AND zone = "' . intval($zone_id) .
'"':
'') .
' AND (poidsmin<="' . floatval($total_weight) .
'" OR poidsmin=0) AND (poidsmax>="' . floatval($total_weight) .
'" OR poidsmax=0) AND (totalmin<="' . floatval($total_price) .
'" OR totalmin=0) AND (totalmax>="' . floatval($total_price) .
'" OR totalmax=0)
1224 ORDER BY ' . $order_by .
'
1228 $delivery_cost_infos[
'cost_ht'] = $this_tarif[
'tarif'] / (1 + $this_tarif[
'tva'] / 100);
1230 $delivery_cost_infos[
'tva'] = $this_tarif[
'tva'];
1232 $delivery_cost_infos[
'tva'] = 0;
1234 }
elseif (!empty($type_id)) {
1236 $delivery_cost_infos =
false;
1238 $delivery_cost_infos_by_weight_and_price_array[$key_weight_and_price] = $delivery_cost_infos;
1240 $delivery_cost_infos = $delivery_cost_infos_by_weight_and_price_array[$key_weight_and_price];
1244 return $delivery_cost_infos;
1255 $sql_paiement =
'SELECT technical_code
1258 $res_paiement =
query($sql_paiement);
1260 return $tab_paiement[
'technical_code'];
1274 $sql =
'SELECT SUM(pca.tva) AS products_tva_for_this_percent, pca.tva_percent, pc.tva_cout_transport, ROUND(pc.tva_cout_transport/pc.cout_transport_ht*100,2) AS cout_transport_tva_percent, pc.tva_tarif_paiement, ROUND(pc.tva_tarif_paiement/pc.tarif_paiement_ht*100,2) AS tarif_paiement_tva_percent, tva_small_order_overcost, ROUND(tva_small_order_overcost/(small_order_overcost_amount-tva_small_order_overcost)*100,2) AS small_order_overcost_tva_percent
1275 FROM peel_commandes_articles pca
1276 INNER JOIN peel_commandes pc ON pca.commande_id = pc.id AND ' .
get_filter_site_cond(
'commandes',
'pc') .
'
1278 GROUP BY pc.id, pca.tva_percent';
1287 $total_tva[$result[
'tva_percent']] += $result[
'products_tva_for_this_percent'];
1291 if ($result[
'tva_cout_transport'] > 0) {
1292 $total_tva[
'transport ' . $result[
'cout_transport_tva_percent']] = $result[
'tva_cout_transport'];
1294 if ($result[
'tva_tarif_paiement'] > 0) {
1295 if (empty(
$total_tva[$result[
'tarif_paiement_tva_percent']])) {
1296 $total_tva[$result[
'tarif_paiement_tva_percent']] = 0;
1298 $total_tva[$result[
'tarif_paiement_tva_percent']] += $result[
'tva_tarif_paiement'];
1300 if ($result[
'tva_small_order_overcost'] > 0) {
1301 if (empty(
$total_tva[$result[
'small_order_overcost_tva_percent']])) {
1302 $total_tva[$result[
'small_order_overcost_tva_percent']] = 0;
1304 $total_tva[$result[
'small_order_overcost_tva_percent']] += $result[
'tva_small_order_overcost'];
1322 if(empty($order_object)){
1325 if (!empty($order_object->a_timestamp) && $order_object->a_timestamp !=
'0000-00-00' && in_array($order_object->statut_paiement, array(
'discussed',
'completed'))) {
1326 $order_infos[
'displayed_paiement_date'] =
get_formatted_date($order_object->a_timestamp);
1328 $order_infos[
'displayed_paiement_date'] = null;
1331 $separator_before_country =
"\n";
1332 $separator_before_email =
"\n";
1336 $order_object->adresse_bill = str_replace(
"\n",
' - ', $order_object->adresse_bill);
1339 $separator_before_country =
' - ';
1341 $separator_before_email =
' - ';
1345 $order_infos[
'client_infos_bill'] = (!empty($order_object->societe_bill)?$order_object->societe_bill .
"\n":
'')
1346 . trim($order_object->nom_bill .
" " . $order_object->prenom_bill)
1347 .
"\n" . $order_object->adresse_bill;
1348 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
1349 foreach(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'] as $this_field => $this_title) {
1351 $this_text =
$GLOBALS[$this_title];
1353 $this_text = $this_title;
1355 if ((
String::substr($this_field, -5) ==
'_bill') && !empty($order_object->$this_field)) {
1357 $order_infos[
'client_infos_bill'] .=
"\n" . $this_title .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
vb($order_object->$this_field);
1361 $order_infos[
'client_infos_bill'] .=
"\n" . trim($order_object->zip_bill .
" " . $order_object->ville_bill)
1362 . $separator_before_country . $order_object->pays_bill
1364 . $separator_before_email . $order_object->email_bill;
1366 $order_infos[
'client_infos_bill'] = trim(str_replace(array(
"\n ",
"\n\n\n\n",
"\n\n\n",
"\n\n"),
"\n", $order_infos[
'client_infos_bill']));
1369 $separator_before_country =
"\n";
1370 $separator_before_email =
"\n";
1374 $order_object->adresse_ship = str_replace(
"\n",
' - ', $order_object->adresse_ship);
1377 $separator_before_country =
' - ';
1379 $separator_before_email =
' - ';
1383 $order_infos[
'client_infos_ship'] = (!empty($order_object->societe_ship)?$order_object->societe_ship .
"\n":
'')
1384 . trim($order_object->nom_ship .
" " . $order_object->prenom_ship)
1385 .
"\n" . $order_object->adresse_ship;
1386 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
1387 foreach(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'] as $this_field => $this_title) {
1389 $this_text =
$GLOBALS[$this_title];
1391 $this_text = $this_title;
1393 if ((
String::substr($this_field, -5) ==
'_ship') && !empty($order_object->$this_field)) {
1395 $order_infos[
'client_infos_ship'] .=
"\n" . $this_text .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
vb($order_object->$this_field);
1399 $order_infos[
'client_infos_ship'] .=
"\n" . trim($order_object->zip_ship .
" " . $order_object->ville_ship)
1400 . $separator_before_country . $order_object->pays_ship
1402 . $separator_before_email . $order_object->email_ship;
1403 if (
String::strpos($order_infos[
'client_infos_bill'],
'TVA') ===
false) {
1405 if (!empty($client) && !empty($client[
'intracom_for_billing'])) {
1407 $order_infos[
'client_infos_bill'] .=
"\n" .
$GLOBALS[
'STR_VAT_INTRACOM'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " . $client[
'intracom_for_billing'];
1410 $order_infos[
'client_infos_ship'] = trim(str_replace(array(
"\n ",
"\n\n\n\n",
"\n\n\n",
"\n\n"),
"\n", $order_infos[
'client_infos_ship']));
1412 $order_infos[
'net_infos_array'] = array(
"avoir" =>
fprix($order_object->avoir,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1413 "total_remise" =>
fprix($order_object->total_remise,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1414 "cout_transport" =>
fprix($order_object->cout_transport,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1415 "totalttc" =>
fprix($order_object->montant+$order_object->avoir,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1416 "montant" =>
fprix($order_object->montant,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1417 "total_tva" =>
fprix($order_object->total_tva,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1418 "montant_ht" =>
fprix($order_object->montant_ht,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1419 "tarif_paiement" =>
fprix($order_object->tarif_paiement,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1420 "cout_transport_ht" =>
fprix($order_object->cout_transport_ht,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1421 "small_order_overcost_amount" =>
fprix($order_object->small_order_overcost_amount,
true, $order_object->devise,
true, $order_object->currency_rate,
true),
1422 "total_ecotaxe_ht" =>
fprix($order_object->total_ecotaxe_ht,
true, $order_object->devise,
true, $order_object->currency_rate,
true)
1424 if ($order_object->cout_transport != 0) {
1425 $order_infos[
'net_infos_array'][
'displayed_cout_transport'] =
fprix($order_object->cout_transport,
true, $order_object->devise,
true, $order_object->currency_rate) .
" " .
$GLOBALS[
'STR_TTC'];
1427 $order_infos[
'net_infos_array'][
'displayed_cout_transport'] =
$GLOBALS[
'STR_OFFERED'];
1429 $order_infos[
'tva_infos_array'] = array(
"total_tva" =>
fprix($order_object->total_tva,
true, $order_object->devise,
true, $order_object->currency_rate,
true));
1430 $distinct_total_vat =
get_vat_array($order_object->code_facture);
1431 foreach($distinct_total_vat as $vat_percent_name => $value) {
1432 if (
String::substr($vat_percent_name, 0, strlen(
'transport')) ==
'transport') {
1435 $vat_percent = trim(
String::substr($vat_percent_name, strlen(
'transport')));
1438 $vat_percent = $vat_percent_name;
1440 if ($vat_percent>0 && $value>0) {
1441 $order_infos[
'tva_infos_array'][
"distinct_total_vat"][$vat_percent_name] =
fprix($value,
true, $order_object->devise,
true, $order_object->currency_rate,
true);
1444 if (!empty($order_object->code_promo)) {
1445 $order_infos[
'code_promo_text'] =
$GLOBALS[
'STR_CODE_PROMO_REMISE'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " . $order_object->code_promo;
1446 $code_promo_query =
query(
'SELECT code_promo, valeur_code_promo, percent_code_promo
1447 FROM peel_commandes pc
1450 $order_infos[
'code_promo_text'] .=
' - ' .
get_discount_text($cp[
'valeur_code_promo'], $cp[
'percent_code_promo'],
true) .
'';
1453 $order_infos[
'code_promo_text'] =
'';
1455 $order_infos[
'delivery_infos'] = $order_object->type;
1456 return $order_infos;
1471 if(empty($order_by) && !empty(
$GLOBALS[
'site_parameters'][
'order_article_order_by']) &&
$GLOBALS[
'site_parameters'][
'order_article_order_by'] ==
'name') {
1472 $order_by =
'oi.nom_produit ASC';
1473 }
elseif(!empty(
$GLOBALS[
'site_parameters'][
'order_article_order_by']) &&
$GLOBALS[
'site_parameters'][
'order_article_order_by'] ==
'reference') {
1474 $order_by =
'oi.reference ASC';
1476 $order_by =
'oi.id ASC';
1479 $product_infos_array = array();
1480 $sql =
"SELECT oi.*, p.technical_code, c.nom_".$_SESSION[
'session_langue'].
" AS category_name, m.nom_".
$_SESSION[
'session_langue'].
" AS brand_name
1481 FROM peel_commandes_articles oi
1482 LEFT JOIN peel_produits p ON p.id=oi.produit_id AND " .
get_filter_site_cond(
'produits',
'p') .
"
1483 LEFT JOIN peel_produits_categories pc ON p.id = pc.produit_id
1484 LEFT JOIN peel_categories c ON c.id = pc.categorie_id AND " .
get_filter_site_cond(
'categories',
'c') .
"
1485 LEFT JOIN peel_marques m ON m.id = p.id_marque AND " .
get_filter_site_cond(
'marques',
'm') .
"
1486 WHERE commande_id='" . intval($order_id) .
"' AND " .
get_filter_site_cond(
'commandes_articles',
'oi') .
"
1487 GROUP BY oi.nom_attribut, oi.attributs_list, oi.produit_id, oi.reference, oi.nom_produit, oi.prix, oi.couleur_id, oi.taille_id
1488 ORDER BY " . $order_by;
1492 $category_text = (!empty($prod[
'category_name']) && !empty(
$GLOBALS[
'site_parameters'][
'display_category_name_in_product_infos_in_order']) ?
"\r\n" .
$GLOBALS[
'STR_CATEGORY'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
String::htmlspecialchars_decode($prod[
"category_name"], ENT_QUOTES) :
"");
1493 $brand_text = (!empty($prod[
'brand_name']) && !empty(
$GLOBALS[
'site_parameters'][
'display_brand_name_in_product_infos_in_order']) ?
"\r\n" .
$GLOBALS[
'STR_BRAND'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
String::htmlspecialchars_decode($prod[
"brand_name"], ENT_QUOTES) :
"");
1497 if ($prod[
'nom_attribut'] !=
'') {
1499 if($add_total_prix_attribut) {
1500 $attribut_text .= ($prod[
'total_prix_attribut'] > 0 ?
"\r\n" .
$GLOBALS[
'STR_OPTIONS_COST'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': ' .
fprix($prod[
'total_prix_attribut'],
true) .
' ' .
$GLOBALS[
'STR_TTC'] :
'');
1503 $attribut_text =
'';
1505 $delai_text = (!empty($prod[
'delai_stock']) ?
"\r\n" .
$GLOBALS[
'STR_DELIVERY_STOCK'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
get_formatted_duration((intval($prod[
'delai_stock']) * 24 * 3600),
false,
true) :
"");
1507 $option_text = ($prod[
'prix_option'] != 0 ?
"\r\n" .
$GLOBALS[
'STR_OPTION_PRIX'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
fprix($prod[
'prix_option'],
true, $devise,
true,
$currency_rate) .
"" :
"");
1515 $ecotaxe_text = ($prod[
'ecotaxe_ttc'] > 0) ?
"\r\n" .
$GLOBALS[
'STR_ECOTAXE_INCLUDE'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
fprix($prod[
'ecotaxe_ttc'],
true, $devise,
true,
$currency_rate) :
"";
1518 $prod[
'product_text'] =
String::html_entity_decode_if_needed($prod[
'nom_produit'] .
vb($category_text) .
vb($brand_text) .
vb($reference_text) .
vb($couleur_text) .
vb($taille_text) .
vb($attribut_text) .
vb($option_text) .
vb($remise_text) .
vb($ecotaxe_text) .
vb($delai_text));
1519 $product_infos_array[] = $prod;
1521 return $product_infos_array;
1534 function get_payment_form($order_id, $forced_type = null, $send_admin_email =
false, $amount_to_pay = 0, $allow_autosend =
true)
1544 if (empty($amount_to_pay)) {
1545 $amount_to_pay = floatval(
$com->montant);
1550 if (!empty($forced_type)) {
1551 $type = $forced_type;
1554 $type =
$com->paiement;
1558 $sql_paiement =
'SELECT p.technical_code
1559 FROM peel_paiement p
1561 ORDER BY p.position';
1562 $res_paiement =
query($sql_paiement);
1563 while ($tab_paiement =
fetch_assoc($res_paiement)) {
1564 if (!empty($tab_paiement[
'technical_code'])) {
1565 $this_output =
get_payment_form($order_id, $tab_paiement[
'technical_code'], $send_admin_email, $amount_to_pay, $allow_autosend);
1566 if(!empty($this_output)) {
1567 $output_array[] = $this_output;
1571 return implode(
'<hr />', $output_array);
1573 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'payment_form.tpl');
1574 $tpl->assign(
'type', $type);
1575 $tpl->assign(
'commande_pdf_href',
get_site_wwwroot(
$com->site_id) .
'/factures/commande_pdf.php?code_facture=' .
$com->code_facture .
'&mode=bdc');
1577 $tpl->assign(
'disable_address_payment_by_check', !empty(
$GLOBALS[
'site_parameters'][
'disable_address_payment_by_check']));
1578 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
1579 $tpl->assign(
'STR_FOR_A_CHECK_PAYMENT',
$GLOBALS[
'STR_FOR_A_CHECK_PAYMENT']);
1580 $tpl->assign(
'STR_SEND_CHECK',
$GLOBALS[
'STR_SEND_CHECK']);
1581 $tpl->assign(
'STR_SEND_TRANSFER',
$GLOBALS[
'STR_SEND_TRANSFER']);
1582 $tpl->assign(
'STR_FOR_A_TRANSFERT',
$GLOBALS[
'STR_FOR_A_TRANSFERT']);
1583 $tpl->assign(
'STR_PRINT_PROFORMA',
$GLOBALS[
'STR_PRINT_PROFORMA']);
1584 $tpl->assign(
'STR_FOLLOWING_ADDRESS',
$GLOBALS[
'STR_FOLLOWING_ADDRESS']);
1585 $tpl->assign(
'STR_FOLLOWING_ACCOUNT',
$GLOBALS[
'STR_FOLLOWING_ACCOUNT']);
1588 $tpl->assign(
'societe', print_societe(
true));
1592 $tpl->assign(
'rib', print_rib(
true));
1596 if (file_exists(
$GLOBALS[
'fonctionscmcic'])) {
1597 require_once(
$GLOBALS[
'fonctionscmcic']);
1598 $js_action =
'document.getElementById("PaymentRequest").submit()';
1599 $tpl->assign(
'form', getCMCICForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
''));
1600 $send_admin_template_email =
'admin_info_payment_credit_card';
1605 if (file_exists(
$GLOBALS[
'fonctionscmcic'])) {
1606 require_once(
$GLOBALS[
'fonctionscmcic']);
1607 $js_action =
'document.getElementById("PaymentRequest").submit()';
1608 $tpl->assign(
'form', getCMCICForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 3,
''));
1609 $send_admin_template_email =
'admin_info_payment_credit_card_3_times';
1614 if (file_exists(
$GLOBALS[
'fonctionsatos']) && !empty(
$GLOBALS[
'site_parameters'][
'atos_solution_name'][
'atos'])) {
1615 require_once(
$GLOBALS[
'fonctionsatos']);
1617 $tpl->assign(
'form', getATOSForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$GLOBALS[
'site_parameters'][
'atos_solution_name'][
'atos']));
1618 $send_admin_template_email =
'admin_info_payment_credit_card';
1623 if (file_exists(
$GLOBALS[
'fonctionsatos']) && !empty(
$GLOBALS[
'site_parameters'][
'atos_solution_name'][
'atos_by_3'])) {
1624 require_once(
$GLOBALS[
'fonctionsatos']);
1626 $tpl->assign(
'form', getATOSForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 3,
'',
$GLOBALS[
'site_parameters'][
'atos_solution_name'][
'atos_by_3']));
1627 $send_admin_template_email =
'admin_info_payment_credit_card_3_times';
1632 if (file_exists(
$GLOBALS[
'fonctionsatos']) && !empty(
$GLOBALS[
'site_parameters'][
'atos_solution_name'][
'cetelem'])) {
1633 require_once(
$GLOBALS[
'fonctionsatos']);
1635 $tpl->assign(
'form', getATOSForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$GLOBALS[
'site_parameters'][
'atos_solution_name'][
'cetelem']));
1636 $send_admin_template_email =
'admin_info_payment_credit_card_3_times';
1641 if (file_exists(
$GLOBALS[
'fonctionssystempay'])) {
1642 require_once(
$GLOBALS[
'fonctionssystempay']);
1643 $js_action =
'document.getElementById("SystempayForm").submit()';
1644 $tpl->assign(
'form', getSystempayForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
$com->id_utilisateur,
$com->nom_bill,
$com->prenom_bill,
$com->telephone_bill));
1645 $send_admin_template_email =
'admin_info_payment_credit_card';
1649 case 'systempay_3x' :
1650 if (file_exists(
$GLOBALS[
'fonctionssystempay'])) {
1651 require_once(
$GLOBALS[
'fonctionssystempay']);
1652 $js_action =
'document.getElementById("SystempayForm").submit()';
1653 $tpl->assign(
'form', getSystempayForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email,
vn(
$GLOBALS[
'site_parameters'][
'systempay_payment_count'], 1),
'',
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
$com->id_utilisateur,
$com->nom_bill,
$com->prenom_bill,
$com->telephone_bill));
1654 $send_admin_template_email =
'admin_info_payment_credit_card';
1659 if (file_exists(
$GLOBALS[
'fonctionsspplus'])) {
1660 require_once(
$GLOBALS[
'fonctionsspplus']);
1663 $tpl->assign(
'form', getSPPlusForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
''));
1664 $send_admin_template_email =
'admin_info_payment_credit_card';
1669 if (file_exists(
$GLOBALS[
'fonctionspaybox'])) {
1670 require_once(
$GLOBALS[
'fonctionspaybox']);
1671 $js_action =
'document.TheForm.submit()';
1672 $tpl->assign(
'form', givePayboxForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
vb(
$GLOBALS[
'site_parameters'][
'paybox_cgi']),
vb(
$GLOBALS[
'site_parameters'][
'paybox_site']),
vb(
$GLOBALS[
'site_parameters'][
'paybox_rang']),
vb(
$GLOBALS[
'site_parameters'][
'paybox_identifiant'])));
1673 $send_admin_template_email =
'admin_info_payment_credit_card';
1678 if (file_exists(
$GLOBALS[
'fonctionsbluepaid'])) {
1679 require_once(
$GLOBALS[
'fonctionsbluepaid']);
1680 $js_action =
'document.TheForm.submit()';
1681 $tpl->assign(
'form', getBluepaidForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->id_utilisateur,
$com->pays_bill));
1682 $send_admin_template_email =
'admin_info_payment_credit_card';
1686 case 'bluepaid_abonnement' :
1687 if (file_exists(
$GLOBALS[
'fonctionsbluepaid'])) {
1688 require_once(
$GLOBALS[
'fonctionsbluepaid']);
1689 $js_action =
'document.TheForm.submit()';
1690 $tpl->assign(
'form', getBluepaidForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->id_utilisateur,
$com->pays_bill,
true));
1691 $send_admin_template_email =
'admin_info_payment_credit_card';
1696 if (file_exists(
$GLOBALS[
'fonctionsfianet'])) {
1697 echo
$GLOBALS[
'STR_THANKS_FIANET'];
1699 require_once($GLOBALS[
'fonctionsfianet']);
1700 $tpl->assign(
'form', getKwixoForm($order_id,
'comptant'));
1701 $send_admin_template_email =
'admin_info_payment_credit_card';
1706 if (file_exists(
$GLOBALS[
'fonctionsfianet'])) {
1707 echo
$GLOBALS[
'STR_THANKS_FIANET'];
1709 require_once($GLOBALS[
'fonctionsfianet']);
1710 $tpl->assign(
'form', getKwixoForm($order_id,
'rnp'));
1711 $send_admin_template_email =
'admin_info_payment_credit_card';
1715 case 'kwixo_credit':
1716 if (file_exists(
$GLOBALS[
'fonctionsfianet'])) {
1717 echo
$GLOBALS[
'STR_THANKS_FIANET'];
1719 require_once($GLOBALS[
'fonctionsfianet']);
1720 $tpl->assign(
'form', getKwixoForm($order_id,
'credit'));
1721 $send_admin_template_email =
'admin_info_payment_credit_card';
1726 case 'postfinance' :
1727 if (file_exists(
$GLOBALS[
'fonctionsogone'])) {
1728 require_once(
$GLOBALS[
'fonctionsogone']);
1729 $js_action =
'document.getElementById("ogoneForm").submit()';
1730 $tpl->assign(
'form', giveOgoneForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
$com->prenom_bill .
' ' .
$com->nom_bill,
$com->telephone_bill, $type));
1731 $send_admin_template_email =
'admin_info_payment_credit_card';
1736 if (file_exists(
$GLOBALS[
'dirroot'] .
'/modules/worldpay/fonctions.php')) {
1737 require_once(
$GLOBALS[
'dirroot'] .
'/modules/worldpay/fonctions.php');
1738 $js_action =
'document.getElementById("worldpayForm").submit()';
1739 $tpl->assign(
'form', giveWorldpayForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
$com->prenom_bill .
' ' .
$com->nom_bill,
$com->telephone_bill));
1740 $send_admin_template_email =
'admin_info_payment_credit_card';
1745 if (file_exists(
$GLOBALS[
'fonctionsomnikassa'])) {
1746 require_once(
$GLOBALS[
'fonctionsomnikassa']);
1747 $js_action =
'document.getElementById("omnikassaForm").submit()';
1748 $tpl->assign(
'form', giveOmnikassaForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
$com->prenom_bill .
' ' .
$com->nom_bill,
$com->telephone_bill));
1749 $send_admin_template_email =
'admin_info_payment_credit_card';
1753 case 'moneybookers' :
1754 if (file_exists(
$GLOBALS[
'fonctionsmoneybookers']) && !empty(
$GLOBALS[
'site_parameters'][
'email_moneybookers'])) {
1755 require_once(
$GLOBALS[
'fonctionsmoneybookers']);
1756 $js_action =
'document.getElementById("MoneyBookersForm").submit()';
1757 $tpl->assign(
'form',
getMoneyBookersForm(
vb(
$GLOBALS[
'site_parameters'][
'email_moneybookers']), $order_id,
$_SESSION[
'session_langue'],
$com->id_utilisateur,
$com->email,
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->prenom_bill,
$com->nom_bill,
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
fprix(
$com->total_tva,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->moneybookers_payment_methods));
1758 $send_admin_template_email =
'admin_info_payment_credit_card';
1763 if (file_exists(
$GLOBALS[
'fonctionspaypal']) && !empty(
$GLOBALS[
'site_parameters'][
'email_paypal'])) {
1764 require_once(
$GLOBALS[
'fonctionspaypal']);
1765 $js_action =
'document.getElementById("paypalForm").submit()';
1766 $tpl->assign(
'form',
getPaypalForm($order_id,
$_SESSION[
'session_langue'],
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
$com->devise,
$com->email, 1,
'',
$com->id_utilisateur,
$com->prenom_ship,
$com->nom_ship,
$com->adresse_ship,
$com->zip_ship,
$com->ville_ship,
$com->pays_ship,
$com->telephone_ship,
$com->prenom_bill,
$com->nom_bill,
$com->adresse_bill,
$com->zip_bill,
$com->ville_bill,
$com->pays_bill,
$com->telephone_bill));
1767 $tpl->assign(
'STR_FOR_A_PAYPAL_PAYMENT',
$GLOBALS[
'STR_FOR_A_PAYPAL_PAYMENT']);
1768 $tpl->assign(
'paypal_img_html',
$GLOBALS[
'STR_PAYPAL_IMG']);
1769 $send_admin_template_email =
'admin_info_payment_credit_card';
1774 if (function_exists(
'get_payment_form_'.$type)) {
1775 $function_name =
'get_payment_form_'.$type;
1776 $tpl->assign(
'form', $function_name(array(
'order_id' => $order_id,
'lang' =>
$_SESSION[
'session_langue'],
'amount' =>
fprix($amount_to_pay,
false,
$com->devise,
true,
$com->currency_rate,
false,
false),
'currency_code' =>
$com->devise,
'user_email' =>
$com->email,
'payment_times' => 1,
'sTexteLibre' =>
'',
'prenom_ship' =>
$com->prenom_ship,
'nom_ship' =>
$com->nom_ship,
'adresse_ship' =>
$com->adresse_ship,
'zip_ship' =>
$com->zip_ship,
'ville_ship' =>
$com->ville_ship,
'pays_ship' =>
$com->pays_ship,
'prenom_bill' =>
$com->prenom_bill,
'nom_bill' =>
$com->nom_bill,
'adresse_bill' =>
$com->adresse_bill,
'zip_bill' =>
$com->zip_bill,
'ville_bill' =>
$com->ville_bill,
'pays_bill' =>
$com->pays_bill,
'fullname_bill' =>
$com->prenom_bill .
' ' .
$com->nom_bill,
'telephone_bill' =>
$com->telephone_bill,
'type' => $type)));
1777 $send_admin_template_email =
'admin_info_payment_credit_card';
1781 if ($send_admin_email && !empty($send_admin_template_email)) {
1782 unset($custom_template_tags);
1783 $custom_template_tags[
'ORDER_ID'] = $order_id;
1784 send_email(
$GLOBALS[
'support_commande'],
'',
'', $send_admin_template_email, $custom_template_tags, null,
$GLOBALS[
'support_commande']);
1786 if($allow_autosend && !empty($js_action) && (
vn(
$GLOBALS[
'site_parameters'][
'module_autosend']) == 1)) {
1788 setTimeout("' .
filtre_javascript($js_action,
true,
false,
true,
true,
false) .
'", ' .
vn(
$GLOBALS[
'site_parameters'][
'module_autosend_delay']) * 1000 .
');
1804 if (empty($order_datetime) || substr($order_datetime, 0, 10) ==
'0000-00-00') {
1806 }
elseif (empty(
$GLOBALS[
'site_parameters'][
'keep_old_orders_intact']) ||
$GLOBALS[
'site_parameters'][
'keep_old_orders_intact'] ==
'0') {
1808 }
elseif (
$GLOBALS[
'site_parameters'][
'keep_old_orders_intact'] ==
'1') {
1809 if (intval(date(
'm')) > 6) {
1811 $reference_date = date(
'Y-12-31', time() - 24 * 3600 * 365);
1814 $reference_date = date(
'Y-12-31', time() - 24 * 3600 * 365 * 2);
1818 $reference_date = date(
'Y-m-d H:i:s',
$GLOBALS[
'site_parameters'][
'keep_old_orders_intact']);
1820 if (!empty($reference_date) && $order_datetime > $reference_date) {
1840 if (!empty(
$result[
'order_id'])) {
1849 if (empty(
$result[
'order_id']) || empty(
$id)) {
1852 $query =
query(
'SELECT MAX(order_id) as max_order_id
1856 return $result[
'max_order_id']+1;
foreach(array('date1', 'date2', 'type', 'renewals', 'width') as $item) $data
get_delivery_cost_infos($total_weight, $total_price, $type_id=null, $zone_id=null, $nb_product=1)
Calcul des frais de livraison Si type_id est vide, on récupère les tarifs en excluant les tarifs=0 qu...
put_session_commande(&$frm)
Récupère les informations du tableau $frm pour les mettre de manière standardisée dans $_SESSION['ses...
get_payment_status_name($id)
get_payment_status_name()
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
static htmlspecialchars_decode($string, $style=ENT_COMPAT)
This function is String::htmlspecialchars_decode with php4 compatibility.
get_discount_text($remise_valeur, $remise_percent, $is_remise_valeur_including_taxe)
Retourne la remise d'un code promotionnel (en % dans le cas d'une remise en pourcentage ou dans le fo...
get_user_information($user_id=null, $get_full_infos=false)
Chargement des détails de l'utilisateur.
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
get_delivery_type_name($id)
get_delivery_type_name()
if(!defined('IN_PEEL')) get_bill_number($bill_number_format, $id, $generate_bill_number_if_empty=true)
Fonction qui génère le numéro de facture pour la facture n° $id à partir du format défini dans les pa...
get_product_infos_array_in_order($order_id, $devise=null, $currency_rate=null, $order_by=null, $add_total_prix_attribut=false)
get_product_infos_array_in_order()
get_delivery_status_name($id)
get_delivery_status_name()
get_vat_array($code_facture)
Fonction permettant l'affichage des taux de TVA dans les factures.
handle_specific_fields(&$frm, $form_usage= 'user')
Traite la réception de champs spécifiques venant d'un formulaire, et l'identification de tous les cha...
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
is_order_modification_allowed($order_datetime)
Renvoie si il est autorisé de modifier une commande.
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
get_order_id($id=null)
Fonction qui génère le numéro de commande comptable.
get_needed_for_free_delivery($total_weight, $total_price, $type_id=null, $zone_id=null, $nb_product=1)
get_needed_for_free_delivery()
insert_id($database_object=null)
insert_id()
static strlen($string)
Returns the length of the given string.
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
if(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
real_escape_string($value)
real_escape_string()
if(!defined('PAYPAL_SANDBOX')) getPaypalForm($order_id, $lang, $amount, $currency_code, $user_email, $payment_times=1, $sTexteLibre= '', $user_id, $prenom_ship, $nom_ship, $adresse_ship, $zip_ship, $ville_ship, $pays_ship, $telephone_ship, $prenom_bill=null, $nom_bill=null, $adresse_bill=null, $zip_bill=null, $ville_bill=null, $pays_bill=null, $telephone_bill=null)
Génère le formulaire de paiement Paypal.
getMoneyBookersForm($pay_to_email, $order_id, $lang, $user_id, $user_email, $amount, $currency, $user_firstname, $user_familyname, $user_address, $user_zip, $user_town, $user_country_name, $total_tva, $payment_methods)
getMoneyBookersForm()
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
get_user_id_from_email($email)
Fonction de recherche d'id utilisateur par l'email.
if(!defined('IN_PEEL')) display_prices_with_taxes_active()
display_prices_with_taxes_active()
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
create_or_update_order(&$order_infos, &$articles_array)
Crée ou modifie une commande en base de données, ainsi que les produits commandés.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
num_rows($query_result)
num_rows()
if(!defined('IN_PEEL')) send_email($to, $mail_subject= '', $mail_content= '', $template_technical_code=null, $template_tags=null, $format=null, $sender=null, $html_add_structure=true, $html_correct_conformity=false, $html_convert_url_to_links=true, $reply_to=null, $attached_files_infos_array=null, $lang=null, $additional_infos_array=array(), $attachment_not_sent_by_email=false)
Envoi d'un email à un utilisateur.
get_table_field_names($table_name, $link_identifier=null, $silent_if_error=false)
get_table_field_names()
fetch_object($query_result)
fetch_object()
send_mail_order_admin($order_id)
send_mail_order_admin()
accounting_insert_transaction($order_id, $technical_code, $data)
Crée une transaction d'encaissement.
fetch_assoc($query_result)
fetch_assoc()
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
get_payment_form($order_id, $forced_type=null, $send_admin_email=false, $amount_to_pay=0, $allow_autosend=true)
Renvoie le formulaire de paiement.
is_delivery_address_necessary_for_delivery_type($selected_delivery_type_id=null)
is_delivery_address_necessary_for_delivery_type()
$GLOBALS['page_columns_count']
email_commande($order_id)
email_commande()
get_payment_technical_code($id_or_code)
get_payment_technical_code()
get_site_wwwroot($site_id, $lang=null)
Renvoie l'URL d'un site donné
get_site_id_sql_set_value($site_ids)
Retourne la valeur SQL d'un champ INT ou SET suivant que ce soit un entier ou un tableau.
MDP($chrs=8)
Fonction utilisée pour générer un mot aléatoire (sert par exemple pour le renommage des fichiers imag...
get_order_infos_array($order_object)
get_order_infos_array()
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
get_payment_name($id_or_code)
get_payment_name()
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
static substr_count($string, $searched)
Returns the number of times the needle substring occurs in the haystack string.
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
update_order_payment_status($order_id, $status_or_is_payment_validated, $allow_update_paid_orders=true, $statut_livraison_new=null, $delivery_tracking=null, $no_stock_decrement_already_done=false, $payment_technical_code=null)
Met à jour le status de paiement et/ou de livraison d'une commande, et gère les stocks suivant le sta...
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
send_avis_expedition($commandeid, $delivery_tracking)
send_avis_expedition()