* * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Source$ * */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once("../includes/configure.php"); require_once("../clients/osc_customer.class.php"); require_once("../produits/osc_product.class.php"); llxHeader(); if ($action == '' && !$cancel) { if ($_GET["orderid"]) { $osc_order = new Osc_order($db, $_GET["orderid"]); $result = $osc_order->fetch($_GET["orderid"]); if ( !$result) { $osc_prod = new Osc_Product($db); print '
| client OSC | '.$osc_order->osc_custid.' | '; print '
| Nom client | '.$osc_order->osc_custname.' | '; print '
| Montant | '.convert_price($osc_order->osc_ordertotal).' | '; print '
| Date commande | '.$osc_order->osc_orderdate.' | '; print '
| Méthode de paiement | '.$osc_order->osc_orderpaymet.' | '; print "
| '.$osc_order->osc_lines[$l]["products_id"].' | '.$osc_prod->get_productid($osc_order->osc_lines[$l]["products_id"]).' | '.$osc_order->osc_lines[$l]["products_name"].' | '.convert_price($osc_order->osc_lines[$l]["products_price"]).' | '.$osc_order->osc_lines[$l]["quantity"].' |
ERROR 1c
\n"; dolibarr_print_error('',"erreur webservice ".$osc_order->error); print ''.$langs->trans("Retour").''; print "\nERROR 1b
\n"; print ''.$langs->trans("Retour").''; print "\nCette commande existe déjà
'; } else { // vérifier que la société est renseignée, sinon importer le client d'abord if ( ! $commande->socid) { $osc_cust = new Osc_customer($db, $osc_order->osc_custid); $result = $osc_cust->fetch($osc_order->osc_custid); if ( !$result ) { $societe = new Societe($db); if ($_error == 1) { print "\ncréation réussie nouveau client/prospect : '.$societe->nom; $res = $osc_cust->transcode($osc_cust->osc_custid,$societe->id); print ' : Id Dolibarr '.$societe->id.' , Id osc : '.$osc_cust->osc_custid.'
'; } else { print 'création impossible client : '. $osc_cust->osc_custid .'
'; exit; } } } // vérifier l'existence des produits commandés $osc_product = new Osc_Product($db); $err = 0; for ($lig = 0; $lig < sizeof($commande->lines); $lig++) { if (! $commande->lines[$lig]->fk_product) $err ++; } if ($err > 0) { print ("Des produits de la commande sont inexistants
"); $id =-9; } else $id = $commande->create($user); if ($id > 0) { print "\n$id = -3 ".$commande->error."
"); $_error = 1; $_GET["action"] = "create"; $_GET["type"] = $_POST["type"]; } if ($id == -2) { /* la référence existe on fait un update */ $societe_control = new Societe($db); if ($_error == 1) { print '