Debug v18
This commit is contained in:
parent
5fcbf14652
commit
d28fcdafff
4 changed files with 778 additions and 769 deletions
|
|
@ -96,10 +96,13 @@ class Subscription extends CommonObject
|
|||
public $amount;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int ID of bank in llx_bank
|
||||
*/
|
||||
public $fk_bank;
|
||||
|
||||
/**
|
||||
* @var array Array with all fields into database and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
|
||||
|
|
@ -128,7 +131,7 @@ class Subscription extends CommonObject
|
|||
|
||||
|
||||
/**
|
||||
* Function who permitted cretaion of the subscription
|
||||
* Function who permitted creation of the subscription
|
||||
*
|
||||
* @param User $user User that create
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
|
|
@ -151,7 +154,6 @@ class Subscription extends CommonObject
|
|||
$this->datec = $now;
|
||||
}
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
|
||||
|
|
@ -217,7 +219,7 @@ class Subscription extends CommonObject
|
|||
$sql .= " datef,";
|
||||
$sql .= " subscription, note as note_public, fk_bank";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||
$sql .= " WHERE rowid=".((int) $rowid);
|
||||
$sql .= " WHERE rowid = ".((int) $rowid);
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
@ -274,11 +276,11 @@ class Subscription extends CommonObject
|
|||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".((int) $this->fk_type).",";
|
||||
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
|
||||
$sql .= " note=".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
|
||||
$sql .= " note = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||
$sql .= " dateadh = '".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef = '".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec = '".$this->db->idate($this->datec)."',";
|
||||
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -148,7 +148,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('adheren
|
|||
header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent);
|
||||
exit;
|
||||
} else {
|
||||
$mesg = $adh->error;
|
||||
$errmesg = $adh->error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -194,45 +194,51 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'edit') {
|
|||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur" colspan="3">';
|
||||
print '<td class="valeur">';
|
||||
print $form->showrefnav($object, 'rowid', $linkback, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Member
|
||||
$adh->ref = $adh->getFullName($langs);
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
||||
print '<td>'.$langs->trans("Member").'</td>';
|
||||
print '<td class="valeur">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Type
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Type").'</td><td class="valeur" colspan="3">';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid") : $object->fk_type));
|
||||
print'</td></tr>';
|
||||
|
||||
// Date start subscription
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectDate($object->datef, 'datesubend', 0, 0, 0, 'update', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="2">';
|
||||
print '<input type="text" class="flat" size="10" name="amount" value="'.price($object->amount).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input type="text" class="flat width200" name="amount" value="'.price($object->amount).'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="2">';
|
||||
print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input type="text" class="flat" name="note" value="'.$object->note_private.'"></td></tr>';
|
||||
|
||||
// Bank line
|
||||
if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) {
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||
if ($object->fk_bank) {
|
||||
$bankline = new AccountLine($db);
|
||||
$result = $bankline->fetch($object->fk_bank);
|
||||
|
|
|
|||
|
|
@ -2570,8 +2570,9 @@ class AccountLine extends CommonObjectLine
|
|||
$result .= $langs->trans("BankLineConciliated").': ';
|
||||
$result .= yn($this->rappro);
|
||||
}
|
||||
if ($option == 'showall' || $option == 'showconciliatedandaccounted') {
|
||||
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".((int) $this->id);
|
||||
if (isModEnabled('accounting') && ($option == 'showall' || $option == 'showconciliatedandaccounted')) {
|
||||
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " WHERE doc_type = 'bank' AND fk_doc = ".((int) $this->id);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
|
|
|||
Loading…
Reference in a new issue