Fix: [bug #316]
This commit is contained in:
parent
72ca840cab
commit
eb5177194e
@ -639,16 +639,16 @@ if ($action == 'addline' && $user->rights->commande->creer)
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang='';
|
$newlang='';
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','int')) $newlang=GETPOST('lang_id','int');
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||||
if (! empty($newlang))
|
if (! empty($newlang))
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
|
|
||||||
unset($_POST['qty']);
|
unset($_POST['qty']);
|
||||||
|
|||||||
@ -133,12 +133,7 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
dol_print_error($db,$object->error);
|
dol_print_error($db,$object->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
$ret=$object->fetch_thirdparty();
|
||||||
if ($object->socid)
|
|
||||||
{
|
|
||||||
$societe=new Societe($db);
|
|
||||||
$societe->fetch($object->socid);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ecrase $pu par celui du produit
|
// Ecrase $pu par celui du produit
|
||||||
// Ecrase $desc par celui du produit
|
// Ecrase $desc par celui du produit
|
||||||
@ -171,7 +166,7 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
|
|
||||||
$remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"];
|
$remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"];
|
||||||
|
|
||||||
$tva_tx = get_default_tva($societe,$mysoc,$product->id);
|
$tva_tx = get_default_tva($object->client,$mysoc,$product->id);
|
||||||
$type = $product->type;
|
$type = $product->type;
|
||||||
|
|
||||||
// Local Taxes
|
// Local Taxes
|
||||||
@ -207,8 +202,8 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
$tva_tx = price2num($_POST['tva_tx']);
|
$tva_tx = price2num($_POST['tva_tx']);
|
||||||
|
|
||||||
// Local Taxes
|
// Local Taxes
|
||||||
$localtax1_tx= get_localtax($tva_tx, 1, $societe);
|
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
|
||||||
$localtax2_tx= get_localtax($tva_tx, 2, $societe);
|
$localtax2_tx= get_localtax($tva_tx, 2, $object->client);
|
||||||
|
|
||||||
if (! $_POST['dp_desc'])
|
if (! $_POST['dp_desc'])
|
||||||
{
|
{
|
||||||
@ -235,11 +230,15 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
//print "xx".$tva_tx; exit;
|
//print "xx".$tva_tx; exit;
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
if (! empty($_REQUEST['lang_id']))
|
$newlang='';
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','int')) $newlang=GETPOST('lang_id','int');
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||||
|
if (! empty($newlang))
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
|
|
||||||
@ -1416,7 +1415,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$genallowed=$user->rights->fournisseur->commande->creer;
|
$genallowed=$user->rights->fournisseur->commande->creer;
|
||||||
$delallowed=$user->rights->fournisseur->commande->supprimer;
|
$delallowed=$user->rights->fournisseur->commande->supprimer;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
$somethingshown=$formfile->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$soc->default_lang);
|
||||||
|
|
||||||
$object=$object;
|
$object=$object;
|
||||||
|
|
||||||
|
|||||||
@ -440,12 +440,7 @@ if ($_GET['action'] == 'addline')
|
|||||||
dol_print_error($db,$facfou->error);
|
dol_print_error($db,$facfou->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
$ret=$facfou->fetch_thirdparty();
|
||||||
if ($facfou->socid)
|
|
||||||
{
|
|
||||||
$societe=new Societe($db);
|
|
||||||
$societe->fetch($facfou->socid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_POST['idprodfournprice']) // > 0 or -1
|
if ($_POST['idprodfournprice']) // > 0 or -1
|
||||||
{
|
{
|
||||||
@ -509,12 +504,16 @@ if ($_GET['action'] == 'addline')
|
|||||||
//print "xx".$tva_tx; exit;
|
//print "xx".$tva_tx; exit;
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$outputlangs = $langs;
|
// Define output language
|
||||||
if (! empty($_REQUEST['lang_id']))
|
$outputlangs = $langs;
|
||||||
{
|
$newlang='';
|
||||||
$outputlangs = new Translate("",$conf);
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','int')) $newlang=GETPOST('lang_id','int');
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$facfou->client->default_lang;
|
||||||
}
|
if (! empty($newlang))
|
||||||
|
{
|
||||||
|
$outputlangs = new Translate("",$conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
//supplier_invoice_pdf_create($db, $fac->id, $fac->modelpdf, $outputlangs);
|
//supplier_invoice_pdf_create($db, $fac->id, $fac->modelpdf, $outputlangs);
|
||||||
|
|
||||||
unset($_POST['qty']);
|
unset($_POST['qty']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user