Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ task #104 ] Possibilité de facturer plusieurs commandes #222

Merged
merged 1 commit into from Jun 6, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 3 additions & 11 deletions htdocs/commande/orderstoinvoice.php
Expand Up @@ -49,14 +49,9 @@


$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='c.rowid'; if (! $sortfield) $sortfield='c.rowid';
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server $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_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_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
Expand Down Expand Up @@ -202,14 +197,12 @@
$sql.= ", '".$object->element."'"; $sql.= ", '".$object->element."'";
$sql.= ")"; $sql.= ")";


dol_syslog(get_class($this)."::add_object_linked sql=".$sql, LOG_DEBUG);
if ($db->query($sql)) if ($db->query($sql))
{ {
$db->commit(); $db->commit();
} }
else else
{ {

$db->rollback(); $db->rollback();
} }
} }
Expand Down Expand Up @@ -528,7 +521,6 @@
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
} }
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder; $sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$sql.= $db->plimit($limit + 1,$offset);
$resql = $db->query($sql); $resql = $db->query($sql);


if ($resql) if ($resql)
Expand All @@ -545,7 +537,7 @@
} }
$title.=' - '.$langs->trans('StatusOrderToBillShort'); $title.=' - '.$langs->trans('StatusOrderToBillShort');
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print_barre_liste($title, $_GET['page'], 'liste.php','&socid='.$socid,$sortfield,$sortorder,'',$num); print_fiche_titre($title);
$i = 0; $i = 0;
$period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1); $period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1);
$periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1); $periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1);
Expand Down Expand Up @@ -604,7 +596,7 @@
$var=True; $var=True;
$generic_commande = new Commande($db); $generic_commande = new Commande($db);


while ($i < min($num,$limit)) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
Expand Down