forked from Wavyzz/dolibarr
Fix several bugs reported by scrutinizer
This commit is contained in:
@@ -55,7 +55,7 @@ if ($action == "set")
|
|||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int');
|
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int');
|
||||||
$account = new Account($db, $id);
|
$account = new Account($db);
|
||||||
|
|
||||||
if($account->fetch($id)>0)
|
if($account->fetch($id)>0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ print "<br>\n";
|
|||||||
$template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
$template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
||||||
|
|
||||||
$interfaces = new Interfaces($db);
|
$interfaces = new Interfaces($db);
|
||||||
$triggers = $interfaces->getTriggersList(0,'priority');
|
$triggers = $interfaces->getTriggersList();
|
||||||
|
|
||||||
print '<table class="noborder">
|
print '<table class="noborder">
|
||||||
<tr class="liste_titre">
|
<tr class="liste_titre">
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ llxHeader('',$langs->trans("Categories"),$help_url);
|
|||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'setup');
|
print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'setup');
|
||||||
|
|
||||||
$head = categoriesadmin_prepare_head(null);
|
$head = categoriesadmin_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category');
|
dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category');
|
||||||
|
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ else if ($id || $ref)
|
|||||||
llxHeader("","",$langs->trans("Member"));
|
llxHeader("","",$langs->trans("Member"));
|
||||||
|
|
||||||
|
|
||||||
$head=member_prepare_head($member, $user);
|
$head=member_prepare_head($member);
|
||||||
$titre=$langs->trans("Member");
|
$titre=$langs->trans("Member");
|
||||||
$picto='user';
|
$picto='user';
|
||||||
dol_fiche_head($head, 'category', $titre,0,$picto);
|
dol_fiche_head($head, 'category', $titre,0,$picto);
|
||||||
@@ -471,7 +471,7 @@ else if ($id || $ref)
|
|||||||
llxHeader("","",$langs->trans("Contact"));
|
llxHeader("","",$langs->trans("Contact"));
|
||||||
|
|
||||||
|
|
||||||
$head=contact_prepare_head($object, $user);
|
$head=contact_prepare_head($object);
|
||||||
$titre=$langs->trans("ContactsAddresses");
|
$titre=$langs->trans("ContactsAddresses");
|
||||||
$picto='contact';
|
$picto='contact';
|
||||||
dol_fiche_head($head, 'category', $titre,0,$picto);
|
dol_fiche_head($head, 'category', $titre,0,$picto);
|
||||||
|
|||||||
@@ -258,9 +258,10 @@ class ActionComm extends CommonObject
|
|||||||
* Load object from database
|
* Load object from database
|
||||||
*
|
*
|
||||||
* @param int $id Id of action to get
|
* @param int $id Id of action to get
|
||||||
|
* @param string $ref Ref of action to get
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id, $ref='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -286,7 +287,9 @@ class ActionComm extends CommonObject
|
|||||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
||||||
$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id";
|
$sql.= " WHERE a.fk_action=c.id";
|
||||||
|
if ($ref) $sql.= " AND a.id=".$ref; // No field ref, we use id
|
||||||
|
else $sql.= " AND a.id=".$id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
|
|||||||
@@ -327,11 +327,11 @@ if ($id > 0)
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'editconditions')
|
if ($action == 'editconditions')
|
||||||
{
|
{
|
||||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'cond_reglement_id',-1,1);
|
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id',1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'none');
|
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'none');
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@@ -338,9 +338,10 @@ class Account extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Create bank account into database
|
* Create bank account into database
|
||||||
*
|
*
|
||||||
|
* @param User $user Object user making creation
|
||||||
* @return int < 0 if KO, > 0 if OK
|
* @return int < 0 if KO, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function create()
|
function create($user='')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
@@ -665,10 +666,9 @@ class Account extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ if ($_POST["action"] == 'add')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$id = $account->create($user->id);
|
$id = $account->create($user);
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
$_GET["id"]=$id; // Force chargement page en mode visu
|
$_GET["id"]=$id; // Force chargement page en mode visu
|
||||||
@@ -306,7 +306,7 @@ if ($action == 'create')
|
|||||||
$doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
|
$doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@@ -510,7 +510,7 @@ else
|
|||||||
$account->fetch(GETPOST('id','int'));
|
$account->fetch(GETPOST('id','int'));
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("EditFinancialAccount"));
|
print_fiche_titre($langs->trans("EditFinancialAccount"));
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
@@ -614,7 +614,7 @@ else
|
|||||||
$doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
|
$doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@@ -635,7 +635,7 @@ else
|
|||||||
// Accountancy journal
|
// Accountancy journal
|
||||||
print '<tr><td valign="top">'.$langs->trans("AccountancyJournal").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("AccountancyJournal").'</td>';
|
||||||
print '<td colspan="3"><input type="text" name="accountancy_journal" value="'.(isset($_POST["accountancy_journal"])?$_POST["accountancy_journal"]:$account->accountancy_journal).'"></td></tr>';
|
print '<td colspan="3"><input type="text" name="accountancy_journal" value="'.(isset($_POST["accountancy_journal"])?$_POST["accountancy_journal"]:$account->accountancy_journal).'"></td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<center><br><input value="'.$langs->trans("Modify").'" type="submit" class="button">';
|
print '<center><br><input value="'.$langs->trans("Modify").'" type="submit" class="button">';
|
||||||
|
|||||||
@@ -222,13 +222,16 @@ class Deplacement extends CommonObject
|
|||||||
* Load an object from database
|
* Load an object from database
|
||||||
*
|
*
|
||||||
* @param int $id Id of record to load
|
* @param int $id Id of record to load
|
||||||
|
* @param string $ref Ref of record
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id, $ref='')
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams";
|
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
|
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
|
||||||
$sql.= " WHERE rowid = ".$id;
|
$sql.= " WHERE entity IN (".getEntity('deplacement').")";
|
||||||
|
if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'";
|
||||||
|
else $sql.= " AND id = ".$id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ if ($object->id)
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$head=trip_prepare_head($object, $user);
|
$head=trip_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');
|
dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');
|
||||||
|
|
||||||
|
|||||||
@@ -171,11 +171,12 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fact
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete line
|
// Delete line
|
||||||
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer) {
|
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$result = $object->deleteline($_GET ['lineid'], $user);
|
$result = $object->deleteline(GETPOST('lineid'));
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
@@ -203,14 +204,16 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete link of credit note to invoice
|
// Delete link of credit note to invoice
|
||||||
else if ($action == 'unlinkdiscount' && $user->rights->facture->creer) {
|
else if ($action == 'unlinkdiscount' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$discount = new DiscountAbsolute($db);
|
$discount = new DiscountAbsolute($db);
|
||||||
$result = $discount->fetch($_GET ["discountid"]);
|
$result = $discount->fetch(GETPOST("discountid"));
|
||||||
$discount->unlink_invoice();
|
$discount->unlink_invoice();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
else if ($action == 'valid' && $user->rights->facture->creer) {
|
else if ($action == 'valid' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
// On verifie signe facture
|
// On verifie signe facture
|
||||||
@@ -229,7 +232,8 @@ else if ($action == 'valid' && $user->rights->facture->creer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_thirdparty' && $user->rights->facture->creer) {
|
else if ($action == 'set_thirdparty' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->setValueFrom('fk_soc', $socid);
|
$object->setValueFrom('fk_soc', $socid);
|
||||||
|
|
||||||
@@ -237,12 +241,14 @@ else if ($action == 'set_thirdparty' && $user->rights->facture->creer) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'classin' && $user->rights->facture->creer) {
|
else if ($action == 'classin' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->setProject($_POST['projectid']);
|
$object->setProject($_POST['projectid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmode' && $user->rights->facture->creer) {
|
else if ($action == 'setmode' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@@ -268,7 +274,8 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
|
|||||||
if ($result < 0) dol_print_error($db, $object->error);
|
if ($result < 0) dol_print_error($db, $object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setconditions' && $user->rights->facture->creer) {
|
else if ($action == 'setconditions' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->cond_reglement_code = 0; // To clean property
|
$object->cond_reglement_code = 0; // To clean property
|
||||||
$object->cond_reglement_id = 0; // To clean property
|
$object->cond_reglement_id = 0; // To clean property
|
||||||
@@ -283,7 +290,8 @@ else if ($action == 'setconditions' && $user->rights->facture->creer) {
|
|||||||
if ($result < 0) dol_print_error($db, $object->error);
|
if ($result < 0) dol_print_error($db, $object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setpaymentterm' && $user->rights->facture->creer) {
|
else if ($action == 'setpaymentterm' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
|
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
|
||||||
if ($object->date_lim_reglement < $object->date) {
|
if ($object->date_lim_reglement < $object->date) {
|
||||||
@@ -295,7 +303,8 @@ else if ($action == 'setpaymentterm' && $user->rights->facture->creer) {
|
|||||||
dol_print_error($db, $object->error);
|
dol_print_error($db, $object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) {
|
else if ($action == 'setrevenuestamp' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->revenuestamp = GETPOST('revenuestamp');
|
$object->revenuestamp = GETPOST('revenuestamp');
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
@@ -305,16 +314,19 @@ else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bank account
|
// bank account
|
||||||
else if ($action == 'setbankaccount' && $user->rights->facture->creer) {
|
else if ($action == 'setbankaccount' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setremisepercent' && $user->rights->facture->creer) {
|
else if ($action == 'setremisepercent' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->set_remise($user, $_POST['remise_percent']);
|
$result = $object->set_remise($user, $_POST['remise_percent']);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == "setabsolutediscount" && $user->rights->facture->creer) {
|
else if ($action == "setabsolutediscount" && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
// POST[remise_id] ou POST[remise_id_for_payment]
|
// POST[remise_id] ou POST[remise_id_for_payment]
|
||||||
if (! empty($_POST["remise_id"])) {
|
if (! empty($_POST["remise_id"])) {
|
||||||
$ret = $object->fetch($id);
|
$ret = $object->fetch($id);
|
||||||
@@ -339,7 +351,8 @@ else if ($action == "setabsolutediscount" && $user->rights->facture->creer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_ref_client' && $user->rights->facture->creer) {
|
else if ($action == 'set_ref_client' && $user->rights->facture->creer)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->set_ref_client($_POST['ref_client']);
|
$object->set_ref_client($_POST['ref_client']);
|
||||||
}
|
}
|
||||||
@@ -359,7 +372,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
{
|
{
|
||||||
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
|
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
|
||||||
$idprof = 'idprof' . $i;
|
$idprof = 'idprof' . $i;
|
||||||
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) {
|
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
|
||||||
|
{
|
||||||
if (! $error)
|
if (! $error)
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error ++;
|
$error ++;
|
||||||
@@ -376,7 +390,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for warehouse
|
// Check for warehouse
|
||||||
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) {
|
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
|
||||||
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
if (! $idwarehouse || $idwarehouse == - 1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
||||||
@@ -412,7 +427,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Go back to draft status (unvalidate)
|
// Go back to draft status (unvalidate)
|
||||||
else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)) {
|
else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
|
||||||
|
{
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
@@ -426,7 +442,8 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) {
|
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
|
||||||
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
if (! $idwarehouse || $idwarehouse == - 1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
||||||
@@ -460,7 +477,8 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
|
|||||||
$ventilExportCompta = $object->getVentilExportCompta();
|
$ventilExportCompta = $object->getVentilExportCompta();
|
||||||
|
|
||||||
// On verifie si aucun paiement n'a ete effectue
|
// On verifie si aucun paiement n'a ete effectue
|
||||||
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) {
|
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
|
||||||
|
{
|
||||||
$result=$object->set_draft($user, $idwarehouse);
|
$result=$object->set_draft($user, $idwarehouse);
|
||||||
if ($result<0) setEventMessage($object->error,'errors');
|
if ($result<0) setEventMessage($object->error,'errors');
|
||||||
|
|
||||||
@@ -484,12 +502,14 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Classify "paid"
|
// Classify "paid"
|
||||||
else if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->facture->paiement) {
|
else if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->facture->paiement)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->set_paid($user);
|
$result = $object->set_paid($user);
|
||||||
if ($result<0) setEventMessage($object->error,'errors');
|
if ($result<0) setEventMessage($object->error,'errors');
|
||||||
} // Classif "paid partialy"
|
} // Classif "paid partialy"
|
||||||
else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement) {
|
else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement)
|
||||||
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$close_code = $_POST["close_code"];
|
$close_code = $_POST["close_code"];
|
||||||
$close_note = $_POST["close_note"];
|
$close_note = $_POST["close_note"];
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$id=GETPOST('id');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@@ -39,8 +41,8 @@ $langs->load("companies");
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$paiement = new Paiement($db);
|
$paiement = new Paiement($db);
|
||||||
$paiement->fetch($_GET["id"], $user);
|
$paiement->fetch($id);
|
||||||
$paiement->info($_GET["id"]);
|
$paiement->info($id);
|
||||||
|
|
||||||
$head = payment_prepare_head($paiement);
|
$head = payment_prepare_head($paiement);
|
||||||
|
|
||||||
|
|||||||
@@ -3043,7 +3043,7 @@ class Form
|
|||||||
* @param int $page Page
|
* @param int $page Page
|
||||||
* @param string $selected Id condition pre-selectionne
|
* @param string $selected Id condition pre-selectionne
|
||||||
* @param string $htmlname Name of select html field
|
* @param string $htmlname Name of select html field
|
||||||
* @param int $addempty Ajoute entree vide
|
* @param int $addempty Add empty entry
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
|
function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||||
|
|
||||||
|
ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer;
|
||||||
|
|
||||||
ALTER TABLE llx_propal ADD COLUMN fk_user_modif integer after fk_user_author;
|
ALTER TABLE llx_propal ADD COLUMN fk_user_modif integer after fk_user_author;
|
||||||
ALTER TABLE llx_commande ADD COLUMN fk_user_modif integer after fk_user_author;
|
ALTER TABLE llx_commande ADD COLUMN fk_user_modif integer after fk_user_author;
|
||||||
@@ -26,6 +27,8 @@ ALTER TABLE llx_product ADD COLUMN fk_user_modif integer after fk_user_author;
|
|||||||
ALTER TABLE llx_fichinter ADD COLUMN fk_user_modif integer after fk_user_author;
|
ALTER TABLE llx_fichinter ADD COLUMN fk_user_modif integer after fk_user_author;
|
||||||
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_user_modif integer after fk_user_author;
|
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_user_modif integer after fk_user_author;
|
||||||
ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_modif integer after fk_user_author;
|
ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_modif integer after fk_user_author;
|
||||||
|
ALTER TABLE llx_bank_account ADD COLUMN fk_user_modif integer after fk_user_author;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_fichinter ADD COLUMN ref_ext varchar(255);
|
ALTER TABLE llx_fichinter ADD COLUMN ref_ext varchar(255);
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ create table llx_bank_account
|
|||||||
ref varchar(12) NOT NULL,
|
ref varchar(12) NOT NULL,
|
||||||
label varchar(30) NOT NULL,
|
label varchar(30) NOT NULL,
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
|
fk_user_author integer,
|
||||||
|
fk_user_modif integer,
|
||||||
bank varchar(60),
|
bank varchar(60),
|
||||||
code_banque varchar(8),
|
code_banque varchar(8),
|
||||||
code_guichet varchar(6),
|
code_guichet varchar(6),
|
||||||
|
|||||||
Reference in New Issue
Block a user