Merge github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
0fee06139a
@ -294,13 +294,11 @@ if ($resql)
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
|
||||
|
||||
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
// Box to select active chart of account
|
||||
print $langs->trans("Selectchartofaccounts")." : ";
|
||||
@ -343,15 +341,15 @@ if ($resql)
|
||||
|
||||
// Line for search fields
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="'.$search_account.'"></td>';
|
||||
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_labelshort" value="'.$search_labelshort.'"></td>';
|
||||
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_account" value="'.$search_account.'"></td>';
|
||||
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$search_label.'"></td>';
|
||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_labelshort" value="'.$search_labelshort.'"></td>';
|
||||
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
@ -416,18 +414,24 @@ if ($resql)
|
||||
// Account parent
|
||||
if (!empty($arrayfields['aa.account_parent']['checked']))
|
||||
{
|
||||
if (!empty($obj->account_parent))
|
||||
// Note: obj->account_parent is a foreign key to a rowid. It is field in child table and obj->rowid2 is same, but in parent table.
|
||||
// So for orphans, obj->account_parent is set but not obj->rowid2
|
||||
if (!empty($obj->account_parent) && !empty($obj->rowid2))
|
||||
{
|
||||
print "<td>";
|
||||
print '<!-- obj->account_parent = '.$obj->account_parent.' obj->rowid2 = '.$obj->rowid2.' -->';
|
||||
$accountparent->id = $obj->rowid2;
|
||||
$accountparent->label = $obj->label2;
|
||||
$accountparent->account_number = $obj->account_number2;
|
||||
|
||||
print "<td>";
|
||||
$accountparent->account_number = $obj->account_number2; // Sotre an account number for output
|
||||
print $accountparent->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
if (!empty($obj->account_parent)) {
|
||||
print '<!-- Bad value for obj->account_parent = '.$obj->account_parent.': is a rowid that does not exists -->';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ if ($action == 'display' || $action == 'delete') {
|
||||
print '<td class="right">';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&account_category='.$cat_id.'&cptid='.$cpt->rowid.'">';
|
||||
print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink');
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', 'class="paddingleft"');
|
||||
print "</a>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
@ -100,7 +100,9 @@ if (empty($reshook))
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("ReportThirdParty"));
|
||||
$title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger');
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
// Customer
|
||||
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '0' as type, sa.entity";
|
||||
@ -268,7 +270,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans('ReportThirdParty'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
print '<div class="warning">'.$langs->trans("WarningCreateSubAccounts").'</div>';
|
||||
|
||||
@ -335,17 +337,17 @@ if ($resql)
|
||||
// Customer
|
||||
if ($obj->type == 0)
|
||||
{
|
||||
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
|
||||
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
|
||||
}
|
||||
// Supplier
|
||||
elseif ($obj->type == 1)
|
||||
{
|
||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||
}
|
||||
// User
|
||||
elseif ($obj->type == 2)
|
||||
{
|
||||
$s .= '<a class="user-back" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
|
||||
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
|
||||
}
|
||||
print $s;
|
||||
print '</td>';
|
||||
|
||||
@ -339,7 +339,7 @@ if ($action != 'export_csv')
|
||||
print '<td class="nowraponall right">'.price($opening_balances["'".$line->numero_compte."'"]).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->credit).'</td>';
|
||||
print '<td class="nowraponall right">'.price($line->debit - $line->credit).'</td>';
|
||||
print '<td class="nowraponall right">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
|
||||
print '<td class="center">'.$link;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1863,6 +1863,7 @@ if ($action == 'create' && $usercancreate)
|
||||
$author = new User($db);
|
||||
$author->fetch($object->user_author_id);
|
||||
|
||||
$object->fetch_thirdparty();
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = commande_prepare_head($object);
|
||||
|
||||
@ -46,24 +46,24 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
$langs->loadLangs(array('bills', 'banks', 'compta', 'companies'));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist';
|
||||
|
||||
$facid = GETPOST('facid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$day = GETPOST('day', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$day = GETPOST('day', 'int');
|
||||
$month = GETPOST('month', 'int');
|
||||
$year = GETPOST('year', 'int');
|
||||
$year = GETPOST('year', 'int');
|
||||
|
||||
$search_ref = GETPOST("search_ref", "alpha");
|
||||
$search_account = GETPOST("search_account", "int");
|
||||
$search_paymenttype = GETPOST("search_paymenttype");
|
||||
$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
|
||||
$search_company = GETPOST("search_company", 'alpha');
|
||||
$search_paymenttype = GETPOST("search_paymenttype");
|
||||
$search_account = GETPOST("search_account", "int");
|
||||
$search_payment_num = GETPOST('search_payment_num', 'alpha');
|
||||
$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -76,27 +76,35 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
if (!$sortfield) $sortfield = "p.rowid";
|
||||
if (!$sortfield) $sortfield = "p.ref";
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new Paiement($db);
|
||||
$hookmanager->initHooks(array('paymentlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
'p.ref'=>"RefPayment",
|
||||
's.nom'=>"ThirdParty",
|
||||
'p.num_paiement'=>"Numero",
|
||||
'p.amount'=>"Amount",
|
||||
);
|
||||
|
||||
$arrayfields = array(
|
||||
'p.rowid' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10),
|
||||
'p.ref' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10),
|
||||
'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20),
|
||||
's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
|
||||
'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40),
|
||||
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->banque->enabled))),
|
||||
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(!empty($conf->banque->enabled))),
|
||||
'p.num_payment' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
|
||||
'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
|
||||
'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80),
|
||||
'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))),
|
||||
);
|
||||
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('paymentlist'));
|
||||
$object = new Paiement($db);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -140,7 +148,7 @@ llxHeader('', $langs->trans('ListPayment'));
|
||||
|
||||
if (GETPOST("orphelins", "alpha")) {
|
||||
// Payments not linked to an invoice. Should not happend. For debug only.
|
||||
$sql = "SELECT p.rowid, p.ref, p.datep, p.amount, p.statut, p.num_paiement as num_payment";
|
||||
$sql = "SELECT p.ref, p.datep, p.amount, p.statut, p.num_paiement";
|
||||
$sql .= ", c.code as paiement_code";
|
||||
|
||||
// Add fields from hooks
|
||||
@ -158,7 +166,7 @@ if (GETPOST("orphelins", "alpha")) {
|
||||
$sql .= $hookmanager->resPrint;
|
||||
} else {
|
||||
// DISTINCT is to avoid duplicate when there is a link to sales representatives
|
||||
$sql = "SELECT DISTINCT p.rowid, p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement as num_payment";
|
||||
$sql = "SELECT DISTINCT p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement";
|
||||
$sql .= ", c.code as paiement_code";
|
||||
$sql .= ", ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.email";
|
||||
@ -198,6 +206,8 @@ if (GETPOST("orphelins", "alpha")) {
|
||||
if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1);
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
|
||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -251,6 +261,12 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
@ -268,7 +284,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
}
|
||||
|
||||
// Filter: Ref
|
||||
if (!empty($arrayfields['p.rowid']['checked'])) {
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
@ -305,7 +321,7 @@ if (!empty($arrayfields['transaction']['checked'])) {
|
||||
}
|
||||
|
||||
// Filter: Cheque number (fund transfer)
|
||||
if (!empty($arrayfields['p.num_payment']['checked'])) {
|
||||
if (!empty($arrayfields['p.num_paiement']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
}
|
||||
@ -343,11 +359,11 @@ print "</tr>";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.rowid']['checked'])) print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"], "p.rowid", '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.datep']['checked'])) print_liste_field_titre($arrayfields['p.datep']['label'], $_SERVER["PHP_SELF"], "p.datep", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['c.libelle']['checked'])) print_liste_field_titre($arrayfields['c.libelle']['label'], $_SERVER["PHP_SELF"], "c.libelle", '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.num_payment']['checked'])) print_liste_field_titre($arrayfields['p.num_payment']['label'], $_SERVER["PHP_SELF"], "p.num_payment", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_payment']['tooltip']);
|
||||
if (!empty($arrayfields['p.num_paiement']['checked'])) print_liste_field_titre($arrayfields['p.num_paiement']['label'], $_SERVER["PHP_SELF"], "p.num_paiement", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_paiement']['tooltip']);
|
||||
if (!empty($arrayfields['transaction']['checked'])) print_liste_field_titre($arrayfields['transaction']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['ba.label']['checked'])) print_liste_field_titre($arrayfields['ba.label']['label'], $_SERVER["PHP_SELF"], "ba.label", '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.amount']['checked'])) print_liste_field_titre($arrayfields['p.amount']['label'], $_SERVER["PHP_SELF"], "p.amount", '', $param, 'class="right"', $sortfield, $sortorder);
|
||||
@ -361,6 +377,13 @@ print $hookmanager->resPrint;
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print "</tr>";
|
||||
|
||||
$checkedCount = 0;
|
||||
foreach ($arrayfields as $column) {
|
||||
if ($column['checked']) {
|
||||
$checkedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
while ($i < min($num, $limit)) {
|
||||
@ -382,7 +405,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['p.rowid']['checked'])) {
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
print '<td>'.$object->getNomUrl(1).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -412,8 +435,8 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
|
||||
// Filter: Cheque number (fund transfer)
|
||||
if (!empty($arrayfields['p.num_payment']['checked'])) {
|
||||
print '<td>'.$objp->num_payment.'</td>';
|
||||
if (!empty($arrayfields['p.num_paiement']['checked'])) {
|
||||
print '<td>'.$objp->num_paiement.'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -448,7 +471,7 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['p.amount']['checked'])) {
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
$totalarray['pos'][8] = 'amount';
|
||||
$totalarray['pos'][$checkedCount] = 'amount';
|
||||
$totalarray['val']['amount'] += $objp->amount;
|
||||
}
|
||||
|
||||
|
||||
@ -119,6 +119,28 @@ if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFOR
|
||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
// Customer payments
|
||||
if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire)
|
||||
{
|
||||
$arrayresult['searchintocustomerpayments'] = array(
|
||||
'position'=>170,
|
||||
'img'=>'object_payment',
|
||||
'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
|
||||
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
|
||||
'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
// Vendor payments
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$arrayresult['searchintovendorpayments'] = array(
|
||||
'position'=>175,
|
||||
'img'=>'object_payment',
|
||||
'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
|
||||
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
|
||||
'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
// Miscellaneous payments
|
||||
if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED) && $user->rights->banque->lire)
|
||||
{
|
||||
|
||||
@ -46,6 +46,9 @@ class box_validated_projects extends ModeleBoxes
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
public $enabled = 1;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -54,15 +57,17 @@ class box_validated_projects extends ModeleBoxes
|
||||
*/
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $user, $langs;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('boxes', 'projects'));
|
||||
|
||||
$this->db = $db;
|
||||
$this->boxlabel = "ValidatedProjects";
|
||||
$this->boxlabel = "ProjectsWithTask";
|
||||
|
||||
$this->hidden = ! ($user->rights->projet->lire);
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) $this->enabled = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,7 +86,7 @@ class box_validated_projects extends ModeleBoxes
|
||||
$totalnb = 0;
|
||||
$totalnbTask=0;
|
||||
|
||||
$textHead = $langs->trans("ValidatedProjects");
|
||||
$textHead = $langs->trans("ProjectTasksWithoutTimeSpent");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
|
||||
// list the summary of the orders
|
||||
@ -96,17 +101,19 @@ class box_validated_projects extends ModeleBoxes
|
||||
$projectsListId='';
|
||||
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref as Ref, p.fk_soc as Client, p.dateo as startDate,";
|
||||
$sql.= " (SELECT COUNT(t.rowid) FROM ".MAIN_DB_PREFIX."projet_task AS t";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id";
|
||||
$sql.= " WHERE t.fk_projet = p.rowid AND c.fk_c_type_contact != 160 AND c.fk_socpeople = ".$user->id." AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")) AS 'taskNumber'";
|
||||
// I tried to solve sql error and performance problem, rewriting sql request but it is not clear what we want.
|
||||
// Count of tasks without time spent for tasks we are assigned too or
|
||||
// Count of tasks without time spent for all tasks of projects we are allowed to read (what it does) ?
|
||||
$sql = "SELECT p.rowid, p.ref, p.fk_soc, p.dateo as startdate,";
|
||||
$sql.= " COUNT(DISTINCT t.rowid) as tasknumber";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet AS p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet";
|
||||
// TODO Replace -1, -2, -3 with ID used for type of contat project_task into llx_c_type_contact. Once done, we can switch widget as stable.
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)";
|
||||
$sql.= " WHERE p.fk_statut = 1"; // Only open projects
|
||||
if ($projectsListId) $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project we ara allowed
|
||||
$sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")";
|
||||
$sql.= " AND c.fk_socpeople = ".$user->id;
|
||||
$sql.= " GROUP BY p.ref";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo";
|
||||
$sql.= " ORDER BY p.dateo ASC";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@ -135,10 +142,7 @@ class box_validated_projects extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$projectstatic->id = $objp->rowid;
|
||||
$projectstatic->ref = $objp->Ref;
|
||||
$projectstatic->customer = $objp->Client;
|
||||
$projectstatic->startDate = $objp->startDate;
|
||||
$projectstatic->taskNumber = $objp->taskNumber;
|
||||
$projectstatic->ref = $objp->ref;
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
@ -146,21 +150,26 @@ class box_validated_projects extends ModeleBoxes
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
$sql = 'SELECT rowid, nom FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->Client;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql){
|
||||
$socstatic = new Societe($this->db);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
|
||||
'text' => $obj->nom,
|
||||
'asis' => 1,
|
||||
'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid
|
||||
);
|
||||
}
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
if ($objp->fk_soc > 0) {
|
||||
$sql = 'SELECT rowid, nom as name FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->fk_soc;
|
||||
$resql = $this->db->query($sql);
|
||||
//$socstatic = new Societe($this->db);
|
||||
$obj2 = $this->db->fetch_object($resql);
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
|
||||
'text' => $obj2->name,
|
||||
'asis' => 1,
|
||||
'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj2->rowid
|
||||
);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
|
||||
'text' => '',
|
||||
'asis' => 1,
|
||||
'url' => ''
|
||||
);
|
||||
}
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="center"',
|
||||
@ -169,7 +178,7 @@ class box_validated_projects extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="center"',
|
||||
'text' => $objp->taskNumber." ".$langs->trans("Tasks"),
|
||||
'text' => $objp->tasknumber." ".$langs->trans("Tasks"),
|
||||
'asis' => 1,
|
||||
);
|
||||
$i++;
|
||||
|
||||
@ -533,7 +533,7 @@ class DolGraph
|
||||
$vals = array();
|
||||
|
||||
$nblines = count($this->data);
|
||||
$nbvalues = count($this->data[0]) - 1;
|
||||
$nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1);
|
||||
|
||||
for ($j = 0; $j < $nblines; $j++)
|
||||
{
|
||||
@ -562,7 +562,7 @@ class DolGraph
|
||||
$vals = array();
|
||||
|
||||
$nblines = count($this->data);
|
||||
$nbvalues = count($this->data[0]) - 1;
|
||||
$nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1);
|
||||
|
||||
for ($j = 0; $j < $nblines; $j++)
|
||||
{
|
||||
|
||||
@ -1605,7 +1605,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
||||
|
||||
if ($pdfexists && !$error)
|
||||
{
|
||||
$heightforphotref = 70;
|
||||
$heightforphotref = 80;
|
||||
if (!empty($conf->dol_optimize_smallscreen)) $heightforphotref = 60;
|
||||
// If the preview file is found
|
||||
if (file_exists($fileimage))
|
||||
|
||||
@ -57,20 +57,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist';
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_day = GETPOST('search_day', 'int');
|
||||
$search_month = GETPOST('search_month', 'int');
|
||||
$search_year = GETPOST('search_year', 'int');
|
||||
$search_year = GETPOST('search_year', 'int');
|
||||
$search_company = GETPOST('search_company', 'alpha');
|
||||
$search_payment_type = GETPOST('search_payment_type');
|
||||
$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
|
||||
$search_bank_account = GETPOST('search_bank_account', 'int');
|
||||
$search_bank_account = GETPOST('search_bank_account', 'int');
|
||||
$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -86,7 +86,15 @@ $pagenext = $page + 1;
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
if (!$sortfield) $sortfield = "p.datep";
|
||||
|
||||
// TODO: add global search for this list
|
||||
$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
'p.ref'=>"RefPayment",
|
||||
's.nom'=>"ThirdParty",
|
||||
'p.num_paiement'=>"Numero",
|
||||
'p.amount'=>"Amount",
|
||||
);
|
||||
|
||||
$arrayfields = array(
|
||||
'p.ref' =>array('label'=>"RefPayment", 'checked'=>1, 'position'=>10),
|
||||
@ -99,6 +107,7 @@ $arrayfields = array(
|
||||
);
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('paymentsupplierlist'));
|
||||
$object = new PaiementFourn($db);
|
||||
|
||||
@ -164,6 +173,8 @@ if ($search_cheque_num != '') $sql .= natural_search('p.num_paiement', $search_c
|
||||
if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1);
|
||||
if ($search_bank_account > 0) $sql .= ' AND b.fk_account='.$search_bank_account."'";
|
||||
|
||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
@ -223,6 +234,12 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'supplier_invoice', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$parameters = array();
|
||||
|
||||
@ -156,6 +156,7 @@ class Odf
|
||||
*/
|
||||
public function convertVarToOdf($value, $encode = true, $charset = 'ISO-8859')
|
||||
{
|
||||
$value = $encode ? htmlspecialchars($value) : $value;
|
||||
$value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
|
||||
$convertedValue = $value;
|
||||
|
||||
|
||||
@ -358,4 +358,7 @@ ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
|
||||
|
||||
DELETE FROM llx_const WHERE name in ('MAIN_INCLUDE_ZERO_VAT_IN_REPORTS');
|
||||
|
||||
UPDATE llx_projet_task_time SET tms = null WHERE tms = 0;
|
||||
ALTER TABLE llx_projet_task_time MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
ALTER TABLE llx_projet_task_time MODIFY COLUMN datec datetime;
|
||||
|
||||
@ -24,7 +24,8 @@ Journals=Journals
|
||||
JournalFinancial=Financial journals
|
||||
BackToChartofaccounts=Return chart of accounts
|
||||
Chartofaccounts=Chart of accounts
|
||||
ChartOfSubaccounts=Chart of subaccounts
|
||||
ChartOfSubaccounts=Chart of individual accounts
|
||||
ChartOfIndividualAccountsOfSubsidiaryLedger=Chart of individual accounts of the subsidiary ledger
|
||||
CurrentDedicatedAccountingAccount=Current dedicated account
|
||||
AssignDedicatedAccountingAccount=New account to assign
|
||||
InvoiceLabel=Invoice label
|
||||
|
||||
@ -658,7 +658,7 @@ Module50200Desc=Offer customers a PayPal online payment page (PayPal account or
|
||||
Module50300Name=Stripe
|
||||
Module50300Desc=Offer customers a Stripe online payment page (credit/debit cards). This can be used to allow your customers to make ad-hoc payments or payments related to a specific Dolibarr object (invoice, order etc...)
|
||||
Module50400Name=Accounting (double entry)
|
||||
Module50400Desc=Accounting management (double entries, support general and auxiliary ledgers). Export the ledger in several other accounting software formats.
|
||||
Module50400Desc=Accounting management (double entries, support General and Subsidiary Ledgers). Export the ledger in several other accounting software formats.
|
||||
Module54000Name=PrintIPP
|
||||
Module54000Desc=Direct print (without opening the documents) using Cups IPP interface (Printer must be visible from server, and CUPS must be installed on server).
|
||||
Module55000Name=Poll, Survey or Vote
|
||||
|
||||
@ -1014,6 +1014,8 @@ SearchIntoCustomerShipments=Customer shipments
|
||||
SearchIntoExpenseReports=Expense reports
|
||||
SearchIntoLeaves=Leave
|
||||
SearchIntoTickets=Tickets
|
||||
SearchIntoCustomerPayments=Customer payments
|
||||
SearchIntoVendorPayments=Vendor payments
|
||||
SearchIntoMiscPayments=Miscellaneous payments
|
||||
CommentLink=Comments
|
||||
NbComments=Number of comments
|
||||
|
||||
@ -223,13 +223,15 @@ if ($object->id > 0)
|
||||
$objthirdparty = $object;
|
||||
$objcon = new stdClass();
|
||||
|
||||
$out = '&origin='.$object->element.'&originid='.$object->id;
|
||||
$out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
||||
{
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') $out .= '&socid='.$objthirdparty->id;
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1';
|
||||
if (get_class($objthirdparty) == 'Societe') $out .= '&socid='.urlencode($objthirdparty->id);
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1';
|
||||
//$out.=$langs->trans("AddAnAction").' ';
|
||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||
//$out.="</a>";
|
||||
@ -264,7 +266,7 @@ if ($object->id > 0)
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'mymmodule');
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -569,7 +569,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@mymodule', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
@ -713,7 +713,7 @@ textarea.centpercent {
|
||||
.longmessagecut {
|
||||
max-height: 250px;
|
||||
max-width: 100%;
|
||||
overflow-y: scroll;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
body[class*="colorblind-"] .text-warning{
|
||||
|
||||
@ -795,7 +795,7 @@ textarea.centpercent {
|
||||
.longmessagecut {
|
||||
max-height: 250px;
|
||||
max-width: 100%;
|
||||
overflow-y: scroll;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.text-warning{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user