This commit is contained in:
aspangaro 2015-06-18 06:30:48 +02:00
parent 9cf06ec21c
commit 7539ad88fa
4 changed files with 17 additions and 17 deletions

View File

@ -42,7 +42,7 @@ class PaymentDonation extends CommonObject
var $datep=''; var $datep='';
var $amount; // Total amount of payment var $amount; // Total amount of payment
var $amounts=array(); // Array of amounts var $amounts=array(); // Array of amounts
var $fk_typepayment; var $typepayment;
var $num_payment; var $num_payment;
var $note; var $note;
var $fk_bank; var $fk_bank;
@ -90,7 +90,7 @@ class PaymentDonation extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation);
if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->amount)) $this->amount=trim($this->amount);
if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); if (isset($this->typepayment)) $this->typepayment=trim($this->typepayment);
if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment);
if (isset($this->note)) $this->note=trim($this->note); if (isset($this->note)) $this->note=trim($this->note);
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);

View File

@ -1477,7 +1477,7 @@ else
print "<tr ".$bc[$var]."><td>"; print "<tr ".$bc[$var]."><td>";
print '<a href="'.DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>'; print '<a href="'.DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n"; print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->payment_type; $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->fk_typepayment;
print "<td>".$labeltype.' '.$object->num_payment."</td>\n"; print "<td>".$labeltype.' '.$object->num_payment."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n"; print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
print "</tr>"; print "</tr>";

View File

@ -42,7 +42,7 @@ class PaymentExpenseReport extends CommonObject
var $datep=''; var $datep='';
var $amount; // Total amount of payment var $amount; // Total amount of payment
var $amounts=array(); // Array of amounts var $amounts=array(); // Array of amounts
var $paymenttype; var $fk_typepayment;
var $num_payment; var $num_payment;
var $note; var $note;
var $fk_bank; var $fk_bank;
@ -84,7 +84,7 @@ class PaymentExpenseReport extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->fk_expensereport)) $this->fk_expensereport=trim($this->fk_expensereport); if (isset($this->fk_expensereport)) $this->fk_expensereport=trim($this->fk_expensereport);
if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->amount)) $this->amount=trim($this->amount);
if (isset($this->fk_typepayment)) $this->paymenttype=trim($this->paymenttype); if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment);
if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment);
if (isset($this->note)) $this->note=trim($this->note); if (isset($this->note)) $this->note=trim($this->note);
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
@ -109,11 +109,11 @@ class PaymentExpenseReport extends CommonObject
if ($totalamount != 0) if ($totalamount != 0)
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,";
$sql.= " fk_c_typepayment, num_payment, note, fk_user_creat, fk_bank)"; $sql.= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)";
$sql.= " VALUES ($this->chid, '".$this->db->idate($now)."',"; $sql.= " VALUES ($this->chid, '".$this->db->idate($now)."',";
$sql.= " '".$this->db->idate($this->datepaid)."',"; $sql.= " '".$this->db->idate($this->datepaid)."',";
$sql.= " ".$totalamount.","; $sql.= " ".$totalamount.",";
$sql.= " ".$this->paymenttype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.","; $sql.= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.",";
$sql.= " 0)"; $sql.= " 0)";
dol_syslog(get_class($this)."::create", LOG_DEBUG); dol_syslog(get_class($this)."::create", LOG_DEBUG);
@ -187,7 +187,7 @@ class PaymentExpenseReport extends CommonObject
$this->tms = $this->db->jdate($obj->tms); $this->tms = $this->db->jdate($obj->tms);
$this->datep = $this->db->jdate($obj->datep); $this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->fk_typepayment = $obj->fk_typepayment; $this->fk_typepayment = $obj->fk_typepayment;
$this->num_payment = $obj->num_payment; $this->num_payment = $obj->num_payment;
$this->note = $obj->note; $this->note = $obj->note;
$this->fk_bank = $obj->fk_bank; $this->fk_bank = $obj->fk_bank;
@ -486,7 +486,7 @@ class PaymentExpenseReport extends CommonObject
// Insert payment into llx_bank // Insert payment into llx_bank
$bank_line_id = $acc->addline( $bank_line_id = $acc->addline(
$this->datepaid, $this->datepaid,
$this->paymenttype, // Payment mode id or code ("CHQ or VIR for example") $this->fk_typepayment, // Payment mode id or code ("CHQ or VIR for example")
$label, $label,
$amount, $amount,
$this->num_payment, $this->num_payment,

View File

@ -57,7 +57,7 @@ if ($action == 'add_payment')
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
if (! $_POST["paymenttype"] > 0) if (! $_POST["fk_typepayment"] > 0)
{ {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
$error++; $error++;
@ -99,12 +99,12 @@ if ($action == 'add_payment')
// Create a line of payments // Create a line of payments
$payment = new PaymentExpenseReport($db); $payment = new PaymentExpenseReport($db);
$payment->chid = $chid; $payment->chid = $chid;
$payment->datepaid = $datepaid; $payment->datepaid = $datepaid;
$payment->amounts = $amounts; // Tableau de montant $payment->amounts = $amounts; // Tableau de montant
$payment->paymenttype = $_POST["paymenttype"]; $payment->fk_typepayment = $_POST["fk_typepayment"];
$payment->num_payment = $_POST["num_payment"]; $payment->num_payment = $_POST["num_payment"];
$payment->note = $_POST["note"]; $payment->note = $_POST["note"];
if (! $error) if (! $error)
{ {
@ -210,7 +210,7 @@ if (GETPOST("action") == 'create')
print '</tr>'; print '</tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">'; print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
$form->select_types_paiements(isset($_POST["paymenttype"])?$_POST["paymenttype"]:$expensereport->paymenttype, "paymenttype"); $form->select_types_paiements(isset($_POST["fk_typepayment"])?$_POST["fk_typepayment"]:$expensereport->fk_typepayment, "fk_typepayment");
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';