diff --git a/ChangeLog b/ChangeLog index 204eeddf8a6..a83fc453a65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,9 +24,7 @@ Dolibarr 4.0 should be compatible with PHP 7 but more feedbacks are still expect Following changes may create regression for some external modules, but were necessary to make Dolibarr better: -- Method FormBank::select_type_comptes_financiers() has been renamed into FormBank::selectTypeOfBankAccount() -- Method Form::form_date() has been renamed into Form::formDate() -- Method Form::select_date() has been renamed into Form::selectDate() +- Method select_type_comptes_financiers() has been renamed into selectTypeOfBankAccount() diff --git a/dev/skeletons/skeleton_card.php b/dev/skeletons/skeleton_card.php index b122e9a86c7..03f70955527 100644 --- a/dev/skeletons/skeleton_card.php +++ b/dev/skeletons/skeleton_card.php @@ -288,7 +288,7 @@ if ($id && (empty($action) || $action == 'view' || $action == 'delete')) dol_fiche_head(); if ($action == 'delete') { - $formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1); print $formconfirm; } diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index 29ca9261a70..2321b76aac8 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -370,7 +370,7 @@ if ($resql) }*/ // Action column print '
| ' . $langs->trans("Docdate") . ' | '; print ''; - print Form::selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1); + print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1); print ' | '; print ''; print ' | ';
print $langs->trans('From') . ': ';
- print Form::selectDate($search_date_start, 'date_start', 0, 0, 1);
+ print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
print ' '; print $langs->trans('To') . ': '; - print Form::selectDate($search_date_end, 'date_end', 0, 0, 1); + print $form->select_date($search_date_end, 'date_end', 0, 0, 1); print ' | ';
print ''; print ' | '; diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php index f9f86002376..10640c1887a 100644 --- a/htdocs/accountancy/bookkeeping/listbyyear.php +++ b/htdocs/accountancy/bookkeeping/listbyyear.php @@ -176,9 +176,9 @@ print_barre_liste($langs->trans("Bookkeeping") . ' ' . dol_print_date($search_da print ' | '; print '';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 4d1d71f48b9..f995b2684ee 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -52,9 +52,8 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
$langs->load("companies");
$langs->load("other");
$langs->load("compta");
-$langs->load("banks");
+$langs->load("bank");
$langs->load('bills');
-$langs->load('donations');
$langs->load("accountancy");
$id_bank_account = GETPOST('id_account', 'int');
@@ -131,12 +130,11 @@ if ($result) {
$num = $db->num_rows($result);
// Variables
- $account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
- $account_customer = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
- $account_employee = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
- $account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
- $account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
- $account_transfer = (! empty($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) ? $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH : $langs->trans("CodeNotDef"));
+ $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
+ $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
+ $accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
+ $accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
+ $accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
$tabpay = array ();
$tabbq = array ();
@@ -156,9 +154,11 @@ if ($result) {
// Controls
$compta_bank = $obj->account_number;
if ($obj->label == '(SupplierInvoicePayment)')
- $compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
+ $compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $cptfour);
if ($obj->label == '(CustomerInvoicePayment)')
- $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
+ $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
+ if ($obj->typeop == '(BankTransfert)')
+ $compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
// Variable bookkeeping
$tabpay[$obj->rowid]["date"] = $obj->do;
@@ -226,23 +226,25 @@ if ($result) {
$paymentdonstatic->id = $links[$key]['url_id'];
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentDonation");
- $tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
+ $tabtp[$obj->rowid][$accountancy_account_pay_donation] += $obj->amount;
} else if ($links[$key]['type'] == 'payment_vat') {
$paymentvatstatic->id = $links[$key]['url_id'];
$paymentvatstatic->ref = $links[$key]['url_id'];
- $paymentvatstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentVat");
- $tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
+ $tabtp[$obj->rowid][$accountancy_account_pay_vat] += $obj->amount;
} else if ($links[$key]['type'] == 'payment_salary') {
$paymentsalstatic->id = $links[$key]['url_id'];
$paymentsalstatic->ref = $links[$key]['url_id'];
$paymentsalstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
- $tabtp[$obj->rowid][$account_employee ] += $obj->amount;
+ $tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount;
} else if ($links[$key]['type'] == 'banktransfert') {
- $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
- $tabtp[$obj->rowid][$account_transfer] += $obj->amount;
+ $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
+ $tabtp[$obj->rowid][$cpttva] += $obj->amount;
}
+ /*else {
+ $tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
+ }*/
}
}
@@ -539,7 +541,7 @@ else {
$nom = $langs->trans("FinanceJournal") . ' - ' . $bank_code_journal->getNomUrl(1);
$builddate = time();
$description = $langs->trans("DescFinanceJournal") . ' '; - $period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); + $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $varlink = 'id_account=' . $id_bank_account; report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( @@ -586,30 +588,24 @@ else { foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), 'day'); - $reflabel = $val["ref"]; - if ($reflabel == '(SupplierInvoicePayment)') { - $reflabel = $langs->trans('Supplier'); + if ($val["lib"] == '(SupplierInvoicePayment)') { + $reflabel = $langs->trans('SupplierInvoicePayment'); } - if ($reflabel == '(CustomerInvoicePayment)') { - $reflabel = $langs->trans('Customer'); - } - if ($reflabel == '(SocialContributionPayment)') { - $reflabel = $langs->trans('SocialContribution'); - } - if ($reflabel == '(DonationPayment)') { - $reflabel = $langs->trans('Donation'); + if ($val["lib"] == '(CustomerInvoicePayment)') { + $reflabel = $langs->trans('CustomerInvoicePayment'); } // Bank foreach ( $tabbq[$key] as $k => $mt ) { print " | ||||||||
| " . $date . " | "; - print "" . $ref . " | "; + print "" . $reflabel . " | "; print "" . length_accountg($k) . " | "; + // print "" . $langs->trans('Bank') . " | "; if ($val['soclib'] == '') { - print "" . $bank_code_journal->label . " - " . $val["ref"] . " | "; + print "" . $langs->trans('Bank') . " - " . $val["ref"] . " | "; } else { - print "" . $bank_code_journal->label . " - " . $val['soclib'] . " | "; + print "" . $langs->trans("Bank") . " - " . $val['soclib'] . " | "; } print "" . $val["type_payment"] . " | "; print "" . ($mt >= 0 ? price($mt) : '') . " | "; @@ -623,9 +619,19 @@ else { if ($k != 'type') { print "||||
| " . $date . " | "; - print "" . $ref . " | "; + print "" . $val["soclib"] . " | "; + // print "" . length_accounta($k) . " | "; + if (length_accounta($k) == '') { + print "" . length_accounta($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) . " | "; + } else { print "" . length_accounta($k) . " | "; - print "" . $reflabel . ' ' . $val['soclib'] . " | "; + } + // print "" . $langs->trans('ThirdParty') . " (" . $val['soclib'] . ") | "; + if ($val['soclib'] == '') { + print "" . $langs->trans('ThirdParty') . " - " . $val["ref"] . " | "; + } else { + print "" . $langs->trans("ThirdParty") . ' - ' . $val['soclib'] . " | "; + } print "" . $val["type_payment"] . " | "; print "" . ($mt < 0 ? price(- $mt) : '') . " | "; print "" . ($mt >= 0 ? price($mt) : '') . " | "; @@ -636,9 +642,14 @@ else { foreach ( $tabbq[$key] as $k => $mt ) { print "||
| " . $date . " | "; - print "" . $ref . " | "; - print "" . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . " | "; print "" . $reflabel . " | "; + print "" . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . " | "; + // print "" . $langs->trans('ThirdParty') . " | "; + if ($val['soclib'] == '') { + print "" . $langs->trans('ThirdParty') . " - " . $val["ref"] . " | "; + } else { + print "" . $langs->trans("ThirdParty") . ' - ' . $val['soclib'] . " | "; + } print ""; print " | " . ($mt < 0 ? price(- $mt) : '') . " | "; print "" . ($mt >= 0 ? price($mt) : '') . " | "; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 6f8642a4c47..82811598188 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -403,7 +403,7 @@ if ($action == 'export_csv') { $description .= $langs->trans("DepositsAreIncluded"); } - $period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); + $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( 'action' => '' )); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 65e383dce88..670875ec52b 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -418,7 +418,7 @@ if ($action == 'export_csv') { $description .= $langs->trans("DepositsAreNotIncluded"); else $description .= $langs->trans("DepositsAreIncluded"); - $period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); + $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( 'action' => '' )); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 5ced4aa5f84..ade361fdd51 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -221,7 +221,7 @@ if ($result) { print ''; print ' | '; print ' | '; - $searchpitco=Form::showFilterAndCheckAddButtons(); + $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; print ' | '; print "|
| '.$langs->trans("AdherentLoginRequired").' | '; -print Form::selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1); +print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1); print ' | '; print ''; print " | ||||||||||||
| '.$langs->trans("AdherentMailRequired").' | '; -print Form::selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1); +print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1); print ' | '; print ''; print " | ||||||||||||
| '.$langs->trans("MemberSendInformationByMailByDefault").' | '; -print Form::selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1); +print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1); print ' | '; print ''; print " | ||||||||||||
| '; print $langs->trans("EnablePublicSubscriptionForm"); print ' | '; -print Form::selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1); +print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1); print " | |||||||||||||
| '; print $langs->trans("EnablePublicSubscriptionForm"); print ' | '; -print Form::selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1); +print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1); print " | |||||||||||||
| '; print $langs->trans("CanEditAmount"); print ' | '; -print Form::selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1); +print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1); print " | |||||||||||||
| ".$langs->trans("Birthday")." | \n"; - Form::selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); + $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print " | |||||||||||||
| ".$langs->trans("Public")." | \n"; - print Form::selectyesno("public",$object->public,1); + print $form->selectyesno("public",$object->public,1); print " | |||||||||||||
| ".$langs->trans("Birthday")." | \n"; - Form::selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); + $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print " | |||||||||||||
| ".$langs->trans("Public")." | \n"; - print Form::selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1); + print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1); print " | |||||||||||||
| '.$langs->trans("DateEndSubscription").' | '; - print Form::selectDate($dateto,'end','','','',"cotisation",1,0,1); + print $form->select_date($dateto,'end','','','',"cotisation",1,0,1); print " | |||||||||||||
| '.$langs->trans("DatePayment").' | '; - print Form::selectDate(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1,1); + print $form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1,1); print " | |||||||||||||
| '.$langs->trans('Numero'); diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 5f319652182..301664fab83 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -200,7 +200,7 @@ if ($result) // Action column print ' | '; - $searchpitco=Form::showFilterAndCheckAddButtons(); + $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; print ' | '; diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 3ecc840c1bb..6b980a4df1c 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -196,7 +196,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') // Ref print '|||||||||||||
| '.$langs->trans("Ref").' | '; print ''; - print Form::showrefnav($subscription, 'rowid', $linkback, 1); + print $form->showrefnav($subscription, 'rowid', $linkback, 1); print ' | |||||||||||||
| '.$langs->trans("DateSubscription").' | '; - Form::selectDate($subscription->dateh,'datesub',1,1,0,'update',1); + $form->select_date($subscription->dateh,'datesub',1,1,0,'update',1); print ' | '; print '|||||||||||||
| '.$langs->trans("DateEndSubscription").' | '; - Form::selectDate($subscription->datef,'datesubend',0,0,0,'update',1); + $form->select_date($subscription->datef,'datesubend',0,0,0,'update',1); print ' | '; print '|||||||||||||