[ task #652 ] Reduce clicks into creaton of orders, invoices, etc.
This commit is contained in:
parent
0e060cac11
commit
f7e5edb0f8
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
@ -204,6 +204,13 @@ else if ($action == 'add' && $user->rights->commande->creer)
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($socid<1)
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -1355,7 +1362,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
dol_htmloutput_mesg($mesg,$mesgs,'error');
|
||||
|
||||
$soc = new Societe($db);
|
||||
if ($socid) $res=$soc->fetch($socid);
|
||||
if ($socid>0) $res=$soc->fetch($socid);
|
||||
|
||||
if (! empty($origin) && ! empty($originid))
|
||||
{
|
||||
@ -1450,26 +1457,43 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
print '</tr>';
|
||||
|
||||
// Client
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td colspan="2">'.$soc->getNomUrl(1).'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
|
||||
if($socid>0)
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('','socid','s.client = 1',1);
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
/*
|
||||
* Contact de la commande
|
||||
*/
|
||||
print "<tr><td>".$langs->trans("DefaultContact").'</td><td colspan="2">';
|
||||
$form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist);
|
||||
print '</td></tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
|
||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
print '. ';
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
if($socid>0)
|
||||
{
|
||||
print "<tr><td>".$langs->trans("DefaultContact").'</td><td colspan="2">';
|
||||
$form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist);
|
||||
print '</td></tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
|
||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
print '. ';
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
}
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
||||
$form->select_date('','re','','','',"crea_commande",1,1);
|
||||
@ -1506,7 +1530,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
if (! empty($conf->projet->enabled) && $socid>0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||
$numprojet=select_projects($soc->id,$projectid);
|
||||
|
||||
@ -852,7 +852,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
{
|
||||
$langs->load("orders");
|
||||
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
$newmenu->add("/societe/societe.php?leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
|
||||
$newmenu->add("/commande/fiche.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
|
||||
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user