Merge pull request #813 from marcosgdf/3.3

Removed duplicated code and fixed a problem with orders2invoice
This commit is contained in:
Laurent Destailleur 2013-04-07 14:00:32 -07:00
commit 4ce7a70411
2 changed files with 17 additions and 21 deletions

View File

@ -14,6 +14,7 @@ English Dolibarr ChangeLog
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list - Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: Orderstoinvoice didn't act as expected when no order was checked

View File

@ -51,37 +51,32 @@ $sref = GETPOST('sref');
$sref_client = GETPOST('sref_client'); $sref_client = GETPOST('sref_client');
$sall = GETPOST('sall'); $sall = GETPOST('sall');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$selected = GETPOST('orders_to_invoice');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$viewstatut = GETPOST('viewstatut');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
if (! $sortfield) $sortfield='c.rowid'; if (! $sortfield) $sortfield='c.rowid';
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server $now = dol_now();
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); $date_start = dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server
$date_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server $date_end = dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
$date_endy=dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]); $date_starty = dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
$selected=GETPOST('orders_to_invoice'); $date_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
$action=GETPOST('action','alpha');
if ($action == 'create') if ($action == 'create')
{ {
if (! is_array($selected)) if (is_array($selected) == false)
{ {
$mesgs[]='<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>'; $mesgs = array('<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>');
} }
else else
{ {
$socid=GETPOST('socid'); $origin = GETPOST('origin');
$action=GETPOST('action'); $originid = GETPOST('originid');
$origin=GETPOST('origin');
$originid=GETPOST('originid');
} }
} }
$now=dol_now();
$viewstatut=GETPOST('viewstatut');
/* /*
* Actions * Actions
@ -358,7 +353,7 @@ $formfile = new FormFile($db);
$companystatic = new Societe($db); $companystatic = new Societe($db);
// Mode creation // Mode creation
if ($action == 'create') if ($action == 'create' && empty($mesgs))
{ {
$facturestatic=new Facture($db); $facturestatic=new Facture($db);