code syntax directory

This commit is contained in:
Frédéric FRANCE 2021-02-26 16:19:52 +01:00
parent 7ac8fcbca1
commit 96b0f3a25c
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
6 changed files with 13 additions and 23 deletions

View File

@ -1053,10 +1053,9 @@ class pdf_crabe extends ModelePDFFactures
&& empty($conf->global->FACTURE_CHQ_NUMBER)
&& empty($conf->global->FACTURE_RIB_NUMBER)) {
$this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
}
// Avoid having any valid PDF with setup that is not complete
elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
} elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
|| ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) {
// Avoid having any valid PDF with setup that is not complete
$outputlangs->load("errors");
$pdf->SetXY($this->marge_gauche, $posy);

View File

@ -1142,10 +1142,9 @@ class pdf_sponge extends ModelePDFFactures
&& empty($conf->global->FACTURE_CHQ_NUMBER)
&& empty($conf->global->FACTURE_RIB_NUMBER)) {
$this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
}
// Avoid having any valid PDF with setup that is not complete
elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
} elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
|| ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) {
// Avoid having any valid PDF with setup that is not complete
$outputlangs->load("errors");
$pdf->SetXY($this->marge_gauche, $posy);

View File

@ -1719,7 +1719,7 @@ class pdf_cyan extends ModelePDFPropales
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact,$mode, $object);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
// Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;

View File

@ -1084,11 +1084,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Batch number management
if (!empty($conf->productbatch->enabled)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
if ( empty($conf->global ->MAIN_ADVANCE_NUMLOT) )
{
if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) {
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
}
else {
} else {
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
}
print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch'));
@ -1550,11 +1548,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($conf->productbatch->enabled) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
if ( empty($conf->global ->MAIN_ADVANCE_NUMLOT) )
{
if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) {
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
}
else {
} else {
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
}
print $form->selectarray('status_batch', $statutarray, $object->status_batch);

View File

@ -4735,7 +4735,7 @@ class Product extends CommonObject
if ($type == 2) {
switch ($mode) {
case 0:
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')));
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')));
return dolGetStatus($label);
case 1:
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort')));
@ -4779,9 +4779,7 @@ class Product extends CommonObject
$labelStatus = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'));
$labelStatusShort = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort'));
}
}
elseif ( ! empty($conf->global->MAIN_ADVANCE_NUMLOT) && $type == 2 && $status == 2)
{
} elseif (! empty($conf->global->MAIN_ADVANCE_NUMLOT) && $type == 2 && $status == 2) {
$labelStatus = $langs->trans('ProductStatusOnSerial');
$labelStatusShort = $langs->trans('ProductStatusOnSerialShort');
}

View File

@ -1672,11 +1672,9 @@ if ($resql) {
// Lot/Serial
if (!empty($arrayfields['p.tobatch']['checked'])) {
print '<td class="center">';
if ( empty($conf->global->MAIN_ADVANCE_NUMLOT) )
{
if (empty($conf->global->MAIN_ADVANCE_NUMLOT)) {
print yn($obj->tobatch);
}
else {
} else {
print $product_static->getLibStatut(1, 2);
}
print '</td>';