diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 5c63f1264c4..9292a378327 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -73,9 +73,9 @@ $search_zip=GETPOST('search_zip','alpha'); $search_state=trim(GETPOST("search_state")); $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); -$viewstatut=GETPOST('viewstatut'); +$viewstatut=GETPOST('viewstatut','alpha'); $optioncss = GETPOST('optioncss','alpha'); -$object_statut=GETPOST('propal_statut'); +$object_statut=GETPOST('propal_statut','alpha'); $sall=GETPOST('sall', 'alphanohtml'); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index bface3db915..6c93166c063 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2053,11 +2053,13 @@ else if ($id || $ref) else print ''.$langs->trans('SendByMail').''; } - // Create bill and Close shipment + // Create bill if (! empty($conf->facture->enabled) && $object->statut > 0) { if ($user->rights->facture->creer) { + // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) + // If we do that, we must also make this option official. print ''.$langs->trans("CreateBill").''; } } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 01a4a1fb79f..eeec2c135a2 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -50,6 +50,7 @@ $search_zip=GETPOST('search_zip','alpha'); $search_state=trim(GETPOST("search_state")); $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); +$search_billed=GETPOST("search_billed",'int'); $sall = GETPOST('sall', 'alphanohtml'); $optioncss = GETPOST('optioncss','alpha'); @@ -100,7 +101,8 @@ $arrayfields=array( 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled) + 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled), + 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) ); // Extra fields @@ -138,6 +140,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_type=''; $search_country=''; $search_type_thirdparty=''; + $search_billed=''; $viewstatut=''; $search_array_options=array(); } @@ -174,7 +177,7 @@ $formcompany=new FormCompany($db); $helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; llxHeader('',$langs->trans('ListOfSendings'),$helpurl); -$sql = "SELECT e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut,"; +$sql = "SELECT e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,"; $sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; $sql.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; @@ -210,6 +213,7 @@ if ($socid) if ($viewstatut <> '' && $viewstatut >= 0) { $sql.= " AND e.fk_statut = ".$viewstatut; } +if ($search_billed != '' && $search_billed >= 0) $sql.=' AND e.billed = '.$search_billed; if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); if ($search_state) $sql.= natural_search("state.nom",$search_state); @@ -420,6 +424,13 @@ if ($resql) print $form->selectarray('viewstatut', array('0'=>$langs->trans('StatusSendingDraftShort'),'1'=>$langs->trans('StatusSendingValidatedShort'),'2'=>$langs->trans('StatusSendingProcessedShort')),$viewstatut,1); print ''; } + // Status billed + if (! empty($arrayfields['e.billed']['checked'])) + { + print ''; + print $form->selectyesno('search_billed', $search_billed, 1, 0, 1); + print ''; + } // Action column print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -460,7 +471,7 @@ if ($resql) if (! empty($arrayfields['e.datec']['checked'])) print_liste_field_titre($arrayfields['e.datec']['label'],$_SERVER["PHP_SELF"],"e.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['e.tms']['checked'])) print_liste_field_titre($arrayfields['e.tms']['label'],$_SERVER["PHP_SELF"],"e.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['e.fk_statut']['checked'])) print_liste_field_titre($arrayfields['e.fk_statut']['label'],$_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['l.fk_statut']['checked'])) print_liste_field_titre($arrayfields['l.fk_statut']['label'], $_SERVER["PHP_SELF"],"l.fk_statut","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['e.billed']['checked'])) print_liste_field_titre($arrayfields['e.billed']['label'],$_SERVER["PHP_SELF"],"e.billed","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -479,7 +490,6 @@ if ($resql) $companystatic->name=$obj->name; - print ''; // Ref @@ -628,6 +638,13 @@ if ($resql) print ''.$shipment->LibStatut($obj->fk_statut,5).''; if (! $i) $totalarray['nbfield']++; } + // Billed + if (! empty($arrayfields['e.billed']['checked'])) + { + print ''.yn($obj->billed).''; + if (! $i) $totalarray['nbfield']++; + } + // Action column print ''; if (! $i) $totalarray['nbfield']++;