diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 997ebd160b9..3135b2aee2c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1893,13 +1893,28 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; - // Societe + // Third party print ''.$langs->trans('Company').''; print ''.$soc->getNomUrl(1).''; print ''; - // Ligne info remises tiers - print ''.$langs->trans('Discounts').''; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + { + $filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } + else + { + $filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; + $filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; + } + + // Relative and absolute discounts + $addrelativediscount=''.$langs->trans("EditRelativeDiscounts").''; + $addabsolutediscount=''.$langs->trans("EditGlobalDiscounts").''; + $addcreditnote=''.$langs->trans("AddCreditNote").''; + + print ''.$langs->trans('Discounts').''; if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); else print $langs->trans("CompanyHasNoRelativeDiscount"); print '. '; @@ -1915,10 +1930,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } else { - // Remise dispo de type non avoir - $filter='fk_facture_source IS NULL'; + // Remise dispo de type remise fixe (not credit note) print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filterabsolutediscount); } } if ($absolute_creditnote) @@ -1958,10 +1972,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; - if ($action != 'editdate_livraison') print ''; print '
'; print $langs->trans('DateDeliveryPlanned'); print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'
'; - print ''; + print ''; if ($action == 'editdate_livraison') { print '
'; @@ -1976,6 +1989,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : ' '; } print ''; + print ''; // Terms of payment print ''; @@ -1984,7 +1998,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; if ($action != 'editconditions' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).''; print ''; - print ''; + print ''; if ($action == 'editconditions') { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id',1); @@ -2004,7 +2018,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; if ($action != 'editmode' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetMode'),1).''; print ''; - print ''; + print ''; if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); @@ -2022,7 +2036,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; if ($action != 'editavailability' && $object->brouillon) print 'id.'">'.img_edit($langs->trans('SetAvailability'),1).''; print ''; - print ''; + print ''; if ($action == 'editavailability') { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); @@ -2040,7 +2054,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; if ($action != 'editdemandreason' && ! empty($object->brouillon)) print 'id.'">'.img_edit($langs->trans('SetDemandReason'),1).''; print ''; - print ''; + print ''; if ($action == 'editdemandreason') { $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); @@ -2065,7 +2079,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; if ($action != 'classify') print ''.img_edit($langs->trans('SetProject')).''; print ''; - print ''; + print ''; //print "$object->id, $object->socid, $object->fk_project"; if ($action == 'classify') { @@ -2079,52 +2093,52 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } // Other attributes - $parameters=array('colspan' => ' colspan="2"'); + $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); } + $rowspan=4; + if ($mysoc->localtax1_assuj=="1") $rowspan++; + if ($mysoc->localtax2_assuj=="1") $rowspan++; + // Total HT print ''.$langs->trans('AmountHT').''; - print ''.price($object->total_ht).''; - print ''.$langs->trans('Currency'.$conf->currency).''; + print ''.price($object->total_ht,'',$langs,'','',0,$conf->currency).''; // Margin Infos - if (! empty($conf->margin->enabled)) { - print ''; + if (! empty($conf->margin->enabled)) + { + print ''; $object->displayMarginInfos(); print ''; } + else print ''; + print ''; // Total TVA - print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''; - print ''.$langs->trans('Currency'.$conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($object->total_tva,'',$langs,'','',0,$conf->currency).''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; - print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->currency).''; + print ''.price($object->total_localtax1,'',$langs,'','',0,$conf->currency).''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; - print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->currency).''; + print ''.price($object->total_localtax2,'',$langs,'','',0,$conf->currency).''; } // Total TTC - print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''; - print ''.$langs->trans('Currency'.$conf->currency).''; + print ''.$langs->trans('AmountTTC').''.price($object->total_ttc,'',$langs,'','',0,$conf->currency).''; // Statut - print ''.$langs->trans('Status').''; - print ''.$object->getLibStatut(4).''; - print ''; + print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; print '
'; print "\n"; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f22ae595a77..38ad5dee987 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -305,6 +305,10 @@ function ajax_dialog($title,$message,$w=350,$h=150) */ function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0) { + global $conf; + + if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) + $msg = '