Look and feel v6
This commit is contained in:
parent
30bc8b9a32
commit
395d361d66
@ -55,7 +55,6 @@ if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'sortorder');
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == - 1) {
|
||||
$page = 0;
|
||||
@ -63,10 +62,8 @@ if ($page == - 1) {
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield)
|
||||
$sortfield = "aa.account_number";
|
||||
if (! $sortorder)
|
||||
$sortorder = "ASC";
|
||||
if (! $sortfield) $sortfield = "aa.account_number";
|
||||
if (! $sortorder) $sortorder = "ASC";
|
||||
|
||||
$arrayfields=array(
|
||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||
@ -79,6 +76,9 @@ $arrayfields=array(
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -145,6 +145,7 @@ if (empty($reshook))
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("ListAccounts"));
|
||||
@ -170,7 +171,6 @@ if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_la
|
||||
if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent);
|
||||
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||
if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
@ -192,22 +192,29 @@ if ($resql)
|
||||
|
||||
$params='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($search_account) $params.= '&search_account='.urlencode($search_account);
|
||||
if ($search_label) $params.= '&search_label='.urlencode($search_label);
|
||||
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
|
||||
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||
if ($search_account) $params.= '&search_account='.urlencode($search_account);
|
||||
if ($search_label) $params.= '&search_label='.urlencode($search_label);
|
||||
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
|
||||
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
|
||||
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
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.'">';
|
||||
|
||||
$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
||||
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
|
||||
|
||||
// Box to select active chart of account
|
||||
$var = ! $var;
|
||||
print $langs->trans("Selectchartofaccounts") . " : ";
|
||||
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
||||
$sql = "SELECT rowid, pcg_version, label, active";
|
||||
@ -215,12 +222,10 @@ if ($resql)
|
||||
$sql .= " WHERE active = 1";
|
||||
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
||||
$resqlchart = $db->query($sql);
|
||||
$var = true;
|
||||
if ($resqlchart) {
|
||||
$numbis = $db->num_rows($resqlchart);
|
||||
$i = 0;
|
||||
while ( $i < $numbis ) {
|
||||
$var = ! $var;
|
||||
$row = $db->fetch_row($resqlchart);
|
||||
|
||||
print '<option value="' . $row[0] . '"';
|
||||
@ -268,7 +273,8 @@ if ($resql)
|
||||
$accountstatic = new AccountingAccount($db);
|
||||
$accountparent = new AccountingAccount($db);
|
||||
|
||||
while ( $i < min($num, $limit) )
|
||||
$i=0;
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -367,7 +373,6 @@ if ($resql)
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print "</tr>\n";
|
||||
$var = ! $var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -217,21 +217,6 @@ if ($id == 25)
|
||||
}
|
||||
}
|
||||
|
||||
// Define localtax_typeList (used for dictionary "llx_c_tva")
|
||||
$localtax_typeList = array();
|
||||
if ($id == 10)
|
||||
{
|
||||
$localtax_typeList = array(
|
||||
"0" => $langs->trans("No"),
|
||||
"1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
|
||||
"2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
|
||||
"3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
||||
"4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
||||
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
||||
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -1075,21 +1060,6 @@ if ($id)
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
|
||||
else if ($fieldlist[$field]=='localtax1_type') {
|
||||
if ($obj->localtax1 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="right";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax2_type') {
|
||||
if ($obj->localtax2 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="right";
|
||||
}
|
||||
else if ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
$align="right";
|
||||
@ -1253,7 +1223,7 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
global $conf,$langs,$db;
|
||||
global $form;
|
||||
global $region_id;
|
||||
global $elementList,$sourceList,$localtax_typeList;
|
||||
global $elementList,$sourceList;
|
||||
global $bc;
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
@ -1376,24 +1346,6 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||
print '<td><input type="text" class="flat" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field]=='unit') {
|
||||
print '<td>';
|
||||
$units = array(
|
||||
'mm' => $langs->trans('SizeUnitmm'),
|
||||
'cm' => $langs->trans('SizeUnitcm'),
|
||||
'point' => $langs->trans('SizeUnitpoint'),
|
||||
'inch' => $langs->trans('SizeUnitinch')
|
||||
);
|
||||
print $form->selectarray('unit', $units, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 0, 0, 0);
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de taxe locale
|
||||
elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type')
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $form->selectarray($fieldlist[$field], $localtax_typeList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy')
|
||||
{
|
||||
print '<td>';
|
||||
|
||||
@ -451,13 +451,8 @@ $formadmin=new FormAdmin($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$titre=$langs->trans("DictionarySetup");
|
||||
$titre=$langs->trans($tablib[$id]);
|
||||
$linkback='';
|
||||
if ($id)
|
||||
{
|
||||
$titre.=' - '.$langs->trans($tablib[$id]);
|
||||
$linkback='<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
||||
}
|
||||
$titlepicto='title_setup';
|
||||
|
||||
print load_fiche_titre($titre,$linkback,$titlepicto);
|
||||
|
||||
@ -122,7 +122,6 @@ $formaccounting = new FormAccounting($db);
|
||||
$linkback = '';
|
||||
print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy');
|
||||
|
||||
print '<br>';
|
||||
print $langs->trans("DefaultBindingDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -309,9 +309,11 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
llxHeader('', $langs->trans("Payment"));
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement')
|
||||
@ -575,6 +577,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
//print '<tr><td colspan="3">';
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$arraytitle.'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
@ -741,11 +744,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
$totalrecudeposits+=$deposits;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($i > 1)
|
||||
{
|
||||
// Print total
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="3" align="left">'.$langs->trans('TotalTTC').'</td>';
|
||||
print '<td colspan="2" align="left">'.$langs->trans('TotalTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
|
||||
@ -143,6 +143,7 @@ if ($action == 'valide')
|
||||
|
||||
}
|
||||
|
||||
$linkback = '';
|
||||
// $linkback = '<a href="' . DOL_URL_ROOT . '/expensereport/payment/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
|
||||
@ -30,7 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$langs->load("bills");
|
||||
$langs->load("banks");
|
||||
|
||||
$chid=GETPOST("id");
|
||||
$chid=GETPOST("id",'int');
|
||||
$ref=GETPOST('ref','alpha');
|
||||
$action=GETPOST('action','aZ09');
|
||||
$amounts = array();
|
||||
$accountid=GETPOST('accountid','int');
|
||||
@ -59,7 +60,7 @@ if ($action == 'add_payment')
|
||||
}
|
||||
|
||||
$expensereport = new ExpenseReport($db);
|
||||
$expensereport->fetch($chid);
|
||||
$expensereport->fetch($chid, $ref);
|
||||
|
||||
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
|
||||
@ -160,7 +161,7 @@ if ($action == 'add_payment')
|
||||
}
|
||||
}
|
||||
|
||||
$_GET["action"]='create';
|
||||
$action='create';
|
||||
}
|
||||
|
||||
|
||||
@ -174,10 +175,10 @@ $form=new Form($db);
|
||||
|
||||
|
||||
// Form to create expense report payment
|
||||
if (GETPOST('action','aZ09') == 'create')
|
||||
if ($action == 'create' || empty($action))
|
||||
{
|
||||
$expensereport = new ExpenseReport($db);
|
||||
$expensereport->fetch($chid);
|
||||
$expensereport->fetch($chid, $ref);
|
||||
|
||||
$total = $expensereport->total_ttc;
|
||||
|
||||
@ -189,15 +190,20 @@ if (GETPOST('action','aZ09') == 'create')
|
||||
print '<input type="hidden" name="chid" value="'.$chid.'">';
|
||||
print '<input type="hidden" name="action" value="add_payment">';
|
||||
|
||||
dol_fiche_head();
|
||||
dol_fiche_head(null, '0', '', -1);
|
||||
|
||||
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
|
||||
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("ExpenseReport").'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2"><a href="'.DOL_URL_ROOT.'/expensereport/card.php?id='.$chid.'">'.$expensereport->ref.'</a></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Period").'</td><td colspan="2">'.get_date_range($expensereport->date_debut,$expensereport->date_fin,"",$langs,0).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($expensereport->total_ttc,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
$linkback = '';
|
||||
// $linkback = '<a href="' . DOL_URL_ROOT . '/expensereport/payment/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
dol_banner_tab($expensereport, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Period").'</td><td>'.get_date_range($expensereport->date_debut,$expensereport->date_fin,"",$langs,0).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($expensereport->total_ttc,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
$sql = "SELECT sum(p.amount) as total";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as p, ".MAIN_DB_PREFIX."expensereport as e";
|
||||
@ -210,14 +216,18 @@ if (GETPOST('action','aZ09') == 'create')
|
||||
$sumpaid = $obj->total;
|
||||
$db->free();
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2">'.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td colspan="2">'.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td>'.price($sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td>'.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td colspan=\"3\">".$langs->trans("Payment").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
|
||||
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaid):0;
|
||||
$form->select_date($datepayment,'','','','',"add_payment",1,1);
|
||||
@ -251,6 +261,8 @@ if (GETPOST('action','aZ09') == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
// List of expenses ereport not already paid completely
|
||||
|
||||
@ -168,7 +168,7 @@ DescThirdPartyReport=Consult here the list of the third party customers and supp
|
||||
ListAccounts=List of the accounting accounts
|
||||
|
||||
Pcgtype=Class of account
|
||||
Pcgsubtype=Under class of account
|
||||
Pcgsubtype=Subclass of account
|
||||
|
||||
TotalVente=Total turnover before tax
|
||||
TotalMarge=Total sales margin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user