diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a7c4ef4b424..d9bd0be1471 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1619,6 +1619,18 @@ else } } + // Créer commande fournisseur + if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->fournisseur->commande->creer) + { + print ''.$langs->trans('Commande PCB').''; + } + + // Créer commande fournisseur + if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->fournisseur->commande->creer) + { + print ''.$langs->trans('Commande ACD').''; + } + // Edit if ($commande->statut == 1) { diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index d82f7610cd0..c650de045a1 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -37,6 +37,7 @@ $user->getrights("fournisseur"); if (!$user->rights->fournisseur->commande->lire) accessforbidden(); +$comclientid = isset($_GET["comid"])?$_GET["comid"]:''; // Sécurité accés client $socid=0; @@ -239,6 +240,12 @@ if ($_GET["action"] == 'create') if ($fourn->create_commande($user) > 0) { $idc = $fourn->single_open_commande; + + if ($comclientid != '') + { + $fourn->updateFromCommandeClient($user,$idc,$comclientid); + } + Header("Location:fiche.php?id=".$idc); exit; } @@ -437,8 +444,11 @@ if ($_GET["id"] > 0) */ print ''; - $sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice"; + $sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty"; + $sql.= ", l.rowid, l.tva_tx, l.remise_percent, l.subprice"; + $sql.= ", p.label"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid"; $sql.= " WHERE l.fk_commande = $commande->id"; $sql.= " ORDER BY l.rowid"; @@ -452,6 +462,7 @@ if ($_GET["id"] > 0) { print ''; print ''; + print ''; print ''; print ''; print ''; @@ -466,6 +477,7 @@ if ($_GET["id"] > 0) $objp = $db->fetch_object($resql); print ""; print ''; + print ""; print ""; print ''; print '';
'.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("Description").''.$langs->trans("VAT").''.$langs->trans("Qty").'
'.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.'".$objp->label."".nl2br($objp->description)."'.$objp->tva_tx.'%'.$objp->qty.'