Advertisement
Guest User

Untitled

a guest
Aug 30th, 2021
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.40 KB | None | 0 0
  1. diff --git a/class/immopayment.class.php b/class/immopayment.class.php
  2. index a751051..5128b8f 100644
  3. --- a/class/immopayment.class.php
  4. +++ b/class/immopayment.class.php
  5. @@ -395,11 +395,10 @@ class ImmoPayment extends CommonObject
  6.  
  7.  
  8.                 $this->db->begin();
  9. -
  10.                 if ($totalamount != 0) {
  11. -                       $sql = "INSERT INTO " . MAIN_DB_PREFIX . "ultimateimmo_immopayment (fk_receipt, date_creation, date_payment, amount,";
  12. +                       $sql = "INSERT INTO " . MAIN_DB_PREFIX . "ultimateimmo_immopayment (ref, fk_receipt, date_creation, date_payment, amount,";
  13.                         $sql .= " fk_mode_reglement, fk_property, fk_renter, fk_rent, num_payment, note_public, fk_user_creat, fk_account)";
  14. -                       $sql .= " VALUES (" . $this->fk_receipt . ", '" . $this->db->idate($now) . "',";
  15. +                       $sql .= " VALUES ('".$this->ref ."'," . $this->fk_receipt . ", '" . $this->db->idate($now) . "',";
  16.                         $sql .= " '" . $this->db->idate($this->date_payment) . "',";
  17.                         $sql .= " " . $totalamount . ",";
  18.                         $sql .= " " . $this->fk_mode_reglement . ",'" . $this->db->escape($this->fk_property) . "','" . $this->db->escape($this->fk_renter) . "','" . $this->db->escape($this->fk_rent) . "',  '" . $this->db->escape($this->num_payment) . "', '" . $this->db->escape($this->note_public) . "', " . $user->id . ",";
  19. diff --git a/class/immoreceipt.class.php b/class/immoreceipt.class.php
  20. index 023cc53..452fa83 100644
  21. --- a/class/immoreceipt.class.php
  22. +++ b/class/immoreceipt.class.php
  23. @@ -1396,6 +1396,7 @@ class ImmoReceipt extends CommonObject
  24.                 $sql .= ' WHERE rowid = ' . $this->id;
  25.                 $return = $this->db->query ( $sql );
  26.                 $this->db->commit ();
  27. +
  28.                 if ($return)
  29.                         return 1;
  30.                         else
  31. diff --git a/payment/stats.php b/payment/stats.php
  32. index 4fc1337..3a39c16 100644
  33. --- a/payment/stats.php
  34. +++ b/payment/stats.php
  35. @@ -140,7 +140,7 @@ foreach ($months_list as $month_name) {
  36.  }
  37.  print '<td align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
  38.  
  39. -$sql = "SELECT 'own.firstname' AS Proprio";
  40. +$sql = "SELECT own.firstname AS Proprio";
  41.  foreach ($months_list as $month_num => $month_name) {
  42.         $sql .= ', ROUND(SUM(case when MONTH(lp.date_payment)=' . $month_num . ' then lp.amount else 0 end),2) AS month_' . $month_num;
  43.  }
  44. diff --git a/receipt/immoreceipt_card.php b/receipt/immoreceipt_card.php
  45. index 626ddbc..0b9d4e1 100644
  46. --- a/receipt/immoreceipt_card.php
  47. +++ b/receipt/immoreceipt_card.php
  48. @@ -852,7 +852,7 @@ if ($action == 'createall') {
  49.                                         print '<input name="balance" class="flat" size="8" value="' . $balance . '">';
  50.                                 }
  51.                         }
  52. -                       elseif ($val['label'] == 'Paye')
  53. +                       elseif ($val['label'] == 'paye')
  54.                         {
  55.                                 if ($totalpaye==0)
  56.                                 {
  57. @@ -1294,6 +1294,7 @@ if ($action == 'createall') {
  58.                 print "</form>\n";
  59.         }
  60.  
  61. +
  62.         if (is_file($conf->ultimateimmo->dir_output . '/receipt/quittance_' . $id . '.pdf')) {
  63.                 print '&nbsp';
  64.                 print '<table class="border" width="100%">';
  65. @@ -1414,6 +1415,7 @@ if ($action == 'createall') {
  66.         $trackid = 'immo' . $object->id;
  67.  
  68.         include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
  69. +die();
  70.  }
  71.  
  72.  // End of page
  73. diff --git a/receipt/immoreceipt_list.php b/receipt/immoreceipt_list.php
  74. index 44b5631..587c704 100644
  75. --- a/receipt/immoreceipt_list.php
  76. +++ b/receipt/immoreceipt_list.php
  77. @@ -588,7 +588,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
  78.                                 if ($balance >= 0) {
  79.                                         print price($balance, 0, $outputlangs, 1, -1, -1, $conf->currency);
  80.                                 }
  81. -                       } elseif ($val['label'] == 'Paye') {
  82. +                       } elseif ($val['label'] == 'paye') {
  83.                                         if ($totalpaye == 0) {
  84.                                                 print $object->paye = $langs->trans('UnPaidReceipt');
  85.                                         } elseif ($balance == 0) {
  86. diff --git a/receipt/payment/paiement.php b/receipt/payment/paiement.php
  87. index e1c4e47..9a718ac 100644
  88. --- a/receipt/payment/paiement.php
  89. +++ b/receipt/payment/paiement.php
  90. @@ -186,7 +186,7 @@ if ($action == 'add_payment') {
  91.                         $payment->note_public  = GETPOST('note_public', 'string');
  92.  
  93.                         if (!$error) {
  94. -                               $paymentid = $payment->create($user);
  95. +                               echo $paymentid = $payment->create($user);
  96.                                 if ($paymentid < 0) {
  97.                                         $errmsg = $payment->errors;
  98.                                         setEventMessages(null, $errmsg, 'errors');
  99. @@ -204,7 +204,6 @@ if ($action == 'add_payment') {
  100.                                         $error++;
  101.                                 }
  102.                         }
  103. -
  104.                         if (!$error) {
  105.                                 $db->commit();
  106.                                 $loc = dol_buildpath('/ultimateimmo/receipt/immoreceipt_card.php', 1) . '?id=' . $id;
  107.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement