Debug accounting module
This commit is contained in:
parent
14c9cd4490
commit
a057cb93c9
@ -259,10 +259,10 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('Options') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr ' . $bc[false] . '><td width="25%"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductSell') . '</td>';
|
||||
print '<tr ' . $bc[false] . '><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductSell') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSellDesc'));
|
||||
print "</td></tr>\n";
|
||||
print '<tr ' . $bc[true] . '><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductBuy') . '</td>';
|
||||
print '<tr ' . $bc[true] . '><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductBuy') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuyDesc')) . "</td></tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
@ -284,7 +284,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||
/*
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
print_liste_field_titre($langs->trans("Accountancy_code_buy"));
|
||||
@ -301,7 +301,7 @@ if ($result)
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print '<td class="liste_titre"> </td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(1, 'checkforselect', 1);
|
||||
print $searchpitco;
|
||||
@ -340,23 +340,33 @@ if ($result)
|
||||
print '<tr'. $bc[$var].'>';
|
||||
|
||||
print "</tr>";
|
||||
print '<tr'. $bc[$var].'>';
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
|
||||
// Ref produit as link
|
||||
$product_static->ref = $obj->ref;
|
||||
$product_static->id = $obj->rowid;
|
||||
$product_static->type = $obj->type;
|
||||
$product_static->label = $obj->label;
|
||||
$product_static->description = $obj->description;
|
||||
|
||||
print '<td>';
|
||||
if ($product_static->id)
|
||||
print $product_static->getNomUrl(1);
|
||||
else
|
||||
print '- ';
|
||||
print '</td>';
|
||||
print '<td align="left">' . dol_trunc($obj->label, 24) . '</td>';
|
||||
// TODO ADJUST DESCRIPTION SIZE
|
||||
// print '<td align="left">' . $obj->description . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64;
|
||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
|
||||
print '<td align="left">'.$obj->label.'</td>';
|
||||
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC))
|
||||
{
|
||||
// TODO ADJUST DESCRIPTION SIZE
|
||||
// print '<td align="left">' . $obj->description . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64;
|
||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
}
|
||||
|
||||
// Accounting account buy
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
|
||||
@ -342,12 +342,15 @@ if ($result) {
|
||||
print price($objp->tva_tx_line);
|
||||
print '</td>';
|
||||
|
||||
// Accounting account suggested
|
||||
print '<td align="center" style="' . $code_sell_p_notset . '">';
|
||||
if ($objp->code_sell_l == $objp->code_sell_p) {
|
||||
if ($objp->code_sell_l == $objp->code_sell_p) { // Test if there is a difference between code by default and code on product
|
||||
if ($objp->code_sell_l > 0) print $objp->code_sell_l;
|
||||
else print $langs->trans("Unknown");
|
||||
} else {
|
||||
print $langs->trans("Buy") . ' = ' . $objp->code_sell_l . '<br />' . $langs->trans("Sell") . ' = ' . $objp->code_sell_p;
|
||||
print $langs->trans("Default") . ' = ' . ($objp->code_sell_l > 0 ? $objp->code_sell_l : $langs->trans("Unknown"));
|
||||
print '<br>';
|
||||
print $langs->trans("Product") . ' = ' . ($objp->code_sell_p > 0 ? $objp->code_sell_p : $langs->trans("Unknown"));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -174,7 +174,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accounta
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND product_type <= 2";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_buy IS NULL OR p.accountancy_code_buy ='')";
|
||||
// Add search filter like
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= " AND (f.ref like '%" . $search_invoice . "%')";
|
||||
@ -352,13 +352,15 @@ if ($result) {
|
||||
print price($objp->tva_tx_line);
|
||||
print '</td>';
|
||||
|
||||
// Accounting account suggested
|
||||
print '<td align="center" style="' . $code_buy_p_notset . '">';
|
||||
// if not same kind of product_type stored in product & facturedet we display both account and let user choose
|
||||
if ($objp->code_buy_l == $objp->code_buy_p) {
|
||||
if ($objp->code_buy_l > 0) print $objp->code_buy_l;
|
||||
else print $langs->trans("Unknown");
|
||||
} else { // This can happen if user has change type of product after creation of invoice
|
||||
print 'lines=' . $objp->code_buy_l . '<br />product=' . $objp->code_buy_p;
|
||||
if ($objp->code_buy_l == $objp->code_buy_p) { // Test if there is a difference between code by default and code on product
|
||||
if ($objp->code_buy_l > 0) print $objp->code_buy_l;
|
||||
else print $langs->trans("Unknown");
|
||||
} else {
|
||||
print $langs->trans("Default") . ' = ' . ($objp->code_buy_l > 0 ? $objp->code_buy_l : $langs->trans("Unknown"));
|
||||
print '<br>';
|
||||
print $langs->trans("Product") . ' = ' . ($objp->code_buy_p > 0 ? $objp->code_buy_p : $langs->trans("Unknown"));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user