@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | var $description; |
| 44 | 44 | var $type; |
| 45 | 45 | |
| 46 | - var $phpmin = array(4,3,0); // Minimum version of PHP required by module |
|
| 46 | + var $phpmin = array(4, 3, 0); // Minimum version of PHP required by module |
|
| 47 | 47 | var $version = 'dolibarr'; |
| 48 | 48 | |
| 49 | 49 | var $page_largeur; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | var $marge_haute; |
| 55 | 55 | var $marge_basse; |
| 56 | 56 | |
| 57 | - var $emetteur; // Objet societe qui emet |
|
| 57 | + var $emetteur; // Objet societe qui emet |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | function __construct($db) |
| 66 | 66 | { |
| 67 | - global $conf,$langs,$mysoc; |
|
| 67 | + global $conf, $langs, $mysoc; |
|
| 68 | 68 | |
| 69 | 69 | $langs->load("main"); |
| 70 | 70 | $langs->load("bills"); |
@@ -76,56 +76,56 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // Dimension page pour format A4 |
| 78 | 78 | $this->type = 'pdf'; |
| 79 | - $formatarray=pdf_getFormat(); |
|
| 79 | + $formatarray = pdf_getFormat(); |
|
| 80 | 80 | $this->page_largeur = $formatarray['width']; |
| 81 | 81 | $this->page_hauteur = $formatarray['height']; |
| 82 | - $this->format = array($this->page_largeur,$this->page_hauteur); |
|
| 83 | - $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; |
|
| 84 | - $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; |
|
| 85 | - $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; |
|
| 86 | - $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; |
|
| 87 | - |
|
| 88 | - $this->option_logo = 1; // Affiche logo |
|
| 89 | - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
|
| 90 | - $this->option_modereg = 1; // Affiche mode reglement |
|
| 91 | - $this->option_condreg = 1; // Affiche conditions reglement |
|
| 92 | - $this->option_codeproduitservice = 1; // Affiche code produit-service |
|
| 93 | - $this->option_multilang = 1; // Dispo en plusieurs langues |
|
| 94 | - $this->option_escompte = 1; // Affiche si il y a eu escompte |
|
| 95 | - $this->option_credit_note = 1; // Support credit notes |
|
| 96 | - $this->option_freetext = 1; // Support add of a personalised text |
|
| 97 | - $this->option_draft_watermark = 1; // Support add of a watermark on drafts |
|
| 98 | - |
|
| 99 | - $this->franchise=!$mysoc->tva_assuj; |
|
| 82 | + $this->format = array($this->page_largeur, $this->page_hauteur); |
|
| 83 | + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; |
|
| 84 | + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; |
|
| 85 | + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; |
|
| 86 | + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; |
|
| 87 | + |
|
| 88 | + $this->option_logo = 1; // Affiche logo |
|
| 89 | + $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
|
| 90 | + $this->option_modereg = 1; // Affiche mode reglement |
|
| 91 | + $this->option_condreg = 1; // Affiche conditions reglement |
|
| 92 | + $this->option_codeproduitservice = 1; // Affiche code produit-service |
|
| 93 | + $this->option_multilang = 1; // Dispo en plusieurs langues |
|
| 94 | + $this->option_escompte = 1; // Affiche si il y a eu escompte |
|
| 95 | + $this->option_credit_note = 1; // Support credit notes |
|
| 96 | + $this->option_freetext = 1; // Support add of a personalised text |
|
| 97 | + $this->option_draft_watermark = 1; // Support add of a watermark on drafts |
|
| 98 | + |
|
| 99 | + $this->franchise = !$mysoc->tva_assuj; |
|
| 100 | 100 | |
| 101 | 101 | // Get source company |
| 102 | - $this->emetteur=$mysoc; |
|
| 103 | - if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined |
|
| 102 | + $this->emetteur = $mysoc; |
|
| 103 | + if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined |
|
| 104 | 104 | |
| 105 | 105 | // Define position of columns |
| 106 | - $this->posxdesc=$this->marge_gauche+1; |
|
| 107 | - $this->posxtva=112; |
|
| 108 | - $this->posxup=126; |
|
| 109 | - $this->posxqty=145; |
|
| 110 | - $this->posxdiscount=162; |
|
| 111 | - $this->postotalht=174; |
|
| 112 | - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; |
|
| 113 | - $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images |
|
| 106 | + $this->posxdesc = $this->marge_gauche + 1; |
|
| 107 | + $this->posxtva = 112; |
|
| 108 | + $this->posxup = 126; |
|
| 109 | + $this->posxqty = 145; |
|
| 110 | + $this->posxdiscount = 162; |
|
| 111 | + $this->postotalht = 174; |
|
| 112 | + if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva = $this->posxup; |
|
| 113 | + $this->posxpicture = $this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images |
|
| 114 | 114 | if ($this->page_largeur < 210) // To work with US executive format |
| 115 | 115 | { |
| 116 | - $this->posxpicture-=20; |
|
| 117 | - $this->posxtva-=20; |
|
| 118 | - $this->posxup-=20; |
|
| 119 | - $this->posxqty-=20; |
|
| 120 | - $this->posxdiscount-=20; |
|
| 121 | - $this->postotalht-=20; |
|
| 116 | + $this->posxpicture -= 20; |
|
| 117 | + $this->posxtva -= 20; |
|
| 118 | + $this->posxup -= 20; |
|
| 119 | + $this->posxqty -= 20; |
|
| 120 | + $this->posxdiscount -= 20; |
|
| 121 | + $this->postotalht -= 20; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $this->tva=array(); |
|
| 125 | - $this->localtax1=array(); |
|
| 126 | - $this->localtax2=array(); |
|
| 127 | - $this->atleastoneratenotnull=0; |
|
| 128 | - $this->atleastonediscount=0; |
|
| 124 | + $this->tva = array(); |
|
| 125 | + $this->localtax1 = array(); |
|
| 126 | + $this->localtax2 = array(); |
|
| 127 | + $this->atleastoneratenotnull = 0; |
|
| 128 | + $this->atleastonediscount = 0; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
@@ -140,13 +140,13 @@ discard block |
||
| 140 | 140 | * @param int $hideref Do not show ref |
| 141 | 141 | * @return int 1=OK, 0=KO |
| 142 | 142 | */ |
| 143 | - function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) |
|
| 143 | + function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) |
|
| 144 | 144 | { |
| 145 | - global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes; |
|
| 145 | + global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes; |
|
| 146 | 146 | |
| 147 | - if (! is_object($outputlangs)) $outputlangs=$langs; |
|
| 147 | + if (!is_object($outputlangs)) $outputlangs = $langs; |
|
| 148 | 148 | // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO |
| 149 | - if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; |
|
| 149 | + if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output = 'ISO-8859-1'; |
|
| 150 | 150 | |
| 151 | 151 | $outputlangs->load("main"); |
| 152 | 152 | $outputlangs->load("dict"); |
@@ -157,37 +157,37 @@ discard block |
||
| 157 | 157 | $nblignes = count($object->lines); |
| 158 | 158 | |
| 159 | 159 | // Loop on each lines to detect if there is at least one image to show |
| 160 | - $realpatharray=array(); |
|
| 161 | - if (! empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE)) |
|
| 160 | + $realpatharray = array(); |
|
| 161 | + if (!empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE)) |
|
| 162 | 162 | { |
| 163 | - for ($i = 0 ; $i < $nblignes ; $i++) |
|
| 163 | + for ($i = 0; $i < $nblignes; $i++) |
|
| 164 | 164 | { |
| 165 | 165 | if (empty($object->lines[$i]->fk_product)) continue; |
| 166 | 166 | |
| 167 | 167 | $objphoto = new Product($this->db); |
| 168 | 168 | $objphoto->fetch($object->lines[$i]->fk_product); |
| 169 | 169 | |
| 170 | - $pdir = get_exdir($object->lines[$i]->fk_product,2) . $object->lines[$i]->fk_product ."/photos/"; |
|
| 170 | + $pdir = get_exdir($object->lines[$i]->fk_product, 2).$object->lines[$i]->fk_product."/photos/"; |
|
| 171 | 171 | $dir = $conf->product->dir_output.'/'.$pdir; |
| 172 | 172 | |
| 173 | - $realpath=''; |
|
| 174 | - foreach ($objphoto->liste_photos($dir,1) as $key => $obj) |
|
| 173 | + $realpath = ''; |
|
| 174 | + foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) |
|
| 175 | 175 | { |
| 176 | - $filename=$obj['photo']; |
|
| 176 | + $filename = $obj['photo']; |
|
| 177 | 177 | //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; |
| 178 | 178 | $realpath = $dir.$filename; |
| 179 | 179 | break; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - if ($realpath) $realpatharray[$i]=$realpath; |
|
| 182 | + if ($realpath) $realpatharray[$i] = $realpath; |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | - if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva; |
|
| 185 | + if (count($realpatharray) == 0) $this->posxpicture = $this->posxtva; |
|
| 186 | 186 | |
| 187 | 187 | if ($conf->facture->dir_output) |
| 188 | 188 | { |
| 189 | 189 | $object->fetch_thirdparty(); |
| 190 | - if(!empty($object->client) ){ |
|
| 190 | + if (!empty($object->client)) { |
|
| 191 | 191 | $object->thirdparty = $object->client; |
| 192 | 192 | } |
| 193 | 193 | $deja_regle = $object->getSommePaiement(); |
@@ -198,19 +198,19 @@ discard block |
||
| 198 | 198 | if ($object->specimen) |
| 199 | 199 | { |
| 200 | 200 | $dir = $conf->facture->dir_output; |
| 201 | - $file = $dir . "/SPECIMEN.pdf"; |
|
| 201 | + $file = $dir."/SPECIMEN.pdf"; |
|
| 202 | 202 | } |
| 203 | 203 | else |
| 204 | 204 | { |
| 205 | 205 | $objectref = dol_sanitizeFileName($object->ref); |
| 206 | - $dir = $conf->facture->dir_output . "/" . $objectref; |
|
| 207 | - $file = $dir . "/" . $objectref . ".pdf"; |
|
| 206 | + $dir = $conf->facture->dir_output."/".$objectref; |
|
| 207 | + $file = $dir."/".$objectref.".pdf"; |
|
| 208 | 208 | } |
| 209 | - if (! file_exists($dir)) |
|
| 209 | + if (!file_exists($dir)) |
|
| 210 | 210 | { |
| 211 | 211 | if (dol_mkdir($dir) < 0) |
| 212 | 212 | { |
| 213 | - $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); |
|
| 213 | + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); |
|
| 214 | 214 | return 0; |
| 215 | 215 | } |
| 216 | 216 | } |
@@ -218,23 +218,23 @@ discard block |
||
| 218 | 218 | if (file_exists($dir)) |
| 219 | 219 | { |
| 220 | 220 | // Add pdfgeneration hook |
| 221 | - if (! is_object($hookmanager)) |
|
| 221 | + if (!is_object($hookmanager)) |
|
| 222 | 222 | { |
| 223 | 223 | include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
| 224 | - $hookmanager=new HookManager($this->db); |
|
| 224 | + $hookmanager = new HookManager($this->db); |
|
| 225 | 225 | } |
| 226 | 226 | $hookmanager->initHooks(array('pdfgeneration')); |
| 227 | - $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); |
|
| 227 | + $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); |
|
| 228 | 228 | global $action; |
| 229 | - $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks |
|
| 229 | + $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 230 | 230 | |
| 231 | 231 | // Create pdf instance |
| 232 | - $pdf=pdf_getInstance($this->format); |
|
| 233 | - $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance |
|
| 234 | - $heightforinfotot = 50; // Height reserved to output the info and total part |
|
| 235 | - $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page |
|
| 236 | - $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) |
|
| 237 | - $pdf->SetAutoPageBreak(1,0); |
|
| 232 | + $pdf = pdf_getInstance($this->format); |
|
| 233 | + $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance |
|
| 234 | + $heightforinfotot = 50; // Height reserved to output the info and total part |
|
| 235 | + $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page |
|
| 236 | + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) |
|
| 237 | + $pdf->SetAutoPageBreak(1, 0); |
|
| 238 | 238 | |
| 239 | 239 | if (class_exists('TCPDF')) |
| 240 | 240 | { |
@@ -244,27 +244,27 @@ discard block |
||
| 244 | 244 | $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
| 245 | 245 | |
| 246 | 246 | // Set path to the background PDF File |
| 247 | - if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) |
|
| 247 | + if (empty($conf->global->MAIN_DISABLE_FPDI) && !empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) |
|
| 248 | 248 | { |
| 249 | 249 | $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); |
| 250 | 250 | $tplidx = $pdf->importPage(1); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $pdf->Open(); |
| 254 | - $pagenb=0; |
|
| 255 | - $pdf->SetDrawColor(128,128,128); |
|
| 254 | + $pagenb = 0; |
|
| 255 | + $pdf->SetDrawColor(128, 128, 128); |
|
| 256 | 256 | |
| 257 | 257 | $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); |
| 258 | 258 | $pdf->SetSubject($outputlangs->transnoentities("Invoice")); |
| 259 | 259 | $pdf->SetCreator("Dolibarr ".DOL_VERSION); |
| 260 | 260 | $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); |
| 261 | 261 | $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); |
| 262 | - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); |
|
| 262 | + if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); |
|
| 263 | 263 | |
| 264 | - $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right |
|
| 264 | + $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right |
|
| 265 | 265 | |
| 266 | 266 | // Positionne $this->atleastonediscount si on a au moins une remise |
| 267 | - for ($i = 0 ; $i < $nblignes ; $i++) |
|
| 267 | + for ($i = 0; $i < $nblignes; $i++) |
|
| 268 | 268 | { |
| 269 | 269 | if ($object->lines[$i]->remise_percent) |
| 270 | 270 | { |
@@ -273,61 +273,61 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | if (empty($this->atleastonediscount)) |
| 275 | 275 | { |
| 276 | - $this->posxpicture+=($this->postotalht - $this->posxdiscount); |
|
| 277 | - $this->posxtva+=($this->postotalht - $this->posxdiscount); |
|
| 278 | - $this->posxup+=($this->postotalht - $this->posxdiscount); |
|
| 279 | - $this->posxqty+=($this->postotalht - $this->posxdiscount); |
|
| 280 | - $this->posxdiscount+=($this->postotalht - $this->posxdiscount); |
|
| 276 | + $this->posxpicture += ($this->postotalht - $this->posxdiscount); |
|
| 277 | + $this->posxtva += ($this->postotalht - $this->posxdiscount); |
|
| 278 | + $this->posxup += ($this->postotalht - $this->posxdiscount); |
|
| 279 | + $this->posxqty += ($this->postotalht - $this->posxdiscount); |
|
| 280 | + $this->posxdiscount += ($this->postotalht - $this->posxdiscount); |
|
| 281 | 281 | //$this->postotalht; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | // New page |
| 285 | 285 | $pdf->AddPage(); |
| 286 | - if (! empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 286 | + if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 287 | 287 | $pagenb++; |
| 288 | 288 | |
| 289 | 289 | $this->_pagehead($pdf, $object, 1, $outputlangs); |
| 290 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 291 | - $pdf->MultiCell(0, 3, ''); // Set interline to 3 |
|
| 292 | - $pdf->SetTextColor(0,0,0); |
|
| 290 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 291 | + $pdf->MultiCell(0, 3, ''); // Set interline to 3 |
|
| 292 | + $pdf->SetTextColor(0, 0, 0); |
|
| 293 | 293 | |
| 294 | 294 | $tab_top = 90; |
| 295 | - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); |
|
| 295 | + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10); |
|
| 296 | 296 | $tab_height = 130; |
| 297 | 297 | $tab_height_newpage = 150; |
| 298 | 298 | |
| 299 | 299 | // Affiche notes |
| 300 | - $notetoshow=empty($object->note_public)?'':$object->note_public; |
|
| 301 | - if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) |
|
| 300 | + $notetoshow = empty($object->note_public) ? '' : $object->note_public; |
|
| 301 | + if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) |
|
| 302 | 302 | { |
| 303 | 303 | // Get first sale rep |
| 304 | 304 | if (is_object($object->thirdparty)) |
| 305 | 305 | { |
| 306 | - $salereparray=$object->thirdparty->getSalesRepresentatives($user); |
|
| 307 | - $salerepobj=new User($this->db); |
|
| 306 | + $salereparray = $object->thirdparty->getSalesRepresentatives($user); |
|
| 307 | + $salerepobj = new User($this->db); |
|
| 308 | 308 | $salerepobj->fetch($salereparray[0]['id']); |
| 309 | - if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature); |
|
| 309 | + if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); |
|
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | if ($notetoshow) |
| 313 | 313 | { |
| 314 | 314 | $tab_top = 88; |
| 315 | 315 | |
| 316 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 317 | - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); |
|
| 316 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 317 | + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); |
|
| 318 | 318 | $nexY = $pdf->GetY(); |
| 319 | - $height_note=$nexY-$tab_top; |
|
| 319 | + $height_note = $nexY - $tab_top; |
|
| 320 | 320 | |
| 321 | 321 | // Rect prend une longueur en 3eme param |
| 322 | - $pdf->SetDrawColor(192,192,192); |
|
| 323 | - $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); |
|
| 322 | + $pdf->SetDrawColor(192, 192, 192); |
|
| 323 | + $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); |
|
| 324 | 324 | |
| 325 | 325 | $tab_height = $tab_height - $height_note; |
| 326 | - $tab_top = $nexY+6; |
|
| 326 | + $tab_top = $nexY + 6; |
|
| 327 | 327 | } |
| 328 | 328 | else |
| 329 | 329 | { |
| 330 | - $height_note=0; |
|
| 330 | + $height_note = 0; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | $iniY = $tab_top + 7; |
@@ -404,91 +404,91 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | $curY = $nexY; |
| 407 | - $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage |
|
| 408 | - $pdf->SetTextColor(0,0,0); |
|
| 407 | + $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage |
|
| 408 | + $pdf->SetTextColor(0, 0, 0); |
|
| 409 | 409 | |
| 410 | 410 | // Define size of image if we need it |
| 411 | - $imglinesize=array(); |
|
| 412 | - if (! empty($realpatharray[$i])) $imglinesize=pdf_getSizeForImage($realpatharray[$i]); |
|
| 411 | + $imglinesize = array(); |
|
| 412 | + if (!empty($realpatharray[$i])) $imglinesize = pdf_getSizeForImage($realpatharray[$i]); |
|
| 413 | 413 | |
| 414 | 414 | $pdf->setTopMargin($tab_top_newpage); |
| 415 | - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. |
|
| 416 | - $pageposbefore=$pdf->getPage(); |
|
| 415 | + $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. |
|
| 416 | + $pageposbefore = $pdf->getPage(); |
|
| 417 | 417 | |
| 418 | - $showpricebeforepagebreak=1; |
|
| 419 | - $posYAfterImage=0; |
|
| 420 | - $posYAfterDescription=0; |
|
| 418 | + $showpricebeforepagebreak = 1; |
|
| 419 | + $posYAfterImage = 0; |
|
| 420 | + $posYAfterDescription = 0; |
|
| 421 | 421 | |
| 422 | 422 | // We start with Photo of product line |
| 423 | - if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page |
|
| 423 | + if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) // If photo too high, we moved completely on new page |
|
| 424 | 424 | { |
| 425 | - $pdf->AddPage('','',true); |
|
| 426 | - if (! empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 425 | + $pdf->AddPage('', '', true); |
|
| 426 | + if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 427 | 427 | if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
| 428 | - $pdf->setPage($pageposbefore+1); |
|
| 428 | + $pdf->setPage($pageposbefore + 1); |
|
| 429 | 429 | |
| 430 | 430 | $curY = $tab_top_newpage; |
| 431 | - $showpricebeforepagebreak=0; |
|
| 431 | + $showpricebeforepagebreak = 0; |
|
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | if (isset($imglinesize['width']) && isset($imglinesize['height'])) |
| 435 | 435 | { |
| 436 | - $curX = $this->posxpicture-1; |
|
| 437 | - $pdf->Image($realpatharray[$i], $curX + (($this->posxtva-$this->posxpicture-$imglinesize['width'])/2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi |
|
| 436 | + $curX = $this->posxpicture - 1; |
|
| 437 | + $pdf->Image($realpatharray[$i], $curX + (($this->posxtva - $this->posxpicture - $imglinesize['width']) / 2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi |
|
| 438 | 438 | // $pdf->Image does not increase value return by getY, so we save it manually |
| 439 | - $posYAfterImage=$curY+$imglinesize['height']; |
|
| 439 | + $posYAfterImage = $curY + $imglinesize['height']; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | // Description of product line |
| 443 | - $curX = $this->posxdesc-1; |
|
| 443 | + $curX = $this->posxdesc - 1; |
|
| 444 | 444 | |
| 445 | 445 | $pdf->startTransaction(); |
| 446 | - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); |
|
| 447 | - $pageposafter=$pdf->getPage(); |
|
| 446 | + pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc); |
|
| 447 | + $pageposafter = $pdf->getPage(); |
|
| 448 | 448 | if ($pageposafter > $pageposbefore) // There is a pagebreak |
| 449 | 449 | { |
| 450 | 450 | $pdf->rollbackTransaction(true); |
| 451 | - $pageposafter=$pageposbefore; |
|
| 451 | + $pageposafter = $pageposbefore; |
|
| 452 | 452 | //print $pageposafter.'-'.$pageposbefore;exit; |
| 453 | - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. |
|
| 454 | - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); |
|
| 455 | - $pageposafter=$pdf->getPage(); |
|
| 456 | - $posyafter=$pdf->GetY(); |
|
| 453 | + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. |
|
| 454 | + pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc); |
|
| 455 | + $pageposafter = $pdf->getPage(); |
|
| 456 | + $posyafter = $pdf->GetY(); |
|
| 457 | 457 | //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; |
| 458 | - if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text |
|
| 458 | + if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) // There is no space left for total+free text |
|
| 459 | 459 | { |
| 460 | - if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page |
|
| 460 | + if ($i == ($nblignes - 1)) // No more lines, and no space left to show total, so we create a new page |
|
| 461 | 461 | { |
| 462 | - $pdf->AddPage('','',true); |
|
| 463 | - if (! empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 462 | + $pdf->AddPage('', '', true); |
|
| 463 | + if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 464 | 464 | if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
| 465 | - $pdf->setPage($pageposafter+1); |
|
| 465 | + $pdf->setPage($pageposafter + 1); |
|
| 466 | 466 | } |
| 467 | 467 | } |
| 468 | 468 | else |
| 469 | 469 | { |
| 470 | 470 | // We found a page break |
| 471 | - $showpricebeforepagebreak=0; |
|
| 471 | + $showpricebeforepagebreak = 0; |
|
| 472 | 472 | } |
| 473 | 473 | } |
| 474 | 474 | else // No pagebreak |
| 475 | 475 | { |
| 476 | 476 | $pdf->commitTransaction(); |
| 477 | 477 | } |
| 478 | - $posYAfterDescription=$pdf->GetY(); |
|
| 478 | + $posYAfterDescription = $pdf->GetY(); |
|
| 479 | 479 | |
| 480 | 480 | $nexY = $pdf->GetY(); |
| 481 | - $pageposafter=$pdf->getPage(); |
|
| 481 | + $pageposafter = $pdf->getPage(); |
|
| 482 | 482 | $pdf->setPage($pageposbefore); |
| 483 | 483 | $pdf->setTopMargin($this->marge_haute); |
| 484 | - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 484 | + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 485 | 485 | |
| 486 | 486 | // We suppose that a too long description or photo were moved completely on next page |
| 487 | 487 | if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { |
| 488 | 488 | $pdf->setPage($pageposafter); $curY = $tab_top_newpage; |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut |
|
| 491 | + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut |
|
| 492 | 492 | |
| 493 | 493 | // VAT Rate |
| 494 | 494 | if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | $pdf->SetXY($this->posxtva, $curY); |
| 504 | - $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); |
|
| 504 | + $pdf->MultiCell($this->posxup - $this->posxtva - 0.8, 3, $vat_rate, 0, 'R'); |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | // Unit price before discount |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | $pdf->SetXY($this->posxup, $curY); |
| 515 | - $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); |
|
| 515 | + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', 0); |
|
| 516 | 516 | |
| 517 | 517 | // Quantity |
| 518 | 518 | // Affichage de la quantité sur les lignes de total si la conf l'indique |
@@ -533,14 +533,14 @@ discard block |
||
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | $pdf->SetXY($this->posxqty, $curY); |
| 536 | - $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars |
|
| 536 | + $pdf->MultiCell($this->posxdiscount - $this->posxqty - 0.8, 3, $qty, 0, 'R'); // Enough for 6 chars |
|
| 537 | 537 | |
| 538 | 538 | // Discount on line |
| 539 | 539 | if ($object->lines[$i]->remise_percent) |
| 540 | 540 | { |
| 541 | - $pdf->SetXY($this->posxdiscount-2, $curY); |
|
| 541 | + $pdf->SetXY($this->posxdiscount - 2, $curY); |
|
| 542 | 542 | $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); |
| 543 | - $pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R'); |
|
| 543 | + $pdf->MultiCell($this->postotalht - $this->posxdiscount + 2, 3, $remise_percent, 0, 'R'); |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | // Total HT line |
@@ -551,40 +551,40 @@ discard block |
||
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | $pdf->SetXY($this->postotalht, $curY); |
| 554 | - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); |
|
| 554 | + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); |
|
| 555 | 555 | |
| 556 | 556 | // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva |
| 557 | - $tvaligne=doubleval($object->lines[$i]->total_tva); |
|
| 558 | - $localtax1ligne=$object->lines[$i]->total_localtax1; |
|
| 559 | - $localtax2ligne=$object->lines[$i]->total_localtax2; |
|
| 560 | - $localtax1_rate=$object->lines[$i]->localtax1_tx; |
|
| 561 | - $localtax2_rate=$object->lines[$i]->localtax2_tx; |
|
| 562 | - $localtax1_type=$object->lines[$i]->localtax1_type; |
|
| 563 | - $localtax2_type=$object->lines[$i]->localtax2_type; |
|
| 557 | + $tvaligne = doubleval($object->lines[$i]->total_tva); |
|
| 558 | + $localtax1ligne = $object->lines[$i]->total_localtax1; |
|
| 559 | + $localtax2ligne = $object->lines[$i]->total_localtax2; |
|
| 560 | + $localtax1_rate = $object->lines[$i]->localtax1_tx; |
|
| 561 | + $localtax2_rate = $object->lines[$i]->localtax2_tx; |
|
| 562 | + $localtax1_type = $object->lines[$i]->localtax1_type; |
|
| 563 | + $localtax2_type = $object->lines[$i]->localtax2_type; |
|
| 564 | 564 | |
| 565 | - if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; |
|
| 566 | - if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; |
|
| 567 | - if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; |
|
| 565 | + if ($object->remise_percent) $tvaligne -= ($tvaligne * $object->remise_percent) / 100; |
|
| 566 | + if ($object->remise_percent) $localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100; |
|
| 567 | + if ($object->remise_percent) $localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100; |
|
| 568 | 568 | |
| 569 | - $vatrate=(string) $object->lines[$i]->tva_tx; |
|
| 569 | + $vatrate = (string) $object->lines[$i]->tva_tx; |
|
| 570 | 570 | |
| 571 | 571 | // Retrieve type from database for backward compatibility with old records |
| 572 | - if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined |
|
| 573 | - && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax |
|
| 572 | + if ((!isset($localtax1_type) || $localtax1_type == '' || !isset($localtax2_type) || $localtax2_type == '') // if tax type not defined |
|
| 573 | + && (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax |
|
| 574 | 574 | { |
| 575 | - $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0, $object->thirdparty, $mysoc); |
|
| 575 | + $localtaxtmp_array = getLocalTaxesFromRate($vatrate, 0, $object->thirdparty, $mysoc); |
|
| 576 | 576 | $localtax1_type = $localtaxtmp_array[0]; |
| 577 | 577 | $localtax2_type = $localtaxtmp_array[2]; |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | // retrieve global local tax |
| 581 | 581 | if ($localtax1_type && $localtax1ligne != 0) |
| 582 | - $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; |
|
| 582 | + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; |
|
| 583 | 583 | if ($localtax2_type && $localtax2ligne != 0) |
| 584 | - $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; |
|
| 584 | + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; |
|
| 585 | 585 | |
| 586 | - if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; |
|
| 587 | - if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; |
|
| 586 | + if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate .= '*'; |
|
| 587 | + if (!isset($this->tva[$vatrate])) $this->tva[$vatrate] = ''; |
|
| 588 | 588 | |
| 589 | 589 | if (!empty($object->lines[$i]->TTotal_tva)) |
| 590 | 590 | { |
@@ -595,22 +595,22 @@ discard block |
||
| 595 | 595 | } |
| 596 | 596 | else { |
| 597 | 597 | // standard |
| 598 | - if(!empty($tvaligne)) $this->tva[$vatrate] += $tvaligne; |
|
| 598 | + if (!empty($tvaligne)) $this->tva[$vatrate] += $tvaligne; |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | - if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage; |
|
| 601 | + if ($posYAfterImage > $posYAfterDescription) $nexY = $posYAfterImage; |
|
| 602 | 602 | |
| 603 | 603 | // Add line |
| 604 | - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) |
|
| 604 | + if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) |
|
| 605 | 605 | { |
| 606 | 606 | $pdf->setPage($pageposafter); |
| 607 | - $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); |
|
| 607 | + $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(210, 210, 210))); |
|
| 608 | 608 | //$pdf->SetDrawColor(190,190,200); |
| 609 | - $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); |
|
| 609 | + $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); |
|
| 610 | 610 | $pdf->SetLineStyle(array('dash'=>0)); |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | - $nexY+=2; // Passe espace entre les lignes |
|
| 613 | + $nexY += 2; // Passe espace entre les lignes |
|
| 614 | 614 | |
| 615 | 615 | // Detect if some page were added automatically and output _tableau for past pages |
| 616 | 616 | while ($pagenb < $pageposafter) |
@@ -624,13 +624,13 @@ discard block |
||
| 624 | 624 | { |
| 625 | 625 | $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); |
| 626 | 626 | } |
| 627 | - $this->_pagefoot($pdf,$object,$outputlangs,1); |
|
| 627 | + $this->_pagefoot($pdf, $object, $outputlangs, 1); |
|
| 628 | 628 | $pagenb++; |
| 629 | 629 | $pdf->setPage($pagenb); |
| 630 | - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 630 | + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 631 | 631 | if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
| 632 | 632 | } |
| 633 | - if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) |
|
| 633 | + if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) |
|
| 634 | 634 | { |
| 635 | 635 | if ($pagenb == 1) |
| 636 | 636 | { |
@@ -640,10 +640,10 @@ discard block |
||
| 640 | 640 | { |
| 641 | 641 | $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); |
| 642 | 642 | } |
| 643 | - $this->_pagefoot($pdf,$object,$outputlangs,1); |
|
| 643 | + $this->_pagefoot($pdf, $object, $outputlangs, 1); |
|
| 644 | 644 | // New page |
| 645 | 645 | $pdf->AddPage(); |
| 646 | - if (! empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 646 | + if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 647 | 647 | $pagenb++; |
| 648 | 648 | if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
| 649 | 649 | } |
@@ -653,60 +653,60 @@ discard block |
||
| 653 | 653 | if ($pagenb == 1) |
| 654 | 654 | { |
| 655 | 655 | $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); |
| 656 | - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; |
|
| 656 | + $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; |
|
| 657 | 657 | } |
| 658 | 658 | else |
| 659 | 659 | { |
| 660 | 660 | $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); |
| 661 | - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; |
|
| 661 | + $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | // Affiche zone infos |
| 665 | - $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); |
|
| 665 | + $posy = $this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); |
|
| 666 | 666 | |
| 667 | 667 | if (!$conf->global->SUBTOTAL_HIDE_DOCUMENT_TOTAL) { |
| 668 | 668 | // Affiche zone totaux |
| 669 | - $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); |
|
| 669 | + $posy = $this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | // Affiche zone versements |
| 673 | 673 | if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) |
| 674 | 674 | { |
| 675 | - $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); |
|
| 675 | + $posy = $this->_tableau_versements($pdf, $object, $posy, $outputlangs); |
|
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | // Pied de page |
| 679 | - $this->_pagefoot($pdf,$object,$outputlangs); |
|
| 680 | - if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); |
|
| 679 | + $this->_pagefoot($pdf, $object, $outputlangs); |
|
| 680 | + if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); |
|
| 681 | 681 | |
| 682 | 682 | $pdf->Close(); |
| 683 | 683 | |
| 684 | - $pdf->Output($file,'F'); |
|
| 684 | + $pdf->Output($file, 'F'); |
|
| 685 | 685 | |
| 686 | 686 | // Add pdfgeneration hook |
| 687 | 687 | $hookmanager->initHooks(array('pdfgeneration')); |
| 688 | - $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); |
|
| 688 | + $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); |
|
| 689 | 689 | global $action; |
| 690 | - $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks |
|
| 690 | + $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
| 691 | 691 | |
| 692 | - if (! empty($conf->global->MAIN_UMASK)) |
|
| 692 | + if (!empty($conf->global->MAIN_UMASK)) |
|
| 693 | 693 | @chmod($file, octdec($conf->global->MAIN_UMASK)); |
| 694 | 694 | |
| 695 | - return 1; // Pas d'erreur |
|
| 695 | + return 1; // Pas d'erreur |
|
| 696 | 696 | } |
| 697 | 697 | else |
| 698 | 698 | { |
| 699 | - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); |
|
| 699 | + $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); |
|
| 700 | 700 | return 0; |
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | else |
| 704 | 704 | { |
| 705 | - $this->error=$langs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); |
|
| 705 | + $this->error = $langs->trans("ErrorConstantNotDefined", "FAC_OUTPUTDIR"); |
|
| 706 | 706 | return 0; |
| 707 | 707 | } |
| 708 | - $this->error=$langs->trans("ErrorUnknown"); |
|
| 709 | - return 0; // Erreur par defaut |
|
| 708 | + $this->error = $langs->trans("ErrorUnknown"); |
|
| 709 | + return 0; // Erreur par defaut |
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | { |
| 724 | 724 | global $conf; |
| 725 | 725 | |
| 726 | - $sign=1; |
|
| 727 | - if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; |
|
| 726 | + $sign = 1; |
|
| 727 | + if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign = -1; |
|
| 728 | 728 | |
| 729 | 729 | $tab3_posx = 120; |
| 730 | 730 | $tab3_top = $posy + 8; |
@@ -737,109 +737,109 @@ discard block |
||
| 737 | 737 | |
| 738 | 738 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
| 739 | 739 | |
| 740 | - $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); |
|
| 741 | - if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); |
|
| 740 | + $title = $outputlangs->transnoentities("PaymentsAlreadyDone"); |
|
| 741 | + if ($object->type == 2) $title = $outputlangs->transnoentities("PaymentsBackAlreadyDone"); |
|
| 742 | 742 | |
| 743 | - $pdf->SetFont('','', $default_font_size - 3); |
|
| 743 | + $pdf->SetFont('', '', $default_font_size - 3); |
|
| 744 | 744 | $pdf->SetXY($tab3_posx, $tab3_top - 4); |
| 745 | 745 | $pdf->MultiCell(60, 3, $title, 0, 'L', 0); |
| 746 | 746 | |
| 747 | - $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); |
|
| 747 | + $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top); |
|
| 748 | 748 | |
| 749 | - $pdf->SetFont('','', $default_font_size - 4); |
|
| 749 | + $pdf->SetFont('', '', $default_font_size - 4); |
|
| 750 | 750 | $pdf->SetXY($tab3_posx, $tab3_top); |
| 751 | 751 | $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); |
| 752 | - $pdf->SetXY($tab3_posx+21, $tab3_top); |
|
| 752 | + $pdf->SetXY($tab3_posx + 21, $tab3_top); |
|
| 753 | 753 | $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); |
| 754 | - $pdf->SetXY($tab3_posx+40, $tab3_top); |
|
| 754 | + $pdf->SetXY($tab3_posx + 40, $tab3_top); |
|
| 755 | 755 | $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); |
| 756 | - $pdf->SetXY($tab3_posx+58, $tab3_top); |
|
| 756 | + $pdf->SetXY($tab3_posx + 58, $tab3_top); |
|
| 757 | 757 | $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); |
| 758 | 758 | |
| 759 | - $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); |
|
| 759 | + $pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height); |
|
| 760 | 760 | |
| 761 | - $y=0; |
|
| 761 | + $y = 0; |
|
| 762 | 762 | |
| 763 | - $pdf->SetFont('','', $default_font_size - 4); |
|
| 763 | + $pdf->SetFont('', '', $default_font_size - 4); |
|
| 764 | 764 | |
| 765 | 765 | // Loop on each deposits and credit notes included |
| 766 | 766 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 767 | - $sql.= " re.description, re.fk_facture_source,"; |
|
| 768 | - $sql.= " f.type, f.datef"; |
|
| 769 | - $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f"; |
|
| 770 | - $sql.= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = ".$object->id; |
|
| 771 | - $resql=$this->db->query($sql); |
|
| 767 | + $sql .= " re.description, re.fk_facture_source,"; |
|
| 768 | + $sql .= " f.type, f.datef"; |
|
| 769 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re, ".MAIN_DB_PREFIX."facture as f"; |
|
| 770 | + $sql .= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = ".$object->id; |
|
| 771 | + $resql = $this->db->query($sql); |
|
| 772 | 772 | if ($resql) |
| 773 | 773 | { |
| 774 | 774 | $num = $this->db->num_rows($resql); |
| 775 | - $i=0; |
|
| 776 | - $invoice=new Facture($this->db); |
|
| 775 | + $i = 0; |
|
| 776 | + $invoice = new Facture($this->db); |
|
| 777 | 777 | while ($i < $num) |
| 778 | 778 | { |
| 779 | - $y+=3; |
|
| 779 | + $y += 3; |
|
| 780 | 780 | $obj = $this->db->fetch_object($resql); |
| 781 | 781 | |
| 782 | - if ($obj->type == 2) $text=$outputlangs->trans("CreditNote"); |
|
| 783 | - elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit"); |
|
| 784 | - else $text=$outputlangs->trans("UnknownType"); |
|
| 782 | + if ($obj->type == 2) $text = $outputlangs->trans("CreditNote"); |
|
| 783 | + elseif ($obj->type == 3) $text = $outputlangs->trans("Deposit"); |
|
| 784 | + else $text = $outputlangs->trans("UnknownType"); |
|
| 785 | 785 | |
| 786 | 786 | $invoice->fetch($obj->fk_facture_source); |
| 787 | 787 | |
| 788 | - $pdf->SetXY($tab3_posx, $tab3_top+$y); |
|
| 789 | - $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); |
|
| 790 | - $pdf->SetXY($tab3_posx+21, $tab3_top+$y); |
|
| 788 | + $pdf->SetXY($tab3_posx, $tab3_top + $y); |
|
| 789 | + $pdf->MultiCell(20, 3, dol_print_date($obj->datef, 'day', false, $outputlangs, true), 0, 'L', 0); |
|
| 790 | + $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); |
|
| 791 | 791 | $pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); |
| 792 | - $pdf->SetXY($tab3_posx+40, $tab3_top+$y); |
|
| 792 | + $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); |
|
| 793 | 793 | $pdf->MultiCell(20, 3, $text, 0, 'L', 0); |
| 794 | - $pdf->SetXY($tab3_posx+58, $tab3_top+$y); |
|
| 794 | + $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); |
|
| 795 | 795 | $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); |
| 796 | 796 | |
| 797 | - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); |
|
| 797 | + $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); |
|
| 798 | 798 | |
| 799 | 799 | $i++; |
| 800 | 800 | } |
| 801 | 801 | } |
| 802 | 802 | else |
| 803 | 803 | { |
| 804 | - $this->error=$this->db->lasterror(); |
|
| 804 | + $this->error = $this->db->lasterror(); |
|
| 805 | 805 | return -1; |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | // Loop on each payment |
| 809 | 809 | $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; |
| 810 | - $sql.= " cp.code"; |
|
| 811 | - $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; |
|
| 812 | - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; |
|
| 813 | - $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; |
|
| 814 | - $sql.= " ORDER BY p.datep"; |
|
| 815 | - $resql=$this->db->query($sql); |
|
| 810 | + $sql .= " cp.code"; |
|
| 811 | + $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; |
|
| 812 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; |
|
| 813 | + $sql .= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; |
|
| 814 | + $sql .= " ORDER BY p.datep"; |
|
| 815 | + $resql = $this->db->query($sql); |
|
| 816 | 816 | if ($resql) |
| 817 | 817 | { |
| 818 | 818 | $num = $this->db->num_rows($resql); |
| 819 | - $i=0; |
|
| 819 | + $i = 0; |
|
| 820 | 820 | while ($i < $num) { |
| 821 | - $y+=3; |
|
| 821 | + $y += 3; |
|
| 822 | 822 | $row = $this->db->fetch_object($resql); |
| 823 | 823 | |
| 824 | - $pdf->SetXY($tab3_posx, $tab3_top+$y); |
|
| 825 | - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); |
|
| 826 | - $pdf->SetXY($tab3_posx+21, $tab3_top+$y); |
|
| 824 | + $pdf->SetXY($tab3_posx, $tab3_top + $y); |
|
| 825 | + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); |
|
| 826 | + $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); |
|
| 827 | 827 | $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); |
| 828 | - $pdf->SetXY($tab3_posx+40, $tab3_top+$y); |
|
| 829 | - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); |
|
| 828 | + $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); |
|
| 829 | + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); |
|
| 830 | 830 | |
| 831 | 831 | $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); |
| 832 | - $pdf->SetXY($tab3_posx+58, $tab3_top+$y); |
|
| 832 | + $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); |
|
| 833 | 833 | $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); |
| 834 | 834 | |
| 835 | - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); |
|
| 835 | + $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); |
|
| 836 | 836 | |
| 837 | 837 | $i++; |
| 838 | 838 | } |
| 839 | 839 | } |
| 840 | 840 | else |
| 841 | 841 | { |
| 842 | - $this->error=$this->db->lasterror(); |
|
| 842 | + $this->error = $this->db->lasterror(); |
|
| 843 | 843 | return -1; |
| 844 | 844 | } |
| 845 | 845 | |
@@ -861,35 +861,35 @@ discard block |
||
| 861 | 861 | |
| 862 | 862 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
| 863 | 863 | |
| 864 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 864 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 865 | 865 | |
| 866 | 866 | // If France, show VAT mention if not applicable |
| 867 | 867 | if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) |
| 868 | 868 | { |
| 869 | - $pdf->SetFont('','B', $default_font_size - 2); |
|
| 869 | + $pdf->SetFont('', 'B', $default_font_size - 2); |
|
| 870 | 870 | $pdf->SetXY($this->marge_gauche, $posy); |
| 871 | 871 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); |
| 872 | 872 | |
| 873 | - $posy=$pdf->GetY()+4; |
|
| 873 | + $posy = $pdf->GetY() + 4; |
|
| 874 | 874 | } |
| 875 | 875 | |
| 876 | - $posxval=52; |
|
| 876 | + $posxval = 52; |
|
| 877 | 877 | |
| 878 | 878 | // Show payments conditions |
| 879 | 879 | if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) |
| 880 | 880 | { |
| 881 | - $pdf->SetFont('','B', $default_font_size - 2); |
|
| 881 | + $pdf->SetFont('', 'B', $default_font_size - 2); |
|
| 882 | 882 | $pdf->SetXY($this->marge_gauche, $posy); |
| 883 | 883 | $titre = $outputlangs->transnoentities("PaymentConditions").':'; |
| 884 | 884 | $pdf->MultiCell(80, 4, $titre, 0, 'L'); |
| 885 | 885 | |
| 886 | - $pdf->SetFont('','', $default_font_size - 2); |
|
| 886 | + $pdf->SetFont('', '', $default_font_size - 2); |
|
| 887 | 887 | $pdf->SetXY($posxval, $posy); |
| 888 | - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); |
|
| 889 | - $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); |
|
| 890 | - $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); |
|
| 888 | + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); |
|
| 889 | + $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); |
|
| 890 | + $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); |
|
| 891 | 891 | |
| 892 | - $posy=$pdf->GetY()+3; |
|
| 892 | + $posy = $pdf->GetY() + 3; |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | if ($object->type != 2) |
@@ -908,13 +908,13 @@ discard block |
||
| 908 | 908 | $outputlangs->load("errors"); |
| 909 | 909 | |
| 910 | 910 | $pdf->SetXY($this->marge_gauche, $posy); |
| 911 | - $pdf->SetTextColor(200,0,0); |
|
| 912 | - $pdf->SetFont('','B', $default_font_size - 2); |
|
| 913 | - $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code); |
|
| 914 | - $pdf->MultiCell(80, 3, $this->error,0,'L',0); |
|
| 915 | - $pdf->SetTextColor(0,0,0); |
|
| 911 | + $pdf->SetTextColor(200, 0, 0); |
|
| 912 | + $pdf->SetFont('', 'B', $default_font_size - 2); |
|
| 913 | + $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup", $object->mode_reglement_code); |
|
| 914 | + $pdf->MultiCell(80, 3, $this->error, 0, 'L', 0); |
|
| 915 | + $pdf->SetTextColor(0, 0, 0); |
|
| 916 | 916 | |
| 917 | - $posy=$pdf->GetY()+1; |
|
| 917 | + $posy = $pdf->GetY() + 1; |
|
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | // Show payment mode |
@@ -922,26 +922,26 @@ discard block |
||
| 922 | 922 | && $object->mode_reglement_code != 'CHQ' |
| 923 | 923 | && $object->mode_reglement_code != 'VIR') |
| 924 | 924 | { |
| 925 | - $pdf->SetFont('','B', $default_font_size - 2); |
|
| 925 | + $pdf->SetFont('', 'B', $default_font_size - 2); |
|
| 926 | 926 | $pdf->SetXY($this->marge_gauche, $posy); |
| 927 | 927 | $titre = $outputlangs->transnoentities("PaymentMode").':'; |
| 928 | 928 | $pdf->MultiCell(80, 5, $titre, 0, 'L'); |
| 929 | 929 | |
| 930 | - $pdf->SetFont('','', $default_font_size - 2); |
|
| 930 | + $pdf->SetFont('', '', $default_font_size - 2); |
|
| 931 | 931 | $pdf->SetXY($posxval, $posy); |
| 932 | - $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); |
|
| 933 | - $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L'); |
|
| 932 | + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); |
|
| 933 | + $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); |
|
| 934 | 934 | |
| 935 | - $posy=$pdf->GetY()+2; |
|
| 935 | + $posy = $pdf->GetY() + 2; |
|
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | // Show payment mode CHQ |
| 939 | 939 | if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') |
| 940 | 940 | { |
| 941 | 941 | // Si mode reglement non force ou si force a CHQ |
| 942 | - if (! empty($conf->global->FACTURE_CHQ_NUMBER)) |
|
| 942 | + if (!empty($conf->global->FACTURE_CHQ_NUMBER)) |
|
| 943 | 943 | { |
| 944 | - $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); |
|
| 944 | + $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); |
|
| 945 | 945 | |
| 946 | 946 | if ($conf->global->FACTURE_CHQ_NUMBER > 0) |
| 947 | 947 | { |
@@ -949,31 +949,31 @@ discard block |
||
| 949 | 949 | $account->fetch($conf->global->FACTURE_CHQ_NUMBER); |
| 950 | 950 | |
| 951 | 951 | $pdf->SetXY($this->marge_gauche, $posy); |
| 952 | - $pdf->SetFont('','B', $default_font_size - $diffsizetitle); |
|
| 953 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0); |
|
| 954 | - $posy=$pdf->GetY()+1; |
|
| 952 | + $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); |
|
| 953 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0); |
|
| 954 | + $posy = $pdf->GetY() + 1; |
|
| 955 | 955 | |
| 956 | 956 | if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) |
| 957 | 957 | { |
| 958 | 958 | $pdf->SetXY($this->marge_gauche, $posy); |
| 959 | - $pdf->SetFont('','', $default_font_size - $diffsizetitle); |
|
| 959 | + $pdf->SetFont('', '', $default_font_size - $diffsizetitle); |
|
| 960 | 960 | $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); |
| 961 | - $posy=$pdf->GetY()+2; |
|
| 961 | + $posy = $pdf->GetY() + 2; |
|
| 962 | 962 | } |
| 963 | 963 | } |
| 964 | 964 | if ($conf->global->FACTURE_CHQ_NUMBER == -1) |
| 965 | 965 | { |
| 966 | 966 | $pdf->SetXY($this->marge_gauche, $posy); |
| 967 | - $pdf->SetFont('','B', $default_font_size - $diffsizetitle); |
|
| 968 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0); |
|
| 969 | - $posy=$pdf->GetY()+1; |
|
| 967 | + $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); |
|
| 968 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); |
|
| 969 | + $posy = $pdf->GetY() + 1; |
|
| 970 | 970 | |
| 971 | 971 | if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) |
| 972 | 972 | { |
| 973 | 973 | $pdf->SetXY($this->marge_gauche, $posy); |
| 974 | - $pdf->SetFont('','', $default_font_size - $diffsizetitle); |
|
| 974 | + $pdf->SetFont('', '', $default_font_size - $diffsizetitle); |
|
| 975 | 975 | $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); |
| 976 | - $posy=$pdf->GetY()+2; |
|
| 976 | + $posy = $pdf->GetY() + 2; |
|
| 977 | 977 | } |
| 978 | 978 | } |
| 979 | 979 | } |
@@ -982,18 +982,18 @@ discard block |
||
| 982 | 982 | // If payment mode not forced or forced to VIR, show payment with BAN |
| 983 | 983 | if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') |
| 984 | 984 | { |
| 985 | - if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER)) |
|
| 985 | + if (!empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) |
|
| 986 | 986 | { |
| 987 | - $bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank); |
|
| 987 | + $bankid = (empty($object->fk_bank) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_bank); |
|
| 988 | 988 | $account = new Account($this->db); |
| 989 | 989 | $account->fetch($bankid); |
| 990 | 990 | |
| 991 | - $curx=$this->marge_gauche; |
|
| 992 | - $cury=$posy; |
|
| 991 | + $curx = $this->marge_gauche; |
|
| 992 | + $cury = $posy; |
|
| 993 | 993 | |
| 994 | - $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size); |
|
| 994 | + $posy = pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size); |
|
| 995 | 995 | |
| 996 | - $posy+=2; |
|
| 996 | + $posy += 2; |
|
| 997 | 997 | } |
| 998 | 998 | } |
| 999 | 999 | } |
@@ -1014,43 +1014,43 @@ discard block |
||
| 1014 | 1014 | */ |
| 1015 | 1015 | function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) |
| 1016 | 1016 | { |
| 1017 | - global $conf,$mysoc; |
|
| 1017 | + global $conf, $mysoc; |
|
| 1018 | 1018 | |
| 1019 | - $sign=1; |
|
| 1020 | - if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; |
|
| 1019 | + $sign = 1; |
|
| 1020 | + if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign = -1; |
|
| 1021 | 1021 | |
| 1022 | 1022 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
| 1023 | 1023 | |
| 1024 | 1024 | $tab2_top = $posy; |
| 1025 | 1025 | $tab2_hl = 4; |
| 1026 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 1026 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 1027 | 1027 | |
| 1028 | 1028 | // Tableau total |
| 1029 | 1029 | $col1x = 120; $col2x = 170; |
| 1030 | 1030 | if ($this->page_largeur < 210) // To work with US executive format |
| 1031 | 1031 | { |
| 1032 | - $col2x-=20; |
|
| 1032 | + $col2x -= 20; |
|
| 1033 | 1033 | } |
| 1034 | 1034 | $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); |
| 1035 | 1035 | |
| 1036 | - $useborder=0; |
|
| 1036 | + $useborder = 0; |
|
| 1037 | 1037 | $index = 0; |
| 1038 | 1038 | |
| 1039 | 1039 | // Total HT |
| 1040 | - $pdf->SetFillColor(255,255,255); |
|
| 1040 | + $pdf->SetFillColor(255, 255, 255); |
|
| 1041 | 1041 | $pdf->SetXY($col1x, $tab2_top + 0); |
| 1042 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); |
|
| 1042 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); |
|
| 1043 | 1043 | $pdf->SetXY($col2x, $tab2_top + 0); |
| 1044 | - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); |
|
| 1044 | + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); |
|
| 1045 | 1045 | |
| 1046 | 1046 | // Show VAT by rates and total |
| 1047 | - $pdf->SetFillColor(248,248,248); |
|
| 1047 | + $pdf->SetFillColor(248, 248, 248); |
|
| 1048 | 1048 | |
| 1049 | - $this->atleastoneratenotnull=0; |
|
| 1049 | + $this->atleastoneratenotnull = 0; |
|
| 1050 | 1050 | if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) |
| 1051 | 1051 | { |
| 1052 | - $tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false); |
|
| 1053 | - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) |
|
| 1052 | + $tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false); |
|
| 1053 | + if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) |
|
| 1054 | 1054 | { |
| 1055 | 1055 | // Nothing to do |
| 1056 | 1056 | } |
@@ -1059,29 +1059,29 @@ discard block |
||
| 1059 | 1059 | //Local tax 1 before VAT |
| 1060 | 1060 | //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') |
| 1061 | 1061 | //{ |
| 1062 | - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) |
|
| 1062 | + foreach ($this->localtax1 as $localtax_type => $localtax_rate) |
|
| 1063 | 1063 | { |
| 1064 | - if (in_array((string) $localtax_type, array('1','3','5'))) continue; |
|
| 1064 | + if (in_array((string) $localtax_type, array('1', '3', '5'))) continue; |
|
| 1065 | 1065 | |
| 1066 | - foreach( $localtax_rate as $tvakey => $tvaval ) |
|
| 1066 | + foreach ($localtax_rate as $tvakey => $tvaval) |
|
| 1067 | 1067 | { |
| 1068 | - if ($tvakey!=0) // On affiche pas taux 0 |
|
| 1068 | + if ($tvakey != 0) // On affiche pas taux 0 |
|
| 1069 | 1069 | { |
| 1070 | 1070 | //$this->atleastoneratenotnull++; |
| 1071 | 1071 | |
| 1072 | 1072 | $index++; |
| 1073 | 1073 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1074 | 1074 | |
| 1075 | - $tvacompl=''; |
|
| 1076 | - if (preg_match('/\*/',$tvakey)) |
|
| 1075 | + $tvacompl = ''; |
|
| 1076 | + if (preg_match('/\*/', $tvakey)) |
|
| 1077 | 1077 | { |
| 1078 | - $tvakey=str_replace('*','',$tvakey); |
|
| 1078 | + $tvakey = str_replace('*', '', $tvakey); |
|
| 1079 | 1079 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
| 1080 | 1080 | } |
| 1081 | 1081 | |
| 1082 | - $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; |
|
| 1083 | - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; |
|
| 1084 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1082 | + $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; |
|
| 1083 | + $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; |
|
| 1084 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1085 | 1085 | |
| 1086 | 1086 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1087 | 1087 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); |
@@ -1092,13 +1092,13 @@ discard block |
||
| 1092 | 1092 | //Local tax 2 before VAT |
| 1093 | 1093 | //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') |
| 1094 | 1094 | //{ |
| 1095 | - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) |
|
| 1095 | + foreach ($this->localtax2 as $localtax_type => $localtax_rate) |
|
| 1096 | 1096 | { |
| 1097 | - if (in_array((string) $localtax_type, array('1','3','5'))) continue; |
|
| 1097 | + if (in_array((string) $localtax_type, array('1', '3', '5'))) continue; |
|
| 1098 | 1098 | |
| 1099 | - foreach( $localtax_rate as $tvakey => $tvaval ) |
|
| 1099 | + foreach ($localtax_rate as $tvakey => $tvaval) |
|
| 1100 | 1100 | { |
| 1101 | - if ($tvakey!=0) // On affiche pas taux 0 |
|
| 1101 | + if ($tvakey != 0) // On affiche pas taux 0 |
|
| 1102 | 1102 | { |
| 1103 | 1103 | //$this->atleastoneratenotnull++; |
| 1104 | 1104 | |
@@ -1107,15 +1107,15 @@ discard block |
||
| 1107 | 1107 | $index++; |
| 1108 | 1108 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1109 | 1109 | |
| 1110 | - $tvacompl=''; |
|
| 1111 | - if (preg_match('/\*/',$tvakey)) |
|
| 1110 | + $tvacompl = ''; |
|
| 1111 | + if (preg_match('/\*/', $tvakey)) |
|
| 1112 | 1112 | { |
| 1113 | - $tvakey=str_replace('*','',$tvakey); |
|
| 1113 | + $tvakey = str_replace('*', '', $tvakey); |
|
| 1114 | 1114 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
| 1115 | 1115 | } |
| 1116 | - $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; |
|
| 1117 | - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; |
|
| 1118 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1116 | + $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; |
|
| 1117 | + $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; |
|
| 1118 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1119 | 1119 | |
| 1120 | 1120 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1121 | 1121 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | } |
| 1126 | 1126 | //} |
| 1127 | 1127 | // VAT |
| 1128 | - foreach($this->tva as $tvakey => $tvaval) |
|
| 1128 | + foreach ($this->tva as $tvakey => $tvaval) |
|
| 1129 | 1129 | { |
| 1130 | 1130 | if ($tvakey > 0) // On affiche pas taux 0 |
| 1131 | 1131 | { |
@@ -1134,15 +1134,15 @@ discard block |
||
| 1134 | 1134 | $index++; |
| 1135 | 1135 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1136 | 1136 | |
| 1137 | - $tvacompl=''; |
|
| 1138 | - if (preg_match('/\*/',$tvakey)) |
|
| 1137 | + $tvacompl = ''; |
|
| 1138 | + if (preg_match('/\*/', $tvakey)) |
|
| 1139 | 1139 | { |
| 1140 | - $tvakey=str_replace('*','',$tvakey); |
|
| 1140 | + $tvakey = str_replace('*', '', $tvakey); |
|
| 1141 | 1141 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
| 1142 | 1142 | } |
| 1143 | - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; |
|
| 1144 | - $totalvat.=vatrate($tvakey,1).$tvacompl; |
|
| 1145 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1143 | + $totalvat = $outputlangs->transnoentities("TotalVAT").' '; |
|
| 1144 | + $totalvat .= vatrate($tvakey, 1).$tvacompl; |
|
| 1145 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1146 | 1146 | |
| 1147 | 1147 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1148 | 1148 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); |
@@ -1152,11 +1152,11 @@ discard block |
||
| 1152 | 1152 | //Local tax 1 after VAT |
| 1153 | 1153 | //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') |
| 1154 | 1154 | //{ |
| 1155 | - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) |
|
| 1155 | + foreach ($this->localtax1 as $localtax_type => $localtax_rate) |
|
| 1156 | 1156 | { |
| 1157 | - if (in_array((string) $localtax_type, array('2','4','6'))) continue; |
|
| 1157 | + if (in_array((string) $localtax_type, array('2', '4', '6'))) continue; |
|
| 1158 | 1158 | |
| 1159 | - foreach( $localtax_rate as $tvakey => $tvaval ) |
|
| 1159 | + foreach ($localtax_rate as $tvakey => $tvaval) |
|
| 1160 | 1160 | { |
| 1161 | 1161 | if ($tvakey != 0) // On affiche pas taux 0 |
| 1162 | 1162 | { |
@@ -1165,16 +1165,16 @@ discard block |
||
| 1165 | 1165 | $index++; |
| 1166 | 1166 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1167 | 1167 | |
| 1168 | - $tvacompl=''; |
|
| 1169 | - if (preg_match('/\*/',$tvakey)) |
|
| 1168 | + $tvacompl = ''; |
|
| 1169 | + if (preg_match('/\*/', $tvakey)) |
|
| 1170 | 1170 | { |
| 1171 | - $tvakey=str_replace('*','',$tvakey); |
|
| 1171 | + $tvakey = str_replace('*', '', $tvakey); |
|
| 1172 | 1172 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
| 1173 | 1173 | } |
| 1174 | - $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; |
|
| 1175 | - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; |
|
| 1174 | + $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; |
|
| 1175 | + $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; |
|
| 1176 | 1176 | |
| 1177 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1177 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1178 | 1178 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1179 | 1179 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); |
| 1180 | 1180 | } |
@@ -1184,11 +1184,11 @@ discard block |
||
| 1184 | 1184 | //Local tax 2 after VAT |
| 1185 | 1185 | //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') |
| 1186 | 1186 | //{ |
| 1187 | - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) |
|
| 1187 | + foreach ($this->localtax2 as $localtax_type => $localtax_rate) |
|
| 1188 | 1188 | { |
| 1189 | - if (in_array((string) $localtax_type, array('2','4','6'))) continue; |
|
| 1189 | + if (in_array((string) $localtax_type, array('2', '4', '6'))) continue; |
|
| 1190 | 1190 | |
| 1191 | - foreach( $localtax_rate as $tvakey => $tvaval ) |
|
| 1191 | + foreach ($localtax_rate as $tvakey => $tvaval) |
|
| 1192 | 1192 | { |
| 1193 | 1193 | // retrieve global local tax |
| 1194 | 1194 | if ($tvakey != 0) // On affiche pas taux 0 |
@@ -1198,16 +1198,16 @@ discard block |
||
| 1198 | 1198 | $index++; |
| 1199 | 1199 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1200 | 1200 | |
| 1201 | - $tvacompl=''; |
|
| 1202 | - if (preg_match('/\*/',$tvakey)) |
|
| 1201 | + $tvacompl = ''; |
|
| 1202 | + if (preg_match('/\*/', $tvakey)) |
|
| 1203 | 1203 | { |
| 1204 | - $tvakey=str_replace('*','',$tvakey); |
|
| 1204 | + $tvakey = str_replace('*', '', $tvakey); |
|
| 1205 | 1205 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
| 1206 | 1206 | } |
| 1207 | - $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; |
|
| 1207 | + $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; |
|
| 1208 | 1208 | |
| 1209 | - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; |
|
| 1210 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1209 | + $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; |
|
| 1210 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
|
| 1211 | 1211 | |
| 1212 | 1212 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1213 | 1213 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | { |
| 1222 | 1222 | $index++; |
| 1223 | 1223 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1224 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); |
|
| 1224 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); |
|
| 1225 | 1225 | |
| 1226 | 1226 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1227 | 1227 | $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); |
@@ -1230,29 +1230,29 @@ discard block |
||
| 1230 | 1230 | // Total TTC |
| 1231 | 1231 | $index++; |
| 1232 | 1232 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1233 | - $pdf->SetTextColor(0,0,60); |
|
| 1234 | - $pdf->SetFillColor(224,224,224); |
|
| 1235 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); |
|
| 1233 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1234 | + $pdf->SetFillColor(224, 224, 224); |
|
| 1235 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); |
|
| 1236 | 1236 | |
| 1237 | 1237 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1238 | 1238 | $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); |
| 1239 | 1239 | } |
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | - $pdf->SetTextColor(0,0,0); |
|
| 1242 | + $pdf->SetTextColor(0, 0, 0); |
|
| 1243 | 1243 | |
| 1244 | - $creditnoteamount=$object->getSumCreditNotesUsed(); |
|
| 1245 | - $depositsamount=$object->getSumDepositsUsed(); |
|
| 1244 | + $creditnoteamount = $object->getSumCreditNotesUsed(); |
|
| 1245 | + $depositsamount = $object->getSumDepositsUsed(); |
|
| 1246 | 1246 | //print "x".$creditnoteamount."-".$depositsamount;exit; |
| 1247 | 1247 | $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); |
| 1248 | - if ($object->paye) $resteapayer=0; |
|
| 1248 | + if ($object->paye) $resteapayer = 0; |
|
| 1249 | 1249 | |
| 1250 | 1250 | if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) |
| 1251 | 1251 | { |
| 1252 | 1252 | // Already paid + Deposits |
| 1253 | 1253 | $index++; |
| 1254 | 1254 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1255 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); |
|
| 1255 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); |
|
| 1256 | 1256 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1257 | 1257 | $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); |
| 1258 | 1258 | |
@@ -1261,7 +1261,7 @@ discard block |
||
| 1261 | 1261 | { |
| 1262 | 1262 | $index++; |
| 1263 | 1263 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1264 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); |
|
| 1264 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); |
|
| 1265 | 1265 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1266 | 1266 | $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); |
| 1267 | 1267 | } |
@@ -1270,26 +1270,26 @@ discard block |
||
| 1270 | 1270 | if ($object->close_code == 'discount_vat') |
| 1271 | 1271 | { |
| 1272 | 1272 | $index++; |
| 1273 | - $pdf->SetFillColor(255,255,255); |
|
| 1273 | + $pdf->SetFillColor(255, 255, 255); |
|
| 1274 | 1274 | |
| 1275 | 1275 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1276 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOffered"), $useborder, 'L', 1); |
|
| 1276 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOffered"), $useborder, 'L', 1); |
|
| 1277 | 1277 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1278 | 1278 | $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); |
| 1279 | 1279 | |
| 1280 | - $resteapayer=0; |
|
| 1280 | + $resteapayer = 0; |
|
| 1281 | 1281 | } |
| 1282 | 1282 | |
| 1283 | 1283 | $index++; |
| 1284 | - $pdf->SetTextColor(0,0,60); |
|
| 1285 | - $pdf->SetFillColor(224,224,224); |
|
| 1284 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1285 | + $pdf->SetFillColor(224, 224, 224); |
|
| 1286 | 1286 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
| 1287 | - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); |
|
| 1287 | + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); |
|
| 1288 | 1288 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
| 1289 | 1289 | $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); |
| 1290 | 1290 | |
| 1291 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 1292 | - $pdf->SetTextColor(0,0,0); |
|
| 1291 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 1292 | + $pdf->SetTextColor(0, 0, 0); |
|
| 1293 | 1293 | } |
| 1294 | 1294 | |
| 1295 | 1295 | $index++; |
@@ -1308,47 +1308,47 @@ discard block |
||
| 1308 | 1308 | * @param int $hidebottom Hide bottom bar of array |
| 1309 | 1309 | * @return void |
| 1310 | 1310 | */ |
| 1311 | - function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) |
|
| 1311 | + function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) |
|
| 1312 | 1312 | { |
| 1313 | 1313 | global $conf; |
| 1314 | 1314 | |
| 1315 | 1315 | // Force to disable hidetop and hidebottom |
| 1316 | - $hidebottom=0; |
|
| 1317 | - if ($hidetop) $hidetop=-1; |
|
| 1316 | + $hidebottom = 0; |
|
| 1317 | + if ($hidetop) $hidetop = -1; |
|
| 1318 | 1318 | |
| 1319 | 1319 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
| 1320 | 1320 | |
| 1321 | 1321 | // Amount in (at tab_top - 1) |
| 1322 | - $pdf->SetTextColor(0,0,0); |
|
| 1323 | - $pdf->SetFont('','', $default_font_size - 2); |
|
| 1322 | + $pdf->SetTextColor(0, 0, 0); |
|
| 1323 | + $pdf->SetFont('', '', $default_font_size - 2); |
|
| 1324 | 1324 | |
| 1325 | 1325 | if (empty($hidetop)) |
| 1326 | 1326 | { |
| 1327 | - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); |
|
| 1328 | - $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); |
|
| 1327 | + $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); |
|
| 1328 | + $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4); |
|
| 1329 | 1329 | $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); |
| 1330 | 1330 | |
| 1331 | 1331 | //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; |
| 1332 | - if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); |
|
| 1332 | + if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); |
|
| 1333 | 1333 | } |
| 1334 | 1334 | |
| 1335 | - $pdf->SetDrawColor(128,128,128); |
|
| 1336 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 1335 | + $pdf->SetDrawColor(128, 128, 128); |
|
| 1336 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 1337 | 1337 | |
| 1338 | 1338 | // Output Rect |
| 1339 | - $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
|
| 1339 | + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
|
| 1340 | 1340 | |
| 1341 | 1341 | if (empty($hidetop)) |
| 1342 | 1342 | { |
| 1343 | - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param |
|
| 1343 | + $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
| 1344 | 1344 | |
| 1345 | - $pdf->SetXY($this->posxdesc-1, $tab_top+1); |
|
| 1346 | - $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); |
|
| 1345 | + $pdf->SetXY($this->posxdesc - 1, $tab_top + 1); |
|
| 1346 | + $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); |
|
| 1347 | 1347 | } |
| 1348 | 1348 | |
| 1349 | - if (! empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE)) |
|
| 1349 | + if (!empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE)) |
|
| 1350 | 1350 | { |
| 1351 | - $pdf->line($this->posxpicture-1, $tab_top, $this->posxpicture-1, $tab_top + $tab_height); |
|
| 1351 | + $pdf->line($this->posxpicture - 1, $tab_top, $this->posxpicture - 1, $tab_top + $tab_height); |
|
| 1352 | 1352 | if (empty($hidetop)) |
| 1353 | 1353 | { |
| 1354 | 1354 | //$pdf->SetXY($this->posxpicture-1, $tab_top+1); |
@@ -1358,35 +1358,35 @@ discard block |
||
| 1358 | 1358 | |
| 1359 | 1359 | if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) |
| 1360 | 1360 | { |
| 1361 | - $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); |
|
| 1361 | + $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height); |
|
| 1362 | 1362 | if (empty($hidetop)) |
| 1363 | 1363 | { |
| 1364 | - $pdf->SetXY($this->posxtva-3, $tab_top+1); |
|
| 1365 | - $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C'); |
|
| 1364 | + $pdf->SetXY($this->posxtva - 3, $tab_top + 1); |
|
| 1365 | + $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities("VAT"), '', 'C'); |
|
| 1366 | 1366 | } |
| 1367 | 1367 | } |
| 1368 | 1368 | |
| 1369 | - $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); |
|
| 1369 | + $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height); |
|
| 1370 | 1370 | if (empty($hidetop)) |
| 1371 | 1371 | { |
| 1372 | - $pdf->SetXY($this->posxup-1, $tab_top+1); |
|
| 1373 | - $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); |
|
| 1372 | + $pdf->SetXY($this->posxup - 1, $tab_top + 1); |
|
| 1373 | + $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C'); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | - $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); |
|
| 1376 | + $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height); |
|
| 1377 | 1377 | if (empty($hidetop)) |
| 1378 | 1378 | { |
| 1379 | - $pdf->SetXY($this->posxqty-1, $tab_top+1); |
|
| 1380 | - $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); |
|
| 1379 | + $pdf->SetXY($this->posxqty - 1, $tab_top + 1); |
|
| 1380 | + $pdf->MultiCell($this->posxdiscount - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C'); |
|
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | - $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); |
|
| 1383 | + $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height); |
|
| 1384 | 1384 | if (empty($hidetop)) |
| 1385 | 1385 | { |
| 1386 | 1386 | if ($this->atleastonediscount) |
| 1387 | 1387 | { |
| 1388 | - $pdf->SetXY($this->posxdiscount-1, $tab_top+1); |
|
| 1389 | - $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); |
|
| 1388 | + $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1); |
|
| 1389 | + $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C'); |
|
| 1390 | 1390 | } |
| 1391 | 1391 | } |
| 1392 | 1392 | if ($this->atleastonediscount) |
@@ -1395,8 +1395,8 @@ discard block |
||
| 1395 | 1395 | } |
| 1396 | 1396 | if (empty($hidetop)) |
| 1397 | 1397 | { |
| 1398 | - $pdf->SetXY($this->postotalht-1, $tab_top+1); |
|
| 1399 | - $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); |
|
| 1398 | + $pdf->SetXY($this->postotalht - 1, $tab_top + 1); |
|
| 1399 | + $pdf->MultiCell(30, 2, $outputlangs->transnoentities("TotalHT"), '', 'C'); |
|
| 1400 | 1400 | } |
| 1401 | 1401 | } |
| 1402 | 1402 | |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | */ |
| 1412 | 1412 | function _pagehead(&$pdf, $object, $showaddress, $outputlangs) |
| 1413 | 1413 | { |
| 1414 | - global $conf,$langs; |
|
| 1414 | + global $conf, $langs; |
|
| 1415 | 1415 | |
| 1416 | 1416 | $outputlangs->load("main"); |
| 1417 | 1417 | $outputlangs->load("bills"); |
@@ -1420,127 +1420,127 @@ discard block |
||
| 1420 | 1420 | |
| 1421 | 1421 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
| 1422 | 1422 | |
| 1423 | - pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); |
|
| 1423 | + pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); |
|
| 1424 | 1424 | |
| 1425 | 1425 | // Show Draft Watermark |
| 1426 | - if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) |
|
| 1426 | + if ($object->statut == 0 && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) |
|
| 1427 | 1427 | { |
| 1428 | - pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK); |
|
| 1428 | + pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->FACTURE_DRAFT_WATERMARK); |
|
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | - $pdf->SetTextColor(0,0,60); |
|
| 1432 | - $pdf->SetFont('','B', $default_font_size + 3); |
|
| 1431 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1432 | + $pdf->SetFont('', 'B', $default_font_size + 3); |
|
| 1433 | 1433 | |
| 1434 | - $posy=$this->marge_haute; |
|
| 1435 | - $posx=$this->page_largeur-$this->marge_droite-100; |
|
| 1434 | + $posy = $this->marge_haute; |
|
| 1435 | + $posx = $this->page_largeur - $this->marge_droite - 100; |
|
| 1436 | 1436 | |
| 1437 | - $pdf->SetXY($this->marge_gauche,$posy); |
|
| 1437 | + $pdf->SetXY($this->marge_gauche, $posy); |
|
| 1438 | 1438 | |
| 1439 | 1439 | // Logo |
| 1440 | - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; |
|
| 1440 | + $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; |
|
| 1441 | 1441 | if ($this->emetteur->logo) |
| 1442 | 1442 | { |
| 1443 | 1443 | if (is_readable($logo)) |
| 1444 | 1444 | { |
| 1445 | - $height=pdf_getHeightForLogo($logo); |
|
| 1446 | - $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) |
|
| 1445 | + $height = pdf_getHeightForLogo($logo); |
|
| 1446 | + $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) |
|
| 1447 | 1447 | } |
| 1448 | 1448 | else |
| 1449 | 1449 | { |
| 1450 | - $pdf->SetTextColor(200,0,0); |
|
| 1451 | - $pdf->SetFont('','B',$default_font_size - 2); |
|
| 1452 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); |
|
| 1450 | + $pdf->SetTextColor(200, 0, 0); |
|
| 1451 | + $pdf->SetFont('', 'B', $default_font_size - 2); |
|
| 1452 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); |
|
| 1453 | 1453 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); |
| 1454 | 1454 | } |
| 1455 | 1455 | } |
| 1456 | 1456 | else |
| 1457 | 1457 | { |
| 1458 | - $text=$this->emetteur->name; |
|
| 1458 | + $text = $this->emetteur->name; |
|
| 1459 | 1459 | $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); |
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | - $pdf->SetFont('','B', $default_font_size + 3); |
|
| 1463 | - $pdf->SetXY($posx,$posy); |
|
| 1464 | - $pdf->SetTextColor(0,0,60); |
|
| 1465 | - $title=$outputlangs->transnoentities("Invoice"); |
|
| 1466 | - if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); |
|
| 1467 | - if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); |
|
| 1468 | - if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); |
|
| 1469 | - if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); |
|
| 1462 | + $pdf->SetFont('', 'B', $default_font_size + 3); |
|
| 1463 | + $pdf->SetXY($posx, $posy); |
|
| 1464 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1465 | + $title = $outputlangs->transnoentities("Invoice"); |
|
| 1466 | + if ($object->type == 1) $title = $outputlangs->transnoentities("InvoiceReplacement"); |
|
| 1467 | + if ($object->type == 2) $title = $outputlangs->transnoentities("InvoiceAvoir"); |
|
| 1468 | + if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit"); |
|
| 1469 | + if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProFormat"); |
|
| 1470 | 1470 | $pdf->MultiCell(100, 3, $title, '', 'R'); |
| 1471 | 1471 | |
| 1472 | - $pdf->SetFont('','B',$default_font_size); |
|
| 1472 | + $pdf->SetFont('', 'B', $default_font_size); |
|
| 1473 | 1473 | |
| 1474 | - $posy+=5; |
|
| 1475 | - $pdf->SetXY($posx,$posy); |
|
| 1476 | - $pdf->SetTextColor(0,0,60); |
|
| 1477 | - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); |
|
| 1474 | + $posy += 5; |
|
| 1475 | + $pdf->SetXY($posx, $posy); |
|
| 1476 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1477 | + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); |
|
| 1478 | 1478 | |
| 1479 | - $posy+=1; |
|
| 1480 | - $pdf->SetFont('','', $default_font_size - 2); |
|
| 1479 | + $posy += 1; |
|
| 1480 | + $pdf->SetFont('', '', $default_font_size - 2); |
|
| 1481 | 1481 | |
| 1482 | 1482 | if ($object->ref_client) |
| 1483 | 1483 | { |
| 1484 | - $posy+=4; |
|
| 1485 | - $pdf->SetXY($posx,$posy); |
|
| 1486 | - $pdf->SetTextColor(0,0,60); |
|
| 1487 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); |
|
| 1484 | + $posy += 4; |
|
| 1485 | + $pdf->SetXY($posx, $posy); |
|
| 1486 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1487 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); |
|
| 1488 | 1488 | } |
| 1489 | 1489 | |
| 1490 | - $objectidnext=$object->getIdReplacingInvoice('validated'); |
|
| 1490 | + $objectidnext = $object->getIdReplacingInvoice('validated'); |
|
| 1491 | 1491 | if ($object->type == 0 && $objectidnext) |
| 1492 | 1492 | { |
| 1493 | - $objectreplacing=new Facture($this->db); |
|
| 1493 | + $objectreplacing = new Facture($this->db); |
|
| 1494 | 1494 | $objectreplacing->fetch($objectidnext); |
| 1495 | 1495 | |
| 1496 | - $posy+=3; |
|
| 1497 | - $pdf->SetXY($posx,$posy); |
|
| 1498 | - $pdf->SetTextColor(0,0,60); |
|
| 1496 | + $posy += 3; |
|
| 1497 | + $pdf->SetXY($posx, $posy); |
|
| 1498 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1499 | 1499 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R'); |
| 1500 | 1500 | } |
| 1501 | 1501 | if ($object->type == 1) |
| 1502 | 1502 | { |
| 1503 | - $objectreplaced=new Facture($this->db); |
|
| 1503 | + $objectreplaced = new Facture($this->db); |
|
| 1504 | 1504 | $objectreplaced->fetch($object->fk_facture_source); |
| 1505 | 1505 | |
| 1506 | - $posy+=4; |
|
| 1507 | - $pdf->SetXY($posx,$posy); |
|
| 1508 | - $pdf->SetTextColor(0,0,60); |
|
| 1506 | + $posy += 4; |
|
| 1507 | + $pdf->SetXY($posx, $posy); |
|
| 1508 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1509 | 1509 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); |
| 1510 | 1510 | } |
| 1511 | 1511 | if ($object->type == 2) |
| 1512 | 1512 | { |
| 1513 | - $objectreplaced=new Facture($this->db); |
|
| 1513 | + $objectreplaced = new Facture($this->db); |
|
| 1514 | 1514 | $objectreplaced->fetch($object->fk_facture_source); |
| 1515 | 1515 | |
| 1516 | - $posy+=3; |
|
| 1517 | - $pdf->SetXY($posx,$posy); |
|
| 1518 | - $pdf->SetTextColor(0,0,60); |
|
| 1516 | + $posy += 3; |
|
| 1517 | + $pdf->SetXY($posx, $posy); |
|
| 1518 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1519 | 1519 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); |
| 1520 | 1520 | } |
| 1521 | 1521 | |
| 1522 | - $posy+=4; |
|
| 1523 | - $pdf->SetXY($posx,$posy); |
|
| 1524 | - $pdf->SetTextColor(0,0,60); |
|
| 1525 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outputlangs), '', 'R'); |
|
| 1522 | + $posy += 4; |
|
| 1523 | + $pdf->SetXY($posx, $posy); |
|
| 1524 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1525 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R'); |
|
| 1526 | 1526 | |
| 1527 | 1527 | if ($object->type != 2) |
| 1528 | 1528 | { |
| 1529 | - $posy+=3; |
|
| 1530 | - $pdf->SetXY($posx,$posy); |
|
| 1531 | - $pdf->SetTextColor(0,0,60); |
|
| 1532 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); |
|
| 1529 | + $posy += 3; |
|
| 1530 | + $pdf->SetXY($posx, $posy); |
|
| 1531 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1532 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R'); |
|
| 1533 | 1533 | } |
| 1534 | 1534 | |
| 1535 | 1535 | if ($object->thirdparty->code_client) |
| 1536 | 1536 | { |
| 1537 | - $posy+=3; |
|
| 1538 | - $pdf->SetXY($posx,$posy); |
|
| 1539 | - $pdf->SetTextColor(0,0,60); |
|
| 1540 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R'); |
|
| 1537 | + $posy += 3; |
|
| 1538 | + $pdf->SetXY($posx, $posy); |
|
| 1539 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1540 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R'); |
|
| 1541 | 1541 | } |
| 1542 | 1542 | |
| 1543 | - $posy+=1; |
|
| 1543 | + $posy += 1; |
|
| 1544 | 1544 | |
| 1545 | 1545 | // Show list of linked objects |
| 1546 | 1546 | $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); |
@@ -1551,84 +1551,84 @@ discard block |
||
| 1551 | 1551 | $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); |
| 1552 | 1552 | |
| 1553 | 1553 | // Show sender |
| 1554 | - $posy=42; |
|
| 1555 | - $posx=$this->marge_gauche; |
|
| 1556 | - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; |
|
| 1557 | - $hautcadre=40; |
|
| 1554 | + $posy = 42; |
|
| 1555 | + $posx = $this->marge_gauche; |
|
| 1556 | + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->page_largeur - $this->marge_droite - 80; |
|
| 1557 | + $hautcadre = 40; |
|
| 1558 | 1558 | |
| 1559 | 1559 | // Show sender frame |
| 1560 | - $pdf->SetTextColor(0,0,0); |
|
| 1561 | - $pdf->SetFont('','', $default_font_size - 2); |
|
| 1562 | - $pdf->SetXY($posx,$posy-5); |
|
| 1563 | - $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); |
|
| 1564 | - $pdf->SetXY($posx,$posy); |
|
| 1565 | - $pdf->SetFillColor(230,230,230); |
|
| 1560 | + $pdf->SetTextColor(0, 0, 0); |
|
| 1561 | + $pdf->SetFont('', '', $default_font_size - 2); |
|
| 1562 | + $pdf->SetXY($posx, $posy - 5); |
|
| 1563 | + $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); |
|
| 1564 | + $pdf->SetXY($posx, $posy); |
|
| 1565 | + $pdf->SetFillColor(230, 230, 230); |
|
| 1566 | 1566 | $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); |
| 1567 | - $pdf->SetTextColor(0,0,60); |
|
| 1567 | + $pdf->SetTextColor(0, 0, 60); |
|
| 1568 | 1568 | |
| 1569 | 1569 | // Show sender name |
| 1570 | - $pdf->SetXY($posx+2,$posy+3); |
|
| 1571 | - $pdf->SetFont('','B', $default_font_size); |
|
| 1570 | + $pdf->SetXY($posx + 2, $posy + 3); |
|
| 1571 | + $pdf->SetFont('', 'B', $default_font_size); |
|
| 1572 | 1572 | $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); |
| 1573 | - $posy=$pdf->getY(); |
|
| 1573 | + $posy = $pdf->getY(); |
|
| 1574 | 1574 | |
| 1575 | 1575 | // Show sender information |
| 1576 | - $pdf->SetXY($posx+2,$posy); |
|
| 1577 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 1576 | + $pdf->SetXY($posx + 2, $posy); |
|
| 1577 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 1578 | 1578 | $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); |
| 1579 | 1579 | |
| 1580 | 1580 | |
| 1581 | 1581 | |
| 1582 | 1582 | // If BILLING contact defined on invoice, we use it |
| 1583 | - $usecontact=false; |
|
| 1584 | - $arrayidcontact=$object->getIdContact('external','BILLING'); |
|
| 1583 | + $usecontact = false; |
|
| 1584 | + $arrayidcontact = $object->getIdContact('external', 'BILLING'); |
|
| 1585 | 1585 | if (count($arrayidcontact) > 0) |
| 1586 | 1586 | { |
| 1587 | - $usecontact=true; |
|
| 1588 | - $result=$object->fetch_contact($arrayidcontact[0]); |
|
| 1587 | + $usecontact = true; |
|
| 1588 | + $result = $object->fetch_contact($arrayidcontact[0]); |
|
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | 1591 | // Recipient name |
| 1592 | - if (! empty($usecontact)) |
|
| 1592 | + if (!empty($usecontact)) |
|
| 1593 | 1593 | { |
| 1594 | 1594 | // On peut utiliser le nom de la societe du contact |
| 1595 | - if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; |
|
| 1595 | + if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; |
|
| 1596 | 1596 | else $socname = $object->thirdparty->name; |
| 1597 | - $carac_client_name=$outputlangs->convToOutputCharset($socname); |
|
| 1597 | + $carac_client_name = $outputlangs->convToOutputCharset($socname); |
|
| 1598 | 1598 | } |
| 1599 | 1599 | else |
| 1600 | 1600 | { |
| 1601 | - $carac_client_name=$outputlangs->convToOutputCharset($object->thirdparty->name); |
|
| 1601 | + $carac_client_name = $outputlangs->convToOutputCharset($object->thirdparty->name); |
|
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target'); |
|
| 1604 | + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target'); |
|
| 1605 | 1605 | |
| 1606 | 1606 | // Show recipient |
| 1607 | - $widthrecbox=100; |
|
| 1608 | - if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format |
|
| 1609 | - $posy=42; |
|
| 1610 | - $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; |
|
| 1611 | - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; |
|
| 1607 | + $widthrecbox = 100; |
|
| 1608 | + if ($this->page_largeur < 210) $widthrecbox = 84; // To work with US executive format |
|
| 1609 | + $posy = 42; |
|
| 1610 | + $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; |
|
| 1611 | + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche; |
|
| 1612 | 1612 | |
| 1613 | 1613 | // Show recipient frame |
| 1614 | - $pdf->SetTextColor(0,0,0); |
|
| 1615 | - $pdf->SetFont('','', $default_font_size - 2); |
|
| 1616 | - $pdf->SetXY($posx+2,$posy-5); |
|
| 1617 | - $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); |
|
| 1614 | + $pdf->SetTextColor(0, 0, 0); |
|
| 1615 | + $pdf->SetFont('', '', $default_font_size - 2); |
|
| 1616 | + $pdf->SetXY($posx + 2, $posy - 5); |
|
| 1617 | + $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L'); |
|
| 1618 | 1618 | $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); |
| 1619 | 1619 | |
| 1620 | 1620 | // Show recipient name |
| 1621 | - $pdf->SetXY($posx+2,$posy+3); |
|
| 1622 | - $pdf->SetFont('','B', $default_font_size); |
|
| 1621 | + $pdf->SetXY($posx + 2, $posy + 3); |
|
| 1622 | + $pdf->SetFont('', 'B', $default_font_size); |
|
| 1623 | 1623 | $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); |
| 1624 | 1624 | |
| 1625 | 1625 | // Show recipient information |
| 1626 | - $pdf->SetFont('','', $default_font_size - 1); |
|
| 1627 | - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); |
|
| 1626 | + $pdf->SetFont('', '', $default_font_size - 1); |
|
| 1627 | + $pdf->SetXY($posx + 2, $posy + 4 + (dol_nboflines_bis($carac_client_name, 50) * 4)); |
|
| 1628 | 1628 | $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); |
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | - $pdf->SetTextColor(0,0,0); |
|
| 1631 | + $pdf->SetTextColor(0, 0, 0); |
|
| 1632 | 1632 | } |
| 1633 | 1633 | |
| 1634 | 1634 | /** |
@@ -1640,11 +1640,11 @@ discard block |
||
| 1640 | 1640 | * @param int $hidefreetext 1=Hide free text |
| 1641 | 1641 | * @return int Return height of bottom margin including footer text |
| 1642 | 1642 | */ |
| 1643 | - function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) |
|
| 1643 | + function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) |
|
| 1644 | 1644 | { |
| 1645 | - $showdetails=0; |
|
| 1646 | - $free_text = (float)DOL_VERSION > 3.8 ? 'INVOICE_FREE_TEXT' : 'FACTURE_FREE_TEXT'; |
|
| 1647 | - return pdf_pagefoot($pdf,$outputlangs,$free_text,$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); |
|
| 1645 | + $showdetails = 0; |
|
| 1646 | + $free_text = (float) DOL_VERSION > 3.8 ? 'INVOICE_FREE_TEXT' : 'FACTURE_FREE_TEXT'; |
|
| 1647 | + return pdf_pagefoot($pdf, $outputlangs, $free_text, $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); |
|
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | 1650 | } |
@@ -31,187 +31,187 @@ discard block |
||
| 31 | 31 | class modSubtotal extends DolibarrModules |
| 32 | 32 | { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Constructor. Define names, constants, directories, boxes, permissions |
|
| 36 | - * |
|
| 37 | - * @param DoliDB $db Database handler |
|
| 38 | - */ |
|
| 34 | + /** |
|
| 35 | + * Constructor. Define names, constants, directories, boxes, permissions |
|
| 36 | + * |
|
| 37 | + * @param DoliDB $db Database handler |
|
| 38 | + */ |
|
| 39 | 39 | |
| 40 | - public function __construct($db) |
|
| 41 | - { |
|
| 42 | - global $langs, $conf; |
|
| 40 | + public function __construct($db) |
|
| 41 | + { |
|
| 42 | + global $langs, $conf; |
|
| 43 | 43 | |
| 44 | - $this->db = $db; |
|
| 44 | + $this->db = $db; |
|
| 45 | 45 | |
| 46 | 46 | $this->editor_name = 'ATM-Consulting'; |
| 47 | - // Id for module (must be unique). |
|
| 48 | - // Use a free id here |
|
| 49 | - // (See in Home -> System information -> Dolibarr for list of used modules id). |
|
| 50 | - $this->numero = 104777; // 104000 to 104999 for ATM CONSULTING |
|
| 51 | - // Key text used to identify module (for permissions, menus, etc...) |
|
| 52 | - $this->rights_class = 'subtotal'; |
|
| 47 | + // Id for module (must be unique). |
|
| 48 | + // Use a free id here |
|
| 49 | + // (See in Home -> System information -> Dolibarr for list of used modules id). |
|
| 50 | + $this->numero = 104777; // 104000 to 104999 for ATM CONSULTING |
|
| 51 | + // Key text used to identify module (for permissions, menus, etc...) |
|
| 52 | + $this->rights_class = 'subtotal'; |
|
| 53 | 53 | |
| 54 | - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
| 55 | - // It is used to group modules in module setup page |
|
| 56 | - $this->family = "technic"; |
|
| 57 | - // Module label (no space allowed) |
|
| 58 | - // used if translation string 'ModuleXXXName' not found |
|
| 59 | - // (where XXX is value of numeric property 'numero' of module) |
|
| 60 | - $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
| 61 | - // Module description |
|
| 62 | - // used if translation string 'ModuleXXXDesc' not found |
|
| 63 | - // (where XXX is value of numeric property 'numero' of module) |
|
| 64 | - $this->description = "Module permettant l'ajout de sous-totaux et sous-totaux intermédiaires et le déplacement d'une ligne aisée de l'un dans l'autre"; |
|
| 65 | - // Possible values for version are: 'development', 'experimental' or version |
|
| 66 | - $this->version = '3.3.1'; |
|
| 67 | - // Key used in llx_const table to save module status enabled/disabled |
|
| 68 | - // (where MYMODULE is value of property name of module in uppercase) |
|
| 69 | - $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 70 | - // Where to store the module in setup page |
|
| 71 | - // (0=common,1=interface,2=others,3=very specific) |
|
| 72 | - $this->special = 2; |
|
| 73 | - // Name of image file used for this module. |
|
| 74 | - // If file is in theme/yourtheme/img directory under name object_pictovalue.png |
|
| 75 | - // use this->picto='pictovalue' |
|
| 76 | - // If file is in module/img directory under name object_pictovalue.png |
|
| 77 | - // use this->picto='pictovalue@module' |
|
| 78 | - $this->picto = 'subtotal@subtotal'; // mypicto@titre |
|
| 79 | - // Defined all module parts (triggers, login, substitutions, menus, css, etc...) |
|
| 80 | - // for default path (eg: /titre/core/xxxxx) (0=disable, 1=enable) |
|
| 81 | - // for specific path of parts (eg: /titre/core/modules/barcode) |
|
| 82 | - // for specific css file (eg: /titre/css/titre.css.php) |
|
| 83 | - $this->module_parts = array( |
|
| 84 | - // Set this to 1 if module has its own trigger directory |
|
| 85 | - 'triggers' => 1, |
|
| 86 | - // Set this to 1 if module has its own login method directory |
|
| 87 | - //'login' => 0, |
|
| 88 | - // Set this to 1 if module has its own substitution function file |
|
| 89 | - //'substitutions' => 0, |
|
| 90 | - // Set this to 1 if module has its own menus handler directory |
|
| 91 | - //'menus' => 0, |
|
| 92 | - // Set this to 1 if module has its own barcode directory |
|
| 93 | - //'barcode' => 0, |
|
| 94 | - // Set this to 1 if module has its own models directory |
|
| 95 | - 'models' => 1, |
|
| 96 | - // Set this to relative path of css if module has its own css file |
|
| 97 | - //'css' => '/titre/css/mycss.css.php', |
|
| 98 | - // Set here all hooks context managed by module |
|
| 99 | - 'hooks' => array( |
|
| 100 | - 'invoicecard' |
|
| 101 | - ,'invoicesuppliercard' |
|
| 102 | - ,'propalcard' |
|
| 103 | - ,'supplier_proposalcard' |
|
| 104 | - ,'ordercard' |
|
| 105 | - ,'ordersuppliercard' |
|
| 106 | - ,'odtgeneration' |
|
| 107 | - ,'orderstoinvoice' |
|
| 108 | - ,'orderstoinvoicesupplier' |
|
| 109 | - ,'admin' |
|
| 110 | - ,'invoicereccard' |
|
| 111 | - ,'consumptionthirdparty' |
|
| 112 | - ,'ordershipmentcard' |
|
| 113 | - ,'expeditioncard' |
|
| 54 | + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
| 55 | + // It is used to group modules in module setup page |
|
| 56 | + $this->family = "technic"; |
|
| 57 | + // Module label (no space allowed) |
|
| 58 | + // used if translation string 'ModuleXXXName' not found |
|
| 59 | + // (where XXX is value of numeric property 'numero' of module) |
|
| 60 | + $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
| 61 | + // Module description |
|
| 62 | + // used if translation string 'ModuleXXXDesc' not found |
|
| 63 | + // (where XXX is value of numeric property 'numero' of module) |
|
| 64 | + $this->description = "Module permettant l'ajout de sous-totaux et sous-totaux intermédiaires et le déplacement d'une ligne aisée de l'un dans l'autre"; |
|
| 65 | + // Possible values for version are: 'development', 'experimental' or version |
|
| 66 | + $this->version = '3.3.1'; |
|
| 67 | + // Key used in llx_const table to save module status enabled/disabled |
|
| 68 | + // (where MYMODULE is value of property name of module in uppercase) |
|
| 69 | + $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 70 | + // Where to store the module in setup page |
|
| 71 | + // (0=common,1=interface,2=others,3=very specific) |
|
| 72 | + $this->special = 2; |
|
| 73 | + // Name of image file used for this module. |
|
| 74 | + // If file is in theme/yourtheme/img directory under name object_pictovalue.png |
|
| 75 | + // use this->picto='pictovalue' |
|
| 76 | + // If file is in module/img directory under name object_pictovalue.png |
|
| 77 | + // use this->picto='pictovalue@module' |
|
| 78 | + $this->picto = 'subtotal@subtotal'; // mypicto@titre |
|
| 79 | + // Defined all module parts (triggers, login, substitutions, menus, css, etc...) |
|
| 80 | + // for default path (eg: /titre/core/xxxxx) (0=disable, 1=enable) |
|
| 81 | + // for specific path of parts (eg: /titre/core/modules/barcode) |
|
| 82 | + // for specific css file (eg: /titre/css/titre.css.php) |
|
| 83 | + $this->module_parts = array( |
|
| 84 | + // Set this to 1 if module has its own trigger directory |
|
| 85 | + 'triggers' => 1, |
|
| 86 | + // Set this to 1 if module has its own login method directory |
|
| 87 | + //'login' => 0, |
|
| 88 | + // Set this to 1 if module has its own substitution function file |
|
| 89 | + //'substitutions' => 0, |
|
| 90 | + // Set this to 1 if module has its own menus handler directory |
|
| 91 | + //'menus' => 0, |
|
| 92 | + // Set this to 1 if module has its own barcode directory |
|
| 93 | + //'barcode' => 0, |
|
| 94 | + // Set this to 1 if module has its own models directory |
|
| 95 | + 'models' => 1, |
|
| 96 | + // Set this to relative path of css if module has its own css file |
|
| 97 | + //'css' => '/titre/css/mycss.css.php', |
|
| 98 | + // Set here all hooks context managed by module |
|
| 99 | + 'hooks' => array( |
|
| 100 | + 'invoicecard' |
|
| 101 | + ,'invoicesuppliercard' |
|
| 102 | + ,'propalcard' |
|
| 103 | + ,'supplier_proposalcard' |
|
| 104 | + ,'ordercard' |
|
| 105 | + ,'ordersuppliercard' |
|
| 106 | + ,'odtgeneration' |
|
| 107 | + ,'orderstoinvoice' |
|
| 108 | + ,'orderstoinvoicesupplier' |
|
| 109 | + ,'admin' |
|
| 110 | + ,'invoicereccard' |
|
| 111 | + ,'consumptionthirdparty' |
|
| 112 | + ,'ordershipmentcard' |
|
| 113 | + ,'expeditioncard' |
|
| 114 | 114 | ,'deliverycard' |
| 115 | 115 | ,'paiementcard' |
| 116 | - ) |
|
| 117 | - // Set here all workflow context managed by module |
|
| 118 | - //'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) |
|
| 119 | - ); |
|
| 116 | + ) |
|
| 117 | + // Set here all workflow context managed by module |
|
| 118 | + //'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) |
|
| 119 | + ); |
|
| 120 | 120 | |
| 121 | - // Data directories to create when module is enabled. |
|
| 122 | - // Example: this->dirs = array("/titre/temp"); |
|
| 123 | - $this->dirs = array(); |
|
| 121 | + // Data directories to create when module is enabled. |
|
| 122 | + // Example: this->dirs = array("/titre/temp"); |
|
| 123 | + $this->dirs = array(); |
|
| 124 | 124 | |
| 125 | - // Config pages. Put here list of php pages |
|
| 126 | - // stored into titre/admin directory, used to setup module. |
|
| 127 | - $this->config_page_url = array("subtotal_setup.php@subtotal"); |
|
| 125 | + // Config pages. Put here list of php pages |
|
| 126 | + // stored into titre/admin directory, used to setup module. |
|
| 127 | + $this->config_page_url = array("subtotal_setup.php@subtotal"); |
|
| 128 | 128 | |
| 129 | - // Dependencies |
|
| 130 | - // List of modules id that must be enabled if this module is enabled |
|
| 131 | - $this->depends = array(); |
|
| 129 | + // Dependencies |
|
| 130 | + // List of modules id that must be enabled if this module is enabled |
|
| 131 | + $this->depends = array(); |
|
| 132 | 132 | |
| 133 | 133 | $this->conflictwith=array('modMilestone'); |
| 134 | - // List of modules id to disable if this one is disabled |
|
| 135 | - $this->requiredby = array(); |
|
| 136 | - // Minimum version of PHP required by module |
|
| 137 | - $this->phpmin = array(5, 3); |
|
| 138 | - // Minimum version of Dolibarr required by module |
|
| 139 | - $this->need_dolibarr_version = array(3, 2); |
|
| 140 | - $this->langfiles = array("subtotal@subtotal"); // langfiles@titre |
|
| 141 | - // Constants |
|
| 142 | - // List of particular constants to add when module is enabled |
|
| 143 | - // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) |
|
| 144 | - // Example: |
|
| 145 | - $this->const = array( |
|
| 146 | - 0=>array( |
|
| 147 | - 'SUBTOTAL_STYLE_TITRES_SI_LIGNES_CACHEES', |
|
| 148 | - 'chaine', |
|
| 149 | - 'I', |
|
| 150 | - 'Définit le style (B : gras, I : Italique, U : Souligné) des sous titres lorsque le détail des lignes et des ensembles est caché', |
|
| 151 | - 1 |
|
| 152 | - ) |
|
| 134 | + // List of modules id to disable if this one is disabled |
|
| 135 | + $this->requiredby = array(); |
|
| 136 | + // Minimum version of PHP required by module |
|
| 137 | + $this->phpmin = array(5, 3); |
|
| 138 | + // Minimum version of Dolibarr required by module |
|
| 139 | + $this->need_dolibarr_version = array(3, 2); |
|
| 140 | + $this->langfiles = array("subtotal@subtotal"); // langfiles@titre |
|
| 141 | + // Constants |
|
| 142 | + // List of particular constants to add when module is enabled |
|
| 143 | + // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) |
|
| 144 | + // Example: |
|
| 145 | + $this->const = array( |
|
| 146 | + 0=>array( |
|
| 147 | + 'SUBTOTAL_STYLE_TITRES_SI_LIGNES_CACHEES', |
|
| 148 | + 'chaine', |
|
| 149 | + 'I', |
|
| 150 | + 'Définit le style (B : gras, I : Italique, U : Souligné) des sous titres lorsque le détail des lignes et des ensembles est caché', |
|
| 151 | + 1 |
|
| 152 | + ) |
|
| 153 | 153 | ,1=>array('SUBTOTAL_ALLOW_ADD_BLOCK', 'chaine', '1', 'Permet l\'ajout de titres et sous-totaux') |
| 154 | 154 | ,2=>array('SUBTOTAL_ALLOW_EDIT_BLOCK', 'chaine', '1', 'Permet de modifier titres et sous-totaux') |
| 155 | 155 | ,3=>array('SUBTOTAL_ALLOW_REMOVE_BLOCK', 'chaine', '1', 'Permet de supprimer les titres et sous-totaux') |
| 156 | 156 | ,4=>array('SUBTOTAL_TITLE_STYLE', 'chaine', 'BU') |
| 157 | 157 | ,5=>array('SUBTOTAL_SUBTOTAL_STYLE', 'chaine', 'B') |
| 158 | - // 1=>array( |
|
| 159 | - // 'MYMODULE_MYNEWCONST2', |
|
| 160 | - // 'chaine', |
|
| 161 | - // 'myvalue', |
|
| 162 | - // 'This is another constant to add', |
|
| 163 | - // 0 |
|
| 164 | - // ) |
|
| 165 | - ); |
|
| 158 | + // 1=>array( |
|
| 159 | + // 'MYMODULE_MYNEWCONST2', |
|
| 160 | + // 'chaine', |
|
| 161 | + // 'myvalue', |
|
| 162 | + // 'This is another constant to add', |
|
| 163 | + // 0 |
|
| 164 | + // ) |
|
| 165 | + ); |
|
| 166 | 166 | |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | |
| 170 | - // Array to add new pages in new tabs |
|
| 171 | - // Example: |
|
| 172 | - $this->tabs = array( |
|
| 173 | - // // To add a new tab identified by code tabname1 |
|
| 174 | - // 'objecttype:+tabname1:Title1:langfile@titre:$user->rights->titre->read:/titre/mynewtab1.php?id=__ID__', |
|
| 175 | - // // To add another new tab identified by code tabname2 |
|
| 176 | - // 'objecttype:+tabname2:Title2:langfile@titre:$user->rights->othermodule->read:/titre/mynewtab2.php?id=__ID__', |
|
| 177 | - // // To remove an existing tab identified by code tabname |
|
| 178 | - // 'objecttype:-tabname' |
|
| 179 | - ); |
|
| 180 | - // where objecttype can be |
|
| 181 | - // 'thirdparty' to add a tab in third party view |
|
| 182 | - // 'intervention' to add a tab in intervention view |
|
| 183 | - // 'order_supplier' to add a tab in supplier order view |
|
| 184 | - // 'invoice_supplier' to add a tab in supplier invoice view |
|
| 185 | - // 'invoice' to add a tab in customer invoice view |
|
| 186 | - // 'order' to add a tab in customer order view |
|
| 187 | - // 'product' to add a tab in product view |
|
| 188 | - // 'stock' to add a tab in stock view |
|
| 189 | - // 'propal' to add a tab in propal view |
|
| 190 | - // 'member' to add a tab in fundation member view |
|
| 191 | - // 'contract' to add a tab in contract view |
|
| 192 | - // 'user' to add a tab in user view |
|
| 193 | - // 'group' to add a tab in group view |
|
| 194 | - // 'contact' to add a tab in contact view |
|
| 195 | - // 'categories_x' to add a tab in category view |
|
| 196 | - // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
| 197 | - // Dictionnaries |
|
| 198 | - if (! isset($conf->subtotal->enabled)) { |
|
| 199 | - $conf->subtotal=new stdClass(); |
|
| 200 | - $conf->subtotal->enabled = 0; |
|
| 201 | - } |
|
| 202 | - $this->dictionaries = array( |
|
| 170 | + // Array to add new pages in new tabs |
|
| 171 | + // Example: |
|
| 172 | + $this->tabs = array( |
|
| 173 | + // // To add a new tab identified by code tabname1 |
|
| 174 | + // 'objecttype:+tabname1:Title1:langfile@titre:$user->rights->titre->read:/titre/mynewtab1.php?id=__ID__', |
|
| 175 | + // // To add another new tab identified by code tabname2 |
|
| 176 | + // 'objecttype:+tabname2:Title2:langfile@titre:$user->rights->othermodule->read:/titre/mynewtab2.php?id=__ID__', |
|
| 177 | + // // To remove an existing tab identified by code tabname |
|
| 178 | + // 'objecttype:-tabname' |
|
| 179 | + ); |
|
| 180 | + // where objecttype can be |
|
| 181 | + // 'thirdparty' to add a tab in third party view |
|
| 182 | + // 'intervention' to add a tab in intervention view |
|
| 183 | + // 'order_supplier' to add a tab in supplier order view |
|
| 184 | + // 'invoice_supplier' to add a tab in supplier invoice view |
|
| 185 | + // 'invoice' to add a tab in customer invoice view |
|
| 186 | + // 'order' to add a tab in customer order view |
|
| 187 | + // 'product' to add a tab in product view |
|
| 188 | + // 'stock' to add a tab in stock view |
|
| 189 | + // 'propal' to add a tab in propal view |
|
| 190 | + // 'member' to add a tab in fundation member view |
|
| 191 | + // 'contract' to add a tab in contract view |
|
| 192 | + // 'user' to add a tab in user view |
|
| 193 | + // 'group' to add a tab in group view |
|
| 194 | + // 'contact' to add a tab in contact view |
|
| 195 | + // 'categories_x' to add a tab in category view |
|
| 196 | + // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
| 197 | + // Dictionnaries |
|
| 198 | + if (! isset($conf->subtotal->enabled)) { |
|
| 199 | + $conf->subtotal=new stdClass(); |
|
| 200 | + $conf->subtotal->enabled = 0; |
|
| 201 | + } |
|
| 202 | + $this->dictionaries = array( |
|
| 203 | 203 | 'langs'=>'subtotal@subtotal', |
| 204 | - 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 205 | - 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 206 | - 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 207 | - 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 208 | - 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 209 | - 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 210 | - 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 211 | - 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 212 | - 'tabcond'=>array($conf->subtotal->enabled) |
|
| 204 | + 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 205 | + 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 206 | + 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 207 | + 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 208 | + 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 209 | + 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 210 | + 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 211 | + 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 212 | + 'tabcond'=>array($conf->subtotal->enabled) |
|
| 213 | 213 | ); |
| 214 | - /* Example: |
|
| 214 | + /* Example: |
|
| 215 | 215 | // This is to avoid warnings |
| 216 | 216 | if (! isset($conf->titre->enabled)) $conf->titre->enabled=0; |
| 217 | 217 | $this->dictionnaries=array( |
@@ -252,223 +252,223 @@ discard block |
||
| 252 | 252 | ); |
| 253 | 253 | */ |
| 254 | 254 | |
| 255 | - // Boxes |
|
| 256 | - // Add here list of php file(s) stored in core/boxes that contains class to show a box. |
|
| 257 | - $this->boxes = array(); // Boxes list |
|
| 255 | + // Boxes |
|
| 256 | + // Add here list of php file(s) stored in core/boxes that contains class to show a box. |
|
| 257 | + $this->boxes = array(); // Boxes list |
|
| 258 | 258 | |
| 259 | - /* |
|
| 259 | + /* |
|
| 260 | 260 | $this->boxes[$r][1] = "myboxb.php"; |
| 261 | 261 | $r++; |
| 262 | 262 | */ |
| 263 | 263 | |
| 264 | - // Permissions |
|
| 265 | - $this->rights = array(); // Permission array used by this module |
|
| 266 | - $r = 0; |
|
| 264 | + // Permissions |
|
| 265 | + $this->rights = array(); // Permission array used by this module |
|
| 266 | + $r = 0; |
|
| 267 | 267 | |
| 268 | - // Add here list of permission defined by |
|
| 269 | - // an id, a label, a boolean and two constant strings. |
|
| 270 | - // Example: |
|
| 271 | - //// Permission id (must not be already used) |
|
| 272 | - //$this->rights[$r][0] = 2000; |
|
| 273 | - //// Permission label |
|
| 274 | - //$this->rights[$r][1] = 'Permision label'; |
|
| 275 | - //// Permission by default for new user (0/1) |
|
| 276 | - //$this->rights[$r][3] = 1; |
|
| 277 | - //// In php code, permission will be checked by test |
|
| 278 | - //// if ($user->rights->permkey->level1->level2) |
|
| 279 | - //$this->rights[$r][4] = 'level1'; |
|
| 280 | - //// In php code, permission will be checked by test |
|
| 281 | - //// if ($user->rights->permkey->level1->level2) |
|
| 282 | - //$this->rights[$r][5] = 'level2'; |
|
| 283 | - //$r++; |
|
| 284 | - // Main menu entries |
|
| 285 | - $this->menus = array(); // List of menus to add |
|
| 286 | - $r = 0; |
|
| 268 | + // Add here list of permission defined by |
|
| 269 | + // an id, a label, a boolean and two constant strings. |
|
| 270 | + // Example: |
|
| 271 | + //// Permission id (must not be already used) |
|
| 272 | + //$this->rights[$r][0] = 2000; |
|
| 273 | + //// Permission label |
|
| 274 | + //$this->rights[$r][1] = 'Permision label'; |
|
| 275 | + //// Permission by default for new user (0/1) |
|
| 276 | + //$this->rights[$r][3] = 1; |
|
| 277 | + //// In php code, permission will be checked by test |
|
| 278 | + //// if ($user->rights->permkey->level1->level2) |
|
| 279 | + //$this->rights[$r][4] = 'level1'; |
|
| 280 | + //// In php code, permission will be checked by test |
|
| 281 | + //// if ($user->rights->permkey->level1->level2) |
|
| 282 | + //$this->rights[$r][5] = 'level2'; |
|
| 283 | + //$r++; |
|
| 284 | + // Main menu entries |
|
| 285 | + $this->menus = array(); // List of menus to add |
|
| 286 | + $r = 0; |
|
| 287 | 287 | |
| 288 | - // Add here entries to declare new menus |
|
| 289 | - // |
|
| 290 | - // Example to declare a new Top Menu entry and its Left menu entry: |
|
| 291 | - //$this->menu[$r]=array( |
|
| 292 | - // // Put 0 if this is a top menu |
|
| 293 | - // 'fk_menu'=>0, |
|
| 294 | - // // This is a Top menu entry |
|
| 295 | - // 'type'=>'top', |
|
| 296 | - // 'titre'=>'titre top menu', |
|
| 297 | - // 'mainmenu'=>'titre', |
|
| 298 | - // 'leftmenu'=>'titre', |
|
| 299 | - // 'url'=>'/titre/pagetop.php', |
|
| 300 | - // // Lang file to use (without .lang) by module. |
|
| 301 | - // // File must be in langs/code_CODE/ directory. |
|
| 302 | - // 'langs'=>'mylangfile', |
|
| 303 | - // 'position'=>100, |
|
| 304 | - // // Define condition to show or hide menu entry. |
|
| 305 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 306 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 307 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 308 | - // // if you want your menu with a permission rules |
|
| 309 | - // 'perms'=>'1', |
|
| 310 | - // 'target'=>'', |
|
| 311 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 312 | - // 'user'=>2 |
|
| 313 | - //); |
|
| 314 | - //$r++; |
|
| 315 | - //$this->menu[$r]=array( |
|
| 316 | - // // Use r=value where r is index key used for the parent menu entry |
|
| 317 | - // // (higher parent must be a top menu entry) |
|
| 318 | - // 'fk_menu'=>'r=0', |
|
| 319 | - // // This is a Left menu entry |
|
| 320 | - // 'type'=>'left', |
|
| 321 | - // 'titre'=>'titre left menu', |
|
| 322 | - // 'mainmenu'=>'titre', |
|
| 323 | - // 'leftmenu'=>'titre', |
|
| 324 | - // 'url'=>'/titre/pagelevel1.php', |
|
| 325 | - // // Lang file to use (without .lang) by module. |
|
| 326 | - // // File must be in langs/code_CODE/ directory. |
|
| 327 | - // 'langs'=>'mylangfile', |
|
| 328 | - // 'position'=>100, |
|
| 329 | - // // Define condition to show or hide menu entry. |
|
| 330 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 331 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 332 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 333 | - // // if you want your menu with a permission rules |
|
| 334 | - // 'perms'=>'1', |
|
| 335 | - // 'target'=>'', |
|
| 336 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 337 | - // 'user'=>2 |
|
| 338 | - //); |
|
| 339 | - //$r++; |
|
| 340 | - // |
|
| 341 | - // Example to declare a Left Menu entry into an existing Top menu entry: |
|
| 342 | - //$this->menu[$r]=array( |
|
| 343 | - // // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' |
|
| 344 | - // 'fk_menu'=>'fk_mainmenu=mainmenucode', |
|
| 345 | - // // This is a Left menu entry |
|
| 346 | - // 'type'=>'left', |
|
| 347 | - // 'titre'=>'titre left menu', |
|
| 348 | - // 'mainmenu'=>'mainmenucode', |
|
| 349 | - // 'leftmenu'=>'titre', |
|
| 350 | - // 'url'=>'/titre/pagelevel2.php', |
|
| 351 | - // // Lang file to use (without .lang) by module. |
|
| 352 | - // // File must be in langs/code_CODE/ directory. |
|
| 353 | - // 'langs'=>'mylangfile', |
|
| 354 | - // 'position'=>100, |
|
| 355 | - // // Define condition to show or hide menu entry. |
|
| 356 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 357 | - // // Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 358 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 359 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 360 | - // // if you want your menu with a permission rules |
|
| 361 | - // 'perms'=>'1', |
|
| 362 | - // 'target'=>'', |
|
| 363 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 364 | - // 'user'=>2 |
|
| 365 | - //); |
|
| 366 | - //$r++; |
|
| 367 | - // Exports |
|
| 368 | - $r = 1; |
|
| 288 | + // Add here entries to declare new menus |
|
| 289 | + // |
|
| 290 | + // Example to declare a new Top Menu entry and its Left menu entry: |
|
| 291 | + //$this->menu[$r]=array( |
|
| 292 | + // // Put 0 if this is a top menu |
|
| 293 | + // 'fk_menu'=>0, |
|
| 294 | + // // This is a Top menu entry |
|
| 295 | + // 'type'=>'top', |
|
| 296 | + // 'titre'=>'titre top menu', |
|
| 297 | + // 'mainmenu'=>'titre', |
|
| 298 | + // 'leftmenu'=>'titre', |
|
| 299 | + // 'url'=>'/titre/pagetop.php', |
|
| 300 | + // // Lang file to use (without .lang) by module. |
|
| 301 | + // // File must be in langs/code_CODE/ directory. |
|
| 302 | + // 'langs'=>'mylangfile', |
|
| 303 | + // 'position'=>100, |
|
| 304 | + // // Define condition to show or hide menu entry. |
|
| 305 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 306 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 307 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 308 | + // // if you want your menu with a permission rules |
|
| 309 | + // 'perms'=>'1', |
|
| 310 | + // 'target'=>'', |
|
| 311 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 312 | + // 'user'=>2 |
|
| 313 | + //); |
|
| 314 | + //$r++; |
|
| 315 | + //$this->menu[$r]=array( |
|
| 316 | + // // Use r=value where r is index key used for the parent menu entry |
|
| 317 | + // // (higher parent must be a top menu entry) |
|
| 318 | + // 'fk_menu'=>'r=0', |
|
| 319 | + // // This is a Left menu entry |
|
| 320 | + // 'type'=>'left', |
|
| 321 | + // 'titre'=>'titre left menu', |
|
| 322 | + // 'mainmenu'=>'titre', |
|
| 323 | + // 'leftmenu'=>'titre', |
|
| 324 | + // 'url'=>'/titre/pagelevel1.php', |
|
| 325 | + // // Lang file to use (without .lang) by module. |
|
| 326 | + // // File must be in langs/code_CODE/ directory. |
|
| 327 | + // 'langs'=>'mylangfile', |
|
| 328 | + // 'position'=>100, |
|
| 329 | + // // Define condition to show or hide menu entry. |
|
| 330 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 331 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 332 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 333 | + // // if you want your menu with a permission rules |
|
| 334 | + // 'perms'=>'1', |
|
| 335 | + // 'target'=>'', |
|
| 336 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 337 | + // 'user'=>2 |
|
| 338 | + //); |
|
| 339 | + //$r++; |
|
| 340 | + // |
|
| 341 | + // Example to declare a Left Menu entry into an existing Top menu entry: |
|
| 342 | + //$this->menu[$r]=array( |
|
| 343 | + // // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' |
|
| 344 | + // 'fk_menu'=>'fk_mainmenu=mainmenucode', |
|
| 345 | + // // This is a Left menu entry |
|
| 346 | + // 'type'=>'left', |
|
| 347 | + // 'titre'=>'titre left menu', |
|
| 348 | + // 'mainmenu'=>'mainmenucode', |
|
| 349 | + // 'leftmenu'=>'titre', |
|
| 350 | + // 'url'=>'/titre/pagelevel2.php', |
|
| 351 | + // // Lang file to use (without .lang) by module. |
|
| 352 | + // // File must be in langs/code_CODE/ directory. |
|
| 353 | + // 'langs'=>'mylangfile', |
|
| 354 | + // 'position'=>100, |
|
| 355 | + // // Define condition to show or hide menu entry. |
|
| 356 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 357 | + // // Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 358 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 359 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 360 | + // // if you want your menu with a permission rules |
|
| 361 | + // 'perms'=>'1', |
|
| 362 | + // 'target'=>'', |
|
| 363 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 364 | + // 'user'=>2 |
|
| 365 | + //); |
|
| 366 | + //$r++; |
|
| 367 | + // Exports |
|
| 368 | + $r = 1; |
|
| 369 | 369 | |
| 370 | - // Example: |
|
| 371 | - //$this->export_code[$r]=$this->rights_class.'_'.$r; |
|
| 372 | - //// Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 373 | - //$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; |
|
| 374 | - //// Condition to show export in list (ie: '$user->id==3'). |
|
| 375 | - //// Set to 1 to always show when module is enabled. |
|
| 376 | - //$this->export_enabled[$r]='1'; |
|
| 377 | - //$this->export_permission[$r]=array(array("facture","facture","export")); |
|
| 378 | - //$this->export_fields_array[$r]=array( |
|
| 379 | - // 's.rowid'=>"IdCompany", |
|
| 380 | - // 's.nom'=>'CompanyName', |
|
| 381 | - // 's.address'=>'Address', |
|
| 382 | - // 's.cp'=>'Zip', |
|
| 383 | - // 's.ville'=>'Town', |
|
| 384 | - // 's.fk_pays'=>'Country', |
|
| 385 | - // 's.tel'=>'Phone', |
|
| 386 | - // 's.siren'=>'ProfId1', |
|
| 387 | - // 's.siret'=>'ProfId2', |
|
| 388 | - // 's.ape'=>'ProfId3', |
|
| 389 | - // 's.idprof4'=>'ProfId4', |
|
| 390 | - // 's.code_compta'=>'CustomerAccountancyCode', |
|
| 391 | - // 's.code_compta_fournisseur'=>'SupplierAccountancyCode', |
|
| 392 | - // 'f.rowid'=>"InvoiceId", |
|
| 393 | - // 'f.facnumber'=>"InvoiceRef", |
|
| 394 | - // 'f.datec'=>"InvoiceDateCreation", |
|
| 395 | - // 'f.datef'=>"DateInvoice", |
|
| 396 | - // 'f.total'=>"TotalHT", |
|
| 397 | - // 'f.total_ttc'=>"TotalTTC", |
|
| 398 | - // 'f.tva'=>"TotalVAT", |
|
| 399 | - // 'f.paye'=>"InvoicePaid", |
|
| 400 | - // 'f.fk_statut'=>'InvoiceStatus', |
|
| 401 | - // 'f.note'=>"InvoiceNote", |
|
| 402 | - // 'fd.rowid'=>'LineId', |
|
| 403 | - // 'fd.description'=>"LineDescription", |
|
| 404 | - // 'fd.price'=>"LineUnitPrice", |
|
| 405 | - // 'fd.tva_tx'=>"LineVATRate", |
|
| 406 | - // 'fd.qty'=>"LineQty", |
|
| 407 | - // 'fd.total_ht'=>"LineTotalHT", |
|
| 408 | - // 'fd.total_tva'=>"LineTotalTVA", |
|
| 409 | - // 'fd.total_ttc'=>"LineTotalTTC", |
|
| 410 | - // 'fd.date_start'=>"DateStart", |
|
| 411 | - // 'fd.date_end'=>"DateEnd", |
|
| 412 | - // 'fd.fk_product'=>'ProductId', |
|
| 413 | - // 'p.ref'=>'ProductRef' |
|
| 414 | - //); |
|
| 415 | - //$this->export_entities_array[$r]=array('s.rowid'=>"company", |
|
| 416 | - // 's.nom'=>'company', |
|
| 417 | - // 's.address'=>'company', |
|
| 418 | - // 's.cp'=>'company', |
|
| 419 | - // 's.ville'=>'company', |
|
| 420 | - // 's.fk_pays'=>'company', |
|
| 421 | - // 's.tel'=>'company', |
|
| 422 | - // 's.siren'=>'company', |
|
| 423 | - // 's.siret'=>'company', |
|
| 424 | - // 's.ape'=>'company', |
|
| 425 | - // 's.idprof4'=>'company', |
|
| 426 | - // 's.code_compta'=>'company', |
|
| 427 | - // 's.code_compta_fournisseur'=>'company', |
|
| 428 | - // 'f.rowid'=>"invoice", |
|
| 429 | - // 'f.facnumber'=>"invoice", |
|
| 430 | - // 'f.datec'=>"invoice", |
|
| 431 | - // 'f.datef'=>"invoice", |
|
| 432 | - // 'f.total'=>"invoice", |
|
| 433 | - // 'f.total_ttc'=>"invoice", |
|
| 434 | - // 'f.tva'=>"invoice", |
|
| 435 | - // 'f.paye'=>"invoice", |
|
| 436 | - // 'f.fk_statut'=>'invoice', |
|
| 437 | - // 'f.note'=>"invoice", |
|
| 438 | - // 'fd.rowid'=>'invoice_line', |
|
| 439 | - // 'fd.description'=>"invoice_line", |
|
| 440 | - // 'fd.price'=>"invoice_line", |
|
| 441 | - // 'fd.total_ht'=>"invoice_line", |
|
| 442 | - // 'fd.total_tva'=>"invoice_line", |
|
| 443 | - // 'fd.total_ttc'=>"invoice_line", |
|
| 444 | - // 'fd.tva_tx'=>"invoice_line", |
|
| 445 | - // 'fd.qty'=>"invoice_line", |
|
| 446 | - // 'fd.date_start'=>"invoice_line", |
|
| 447 | - // 'fd.date_end'=>"invoice_line", |
|
| 448 | - // 'fd.fk_product'=>'product', |
|
| 449 | - // 'p.ref'=>'product' |
|
| 450 | - //); |
|
| 451 | - //$this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
| 452 | - //$this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'facture as f, ' |
|
| 453 | - // . MAIN_DB_PREFIX . 'facturedet as fd, ' . MAIN_DB_PREFIX . 'societe as s)'; |
|
| 454 | - //$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX |
|
| 455 | - // . 'product as p on (fd.fk_product = p.rowid)'; |
|
| 456 | - //$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid ' |
|
| 457 | - // . 'AND f.rowid = fd.fk_facture'; |
|
| 458 | - //$r++; |
|
| 459 | - } |
|
| 370 | + // Example: |
|
| 371 | + //$this->export_code[$r]=$this->rights_class.'_'.$r; |
|
| 372 | + //// Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 373 | + //$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; |
|
| 374 | + //// Condition to show export in list (ie: '$user->id==3'). |
|
| 375 | + //// Set to 1 to always show when module is enabled. |
|
| 376 | + //$this->export_enabled[$r]='1'; |
|
| 377 | + //$this->export_permission[$r]=array(array("facture","facture","export")); |
|
| 378 | + //$this->export_fields_array[$r]=array( |
|
| 379 | + // 's.rowid'=>"IdCompany", |
|
| 380 | + // 's.nom'=>'CompanyName', |
|
| 381 | + // 's.address'=>'Address', |
|
| 382 | + // 's.cp'=>'Zip', |
|
| 383 | + // 's.ville'=>'Town', |
|
| 384 | + // 's.fk_pays'=>'Country', |
|
| 385 | + // 's.tel'=>'Phone', |
|
| 386 | + // 's.siren'=>'ProfId1', |
|
| 387 | + // 's.siret'=>'ProfId2', |
|
| 388 | + // 's.ape'=>'ProfId3', |
|
| 389 | + // 's.idprof4'=>'ProfId4', |
|
| 390 | + // 's.code_compta'=>'CustomerAccountancyCode', |
|
| 391 | + // 's.code_compta_fournisseur'=>'SupplierAccountancyCode', |
|
| 392 | + // 'f.rowid'=>"InvoiceId", |
|
| 393 | + // 'f.facnumber'=>"InvoiceRef", |
|
| 394 | + // 'f.datec'=>"InvoiceDateCreation", |
|
| 395 | + // 'f.datef'=>"DateInvoice", |
|
| 396 | + // 'f.total'=>"TotalHT", |
|
| 397 | + // 'f.total_ttc'=>"TotalTTC", |
|
| 398 | + // 'f.tva'=>"TotalVAT", |
|
| 399 | + // 'f.paye'=>"InvoicePaid", |
|
| 400 | + // 'f.fk_statut'=>'InvoiceStatus', |
|
| 401 | + // 'f.note'=>"InvoiceNote", |
|
| 402 | + // 'fd.rowid'=>'LineId', |
|
| 403 | + // 'fd.description'=>"LineDescription", |
|
| 404 | + // 'fd.price'=>"LineUnitPrice", |
|
| 405 | + // 'fd.tva_tx'=>"LineVATRate", |
|
| 406 | + // 'fd.qty'=>"LineQty", |
|
| 407 | + // 'fd.total_ht'=>"LineTotalHT", |
|
| 408 | + // 'fd.total_tva'=>"LineTotalTVA", |
|
| 409 | + // 'fd.total_ttc'=>"LineTotalTTC", |
|
| 410 | + // 'fd.date_start'=>"DateStart", |
|
| 411 | + // 'fd.date_end'=>"DateEnd", |
|
| 412 | + // 'fd.fk_product'=>'ProductId', |
|
| 413 | + // 'p.ref'=>'ProductRef' |
|
| 414 | + //); |
|
| 415 | + //$this->export_entities_array[$r]=array('s.rowid'=>"company", |
|
| 416 | + // 's.nom'=>'company', |
|
| 417 | + // 's.address'=>'company', |
|
| 418 | + // 's.cp'=>'company', |
|
| 419 | + // 's.ville'=>'company', |
|
| 420 | + // 's.fk_pays'=>'company', |
|
| 421 | + // 's.tel'=>'company', |
|
| 422 | + // 's.siren'=>'company', |
|
| 423 | + // 's.siret'=>'company', |
|
| 424 | + // 's.ape'=>'company', |
|
| 425 | + // 's.idprof4'=>'company', |
|
| 426 | + // 's.code_compta'=>'company', |
|
| 427 | + // 's.code_compta_fournisseur'=>'company', |
|
| 428 | + // 'f.rowid'=>"invoice", |
|
| 429 | + // 'f.facnumber'=>"invoice", |
|
| 430 | + // 'f.datec'=>"invoice", |
|
| 431 | + // 'f.datef'=>"invoice", |
|
| 432 | + // 'f.total'=>"invoice", |
|
| 433 | + // 'f.total_ttc'=>"invoice", |
|
| 434 | + // 'f.tva'=>"invoice", |
|
| 435 | + // 'f.paye'=>"invoice", |
|
| 436 | + // 'f.fk_statut'=>'invoice', |
|
| 437 | + // 'f.note'=>"invoice", |
|
| 438 | + // 'fd.rowid'=>'invoice_line', |
|
| 439 | + // 'fd.description'=>"invoice_line", |
|
| 440 | + // 'fd.price'=>"invoice_line", |
|
| 441 | + // 'fd.total_ht'=>"invoice_line", |
|
| 442 | + // 'fd.total_tva'=>"invoice_line", |
|
| 443 | + // 'fd.total_ttc'=>"invoice_line", |
|
| 444 | + // 'fd.tva_tx'=>"invoice_line", |
|
| 445 | + // 'fd.qty'=>"invoice_line", |
|
| 446 | + // 'fd.date_start'=>"invoice_line", |
|
| 447 | + // 'fd.date_end'=>"invoice_line", |
|
| 448 | + // 'fd.fk_product'=>'product', |
|
| 449 | + // 'p.ref'=>'product' |
|
| 450 | + //); |
|
| 451 | + //$this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
| 452 | + //$this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'facture as f, ' |
|
| 453 | + // . MAIN_DB_PREFIX . 'facturedet as fd, ' . MAIN_DB_PREFIX . 'societe as s)'; |
|
| 454 | + //$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX |
|
| 455 | + // . 'product as p on (fd.fk_product = p.rowid)'; |
|
| 456 | + //$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid ' |
|
| 457 | + // . 'AND f.rowid = fd.fk_facture'; |
|
| 458 | + //$r++; |
|
| 459 | + } |
|
| 460 | 460 | |
| 461 | - /** |
|
| 462 | - * Function called when module is enabled. |
|
| 463 | - * The init function add constants, boxes, permissions and menus |
|
| 464 | - * (defined in constructor) into Dolibarr database. |
|
| 465 | - * It also creates data directories |
|
| 466 | - * |
|
| 467 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
| 468 | - * @return int 1 if OK, 0 if KO |
|
| 469 | - */ |
|
| 470 | - public function init($options = '') |
|
| 471 | - { |
|
| 461 | + /** |
|
| 462 | + * Function called when module is enabled. |
|
| 463 | + * The init function add constants, boxes, permissions and menus |
|
| 464 | + * (defined in constructor) into Dolibarr database. |
|
| 465 | + * It also creates data directories |
|
| 466 | + * |
|
| 467 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
| 468 | + * @return int 1 if OK, 0 if KO |
|
| 469 | + */ |
|
| 470 | + public function init($options = '') |
|
| 471 | + { |
|
| 472 | 472 | global $conf, $db; |
| 473 | 473 | |
| 474 | 474 | |
@@ -476,46 +476,46 @@ discard block |
||
| 476 | 476 | exit("Attention, ce module rentre ne conflit avec le module Jalon/Milestones. Merci de le désactiver auparavant."); |
| 477 | 477 | } |
| 478 | 478 | */ |
| 479 | - $sql = array(); |
|
| 479 | + $sql = array(); |
|
| 480 | 480 | |
| 481 | - $result = $this->loadTables(); |
|
| 482 | - dol_include_once('/core/class/extrafields.class.php'); |
|
| 481 | + $result = $this->loadTables(); |
|
| 482 | + dol_include_once('/core/class/extrafields.class.php'); |
|
| 483 | 483 | |
| 484 | - $extra = new ExtraFields($db); // propaldet, commandedet, facturedet |
|
| 485 | - $TElementType = array('propaldet', 'commandedet', 'facturedet', 'supplier_proposaldet', 'commande_fournisseurdet', 'facture_fourn_det'); |
|
| 486 | - foreach($TElementType as $element_type) { |
|
| 487 | - $extra->addExtraField('show_total_ht', 'Afficher le Total HT sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 488 | - $extra->addExtraField('show_reduc', 'Afficher la réduction sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 489 | - } |
|
| 484 | + $extra = new ExtraFields($db); // propaldet, commandedet, facturedet |
|
| 485 | + $TElementType = array('propaldet', 'commandedet', 'facturedet', 'supplier_proposaldet', 'commande_fournisseurdet', 'facture_fourn_det'); |
|
| 486 | + foreach($TElementType as $element_type) { |
|
| 487 | + $extra->addExtraField('show_total_ht', 'Afficher le Total HT sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 488 | + $extra->addExtraField('show_reduc', 'Afficher la réduction sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 489 | + } |
|
| 490 | 490 | |
| 491 | - return $this->_init($sql, $options); |
|
| 492 | - } |
|
| 491 | + return $this->_init($sql, $options); |
|
| 492 | + } |
|
| 493 | 493 | |
| 494 | - /** |
|
| 495 | - * Function called when module is disabled. |
|
| 496 | - * Remove from database constants, boxes and permissions from Dolibarr database. |
|
| 497 | - * Data directories are not deleted |
|
| 498 | - * |
|
| 499 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
| 500 | - * @return int 1 if OK, 0 if KO |
|
| 501 | - */ |
|
| 502 | - public function remove($options = '') |
|
| 503 | - { |
|
| 504 | - $sql = array(); |
|
| 494 | + /** |
|
| 495 | + * Function called when module is disabled. |
|
| 496 | + * Remove from database constants, boxes and permissions from Dolibarr database. |
|
| 497 | + * Data directories are not deleted |
|
| 498 | + * |
|
| 499 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
| 500 | + * @return int 1 if OK, 0 if KO |
|
| 501 | + */ |
|
| 502 | + public function remove($options = '') |
|
| 503 | + { |
|
| 504 | + $sql = array(); |
|
| 505 | 505 | |
| 506 | - return $this->_remove($sql, $options); |
|
| 507 | - } |
|
| 506 | + return $this->_remove($sql, $options); |
|
| 507 | + } |
|
| 508 | 508 | |
| 509 | - /** |
|
| 510 | - * Create tables, keys and data required by module |
|
| 511 | - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
| 512 | - * and create data commands must be stored in directory /titre/sql/ |
|
| 513 | - * This function is called by this->init |
|
| 514 | - * |
|
| 515 | - * @return int <=0 if KO, >0 if OK |
|
| 516 | - */ |
|
| 517 | - private function loadTables() |
|
| 518 | - { |
|
| 519 | - return $this->_load_tables('/subtotal/sql/'); |
|
| 520 | - } |
|
| 509 | + /** |
|
| 510 | + * Create tables, keys and data required by module |
|
| 511 | + * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
| 512 | + * and create data commands must be stored in directory /titre/sql/ |
|
| 513 | + * This function is called by this->init |
|
| 514 | + * |
|
| 515 | + * @return int <=0 if KO, >0 if OK |
|
| 516 | + */ |
|
| 517 | + private function loadTables() |
|
| 518 | + { |
|
| 519 | + return $this->_load_tables('/subtotal/sql/'); |
|
| 520 | + } |
|
| 521 | 521 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * \ingroup titre |
| 24 | 24 | * \brief Description and activation file for module titre |
| 25 | 25 | */ |
| 26 | -include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"; |
|
| 26 | +include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Description and activation class for module titre |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $this->version = '3.3.1'; |
| 67 | 67 | // Key used in llx_const table to save module status enabled/disabled |
| 68 | 68 | // (where MYMODULE is value of property name of module in uppercase) |
| 69 | - $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 69 | + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); |
|
| 70 | 70 | // Where to store the module in setup page |
| 71 | 71 | // (0=common,1=interface,2=others,3=very specific) |
| 72 | 72 | $this->special = 2; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | // List of modules id that must be enabled if this module is enabled |
| 131 | 131 | $this->depends = array(); |
| 132 | 132 | |
| 133 | - $this->conflictwith=array('modMilestone'); |
|
| 133 | + $this->conflictwith = array('modMilestone'); |
|
| 134 | 134 | // List of modules id to disable if this one is disabled |
| 135 | 135 | $this->requiredby = array(); |
| 136 | 136 | // Minimum version of PHP required by module |
@@ -195,20 +195,20 @@ discard block |
||
| 195 | 195 | // 'categories_x' to add a tab in category view |
| 196 | 196 | // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
| 197 | 197 | // Dictionnaries |
| 198 | - if (! isset($conf->subtotal->enabled)) { |
|
| 199 | - $conf->subtotal=new stdClass(); |
|
| 198 | + if (!isset($conf->subtotal->enabled)) { |
|
| 199 | + $conf->subtotal = new stdClass(); |
|
| 200 | 200 | $conf->subtotal->enabled = 0; |
| 201 | 201 | } |
| 202 | 202 | $this->dictionaries = array( |
| 203 | 203 | 'langs'=>'subtotal@subtotal', |
| 204 | - 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 205 | - 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 206 | - 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 207 | - 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 208 | - 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 209 | - 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 210 | - 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 211 | - 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 204 | + 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 205 | + 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 206 | + 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 207 | + 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 208 | + 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 209 | + 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 210 | + 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 211 | + 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 212 | 212 | 'tabcond'=>array($conf->subtotal->enabled) |
| 213 | 213 | ); |
| 214 | 214 | /* Example: |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | $extra = new ExtraFields($db); // propaldet, commandedet, facturedet |
| 485 | 485 | $TElementType = array('propaldet', 'commandedet', 'facturedet', 'supplier_proposaldet', 'commande_fournisseurdet', 'facture_fourn_det'); |
| 486 | - foreach($TElementType as $element_type) { |
|
| 486 | + foreach ($TElementType as $element_type) { |
|
| 487 | 487 | $extra->addExtraField('show_total_ht', 'Afficher le Total HT sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
| 488 | 488 | $extra->addExtraField('show_reduc', 'Afficher la réduction sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
| 489 | 489 | } |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | if ($object->id != $line->id && $line->rang > $rang) |
| 108 | 108 | { |
| 109 | 109 | // Update du rang de toutes les lignes suivant mon titre |
| 110 | - $parent->updateRangOfLine($line->id, $line->rang+1); |
|
| 110 | + $parent->updateRangOfLine($line->id, $line->rang + 1); |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // Update du rang de la ligne fraichement ajouté pour la déplacer sous mon titre |
| 115 | - $parent->updateRangOfLine($object->id, $rang+1); |
|
| 116 | - $object->rang = $rang+1; |
|
| 115 | + $parent->updateRangOfLine($object->id, $rang + 1); |
|
| 116 | + $object->rang = $rang + 1; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function addToEnd(&$parent, &$object, $rang) |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | if ($subtotal_line_found) |
| 138 | 138 | { |
| 139 | - $parent->updateRangOfLine($line->id, $line->rang+1); |
|
| 139 | + $parent->updateRangOfLine($line->id, $line->rang + 1); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $current_fk_commande = TSubtotal::getOrderIdFromLineId($this->db, $object->origin_id, $is_supplier); |
| 222 | 222 | $last_fk_commandedet = TSubtotal::getLastLineOrderId($this->db, $current_fk_commande, $is_supplier); |
| 223 | 223 | |
| 224 | - if (!$is_supplier){ |
|
| 224 | + if (!$is_supplier) { |
|
| 225 | 225 | $facture = new Facture($this->db); |
| 226 | 226 | $ret = $facture->fetch($object->fk_facture); |
| 227 | 227 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | { |
| 236 | 236 | $rang = !empty($subtotal_current_rang) ? $subtotal_current_rang : $object->rang; |
| 237 | 237 | // Si le fk_commande courrant est différent alors on change de commande => ajout d'un titre |
| 238 | - if ($current_fk_commande != $subtotal_bloc_previous_fk_commande ) { |
|
| 238 | + if ($current_fk_commande != $subtotal_bloc_previous_fk_commande) { |
|
| 239 | 239 | if (!$is_supplier) $commande = new Commande($this->db); |
| 240 | 240 | else $commande = new CommandeFournisseur($this->db); |
| 241 | 241 | $commande->fetch($current_fk_commande); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | } |
| 248 | 248 | $label = str_replace(array('__REFORDER__', '__REFCUSTOMER__'), array($commande->ref, $commande->ref_client), $label); |
| 249 | 249 | |
| 250 | - if(!empty($current_fk_commande)) { |
|
| 250 | + if (!empty($current_fk_commande)) { |
|
| 251 | 251 | $subtotal_skip = true; |
| 252 | 252 | TSubtotal::addTitle($facture, $label, 1, $rang); |
| 253 | 253 | $rang++; |
@@ -286,14 +286,14 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | if (!empty($conf->global->SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS) && in_array($action, array('LINEPROPAL_INSERT', 'LINEPROPAL_UPDATE', 'LINEORDER_INSERT', 'LINEORDER_UPDATE', 'LINEBILL_INSERT', 'LINEBILL_UPDATE', 'LINEBILL_SUPPLIER_CREATE', 'LINEBILL_SUPPLIER_UPDATE'))) |
| 288 | 288 | { |
| 289 | - if(! function_exists('_updateLineNC')) dol_include_once('/subtotal/lib/subtotal.lib.php'); |
|
| 289 | + if (!function_exists('_updateLineNC')) dol_include_once('/subtotal/lib/subtotal.lib.php'); |
|
| 290 | 290 | |
| 291 | 291 | $doli_action = GETPOST('action'); |
| 292 | 292 | $set = GETPOST('set'); |
| 293 | - if ( (in_array($doli_action, array('updateligne', 'updateline', 'addline', 'add', 'create', 'setstatut', 'save_nomenclature')) || $set == 'defaultTVA') && !TSubtotal::isTitle($object) && !TSubtotal::isSubtotal($object) && in_array($object->element, array('propaldet', 'commandedet', 'facturedet'))) |
|
| 293 | + if ((in_array($doli_action, array('updateligne', 'updateline', 'addline', 'add', 'create', 'setstatut', 'save_nomenclature')) || $set == 'defaultTVA') && !TSubtotal::isTitle($object) && !TSubtotal::isSubtotal($object) && in_array($object->element, array('propaldet', 'commandedet', 'facturedet'))) |
|
| 294 | 294 | { |
| 295 | 295 | dol_syslog( |
| 296 | - "[SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS] Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". object=".$object->element." id=" . $object->id |
|
| 296 | + "[SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS] Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". object=".$object->element." id=".$object->id |
|
| 297 | 297 | ); |
| 298 | 298 | |
| 299 | 299 | $TTitle = TSubtotal::getAllTitleFromLine($object); |
@@ -313,9 +313,9 @@ discard block |
||
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // $object correspond à la ligne ajoutée |
| 316 | - if(empty($object->array_options)) $object->fetch_optionals(); |
|
| 316 | + if (empty($object->array_options)) $object->fetch_optionals(); |
|
| 317 | 317 | |
| 318 | - if(! empty($object->array_options['options_subtotal_nc'])) { |
|
| 318 | + if (!empty($object->array_options['options_subtotal_nc'])) { |
|
| 319 | 319 | $object->total_ht = $object->total_tva = $object->total_ttc = $object->total_localtax1 = $object->total_localtax2 = |
| 320 | 320 | $object->multicurrency_total_ht = $object->multicurrency_total_tva = $object->multicurrency_total_ttc = 0; |
| 321 | 321 | |
@@ -327,11 +327,11 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | // Correction d'un bug lors de la création d'une commande depuis une propale qui a, au moins, une ligne NC |
| 329 | 329 | $parent_element = ''; |
| 330 | - if($object->element == 'propaldet') $parent_element = 'propal'; |
|
| 331 | - if($object->element == 'commandedet') $parent_element = 'commande'; |
|
| 332 | - if($object->element == 'facturedet') $parent_element = 'facture'; |
|
| 330 | + if ($object->element == 'propaldet') $parent_element = 'propal'; |
|
| 331 | + if ($object->element == 'commandedet') $parent_element = 'commande'; |
|
| 332 | + if ($object->element == 'facturedet') $parent_element = 'facture'; |
|
| 333 | 333 | |
| 334 | - if(! empty($parent_element) && ! empty($object->array_options['options_subtotal_nc'])) { |
|
| 334 | + if (!empty($parent_element) && !empty($object->array_options['options_subtotal_nc'])) { |
|
| 335 | 335 | _updateLineNC($parent_element, $object->{'fk_'.$parent_element}, $object->id, $object->array_options['options_subtotal_nc'], 1); |
| 336 | 336 | } |
| 337 | 337 | } |
@@ -339,12 +339,12 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | // Les lignes libres (y compris les sous-totaux) créées à partir d'une facture modèle n'ont pas la TVA de la ligne du modèle mais la TVA par défaut |
| 341 | 341 | if ($action == 'BILL_CREATE' && $object->fac_rec > 0) { |
| 342 | - dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); |
|
| 342 | + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); |
|
| 343 | 343 | |
| 344 | 344 | $object->fetch_lines(); // Lignes pas rajoutées à $object->lines par les appels à addline(); |
| 345 | 345 | |
| 346 | - foreach($object->lines as &$line) { |
|
| 347 | - if(TSubtotal::isSubtotal($line) && ! empty($line->tva_tx)) { |
|
| 346 | + foreach ($object->lines as &$line) { |
|
| 347 | + if (TSubtotal::isSubtotal($line) && !empty($line->tva_tx)) { |
|
| 348 | 348 | $line->tva_tx = 0; |
| 349 | 349 | $line->update(); |
| 350 | 350 | } |
@@ -354,170 +354,170 @@ discard block |
||
| 354 | 354 | |
| 355 | 355 | if ($action == 'USER_LOGIN') { |
| 356 | 356 | dol_syslog( |
| 357 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 357 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 358 | 358 | ); |
| 359 | 359 | } elseif ($action == 'USER_UPDATE_SESSION') { |
| 360 | 360 | // Warning: To increase performances, this action is triggered only if |
| 361 | 361 | // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. |
| 362 | 362 | dol_syslog( |
| 363 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 363 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 364 | 364 | ); |
| 365 | 365 | } elseif ($action == 'USER_CREATE') { |
| 366 | 366 | dol_syslog( |
| 367 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 367 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 368 | 368 | ); |
| 369 | 369 | } elseif ($action == 'USER_CREATE_FROM_CONTACT') { |
| 370 | 370 | dol_syslog( |
| 371 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 371 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 372 | 372 | ); |
| 373 | 373 | } elseif ($action == 'USER_MODIFY') { |
| 374 | 374 | dol_syslog( |
| 375 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 375 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 376 | 376 | ); |
| 377 | 377 | } elseif ($action == 'USER_NEW_PASSWORD') { |
| 378 | 378 | dol_syslog( |
| 379 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 379 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 380 | 380 | ); |
| 381 | 381 | } elseif ($action == 'USER_ENABLEDISABLE') { |
| 382 | 382 | dol_syslog( |
| 383 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 383 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 384 | 384 | ); |
| 385 | 385 | } elseif ($action == 'USER_DELETE') { |
| 386 | 386 | dol_syslog( |
| 387 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 387 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 388 | 388 | ); |
| 389 | 389 | } elseif ($action == 'USER_LOGOUT') { |
| 390 | 390 | dol_syslog( |
| 391 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 391 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 392 | 392 | ); |
| 393 | 393 | } elseif ($action == 'USER_SETINGROUP') { |
| 394 | 394 | dol_syslog( |
| 395 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 395 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 396 | 396 | ); |
| 397 | 397 | } elseif ($action == 'USER_REMOVEFROMGROUP') { |
| 398 | 398 | dol_syslog( |
| 399 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 399 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 400 | 400 | ); |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | // Groups |
| 404 | 404 | elseif ($action == 'GROUP_CREATE') { |
| 405 | 405 | dol_syslog( |
| 406 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 406 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 407 | 407 | ); |
| 408 | 408 | } elseif ($action == 'GROUP_MODIFY') { |
| 409 | 409 | dol_syslog( |
| 410 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 410 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 411 | 411 | ); |
| 412 | 412 | } elseif ($action == 'GROUP_DELETE') { |
| 413 | 413 | dol_syslog( |
| 414 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 414 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 415 | 415 | ); |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | // Companies |
| 419 | 419 | elseif ($action == 'COMPANY_CREATE') { |
| 420 | 420 | dol_syslog( |
| 421 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 421 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 422 | 422 | ); |
| 423 | 423 | } elseif ($action == 'COMPANY_MODIFY') { |
| 424 | 424 | dol_syslog( |
| 425 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 425 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 426 | 426 | ); |
| 427 | 427 | } elseif ($action == 'COMPANY_DELETE') { |
| 428 | 428 | dol_syslog( |
| 429 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 429 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 430 | 430 | ); |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | // Contacts |
| 434 | 434 | elseif ($action == 'CONTACT_CREATE') { |
| 435 | 435 | dol_syslog( |
| 436 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 436 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 437 | 437 | ); |
| 438 | 438 | } elseif ($action == 'CONTACT_MODIFY') { |
| 439 | 439 | dol_syslog( |
| 440 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 440 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 441 | 441 | ); |
| 442 | 442 | } elseif ($action == 'CONTACT_DELETE') { |
| 443 | 443 | dol_syslog( |
| 444 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 444 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 445 | 445 | ); |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | // Products |
| 449 | 449 | elseif ($action == 'PRODUCT_CREATE') { |
| 450 | 450 | dol_syslog( |
| 451 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 451 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 452 | 452 | ); |
| 453 | 453 | } elseif ($action == 'PRODUCT_MODIFY') { |
| 454 | 454 | dol_syslog( |
| 455 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 455 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 456 | 456 | ); |
| 457 | 457 | } elseif ($action == 'PRODUCT_DELETE') { |
| 458 | 458 | dol_syslog( |
| 459 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 459 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 460 | 460 | ); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | // Customer orders |
| 464 | 464 | elseif ($action == 'ORDER_CREATE') { |
| 465 | 465 | dol_syslog( |
| 466 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 466 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 467 | 467 | ); |
| 468 | 468 | } elseif ($action == 'ORDER_VALIDATE') { |
| 469 | 469 | dol_syslog( |
| 470 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 470 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 471 | 471 | ); |
| 472 | 472 | } elseif ($action == 'ORDER_DELETE') { |
| 473 | 473 | dol_syslog( |
| 474 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 474 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 475 | 475 | ); |
| 476 | 476 | } elseif ($action == 'ORDER_BUILDDOC') { |
| 477 | 477 | dol_syslog( |
| 478 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 478 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 479 | 479 | ); |
| 480 | 480 | } elseif ($action == 'ORDER_SENTBYMAIL') { |
| 481 | 481 | dol_syslog( |
| 482 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 482 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 483 | 483 | ); |
| 484 | 484 | } elseif ($action == 'LINEORDER_INSERT') { |
| 485 | 485 | dol_syslog( |
| 486 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 486 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 487 | 487 | ); |
| 488 | 488 | } elseif ($action == 'LINEORDER_DELETE') { |
| 489 | 489 | dol_syslog( |
| 490 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 490 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 491 | 491 | ); |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | // Supplier orders |
| 495 | 495 | elseif ($action == 'ORDER_SUPPLIER_CREATE') { |
| 496 | 496 | dol_syslog( |
| 497 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 497 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 498 | 498 | ); |
| 499 | 499 | } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { |
| 500 | 500 | dol_syslog( |
| 501 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 501 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 502 | 502 | ); |
| 503 | 503 | } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { |
| 504 | 504 | dol_syslog( |
| 505 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 505 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 506 | 506 | ); |
| 507 | 507 | } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') { |
| 508 | 508 | dol_syslog( |
| 509 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 509 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 510 | 510 | ); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | // Proposals |
| 514 | 514 | elseif ($action == 'PROPAL_CREATE') { |
| 515 | 515 | dol_syslog( |
| 516 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 516 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 517 | 517 | ); |
| 518 | 518 | } elseif (in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) { |
| 519 | 519 | dol_syslog( |
| 520 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 520 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 521 | 521 | ); |
| 522 | 522 | |
| 523 | 523 | $doli_action = GETPOST('action'); |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | if (!empty($conf->global->SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS) && in_array($doli_action, array('confirm_clone'))) |
| 526 | 526 | { |
| 527 | 527 | dol_syslog( |
| 528 | - "[SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS] Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". object=".$object->element." id=" . $object->id |
|
| 528 | + "[SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS] Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". object=".$object->element." id=".$object->id |
|
| 529 | 529 | ); |
| 530 | 530 | |
| 531 | 531 | // En fonction de l'objet et de la version, les lignes conservent l'id de l'objet d'origine |
@@ -553,76 +553,76 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | } elseif ($action == 'PROPAL_MODIFY') { |
| 555 | 555 | dol_syslog( |
| 556 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 556 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 557 | 557 | ); |
| 558 | 558 | } elseif ($action == 'PROPAL_VALIDATE') { |
| 559 | 559 | dol_syslog( |
| 560 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 560 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 561 | 561 | ); |
| 562 | 562 | } elseif ($action == 'PROPAL_BUILDDOC') { |
| 563 | 563 | dol_syslog( |
| 564 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 564 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 565 | 565 | ); |
| 566 | 566 | } elseif ($action == 'PROPAL_SENTBYMAIL') { |
| 567 | 567 | dol_syslog( |
| 568 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 568 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 569 | 569 | ); |
| 570 | 570 | } elseif ($action == 'PROPAL_CLOSE_SIGNED') { |
| 571 | 571 | dol_syslog( |
| 572 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 572 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 573 | 573 | ); |
| 574 | 574 | } elseif ($action == 'PROPAL_CLOSE_REFUSED') { |
| 575 | 575 | dol_syslog( |
| 576 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 576 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 577 | 577 | ); |
| 578 | 578 | } elseif ($action == 'PROPAL_DELETE') { |
| 579 | 579 | dol_syslog( |
| 580 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 580 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 581 | 581 | ); |
| 582 | 582 | } elseif ($action == 'LINEPROPAL_INSERT') { |
| 583 | 583 | dol_syslog( |
| 584 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 584 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 585 | 585 | ); |
| 586 | 586 | } elseif ($action == 'LINEPROPAL_MODIFY') { |
| 587 | 587 | dol_syslog( |
| 588 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 588 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 589 | 589 | ); |
| 590 | 590 | } elseif ($action == 'LINEPROPAL_DELETE') { |
| 591 | 591 | dol_syslog( |
| 592 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 592 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 593 | 593 | ); |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | // Contracts |
| 597 | 597 | elseif ($action == 'CONTRACT_CREATE') { |
| 598 | 598 | dol_syslog( |
| 599 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 599 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 600 | 600 | ); |
| 601 | 601 | } elseif ($action == 'CONTRACT_MODIFY') { |
| 602 | 602 | dol_syslog( |
| 603 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 603 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 604 | 604 | ); |
| 605 | 605 | } elseif ($action == 'CONTRACT_ACTIVATE') { |
| 606 | 606 | dol_syslog( |
| 607 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 607 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 608 | 608 | ); |
| 609 | 609 | } elseif ($action == 'CONTRACT_CANCEL') { |
| 610 | 610 | dol_syslog( |
| 611 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 611 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 612 | 612 | ); |
| 613 | 613 | } elseif ($action == 'CONTRACT_CLOSE') { |
| 614 | 614 | dol_syslog( |
| 615 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 615 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 616 | 616 | ); |
| 617 | 617 | } elseif ($action == 'CONTRACT_DELETE') { |
| 618 | 618 | dol_syslog( |
| 619 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 619 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 620 | 620 | ); |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | elseif ($action == 'BILL_MODIFY') { |
| 624 | 624 | dol_syslog( |
| 625 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 625 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 626 | 626 | ); |
| 627 | 627 | |
| 628 | 628 | |
@@ -631,213 +631,213 @@ discard block |
||
| 631 | 631 | if (!empty($conf->global->INVOICE_USE_SITUATION) && $object->element == 'facture' && $object->type == Facture::TYPE_SITUATION) |
| 632 | 632 | { |
| 633 | 633 | $object->situation_final = 1; |
| 634 | - foreach($object->lines as $i => $line) { |
|
| 635 | - if(!TSubtotal::isModSubtotalLine($line) && $line->situation_percent != 100){ |
|
| 634 | + foreach ($object->lines as $i => $line) { |
|
| 635 | + if (!TSubtotal::isModSubtotalLine($line) && $line->situation_percent != 100) { |
|
| 636 | 636 | $object->situation_final = 0; |
| 637 | 637 | break; |
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | // ne pas utiliser $object->setFinal ne peut pas marcher |
| 641 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $object->situation_final . ' where rowid = ' . $object->id; |
|
| 642 | - $resql=$object->db->query($sql); |
|
| 641 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET situation_final = '.$object->situation_final.' where rowid = '.$object->id; |
|
| 642 | + $resql = $object->db->query($sql); |
|
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | |
| 646 | 646 | } elseif ($action == 'BILL_VALIDATE') { |
| 647 | 647 | dol_syslog( |
| 648 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 648 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 649 | 649 | ); |
| 650 | 650 | } elseif ($action == 'BILL_BUILDDOC') { |
| 651 | 651 | dol_syslog( |
| 652 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 652 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 653 | 653 | ); |
| 654 | 654 | } elseif ($action == 'BILL_SENTBYMAIL') { |
| 655 | 655 | dol_syslog( |
| 656 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 656 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 657 | 657 | ); |
| 658 | 658 | } elseif ($action == 'BILL_CANCEL') { |
| 659 | 659 | dol_syslog( |
| 660 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 660 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 661 | 661 | ); |
| 662 | 662 | } elseif ($action == 'BILL_DELETE') { |
| 663 | 663 | dol_syslog( |
| 664 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 664 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 665 | 665 | ); |
| 666 | 666 | } elseif ($action == 'LINEBILL_INSERT') { |
| 667 | 667 | |
| 668 | 668 | dol_syslog( |
| 669 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 669 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 670 | 670 | ); |
| 671 | 671 | } elseif ($action == 'LINEBILL_DELETE') { |
| 672 | 672 | dol_syslog( |
| 673 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 673 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 674 | 674 | ); |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | // Payments |
| 678 | 678 | elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { |
| 679 | 679 | dol_syslog( |
| 680 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 680 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 681 | 681 | ); |
| 682 | 682 | } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') { |
| 683 | 683 | dol_syslog( |
| 684 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 684 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 685 | 685 | ); |
| 686 | 686 | } elseif ($action == 'PAYMENT_ADD_TO_BANK') { |
| 687 | 687 | dol_syslog( |
| 688 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 688 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 689 | 689 | ); |
| 690 | 690 | } elseif ($action == 'PAYMENT_DELETE') { |
| 691 | 691 | dol_syslog( |
| 692 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 692 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 693 | 693 | ); |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | // Interventions |
| 697 | 697 | elseif ($action == 'FICHEINTER_CREATE') { |
| 698 | 698 | dol_syslog( |
| 699 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 699 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 700 | 700 | ); |
| 701 | 701 | } elseif ($action == 'FICHEINTER_MODIFY') { |
| 702 | 702 | dol_syslog( |
| 703 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 703 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 704 | 704 | ); |
| 705 | 705 | } elseif ($action == 'FICHEINTER_VALIDATE') { |
| 706 | 706 | dol_syslog( |
| 707 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 707 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 708 | 708 | ); |
| 709 | 709 | } elseif ($action == 'FICHEINTER_DELETE') { |
| 710 | 710 | dol_syslog( |
| 711 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 711 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 712 | 712 | ); |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | // Members |
| 716 | 716 | elseif ($action == 'MEMBER_CREATE') { |
| 717 | 717 | dol_syslog( |
| 718 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 718 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 719 | 719 | ); |
| 720 | 720 | } elseif ($action == 'MEMBER_VALIDATE') { |
| 721 | 721 | dol_syslog( |
| 722 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 722 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 723 | 723 | ); |
| 724 | 724 | } elseif ($action == 'MEMBER_SUBSCRIPTION') { |
| 725 | 725 | dol_syslog( |
| 726 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 726 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 727 | 727 | ); |
| 728 | 728 | } elseif ($action == 'MEMBER_MODIFY') { |
| 729 | 729 | dol_syslog( |
| 730 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 730 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 731 | 731 | ); |
| 732 | 732 | } elseif ($action == 'MEMBER_NEW_PASSWORD') { |
| 733 | 733 | dol_syslog( |
| 734 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 734 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 735 | 735 | ); |
| 736 | 736 | } elseif ($action == 'MEMBER_RESILIATE') { |
| 737 | 737 | dol_syslog( |
| 738 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 738 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 739 | 739 | ); |
| 740 | 740 | } elseif ($action == 'MEMBER_DELETE') { |
| 741 | 741 | dol_syslog( |
| 742 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 742 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 743 | 743 | ); |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | // Categories |
| 747 | 747 | elseif ($action == 'CATEGORY_CREATE') { |
| 748 | 748 | dol_syslog( |
| 749 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 749 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 750 | 750 | ); |
| 751 | 751 | } elseif ($action == 'CATEGORY_MODIFY') { |
| 752 | 752 | dol_syslog( |
| 753 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 753 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 754 | 754 | ); |
| 755 | 755 | } elseif ($action == 'CATEGORY_DELETE') { |
| 756 | 756 | dol_syslog( |
| 757 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 757 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 758 | 758 | ); |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | // Projects |
| 762 | 762 | elseif ($action == 'PROJECT_CREATE') { |
| 763 | 763 | dol_syslog( |
| 764 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 764 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 765 | 765 | ); |
| 766 | 766 | } elseif ($action == 'PROJECT_MODIFY') { |
| 767 | 767 | dol_syslog( |
| 768 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 768 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 769 | 769 | ); |
| 770 | 770 | } elseif ($action == 'PROJECT_DELETE') { |
| 771 | 771 | dol_syslog( |
| 772 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 772 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 773 | 773 | ); |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | // Project tasks |
| 777 | 777 | elseif ($action == 'TASK_CREATE') { |
| 778 | 778 | dol_syslog( |
| 779 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 779 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 780 | 780 | ); |
| 781 | 781 | } elseif ($action == 'TASK_MODIFY') { |
| 782 | 782 | dol_syslog( |
| 783 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 783 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 784 | 784 | ); |
| 785 | 785 | } elseif ($action == 'TASK_DELETE') { |
| 786 | 786 | dol_syslog( |
| 787 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 787 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 788 | 788 | ); |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | // Task time spent |
| 792 | 792 | elseif ($action == 'TASK_TIMESPENT_CREATE') { |
| 793 | 793 | dol_syslog( |
| 794 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 794 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 795 | 795 | ); |
| 796 | 796 | } elseif ($action == 'TASK_TIMESPENT_MODIFY') { |
| 797 | 797 | dol_syslog( |
| 798 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 798 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 799 | 799 | ); |
| 800 | 800 | } elseif ($action == 'TASK_TIMESPENT_DELETE') { |
| 801 | 801 | dol_syslog( |
| 802 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 802 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 803 | 803 | ); |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | // Shipping |
| 807 | 807 | elseif ($action == 'SHIPPING_CREATE') { |
| 808 | 808 | dol_syslog( |
| 809 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 809 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 810 | 810 | ); |
| 811 | 811 | } elseif ($action == 'SHIPPING_MODIFY') { |
| 812 | 812 | dol_syslog( |
| 813 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 813 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 814 | 814 | ); |
| 815 | 815 | } elseif ($action == 'SHIPPING_VALIDATE') { |
| 816 | 816 | dol_syslog( |
| 817 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 817 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 818 | 818 | ); |
| 819 | 819 | } elseif ($action == 'SHIPPING_SENTBYMAIL') { |
| 820 | 820 | dol_syslog( |
| 821 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 821 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 822 | 822 | ); |
| 823 | 823 | } elseif ($action == 'SHIPPING_DELETE') { |
| 824 | 824 | dol_syslog( |
| 825 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 825 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 826 | 826 | ); |
| 827 | 827 | } elseif ($action == 'SHIPPING_BUILDDOC') { |
| 828 | 828 | dol_syslog( |
| 829 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 829 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 830 | 830 | ); |
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | // File |
| 834 | 834 | elseif ($action == 'FILE_UPLOAD') { |
| 835 | 835 | dol_syslog( |
| 836 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 836 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 837 | 837 | ); |
| 838 | 838 | } elseif ($action == 'FILE_DELETE') { |
| 839 | 839 | dol_syslog( |
| 840 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 840 | + "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id |
|
| 841 | 841 | ); |
| 842 | 842 | } |
| 843 | 843 | |