@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $object->date_ech = $dateech; |
| 167 | 167 | $object->periode = $dateperiod; |
| 168 | 168 | $object->amount = $amount; |
| 169 | - $object->fk_user = $fk_user; |
|
| 169 | + $object->fk_user = $fk_user; |
|
| 170 | 170 | $object->mode_reglement_id = (int) GETPOST('mode_reglement_id', 'int'); |
| 171 | 171 | $object->fk_account = (int) GETPOST('fk_account', 'int'); |
| 172 | 172 | $object->fk_project = (int) GETPOST('fk_project', 'int'); |
@@ -449,10 +449,10 @@ discard block |
||
| 449 | 449 | $userstatic = new User($db); |
| 450 | 450 | $result = $userstatic->fetch($object->fk_user); |
| 451 | 451 | if ($result > 0) { |
| 452 | - $morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(1); |
|
| 452 | + $morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(1); |
|
| 453 | 453 | } |
| 454 | 454 | } else { |
| 455 | - $morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->salaries->write, 'string', '', 0, 1); |
|
| 455 | + $morehtmlref .= '<br>'.$form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->salaries->write, 'string', '', 0, 1); |
|
| 456 | 456 | if (!empty($object->fk_user)) { |
| 457 | 457 | $userstatic = new User($db); |
| 458 | 458 | $result = $userstatic->fetch($object->fk_user); |
@@ -46,8 +46,12 @@ |
||
| 46 | 46 | // 'ZAPIERFORDOLIBARR_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | -if (empty($conf->zapier->enabled)) accessforbidden(); |
|
| 50 | -if (empty($user->admin)) accessforbidden(); |
|
| 49 | +if (empty($conf->zapier->enabled)) { |
|
| 50 | + accessforbidden(); |
|
| 51 | +} |
|
| 52 | +if (empty($user->admin)) { |
|
| 53 | + accessforbidden(); |
|
| 54 | +} |
|
| 51 | 55 | |
| 52 | 56 | |
| 53 | 57 | /* |
@@ -489,8 +489,11 @@ discard block |
||
| 489 | 489 | print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; |
| 490 | 490 | |
| 491 | 491 | // Payment date |
| 492 | - if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
| 493 | - else print '<td></td>'; |
|
| 492 | + if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') { |
|
| 493 | + print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
| 494 | + } else { |
|
| 495 | + print '<td></td>'; |
|
| 496 | + } |
|
| 494 | 497 | |
| 495 | 498 | // Company name |
| 496 | 499 | print '<td class="tdmaxoverflow150">'; |
@@ -620,8 +623,11 @@ discard block |
||
| 620 | 623 | print '<tr class="liste_titre liste_titre_topborder">'; |
| 621 | 624 | print '<td class="left">'.$elementsup.'</td>'; |
| 622 | 625 | print '<td class="left">'.$langs->trans("DateInvoice").'</td>'; |
| 623 | - if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print '<td class="left">'.$langs->trans("DatePayment").'</td>'; |
|
| 624 | - else print '<td></td>'; |
|
| 626 | + if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') { |
|
| 627 | + print '<td class="left">'.$langs->trans("DatePayment").'</td>'; |
|
| 628 | + } else { |
|
| 629 | + print '<td></td>'; |
|
| 630 | + } |
|
| 625 | 631 | print '<td class="left">'.$namesup.'</td>'; |
| 626 | 632 | print '<td class="left">'.$productsup.'</td>'; |
| 627 | 633 | if ($modetax != 1) { |
@@ -406,13 +406,13 @@ discard block |
||
| 406 | 406 | if (is_array($x_both[$rate]['coll']['detail'])) { |
| 407 | 407 | // VAT Rate |
| 408 | 408 | print "<tr>"; |
| 409 | - print '<td class="tax_rate" colspan="' . ($span+1) . '">'; |
|
| 410 | - print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; |
|
| 409 | + print '<td class="tax_rate" colspan="'.($span + 1).'">'; |
|
| 410 | + print $langs->trans('Rate').' : '.vatrate($rate).'%'; |
|
| 411 | 411 | print ' - <a href="'.DOL_URL_ROOT.'/compta/tva/quadri_detail.php?invoice_type=customer'; |
| 412 | 412 | if ($invoice_type != 'customer' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) { |
| 413 | 413 | print '&vat_rate_show='.urlencode($rate); |
| 414 | 414 | } |
| 415 | - print '&date_startyear='.urlencode($date_start_year).'&date_startmonth='.urlencode($date_start_month).'&date_startday='.urlencode($date_start_day).'&date_endyear='.urlencode($date_end_year).'&date_endmonth='.urlencode($date_end_month).'&date_endday='.urlencode($date_end_day).'">' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>'; |
|
| 415 | + print '&date_startyear='.urlencode($date_start_year).'&date_startmonth='.urlencode($date_start_month).'&date_startday='.urlencode($date_start_day).'&date_endyear='.urlencode($date_end_year).'&date_endmonth='.urlencode($date_end_month).'&date_endday='.urlencode($date_end_day).'">'.img_picto('', 'chevron-down', 'class="paddingrightonly"').$langs->trans('VATReportShowByRateDetails').'</a>'; |
|
| 416 | 416 | print '</td>'; |
| 417 | 417 | print '</tr>'."\n"; |
| 418 | 418 | |
@@ -430,22 +430,22 @@ discard block |
||
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | // Payment |
| 433 | - $ratiopaymentinvoice=1; |
|
| 433 | + $ratiopaymentinvoice = 1; |
|
| 434 | 434 | if ($modetax != 1) { |
| 435 | 435 | if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') |
| 436 | 436 | || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) { |
| 437 | 437 | } else { |
| 438 | 438 | if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { |
| 439 | - $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); |
|
| 439 | + $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); |
|
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | // Total collected |
| 445 | - $temp_ht=$fields['totalht']*$ratiopaymentinvoice; |
|
| 445 | + $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; |
|
| 446 | 446 | |
| 447 | 447 | // VAT |
| 448 | - $temp_vat=$fields['vat']*$ratiopaymentinvoice; |
|
| 448 | + $temp_vat = $fields['vat'] * $ratiopaymentinvoice; |
|
| 449 | 449 | |
| 450 | 450 | $subtot_coll_total_ht += $temp_ht; |
| 451 | 451 | $subtot_coll_vat += $temp_vat; |
@@ -485,13 +485,13 @@ discard block |
||
| 485 | 485 | print '<tr class="oddeven">'; |
| 486 | 486 | |
| 487 | 487 | // Ref |
| 488 | - print '<td class="nowrap left">' . $fields['link'] . '</td>'; |
|
| 488 | + print '<td class="nowrap left">'.$fields['link'].'</td>'; |
|
| 489 | 489 | |
| 490 | 490 | // Invoice date |
| 491 | - print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; |
|
| 491 | + print '<td class="left">'.dol_print_date($fields['datef'], 'day').'</td>'; |
|
| 492 | 492 | |
| 493 | 493 | // Payment date |
| 494 | - if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
| 494 | + if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print '<td class="left">'.dol_print_date($fields['datep'], 'day').'</td>'; |
|
| 495 | 495 | else print '<td></td>'; |
| 496 | 496 | |
| 497 | 497 | // Company name |
@@ -505,10 +505,10 @@ discard block |
||
| 505 | 505 | if ($fields['pid']) { |
| 506 | 506 | $product_static->id = $fields['pid']; |
| 507 | 507 | $product_static->ref = $fields['pref']; |
| 508 | - $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
| 508 | + $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
| 509 | 509 | print $product_static->getNomUrl(1); |
| 510 | 510 | if (dol_string_nohtmltag($fields['descr'])) { |
| 511 | - print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 511 | + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 512 | 512 | } |
| 513 | 513 | } else { |
| 514 | 514 | if ($type) { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]); |
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | - print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 528 | + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 529 | 529 | |
| 530 | 530 | // Show range |
| 531 | 531 | print_date_range($fields['ddate_start'], $fields['ddate_end']); |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | print price(price2num($fields['payment_amount'], 'MT')); |
| 565 | 565 | if (isset($fields['payment_amount'])) { |
| 566 | - print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)'; |
|
| 566 | + print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | print '</td>'; |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | // Blank line |
| 619 | - print '<tr><td colspan="'.($span+2).'"> </td></tr>'; |
|
| 619 | + print '<tr><td colspan="'.($span + 2).'"> </td></tr>'; |
|
| 620 | 620 | |
| 621 | 621 | // Print table headers for this quadri - expenses |
| 622 | 622 | print '<tr class="liste_titre liste_titre_topborder">'; |
@@ -640,13 +640,13 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | if (is_array($x_both[$rate]['paye']['detail'])) { |
| 642 | 642 | print "<tr>"; |
| 643 | - print '<td class="tax_rate" colspan="' . ($span+1) . '">'; |
|
| 644 | - print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; |
|
| 643 | + print '<td class="tax_rate" colspan="'.($span + 1).'">'; |
|
| 644 | + print $langs->trans('Rate').' : '.vatrate($rate).'%'; |
|
| 645 | 645 | print ' - <a href="'.DOL_URL_ROOT.'/compta/tva/quadri_detail.php?invoice_type=supplier'; |
| 646 | 646 | if ($invoice_type != 'supplier' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) { |
| 647 | 647 | print '&vat_rate_show='.urlencode($rate); |
| 648 | 648 | } |
| 649 | - print '&date_startyear='.urlencode($date_start_year).'&date_startmonth='.urlencode($date_start_month).'&date_startday='.urlencode($date_start_day).'&date_endyear='.urlencode($date_end_year).'&date_endmonth='.urlencode($date_end_month).'&date_endday='.urlencode($date_end_day).'">' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>'; |
|
| 649 | + print '&date_startyear='.urlencode($date_start_year).'&date_startmonth='.urlencode($date_start_month).'&date_startday='.urlencode($date_start_day).'&date_endyear='.urlencode($date_end_year).'&date_endmonth='.urlencode($date_end_month).'&date_endday='.urlencode($date_end_day).'">'.img_picto('', 'chevron-down', 'class="paddingrightonly"').$langs->trans('VATReportShowByRateDetails').'</a>'; |
|
| 650 | 650 | print '</td>'; |
| 651 | 651 | print '</tr>'."\n"; |
| 652 | 652 | |
@@ -717,14 +717,14 @@ discard block |
||
| 717 | 717 | print '<tr class="oddeven">'; |
| 718 | 718 | |
| 719 | 719 | // Ref |
| 720 | - print '<td class="nowrap left">' . $fields['link'] . '</td>'; |
|
| 720 | + print '<td class="nowrap left">'.$fields['link'].'</td>'; |
|
| 721 | 721 | |
| 722 | 722 | // Invoice date |
| 723 | - print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; |
|
| 723 | + print '<td class="left">'.dol_print_date($fields['datef'], 'day').'</td>'; |
|
| 724 | 724 | |
| 725 | 725 | // Payment date |
| 726 | 726 | if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') { |
| 727 | - print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
| 727 | + print '<td class="left">'.dol_print_date($fields['datep'], 'day').'</td>'; |
|
| 728 | 728 | } else { |
| 729 | 729 | print '<td></td>'; |
| 730 | 730 | } |
@@ -740,10 +740,10 @@ discard block |
||
| 740 | 740 | if ($fields['pid']) { |
| 741 | 741 | $product_static->id = $fields['pid']; |
| 742 | 742 | $product_static->ref = $fields['pref']; |
| 743 | - $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
| 743 | + $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
| 744 | 744 | print $product_static->getNomUrl(1); |
| 745 | 745 | if (dol_string_nohtmltag($fields['descr'])) { |
| 746 | - print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 746 | + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 747 | 747 | } |
| 748 | 748 | } else { |
| 749 | 749 | if ($type) { |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]); |
| 761 | 761 | } |
| 762 | 762 | } |
| 763 | - print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 763 | + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
| 764 | 764 | |
| 765 | 765 | // Show range |
| 766 | 766 | print_date_range($fields['ddate_start'], $fields['ddate_end']); |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | } |
| 799 | 799 | print price(price2num($fields['payment_amount'], 'MT')); |
| 800 | 800 | if (isset($fields['payment_amount'])) { |
| 801 | - print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)'; |
|
| 801 | + print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; |
|
| 802 | 802 | } |
| 803 | 803 | } |
| 804 | 804 | print '</td>'; |
@@ -92,10 +92,18 @@ |
||
| 92 | 92 | global $langs; |
| 93 | 93 | $langs->load("admin"); |
| 94 | 94 | |
| 95 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
| 96 | - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
| 97 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 98 | - if ($this->version) return $this->version; |
|
| 95 | + if ($this->version == 'development') { |
|
| 96 | + return $langs->trans("VersionDevelopment"); |
|
| 97 | + } |
|
| 98 | + if ($this->version == 'experimental') { |
|
| 99 | + return $langs->trans("VersionExperimental"); |
|
| 100 | + } |
|
| 101 | + if ($this->version == 'dolibarr') { |
|
| 102 | + return DOL_VERSION; |
|
| 103 | + } |
|
| 104 | + if ($this->version) { |
|
| 105 | + return $this->version; |
|
| 106 | + } |
|
| 99 | 107 | return $langs->trans("NotAvailable"); |
| 100 | 108 | } |
| 101 | 109 | } |
@@ -560,7 +560,9 @@ |
||
| 560 | 560 | $formmail = new FormMail($this->db); |
| 561 | 561 | $arraydefaultmessage = null; |
| 562 | 562 | |
| 563 | - if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse); |
|
| 563 | + if (!empty($labeltouse)) { |
|
| 564 | + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse); |
|
| 565 | + } |
|
| 564 | 566 | if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { |
| 565 | 567 | $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); |
| 566 | 568 | complete_substitutions_array($substitutionarray, $outputlangs, $object); |
@@ -615,7 +615,7 @@ |
||
| 615 | 615 | |
| 616 | 616 | $ref = dol_sanitizeFileName($newref); |
| 617 | 617 | $pdf_path = $dir_output."/".$ref.".pdf"; |
| 618 | - if (!dol_is_file($pdf_path)||(is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { |
|
| 618 | + if (!dol_is_file($pdf_path) || (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { |
|
| 619 | 619 | // We can't add PDF as it is not generated yet. |
| 620 | 620 | $filepdf = ''; |
| 621 | 621 | } else { |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | $object->town = GETPOST('town', 'alpha'); |
| 85 | 85 | $object->country_id = GETPOST("country_id", 'int'); |
| 86 | 86 | $object->status = GETPOST('status', 'int'); |
| 87 | - $object->fk_user_author = $user->id; |
|
| 87 | + $object->fk_user_author = $user->id; |
|
| 88 | 88 | $object->datec = dol_now(); |
| 89 | 89 | $object->entity = GETPOST('entity', 'int') > 0 ?GETPOST('entity', 'int') : $conf->entity; |
| 90 | 90 | |
@@ -61,8 +61,12 @@ |
||
| 61 | 61 | //if ($user->socid > 0) $socid = $user->socid; |
| 62 | 62 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 63 | 63 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
| 64 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
| 65 | -if (empty($permissiontoread)) accessforbidden(); |
|
| 64 | +if (!isModEnabled('hrm')) { |
|
| 65 | + accessforbidden(); |
|
| 66 | +} |
|
| 67 | +if (empty($permissiontoread)) { |
|
| 68 | + accessforbidden(); |
|
| 69 | +} |
|
| 66 | 70 | |
| 67 | 71 | |
| 68 | 72 | /* |
@@ -568,7 +568,9 @@ discard block |
||
| 568 | 568 | |
| 569 | 569 | // Type |
| 570 | 570 | print '<td>'; |
| 571 | - if (!empty($obj->payment_code)) print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
| 571 | + if (!empty($obj->payment_code)) { |
|
| 572 | + print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
| 573 | + } |
|
| 572 | 574 | print '</td>'; |
| 573 | 575 | if (!$i) { |
| 574 | 576 | $totalarray['nbfield']++; |
@@ -621,7 +623,9 @@ discard block |
||
| 621 | 623 | $totalarray['val']['totalttcfield'] += $obj->amount; |
| 622 | 624 | |
| 623 | 625 | print '<td class="nowrap right">'.$salstatic->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>'; |
| 624 | - if (!$i) $totalarray['nbfield']++; |
|
| 626 | + if (!$i) { |
|
| 627 | + $totalarray['nbfield']++; |
|
| 628 | + } |
|
| 625 | 629 | |
| 626 | 630 | // Extra fields |
| 627 | 631 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; |
@@ -481,7 +481,9 @@ discard block |
||
| 481 | 481 | // Type |
| 482 | 482 | if (!empty($arrayfields['t.fk_typepayment']['checked'])) { |
| 483 | 483 | print '<td>'; |
| 484 | - if (!empty($obj->payment_code)) print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
| 484 | + if (!empty($obj->payment_code)) { |
|
| 485 | + print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
| 486 | + } |
|
| 485 | 487 | print '</td>'; |
| 486 | 488 | if (!$i) { |
| 487 | 489 | $totalarray['nbfield']++; |
@@ -508,7 +510,9 @@ discard block |
||
| 508 | 510 | print $bankstatic->getNomUrl(1); |
| 509 | 511 | } |
| 510 | 512 | print '</td>'; |
| 511 | - if (!$i) $totalarray['nbfield']++; |
|
| 513 | + if (!$i) { |
|
| 514 | + $totalarray['nbfield']++; |
|
| 515 | + } |
|
| 512 | 516 | } |
| 513 | 517 | |
| 514 | 518 | // Amount |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | llxHeader('', $langs->trans("VATDeclarations")); |
| 148 | 148 | |
| 149 | 149 | $sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_typepayment as type, t.fk_account,'; |
| 150 | -$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,'; |
|
| 151 | -$sql.= ' t.num_payment, pst.code as payment_code,'; |
|
| 150 | +$sql .= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,'; |
|
| 151 | +$sql .= ' t.num_payment, pst.code as payment_code,'; |
|
| 152 | 152 | $sql .= ' SUM(ptva.amount) as alreadypayed'; |
| 153 | 153 | |
| 154 | 154 | $sqlfields = $sql; // $sql fields to remove for count total |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | // Amount |
| 545 | 545 | if (!empty($arrayfields['t.amount']['checked'])) { |
| 546 | 546 | $total = $total + $obj->amount; |
| 547 | - print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>'; |
|
| 547 | + print '<td class="nowrap right"><span class="amount">'.price($obj->amount).'</span></td>'; |
|
| 548 | 548 | if (!$i) { |
| 549 | 549 | $totalarray['nbfield']++; |
| 550 | 550 | } |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | if (!empty($arrayfields['t.status']['checked'])) { |
| 560 | - print '<td class="nowrap right">' . $tva_static->LibStatut($obj->paye, 5, $obj->alreadypayed) . '</td>'; |
|
| 560 | + print '<td class="nowrap right">'.$tva_static->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>'; |
|
| 561 | 561 | if (!$i) { |
| 562 | 562 | $totalarray['nbfield']++; |
| 563 | 563 | } |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | /** |
| 93 | 93 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
| 94 | 94 | */ |
| 95 | - public $fields=array( |
|
| 95 | + public $fields = array( |
|
| 96 | 96 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>0,), |
| 97 | 97 | 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>15, 'notnull'=>1, 'visible'=>-2, 'default'=>'1', 'index'=>1,), |
| 98 | 98 | 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>-1,), |
@@ -177,8 +177,12 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | $this->db = $db; |
| 179 | 179 | |
| 180 | - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; |
|
| 181 | - if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; |
|
| 180 | + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { |
|
| 181 | + $this->fields['rowid']['visible'] = 0; |
|
| 182 | + } |
|
| 183 | + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { |
|
| 184 | + $this->fields['entity']['enabled'] = 0; |
|
| 185 | + } |
|
| 182 | 186 | |
| 183 | 187 | // Unset fields that are disabled |
| 184 | 188 | foreach ($this->fields as $key => $val) { |
@@ -220,7 +224,9 @@ discard block |
||
| 220 | 224 | |
| 221 | 225 | // Load source object |
| 222 | 226 | $result = $object->fetchCommon($fromid); |
| 223 | - if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines(); |
|
| 227 | + if ($result > 0 && !empty($object->table_element_line)) { |
|
| 228 | + $object->fetchLines(); |
|
| 229 | + } |
|
| 224 | 230 | |
| 225 | 231 | // get lines so they will be clone |
| 226 | 232 | //foreach($this->lines as $line) |
@@ -232,8 +238,12 @@ discard block |
||
| 232 | 238 | unset($object->import_key); |
| 233 | 239 | |
| 234 | 240 | // Clear fields |
| 235 | - if (property_exists($object, 'ref')) $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; |
|
| 236 | - if (property_exists($object, 'label')) $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; |
|
| 241 | + if (property_exists($object, 'ref')) { |
|
| 242 | + $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; |
|
| 243 | + } |
|
| 244 | + if (property_exists($object, 'label')) { |
|
| 245 | + $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; |
|
| 246 | + } |
|
| 237 | 247 | if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } |
| 238 | 248 | if (property_exists($object, 'date_creation')) { $object->date_creation = dol_now(); } |
| 239 | 249 | if (property_exists($object, 'date_modification')) { $object->date_modification = null; } |
@@ -270,8 +280,9 @@ discard block |
||
| 270 | 280 | if (!$error) { |
| 271 | 281 | // copy external contacts if same company |
| 272 | 282 | if (property_exists($this, 'socid') && $this->socid == $object->socid) { |
| 273 | - if ($this->copy_linked_contact($object, 'external') < 0) |
|
| 274 | - $error++; |
|
| 283 | + if ($this->copy_linked_contact($object, 'external') < 0) { |
|
| 284 | + $error++; |
|
| 285 | + } |
|
| 275 | 286 | } |
| 276 | 287 | } |
| 277 | 288 | |
@@ -320,8 +331,11 @@ discard block |
||
| 320 | 331 | $sql = "SELECT "; |
| 321 | 332 | $sql .= $this->getFieldList(); |
| 322 | 333 | $sql .= " FROM ".$this->db->prefix().$this->table_element." as t"; |
| 323 | - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; |
|
| 324 | - else $sql .= " WHERE 1 = 1"; |
|
| 334 | + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { |
|
| 335 | + $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; |
|
| 336 | + } else { |
|
| 337 | + $sql .= " WHERE 1 = 1"; |
|
| 338 | + } |
|
| 325 | 339 | // Manage filter |
| 326 | 340 | $sqlwhere = array(); |
| 327 | 341 | if (count($filter) > 0) { |
@@ -437,8 +451,12 @@ discard block |
||
| 437 | 451 | $sql = "UPDATE ".$this->db->prefix().$this->table_element; |
| 438 | 452 | $sql .= " SET ref = '".$this->db->escape($num)."',"; |
| 439 | 453 | $sql .= " status = ".self::STATUS_VALIDATED; |
| 440 | - if (!empty($this->fields['date_validation'])) $sql .= ", date_validation = '".$this->db->idate($now)."'"; |
|
| 441 | - if (!empty($this->fields['fk_user_valid'])) $sql .= ", fk_user_valid = ".$user->id; |
|
| 454 | + if (!empty($this->fields['date_validation'])) { |
|
| 455 | + $sql .= ", date_validation = '".$this->db->idate($now)."'"; |
|
| 456 | + } |
|
| 457 | + if (!empty($this->fields['fk_user_valid'])) { |
|
| 458 | + $sql .= ", fk_user_valid = ".$user->id; |
|
| 459 | + } |
|
| 442 | 460 | $sql .= " WHERE rowid = ".((int) $this->id); |
| 443 | 461 | |
| 444 | 462 | dol_syslog(get_class($this)."::validate()", LOG_DEBUG); |
@@ -452,7 +470,9 @@ discard block |
||
| 452 | 470 | if (!$error && !$notrigger) { |
| 453 | 471 | // Call trigger |
| 454 | 472 | $result = $this->call_trigger('PRODUCTFOURNISSEURPRICE_VALIDATE', $user); |
| 455 | - if ($result < 0) $error++; |
|
| 473 | + if ($result < 0) { |
|
| 474 | + $error++; |
|
| 475 | + } |
|
| 456 | 476 | // End call triggers |
| 457 | 477 | } |
| 458 | 478 | } |
@@ -573,7 +593,10 @@ discard block |
||
| 573 | 593 | { |
| 574 | 594 | global $conf, $langs, $hookmanager; |
| 575 | 595 | |
| 576 | - if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips |
|
| 596 | + if (!empty($conf->dol_no_mouse_hover)) { |
|
| 597 | + $notooltip = 1; |
|
| 598 | + } |
|
| 599 | + // Force disable tooltips |
|
| 577 | 600 | |
| 578 | 601 | $result = ''; |
| 579 | 602 | |
@@ -589,8 +612,12 @@ discard block |
||
| 589 | 612 | if ($option != 'nolink') { |
| 590 | 613 | // Add param to save lastsearch_values or not |
| 591 | 614 | $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); |
| 592 | - if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; |
|
| 593 | - if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; |
|
| 615 | + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { |
|
| 616 | + $add_save_lastsearch_values = 1; |
|
| 617 | + } |
|
| 618 | + if ($add_save_lastsearch_values) { |
|
| 619 | + $url .= '&save_lastsearch_values=1'; |
|
| 620 | + } |
|
| 594 | 621 | } |
| 595 | 622 | |
| 596 | 623 | $linkclose = ''; |
@@ -601,7 +628,9 @@ discard block |
||
| 601 | 628 | } |
| 602 | 629 | $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
| 603 | 630 | $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
| 604 | - } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 631 | + } else { |
|
| 632 | + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 633 | + } |
|
| 605 | 634 | |
| 606 | 635 | $linkstart = '<a href="'.$url.'"'; |
| 607 | 636 | $linkstart .= $linkclose.'>'; |
@@ -610,7 +639,9 @@ discard block |
||
| 610 | 639 | $result .= $linkstart; |
| 611 | 640 | |
| 612 | 641 | if (empty($this->showphoto_on_popup)) { |
| 613 | - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
| 642 | + if ($withpicto) { |
|
| 643 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
| 644 | + } |
|
| 614 | 645 | } else { |
| 615 | 646 | if ($withpicto) { |
| 616 | 647 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
@@ -636,7 +667,9 @@ discard block |
||
| 636 | 667 | } |
| 637 | 668 | } |
| 638 | 669 | |
| 639 | - if ($withpicto != 2) $result .= $this->ref; |
|
| 670 | + if ($withpicto != 2) { |
|
| 671 | + $result .= $this->ref; |
|
| 672 | + } |
|
| 640 | 673 | |
| 641 | 674 | $result .= $linkend; |
| 642 | 675 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
@@ -645,8 +678,11 @@ discard block |
||
| 645 | 678 | $hookmanager->initHooks(array('productfournisseurpricedao')); |
| 646 | 679 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
| 647 | 680 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 648 | - if ($reshook > 0) $result = $hookmanager->resPrint; |
|
| 649 | - else $result .= $hookmanager->resPrint; |
|
| 681 | + if ($reshook > 0) { |
|
| 682 | + $result = $hookmanager->resPrint; |
|
| 683 | + } else { |
|
| 684 | + $result .= $hookmanager->resPrint; |
|
| 685 | + } |
|
| 650 | 686 | |
| 651 | 687 | return $result; |
| 652 | 688 | } |
@@ -686,7 +722,9 @@ discard block |
||
| 686 | 722 | |
| 687 | 723 | $statusType = 'status'.$status; |
| 688 | 724 | //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; |
| 689 | - if ($status == self::STATUS_CANCELED) $statusType = 'status6'; |
|
| 725 | + if ($status == self::STATUS_CANCELED) { |
|
| 726 | + $statusType = 'status6'; |
|
| 727 | + } |
|
| 690 | 728 | |
| 691 | 729 | return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); |
| 692 | 730 | } |