Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
12cc1ad326
@ -147,6 +147,7 @@ if ($result) {
|
||||
print '<br/>';
|
||||
|
||||
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
||||
print '<a class="butAction" href="./categories.php">' . $langs->trans("ApplyMassCategories") . '</a>';
|
||||
// print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>';
|
||||
// print '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
|
||||
print '<br/><br/>';
|
||||
|
||||
157
htdocs/accountancy/admin/categories.php
Normal file
157
htdocs/accountancy/admin/categories.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/categories.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page to assign mass categories to accounts
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action');
|
||||
$cat_id = GETPOST('account_category');
|
||||
$selectcpt = GETPOST('cpt_bk');
|
||||
$cpt_id = GETPOST('cptid');
|
||||
|
||||
if($cat_id == 0){
|
||||
$cat_id = null;
|
||||
}
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel');
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$AccCat = new AccountancyCategory($db);
|
||||
|
||||
// si ajout de comptes
|
||||
if(!empty($selectcpt)){
|
||||
$cpts = array();
|
||||
$i = 0;
|
||||
foreach ($selectcpt as $selectedOption){
|
||||
$cpts[$i] = "'".$selectedOption."'";
|
||||
$i++;
|
||||
}
|
||||
|
||||
if($AccCat->updateAccAcc($cat_id, $cpts)){
|
||||
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
||||
}else{
|
||||
setEventMessages($langs->trans('errors'), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if ($action == 'delete') {
|
||||
if($cpt_id){
|
||||
if($AccCat->deleteCptCat($cpt_id)){
|
||||
setEventMessages($langs->trans('Deleted'), null, 'mesgs');
|
||||
}else{
|
||||
setEventMessages($langs->trans('errors'), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
llxheader('', $langs->trans('AccountAccounting'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$form = new Form($db);
|
||||
|
||||
print load_fiche_titre($langs->trans('Categories'));
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="display">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
// Category
|
||||
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
||||
print '<td>';
|
||||
$formaccounting->select_accounting_category($cat_id, 'account_category', 1);
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Display") . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
if(!empty($cat_id)){
|
||||
$obj = $AccCat->getCptBK($cat_id);
|
||||
print '<tr><td>' . $langs->trans("AddCompteFromBK") . '</td>';
|
||||
print '<td>';
|
||||
if(!empty($obj)){
|
||||
print '<select size="'.count($obj).'" name="cpt_bk[]" multiple>';
|
||||
foreach ( $obj as $cpt ) {
|
||||
print '<option value="'.length_accountg($cpt->numero_compte).'">' . length_accountg($cpt->numero_compte) . ' ('.$cpt->label_compte.' '.$cpt->doc_ref.')</option>';
|
||||
|
||||
}
|
||||
print '</select> - <input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("add") . '"> ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
if ($action == 'display' || $action == 'delete') {
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans("Numerocompte").'</th><th class="liste_titre">'.$langs->trans("Description").'</th><th class="liste_titre" width="60" align="center">Action</th></tr>';
|
||||
|
||||
if(!empty($cat_id)){
|
||||
$obj = $AccCat->display($cat_id);
|
||||
$j=1;
|
||||
if(!empty($obj)){
|
||||
foreach ( $obj as $cpt ) {
|
||||
$var = ! $var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>' . length_accountg($cpt->account_number) . '</td>';
|
||||
print '<td>' . $cpt->label . '</td>';
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?account_category=$cat_id&cptid=".$cpt->rowid, $langs->trans("DeleteCptCategory"), $langs->trans("ConfirmDeleteCptCategory"), "delete", '', 0, "action-delete".$j);
|
||||
print '<td><input class="button" type="button" id="action-delete'.$j.'" value="' . $langs->trans("Delete") . '"></td>';
|
||||
print "</tr>\n";
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -205,8 +205,8 @@ if ($action == 'create') {
|
||||
|
||||
// Ref
|
||||
print "<tr>";
|
||||
print '<td width="20%">' . $langs->trans("Ref") . '</td><td>';
|
||||
print $object->rowid;
|
||||
print '<td width="25%">' . $langs->trans("Ref") . '</td><td>';
|
||||
print $object->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
@ -252,11 +252,11 @@ if ($action == 'create') {
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/fiscalyear.php">' . $langs->trans("BackToList") . '</a>';
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/fiscalyear.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td width="50%">';
|
||||
print $object->rowid;
|
||||
print $object->ref;
|
||||
print '</td><td width="25%">';
|
||||
print $linkback;
|
||||
print '</td></tr>';
|
||||
@ -270,16 +270,16 @@ if ($action == 'create') {
|
||||
|
||||
// Date start
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountancycategory.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief File of class to manage categories of an accounting account_category
|
||||
* \brief File of class to manage categories of an accounting category_type
|
||||
*/
|
||||
|
||||
// Class
|
||||
@ -243,7 +243,7 @@ class AccountancyCategory
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.rowid, c.code, c.label, c.account_category ";
|
||||
$sql = "SELECT c.rowid, c.code, c.label, c.category_type ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c, ".MAIN_DB_PREFIX."c_country as co";
|
||||
$sql.= " WHERE c.active = 1 AND c.fk_country = co.rowid";
|
||||
$sql.= " AND co.code = '".$mysoc->country_code."'";
|
||||
@ -343,7 +343,7 @@ class AccountancyCategory
|
||||
{
|
||||
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
|
||||
$sql.= " WHERE c.active = 1 AND c.account_category = 1 ";
|
||||
$sql.= " WHERE c.active = 1 AND c.category_type = 1 ";
|
||||
$sql.= " AND c.fk_country = ".$mysoc->country_id;
|
||||
$sql.= " ORDER BY c.position ASC";
|
||||
}
|
||||
@ -351,7 +351,7 @@ class AccountancyCategory
|
||||
{
|
||||
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c, ".MAIN_DB_PREFIX."c_country as co";
|
||||
$sql.= " WHERE c.active = 1 AND c.account_category = 1 AND c.fk_country = co.rowid";
|
||||
$sql.= " WHERE c.active = 1 AND c.category_type = 1 AND c.fk_country = co.rowid";
|
||||
$sql.= " AND co.code = '".$mysoc->country_code."'";
|
||||
$sql.= " ORDER BY c.position ASC";
|
||||
}
|
||||
|
||||
@ -62,21 +62,12 @@ if ($action == 'setcoder')
|
||||
}
|
||||
else if ($action == 'update')
|
||||
{
|
||||
if (GETPOST('submit_GENBARCODE_LOCATION'))
|
||||
{
|
||||
$location = GETPOST('GENBARCODE_LOCATION','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if (GETPOST('submit_PRODUIT_DEFAULT_BARCODE_TYPE'))
|
||||
{
|
||||
$coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if (GETPOST('submit_GENBARCODE_BARCODETYPE_THIRDPARTY'))
|
||||
{
|
||||
$coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
$location = GETPOST('GENBARCODE_LOCATION','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity);
|
||||
$coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
|
||||
$coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
else if ($action == 'updateengine')
|
||||
{
|
||||
@ -195,9 +186,9 @@ $var=true;
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"updateengine\">";
|
||||
//print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
//print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
//print "<input type=\"hidden\" name=\"action\" value=\"updateengine\">";
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -261,7 +252,7 @@ if ($resql)
|
||||
// Build barcode on disk (not used, this is done to make debug easier)
|
||||
$result=$module->writeBarCode($obj->example,$obj->encoding,'Y');
|
||||
// Generate on the fly and output barcode with generator
|
||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
||||
//print $url;
|
||||
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
|
||||
}
|
||||
@ -296,7 +287,7 @@ if (empty($conf->use_javascript_ajax))
|
||||
// TODO Implement code behind action updateengine
|
||||
//print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"></div>';
|
||||
}
|
||||
print '</form>';
|
||||
//print '</form>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
@ -331,9 +322,7 @@ if (! isset($_SERVER['WINDIR']))
|
||||
$langs->load("errors");
|
||||
print '<br><font class="error">'.$langs->trans("ErrorFileNotFound",$conf->global->GENBARCODE_LOCATION).'</font>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td width="60" align="center"><input type="submit" class="button" name="submit_GENBARCODE_LOCATION" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Module products
|
||||
@ -344,10 +333,7 @@ if (! empty($conf->product->enabled))
|
||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||
print '<td width="60" align="right">';
|
||||
$formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" name="submit_PRODUIT_DEFAULT_BARCODE_TYPE" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Module thirdparty
|
||||
@ -358,13 +344,13 @@ if (! empty($conf->societe->enabled))
|
||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
||||
print '<td width="60" align="right">';
|
||||
print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1);
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
|
||||
print "</div>";
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
@ -419,13 +405,13 @@ if ($conf->produit->enabled)
|
||||
|
||||
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&value='.$file.'">';
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&value='.$file.'">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&value='.$file.'">';
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&value='.$file.'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -442,7 +428,7 @@ if ($conf->produit->enabled)
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
//print '</form>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoProposal").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoProposal").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
@ -277,7 +277,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoProposal").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoProposal").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
@ -357,7 +357,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoOrder").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoOrder").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
@ -438,7 +438,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoSupplierOrder").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoSupplierOrder").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
@ -216,6 +216,11 @@ if (! empty($conf->commande->enabled))
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoOrder").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
$db->free($resql);
|
||||
@ -275,7 +275,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("NoInvoice").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
$db->free($resql);
|
||||
|
||||
@ -273,7 +273,7 @@ class modAccounting extends DolibarrModules
|
||||
$this->rights[$r][0] = 50440;
|
||||
$this->rights[$r][1] = 'Manage chart of accounts';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 1;
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'chartofaccount';
|
||||
$this->rights[$r][5] = '';
|
||||
$r++;
|
||||
|
||||
@ -1736,72 +1736,80 @@ else if ($id || $ref)
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($object->statut == 0 && $num_prod > 0)
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// TODO add alternative status
|
||||
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
||||
if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
if ($object->statut == 0 && $num_prod > 0)
|
||||
{
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// TODO add alternative status
|
||||
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
||||
if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
|
||||
// Create bill and Close shipment
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// This is just to generate a delivery receipt
|
||||
//var_dump($object->linkedObjectsIds['delivery']);
|
||||
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
|
||||
}
|
||||
// Close
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
|
||||
{
|
||||
$label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
|
||||
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
|
||||
if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close.
|
||||
{
|
||||
$label="ClassifyBilled";
|
||||
$paramaction='classifybilled';
|
||||
}
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action='.$paramaction.'">'.$langs->trans($label).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->expedition->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
|
||||
// Create bill and Close shipment
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// This is just to generate a delivery receipt
|
||||
//var_dump($object->linkedObjectsIds['delivery']);
|
||||
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
|
||||
}
|
||||
// Close
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
|
||||
{
|
||||
$label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
|
||||
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
|
||||
if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close.
|
||||
{
|
||||
$label="ClassifyBilled";
|
||||
$paramaction='classifybilled';
|
||||
}
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action='.$paramaction.'">'.$langs->trans($label).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->expedition->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -294,3 +294,5 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23208, '', 0, 'Nor-Oriental', 1);
|
||||
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23209, '', 0, 'Zuliana', 1);
|
||||
|
||||
-- Regions Peru (id country=181)
|
||||
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18101, '', 0, 'Perú', 1);
|
||||
@ -1283,3 +1283,31 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0010', 14003, '', 0, '', 'Esch-sur-Alzette', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0011', 14003, '', 0, '', 'Luxembourg', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0012', 14003, '', 0, '', 'Mersch', 1);
|
||||
|
||||
-- Provinces Perú (id country=181)
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AMA', 18101, '', 0, '', 'Amazonas', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ANC', 18101, '', 0, '', 'Ancash', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('APU', 18101, '', 0, '', 'Apurimac', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ARE', 18101, '', 0, '', 'Arequipa', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AYA', 18101, '', 0, '', 'Ayacucho', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CAJ', 18101, '', 0, '', 'Cajamarca', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CUS', 18101, '', 0, '', 'Cuzco', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CAL', 18101, '', 0, '', 'Callao', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HUV', 18101, '', 0, '', 'Huancavelica', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HUC', 18101, '', 0, '', 'Huanuco', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ICA', 18101, '', 0, '', 'Ica', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JUN', 18101, '', 0, '', 'Junin', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LAL', 18101, '', 0, '', 'La Libertad', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LAM', 18101, '', 0, '', 'Lambayeque', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LIM', 18101, '', 0, '', 'Lima', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LMA', 18101, '', 0, '', 'Lima Metropolitana', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LOR', 18101, '', 0, '', 'Loreto', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MDD', 18101, '', 0, '', 'Madre de Dios', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MOQ', 18101, '', 0, '', 'Moquegua', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PAS', 18101, '', 0, '', 'Pasco', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PIU', 18101, '', 0, '', 'Piura', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PUN', 18101, '', 0, '', 'Puno', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SAM', 18101, '', 0, '', 'San Martin', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TAC', 18101, '', 0, '', 'Tacna', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TUM', 18101, '', 0, '', 'Tumbes', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('UCA', 18101, '', 0, '', 'Ucayali', 1);
|
||||
@ -375,6 +375,16 @@ UPDATE llx_accounting_account SET account_parent = '0' WHERE account_parent = ''
|
||||
-- VMYSQL4.1 ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_parent TYPE integer USING account_parent::integer;
|
||||
|
||||
CREATE TABLE llx_accounting_journal
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
code varchar(32) NOT NULL,
|
||||
label varchar(128) NOT NULL,
|
||||
nature smallint DEFAULT 0 NOT NULL, -- type of journals (Sale / purchase / bank / various operations)
|
||||
active smallint DEFAULT 0
|
||||
)ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code);
|
||||
|
||||
-- VMYSQL4.1 DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque;
|
||||
-- VPGSQL8.2 DROP INDEX uk_bordereau_cheque;
|
||||
|
||||
20
htdocs/install/mysql/tables/llx_accounting_journal.key.sql
Normal file
20
htdocs/install/mysql/tables/llx_accounting_journal.key.sql
Normal file
@ -0,0 +1,20 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===========================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code);
|
||||
27
htdocs/install/mysql/tables/llx_accounting_journal.sql
Normal file
27
htdocs/install/mysql/tables/llx_accounting_journal.sql
Normal file
@ -0,0 +1,27 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- Table of journals for accountancy
|
||||
-- ============================================================================
|
||||
|
||||
create table llx_accounting_journal
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
code varchar(32) NOT NULL,
|
||||
label varchar(128) NOT NULL,
|
||||
nature smallint DEFAULT 0 NOT NULL, -- type of journals (Sale / purchase / bank / various operations)
|
||||
active smallint DEFAULT 0
|
||||
)ENGINE=innodb;
|
||||
@ -149,6 +149,8 @@ FicheVentilation=Breakdown card
|
||||
GeneralLedgerIsWritten=Operations are written in the general ledger
|
||||
|
||||
MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s
|
||||
## Admin
|
||||
ApplyMassCategories=Apply mass categories
|
||||
|
||||
## Export
|
||||
Exports=Exports
|
||||
|
||||
Loading…
Reference in New Issue
Block a user