From 2f4c84f4b5226909b6b628d102d320de0ea9460c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jun 2024 13:23:05 +0200 Subject: [PATCH] Debug v20 --- htdocs/compta/facture/card.php | 19 ++++++-------- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 18 ++++++------- htdocs/core/tpl/object_discounts.tpl.php | 33 ++++++++++++++---------- htdocs/langs/en_US/bills.lang | 1 + htdocs/theme/eldy/global.inc.php | 11 +++++--- htdocs/theme/md/style.css.php | 5 +++- 7 files changed, 51 insertions(+), 38 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7ce2a51c638..86b6ba5d0fd 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3390,9 +3390,6 @@ if ($action == 'create') { if (empty($reshook)) { print ''; - // Ref - //print ''; - $exampletemplateinvoice = new FactureRec($db); $invoice_predefined = new FactureRec($db); if (empty($origin) && empty($originid) && GETPOSTINT('fac_rec') > 0) { @@ -3532,7 +3529,7 @@ if ($action == 'create') { $tmp = ' '; $tmp = $tmp.''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3, 'standardonsmartphone'); + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', 'nowraponall', 0, 3, 'standardonsmartphone'); print '
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'; print ''; } + // Discounts for the known third party if ($socid > 0) { - // Discounts for third party print ''; - + // Warranty if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { $rwStyle = 'display:none;'; if (in_array(GETPOSTINT('type'), $retainedWarrantyInvoiceAvailableType)) { @@ -4048,7 +4045,7 @@ if ($action == 'create') { print ''; print ''; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 18f71ac2f20..e674eb079e7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9064,7 +9064,7 @@ abstract class CommonObject } $out .= ($display_type == 'card' ? '' : ''); - $out .= ($display_type == 'card' ? '' : ''); + $out .= ($display_type == 'card' ? ''."\n" : ''); $e++; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0e779ddd9d7..ec51a50d8a5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6490,16 +6490,16 @@ class Form } /** - * Return array of currencies in user language + * Return array of currencies in user language * - * @param string $selected Preselected currency code - * @param string $htmlname Name of HTML select list - * @param integer $useempty 1=Add empty line - * @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)') - * @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. - * true = we are in currency_rate update , we don't want to see conf->currency in select - * @param string $morecss More css - * @return string + * @param string $selected Preselected currency code + * @param string $htmlname Name of HTML select list + * @param integer $useempty 1=Add empty line + * @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)') + * @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. + * true = we are in currency_rate update , we don't want to see conf->currency in select + * @param string $morecss More css + * @return string HTML component */ public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = false, $morecss = '') { diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 8ad7608d168..17221165344 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -32,10 +32,10 @@ $isInvoice = in_array($object->element, array('facture', 'invoice', 'facture_fou $isNewObject = empty($object->id) && empty($object->rowid); // Clean variables not defined -if (!isset($absolute_discount)) { +if (empty($absolute_discount)) { $absolute_discount = 0; } -if (!isset($absolute_creditnote)) { +if (empty($absolute_creditnote)) { $absolute_creditnote = 0; } @@ -52,28 +52,31 @@ if (!empty($discount_type)) { if ($fixedDiscount > 0) { $translationKey = (empty($discount_type)) ? 'CompanyHasRelativeDiscount' : 'HasRelativeDiscountFromSupplier'; - print $langs->trans($translationKey, $fixedDiscount).'.'; + print $langs->trans($translationKey, $fixedDiscount); } else { - $translationKey = (empty($discount_type)) ? 'CompanyHasNoRelativeDiscount' : 'HasNoRelativeDiscountFromSupplier'; - print ''.$langs->trans($translationKey).'.'; -} -if ($isNewObject) { - print ' '.$addrelativediscount; + if ($conf->dol_optimize_smallscreen) { + $translationKey = 'RelativeDiscount'; + } else { + $translationKey = (empty($discount_type)) ? 'CompanyHasNoRelativeDiscount' : 'HasNoRelativeDiscountFromSupplier'; + } + print ''.$langs->trans($translationKey).''; } +// Add link to edit the relative discount +print ' '.$addrelativediscount; // Is there is commercial discount or down payment available ? if ($absolute_discount > 0) { if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) { $translationKey = empty($discount_type) ? 'CompanyHasDownPaymentOrCommercialDiscount' : 'HasDownPaymentOrCommercialDiscountFromSupplier'; - $text = $langs->trans($translationKey, price($absolute_discount, 1, $outlangs, 1, -1, -1, $conf->currency)).'.'; + $text = $langs->trans($translationKey, price($absolute_discount, 1, $outlangs, 1, -1, -1, $conf->currency)); if ($isInvoice && !$isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse')); } if ($isNewObject) { - $text .= $addabsolutediscount; + $text .= ' '.$addabsolutediscount; } if ($isNewObject) { @@ -94,7 +97,7 @@ if ($absolute_creditnote > 0) { // If validated, we show link "add credit note to payment" if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) { $translationKey = empty($discount_type) ? 'CompanyHasCreditNote' : 'HasCreditNoteFromSupplier'; - $text = $langs->trans($translationKey, price($absolute_creditnote, 1, $langs, 1, -1, -1, $conf->currency)).'.'; + $text = $langs->trans($translationKey, price($absolute_creditnote, 1, $langs, 1, -1, -1, $conf->currency)); if ($isInvoice && !$isNewObject && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('CreditNoteDepositUse')); @@ -117,8 +120,12 @@ if ($absolute_creditnote > 0) { } if ($absolute_discount <= 0 && $absolute_creditnote <= 0) { - $translationKey = !empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount'; - print '
'.$langs->trans($translationKey).'.'; + if ($conf->dol_optimize_smallscreen) { + $translationKey = 'AbsoluteDiscount'; + } else { + $translationKey = !empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount'; + } + print '
'.$langs->trans($translationKey).''; if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { print ' '.$addabsolutediscount; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index f37b236bf05..ce5c7778993 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -327,6 +327,7 @@ ShowDiscount=Show discount ShowReduc=Show the discount ShowSourceInvoice=Show the source invoice RelativeDiscount=Relative discount +AbsoluteDiscount=Absolute discount GlobalDiscount=Global discount CreditNote=Credit note CreditNotes=Credit notes diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 69693f21036..68d2ffea882 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2015,9 +2015,14 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select text-overflow: ellipsis; white-space: nowrap; } - .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { + .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, + div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 40px !important; } + div.tabBar .listofinvoicetype table tr, div.tabBar .listofinvoicetype table tr td { + height: 28px !important; + } + div.tabs div.tab a.tab { max-width: 200px; @@ -2070,8 +2075,8 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select .minwidth300imp { min-width: 120px !important; } .minwidth400imp { min-width: 200px !important; } .minwidth500imp { min-width: 250px !important; } - .titlefield { width: auto; min-width: unset; } - .titlefieldcreate { width: auto !important; } + .titlefield { width: auto; min-width: 125px; } + .titlefieldcreate { width: auto !important; min-width: 125px; } #tooltip { position: absolute; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d0098d6c9b5..fb9b1da4655 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2181,6 +2181,9 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 40px !important; } + div.tabBar .listofinvoicetype table tr, div.tabBar .listofinvoicetype table tr td { + height: 28px !important; + } div.tabs div.tab a.tab { max-width: 200px; @@ -2230,7 +2233,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select .minwidth400imp { min-width: 150px !important; } .minwidth500imp { min-width: 250px !important; } .titlefield { width: auto; min-width: unset; } - .titlefieldcreate { width: auto; } + .titlefieldcreate { min-width: 125px; /* width: auto !important; */ } #tooltip { position: absolute;
'; print $desc; @@ -3719,7 +3716,7 @@ if ($action == 'create') { $tmp = ' '; $text = $tmp.' '; $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3, 'firstsituationonsmartphone'); + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', 'nowraponall', 0, 3, 'firstsituationonsmartphone'); print $desc; print ''; } @@ -3728,7 +3725,7 @@ if ($action == 'create') { $tmp = ' '; $text = $tmp.' '; //$text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc").'

'.$langs->trans("YouMustCreateInvoiceFromThird"), 1, 'help', '', 0, 3, 'replacementonsmartphone'); + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc").'

'.$langs->trans("YouMustCreateInvoiceFromThird"), 1, 'help', 'nowraponall', 0, 3, 'replacementonsmartphone'); print $desc; print ''; } @@ -3884,12 +3881,12 @@ if ($action == 'create') { print '
'.$langs->trans('DiscountStillRemaining').''; - $thirdparty = $soc; - $discount_type = 0; + $thirdparty = $soc; // used by object_discounts.tpl.php + $discount_type = 0; // used by object_discounts.tpl.php $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid'))); include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; @@ -3919,7 +3916,7 @@ if ($action == 'create') { print $form->getSelectConditionsPaiements($cond_reglement_id, 'cond_reglement_id', -1, 1, 0, 'maxwidth500 widthcentpercentminusx'); print '
'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print img_picto('', 'currency', 'class="pictofixedwidth"'); - print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code'); + print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth100 widthcentpercentminusx'); print '