From 6013916d459e4b448ecf0a150755c49fc1edcb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 7 Apr 2013 21:58:24 +0200 Subject: [PATCH 1/2] Removed duplicated code and fixed a problem with orders2invoice --- htdocs/commande/orderstoinvoice.php | 35 +++++++++++++---------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index c709b2b4bbd..a6b2fe44a1f 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -51,37 +51,32 @@ $sref = GETPOST('sref'); $sref_client = GETPOST('sref_client'); $sall = GETPOST('sall'); $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 (! $sortorder) $sortorder='DESC'; -$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server -$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); -$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_endy=dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]); -$selected=GETPOST('orders_to_invoice'); -$action=GETPOST('action','alpha'); +$now = dol_now(); +$date_start = dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server +$date_end = dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); +$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_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]); + if ($action == 'create') { - if (! is_array($selected)) + if (is_array($selected) == false) { - $mesgs[]='
'.$langs->trans('Error_OrderNotChecked').'
'; + $mesgs = array('
'.$langs->trans('Error_OrderNotChecked').'
'); } else { - $socid=GETPOST('socid'); - $action=GETPOST('action'); - $origin=GETPOST('origin'); - $originid=GETPOST('originid'); + $origin = GETPOST('origin'); + $originid = GETPOST('originid'); } } -$now=dol_now(); - -$viewstatut=GETPOST('viewstatut'); - /* * Actions @@ -358,7 +353,7 @@ $formfile = new FormFile($db); $companystatic = new Societe($db); // Mode creation -if ($action == 'create') +if ($action == 'create' && empty($mesgs)) { $facturestatic=new Facture($db); From 303cf3bc41062c945fa6e3a1132d00e11053cc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 7 Apr 2013 22:00:51 +0200 Subject: [PATCH 2/2] Updated changelog --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3a3907ab729..5300f3f219b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,8 @@ English Dolibarr ChangeLog - Fix: Can't reset payment due date - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - 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