From 7318d0fbc01fd0d2cef26c3e4ed65b06ebf9b2e2 Mon Sep 17 00:00:00 2001 From: Andrelec1 Date: Fri, 1 Aug 2014 15:13:21 +0200 Subject: [PATCH 01/21] Highliting IBAN (sepa) Highliting IBAN code in pdf ( SEPA ) --- htdocs/core/lib/pdf.lib.php | 266 +++++++++++++++++++----------------- 1 file changed, 139 insertions(+), 127 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 543c2f5ef43..fb4d67d3f14 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -492,154 +492,166 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) */ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default_font_size=10) { - global $mysoc, $conf; + global $mysoc, $conf; - $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); - $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); + $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); - $pdf->SetXY($curx, $cury); + $pdf->SetXY($curx, $cury); - if (empty($onlynumber)) - { - $pdf->SetFont('','B',$default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); - $cury+=4; - } + if (empty($onlynumber)) + { + $pdf->SetFont('','B',$default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); + $cury+=4; + } - $outputlangs->load("banks"); + $outputlangs->load("banks"); - // Get format of bank account according to its country - $usedetailedbban=$account->useDetailedBBAN(); + // Get format of bank account according to its country + $usedetailedbban=$account->useDetailedBBAN(); - //$onlynumber=0; $usedetailedbban=0; // For tests - if ($usedetailedbban) - { - $savcurx=$curx; + //$onlynumber=0; $usedetailedbban=0; // For tests + if ($usedetailedbban) + { + $savcurx=$curx; - if (empty($onlynumber)) - { - $pdf->SetFont('','',$default_font_size - $diffsizecontent); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); - $cury+=3; - } + if (empty($onlynumber)) + { + $pdf->SetFont('','',$default_font_size - $diffsizecontent); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); + $cury+=3; + } - if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8); + // Use correct name of bank id according to country + $ibankey="IBANNumber"; + if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; + if (! empty($account->iban)) + { - if ($usedetailedbban == 1) - { - $fieldstoshow=array('bank','desk','number','key'); - if ($conf->global->BANK_SHOW_ORDER_OPTION==1) $fieldstoshow=array('bank','desk','key','number'); - } - else if ($usedetailedbban == 2) - { - $fieldstoshow=array('bank','number'); - } - else dol_print_error('','Value returned by function useDetailedBBAN not managed'); + $ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban); + $ibanDisplay = ""; - foreach ($fieldstoshow as $val) - { - if ($val == 'bank') - { - // Bank code - $tmplength=18; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - if ($val == 'desk') - { - // Desk - $tmplength=18; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - if ($val == 'number') - { - // Number - $tmplength=24; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - if ($val == 'key') - { - // Key - $tmplength=13; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - } + for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++){ + $ibanDisplay .= $ibanDisplay_temp[$i]; + if($i%4 == 3 && $i > 0){ + $ibanDisplay .= " "; + } + } - $curx=$savcurx; - $cury+=10; - } - else - { - $pdf->SetFont('','B',$default_font_size - $diffsizecontent); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); - $cury+=3; + $pdf->SetFont('','B',$default_font_size - 3); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $ibanDisplay, 0, 'L', 0); + $cury+=3; + } - $pdf->SetFont('','B',$default_font_size - $diffsizecontent); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); - $cury+=3; + if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8); - if ($diffsizecontent <= 2) $cury+=1; - } + if ($usedetailedbban == 1) + { + $fieldstoshow=array('bank','desk','number','key'); + if ($conf->global->BANK_SHOW_ORDER_OPTION==1) $fieldstoshow=array('bank','desk','key','number'); + } + else if ($usedetailedbban == 2) + { + $fieldstoshow=array('bank','number'); + } + else dol_print_error('','Value returned by function useDetailedBBAN not managed'); - // Use correct name of bank id according to country - $ibankey="IBANNumber"; - $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; - if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; + foreach ($fieldstoshow as $val) + { + if ($val == 'bank') + { + // Bank code + $tmplength=18; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + if ($val == 'desk') + { + // Desk + $tmplength=18; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + if ($val == 'number') + { + // Number + $tmplength=24; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + if ($val == 'key') + { + // Key + $tmplength=13; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + } - $pdf->SetFont('','',$default_font_size - $diffsizecontent); + $curx=$savcurx; + $cury+=10; + } + else + { + $pdf->SetFont('','B',$default_font_size - $diffsizecontent); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); + $cury+=3; - if (empty($onlynumber) && ! empty($account->domiciliation)) - { - $pdf->SetXY($curx, $cury); - $val=$outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation); - $pdf->MultiCell(100, 3, $val, 0, 'L', 0); - //$nboflines=dol_nboflines_bis($val,120); - //$cury+=($nboflines*3)+2; - $tmpy=$pdf->getStringHeight(100, $val); - $cury+=$tmpy; - } - else if (! $usedetailedbban) $cury+=1; + $pdf->SetFont('','B',$default_font_size - $diffsizecontent); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); + $cury+=3; - if (! empty($account->iban)) - { - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $outputlangs->convToOutputCharset($account->iban), 0, 'L', 0); - $cury+=3; - } + if ($diffsizecontent <= 2) $cury+=1; + } - if (! empty($account->bic)) - { - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); - } + // Use correct name of bank id according to country + $bickey="BICNumber"; + if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; - return $pdf->getY(); + $pdf->SetFont('','',$default_font_size - $diffsizecontent); + + if (empty($onlynumber) && ! empty($account->domiciliation)) + { + $pdf->SetXY($curx, $cury); + $val=$outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation); + $pdf->MultiCell(100, 3, $val, 0, 'L', 0); + //$nboflines=dol_nboflines_bis($val,120); + //$cury+=($nboflines*3)+2; + $tmpy=$pdf->getStringHeight(100, $val); + $cury+=$tmpy; + } + else if (! $usedetailedbban) $cury+=1; + + if (! empty($account->bic)) + { + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); + } + + return $pdf->getY(); } - /** * Show footer of page for PDF generation * From 92a5030f8fa6dad8fe8c060a30b840bcab2095b0 Mon Sep 17 00:00:00 2001 From: Andrelec1 Date: Mon, 4 Aug 2014 10:11:56 +0200 Subject: [PATCH 02/21] replace with space by tab --- htdocs/core/lib/pdf.lib.php | 305 ++++++++++++++++++------------------ 1 file changed, 152 insertions(+), 153 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index fb4d67d3f14..2731ec59e18 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1,11 +1,12 @@ - * Copyright (C) 2006 Rodolphe Quiedeville - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2014 Cedric GROSS +/* Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2014 Cedric GROSS + * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -166,7 +167,7 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P') * This class is an enhanced FPDI class that support method writeHTMLCell */ class FPDI_DolExtended extends FPDI - { + { /** * __call * @@ -432,9 +433,9 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height) // Add a background image on document if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) { - $pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image + $pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image $pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_X:0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y:0), 0, $page_height); - $pdf->SetAutoPageBreak(1,0); // Restore pagebreak + $pdf->SetAutoPageBreak(1,0); // Restore pagebreak } } @@ -492,164 +493,162 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) */ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default_font_size=10) { - global $mysoc, $conf; + global $mysoc, $conf; - $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); - $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); + $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); + $pdf->SetXY($curx, $cury); - $pdf->SetXY($curx, $cury); + if (empty($onlynumber)) + { + $pdf->SetFont('','B',$default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); + $cury+=4; + } - if (empty($onlynumber)) - { - $pdf->SetFont('','B',$default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); - $cury+=4; - } + $outputlangs->load("banks"); - $outputlangs->load("banks"); + // Get format of bank account according to its country + $usedetailedbban=$account->useDetailedBBAN(); - // Get format of bank account according to its country - $usedetailedbban=$account->useDetailedBBAN(); + //$onlynumber=0; $usedetailedbban=0; // For tests + if ($usedetailedbban) + { + $savcurx=$curx; - //$onlynumber=0; $usedetailedbban=0; // For tests - if ($usedetailedbban) - { - $savcurx=$curx; + if (empty($onlynumber)) + { + $pdf->SetFont('','',$default_font_size - $diffsizecontent); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); + $cury+=3; + } - if (empty($onlynumber)) - { - $pdf->SetFont('','',$default_font_size - $diffsizecontent); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); - $cury+=3; - } + // Use correct name of bank id according to country + $ibankey="IBANNumber"; + if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; + if (! empty($account->iban)) + { + $ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban); + $ibanDisplay = ""; - // Use correct name of bank id according to country - $ibankey="IBANNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; - if (! empty($account->iban)) - { + for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++){ + $ibanDisplay .= $ibanDisplay_temp[$i]; + if($i%4 == 3 && $i > 0){ + $ibanDisplay .= " "; + } + } - $ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban); - $ibanDisplay = ""; + $pdf->SetFont('','B',$default_font_size - 3); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $ibanDisplay, 0, 'L', 0); + $cury+=3; + } - for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++){ - $ibanDisplay .= $ibanDisplay_temp[$i]; - if($i%4 == 3 && $i > 0){ - $ibanDisplay .= " "; - } - } + if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8); - $pdf->SetFont('','B',$default_font_size - 3); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $ibanDisplay, 0, 'L', 0); - $cury+=3; - } + if ($usedetailedbban == 1) + { + $fieldstoshow=array('bank','desk','number','key'); + if ($conf->global->BANK_SHOW_ORDER_OPTION==1) $fieldstoshow=array('bank','desk','key','number'); + } + else if ($usedetailedbban == 2) + { + $fieldstoshow=array('bank','number'); + } + else dol_print_error('','Value returned by function useDetailedBBAN not managed'); - if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8); + foreach ($fieldstoshow as $val) + { + if ($val == 'bank') + { + // Bank code + $tmplength=18; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + if ($val == 'desk') + { + // Desk + $tmplength=18; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + if ($val == 'number') + { + // Number + $tmplength=24; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + if ($val == 'key') + { + // Key + $tmplength=13; + $pdf->SetXY($curx, $cury+5); + $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0); + $pdf->SetXY($curx, $cury+1); + $curx+=$tmplength; + $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0); + if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); + } + } - if ($usedetailedbban == 1) - { - $fieldstoshow=array('bank','desk','number','key'); - if ($conf->global->BANK_SHOW_ORDER_OPTION==1) $fieldstoshow=array('bank','desk','key','number'); - } - else if ($usedetailedbban == 2) - { - $fieldstoshow=array('bank','number'); - } - else dol_print_error('','Value returned by function useDetailedBBAN not managed'); + $curx=$savcurx; + $cury+=10; + } + else + { + $pdf->SetFont('','B',$default_font_size - $diffsizecontent); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); + $cury+=3; - foreach ($fieldstoshow as $val) - { - if ($val == 'bank') - { - // Bank code - $tmplength=18; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - if ($val == 'desk') - { - // Desk - $tmplength=18; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - if ($val == 'number') - { - // Number - $tmplength=24; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - if ($val == 'key') - { - // Key - $tmplength=13; - $pdf->SetXY($curx, $cury+5); - $pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0); - $pdf->SetXY($curx, $cury+1); - $curx+=$tmplength; - $pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0); - if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8); - } - } + $pdf->SetFont('','B',$default_font_size - $diffsizecontent); + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); + $cury+=3; - $curx=$savcurx; - $cury+=10; - } - else - { - $pdf->SetFont('','B',$default_font_size - $diffsizecontent); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); - $cury+=3; + if ($diffsizecontent <= 2) $cury+=1; + } - $pdf->SetFont('','B',$default_font_size - $diffsizecontent); - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); - $cury+=3; + // Use correct name of bank id according to country + $bickey="BICNumber"; + if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; - if ($diffsizecontent <= 2) $cury+=1; - } + $pdf->SetFont('','',$default_font_size - $diffsizecontent); - // Use correct name of bank id according to country - $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; + if (empty($onlynumber) && ! empty($account->domiciliation)) + { + $pdf->SetXY($curx, $cury); + $val=$outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation); + $pdf->MultiCell(100, 3, $val, 0, 'L', 0); + //$nboflines=dol_nboflines_bis($val,120); + //$cury+=($nboflines*3)+2; + $tmpy=$pdf->getStringHeight(100, $val); + $cury+=$tmpy; + } + else if (! $usedetailedbban) $cury+=1; - $pdf->SetFont('','',$default_font_size - $diffsizecontent); + if (! empty($account->bic)) + { + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); + } - if (empty($onlynumber) && ! empty($account->domiciliation)) - { - $pdf->SetXY($curx, $cury); - $val=$outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation); - $pdf->MultiCell(100, 3, $val, 0, 'L', 0); - //$nboflines=dol_nboflines_bis($val,120); - //$cury+=($nboflines*3)+2; - $tmpy=$pdf->getStringHeight(100, $val); - $cury+=$tmpy; - } - else if (! $usedetailedbban) $cury+=1; - - if (! empty($account->bic)) - { - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); - } - - return $pdf->getY(); + return $pdf->getY(); } /** @@ -681,11 +680,11 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass { // Make substitution $substitutionarray=array( - '__FROM_NAME__' => $fromcompany->nom, - '__FROM_EMAIL__' => $fromcompany->email, - '__TOTAL_TTC__' => $object->total_ttc, - '__TOTAL_HT__' => $object->total_ht, - '__TOTAL_VAT__' => $object->total_vat + '__FROM_NAME__' => $fromcompany->nom, + '__FROM_EMAIL__' => $fromcompany->email, + '__TOTAL_TTC__' => $object->total_ttc, + '__TOTAL_HT__' => $object->total_ht, + '__TOTAL_VAT__' => $object->total_vat ); complete_substitutions_array($substitutionarray,$outputlangs,$object); $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray); From ab9226aab6bc4a53574e8dab2c81ed4c84214f53 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 19 Sep 2014 05:55:54 +0200 Subject: [PATCH 03/21] Delete elements have a link with old module ventilation - Replace today by module Accounting Expert --- htdocs/compta/ventilation/fiche.php | 165 ------------------ .../compta/ventilation/fournisseur/fiche.php | 149 ---------------- .../compta/ventilation/fournisseur/index.php | 127 -------------- .../compta/ventilation/fournisseur/lignes.php | 114 ------------ .../compta/ventilation/fournisseur/liste.php | 105 ----------- htdocs/compta/ventilation/index.php | 102 ----------- htdocs/compta/ventilation/lignes.php | 141 --------------- htdocs/compta/ventilation/liste.php | 129 -------------- htdocs/core/lib/files.lib.php | 6 +- htdocs/core/menus/init_menu_auguria.sql | 10 -- htdocs/core/menus/standard/eldy.lib.php | 4 +- htdocs/core/modules/modComptabilite.class.php | 24 --- htdocs/langs/ar_SA/admin.lang | 3 - htdocs/langs/bg_BG/admin.lang | 3 - htdocs/langs/bs_BA/admin.lang | 3 - htdocs/langs/ca_ES/admin.lang | 3 - htdocs/langs/cs_CZ/admin.lang | 3 - htdocs/langs/da_DK/admin.lang | 3 - htdocs/langs/de_DE/admin.lang | 3 - htdocs/langs/el_GR/admin.lang | 3 - htdocs/langs/en_US/admin.lang | 3 - htdocs/langs/es_ES/admin.lang | 3 - htdocs/langs/et_EE/admin.lang | 3 - htdocs/langs/eu_ES/admin.lang | 3 - htdocs/langs/fa_IR/admin.lang | 3 - htdocs/langs/fi_FI/admin.lang | 3 - htdocs/langs/fr_FR/admin.lang | 3 - htdocs/langs/fr_FR/compta.lang | 3 - htdocs/langs/he_IL/admin.lang | 3 - htdocs/langs/hr_HR/admin.lang | 3 - htdocs/langs/hu_HU/admin.lang | 3 - htdocs/langs/id_ID/admin.lang | 3 - htdocs/langs/is_IS/admin.lang | 3 - htdocs/langs/it_IT/admin.lang | 3 - htdocs/langs/ja_JP/admin.lang | 3 - htdocs/langs/ko_KR/admin.lang | 3 - htdocs/langs/lt_LT/admin.lang | 3 - htdocs/langs/lv_LV/admin.lang | 3 - htdocs/langs/mk_MK/admin.lang | 3 - htdocs/langs/nb_NO/admin.lang | 3 - htdocs/langs/nl_NL/admin.lang | 3 - htdocs/langs/pl_PL/admin.lang | 3 - htdocs/langs/pt_BR/admin.lang | 3 - htdocs/langs/pt_PT/admin.lang | 3 - htdocs/langs/ro_RO/admin.lang | 3 - htdocs/langs/ru_RU/admin.lang | 3 - htdocs/langs/sk_SK/admin.lang | 3 - htdocs/langs/sl_SI/admin.lang | 3 - htdocs/langs/sq_AL/admin.lang | 3 - htdocs/langs/sv_SE/admin.lang | 3 - htdocs/langs/th_TH/admin.lang | 3 - htdocs/langs/tr_TR/admin.lang | 3 - htdocs/langs/uk_UA/admin.lang | 3 - htdocs/langs/uz_UZ/admin.lang | 3 - htdocs/langs/vi_VN/admin.lang | 3 - htdocs/langs/zh_CN/admin.lang | 3 - htdocs/langs/zh_TW/admin.lang | 3 - 57 files changed, 5 insertions(+), 1206 deletions(-) delete mode 100644 htdocs/compta/ventilation/fiche.php delete mode 100644 htdocs/compta/ventilation/fournisseur/fiche.php delete mode 100644 htdocs/compta/ventilation/fournisseur/index.php delete mode 100644 htdocs/compta/ventilation/fournisseur/lignes.php delete mode 100644 htdocs/compta/ventilation/fournisseur/liste.php delete mode 100644 htdocs/compta/ventilation/index.php delete mode 100644 htdocs/compta/ventilation/lignes.php delete mode 100644 htdocs/compta/ventilation/liste.php diff --git a/htdocs/compta/ventilation/fiche.php b/htdocs/compta/ventilation/fiche.php deleted file mode 100644 index b55f2b59475..00000000000 --- a/htdocs/compta/ventilation/fiche.php +++ /dev/null @@ -1,165 +0,0 @@ - - * Copyright (C) 2005-2006 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/fiche.php - * \ingroup compta - * \brief Page fiche ventilation - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - -$langs->load("bills"); - -$mesg = ''; - -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - - -/* - * Actions - */ - -if ($_POST["action"] == 'ventil' && $user->rights->compta->ventilation->creer) -{ - $sql = " UPDATE ".MAIN_DB_PREFIX."facturedet"; - $sql .= " SET fk_code_ventilation = ".$_POST["codeventil"]; - $sql .= " WHERE rowid = ".$_GET["id"]; - - $db->query($sql); -} - -llxHeader("","","Fiche ventilation"); - -if ($cancel == $langs->trans("Cancel")) -{ - $action = ''; -} -/* - * - * - */ - -$sql = "SELECT rowid, numero, intitule"; -$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux"; -$sql .= " ORDER BY numero ASC"; - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $row = $db->fetch_row($result); - $cgs[$row[0]] = $row[1] . ' ' . $row[2]; - $i++; - } -} - -/* - * Cr�ation - * - */ -$form = new Form($db); -$facture_static=new Facture($db); - -if($_GET["id"]) -{ - $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,"; - $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,"; - $sql .= " l.date_start as date_start, l.date_end as date_end,"; - $sql .= " l.fk_code_ventilation "; - $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; - $sql .= " , ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; - - $result = $db->query($sql); - if ($result) - { - $num_lignes = $db->num_rows($result); - $i = 0; - - if ($num_lignes) - { - - $objp = $db->fetch_object($result); - - - if($objp->fk_code_ventilation == 0) - { - print '
'."\n"; - print ''; - print ''; - } - - - print_fiche_titre("Ventilation"); - - print ''; - - // Ref facture - print ''; - $facture_static->ref=$objp->facnumber; - $facture_static->id=$objp->facid; - print ''; - print ''; - - print ''; - print ''; - print ''; - - if($objp->fk_code_ventilation == 0) - { - print ''; - } - print '
'.$langs->trans("Invoice").''.$facture_static->getNomUrl(1).'
Ligne'.nl2br($objp->description).'
Ventiler dans le compte :'; - - if($objp->fk_code_ventilation == 0) - { - print $form->selectarray("codeventil",$cgs, $objp->fk_code_ventilation); - } - else - { - print $cgs[$objp->fk_code_ventilation]; - } - - print '
 
'; - print '
'; - } - else - { - print "Error"; - } - } - else - { - print "Error"; - } -} -else -{ - print "Error ID incorrect"; -} - -$db->close(); - -llxFooter(); diff --git a/htdocs/compta/ventilation/fournisseur/fiche.php b/htdocs/compta/ventilation/fournisseur/fiche.php deleted file mode 100644 index 168b99eea35..00000000000 --- a/htdocs/compta/ventilation/fournisseur/fiche.php +++ /dev/null @@ -1,149 +0,0 @@ - - * Copyright (C) 2005 Simon TOSSER - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/fournisseur/fiche.php - * \ingroup compta - * \brief Page fiche ventilation - */ - -require '../../../main.inc.php'; - -$mesg = ''; - -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - -if ($_POST["action"] == 'ventil' && $user->rights->compta->ventilation->creer) -{ - $sql = " UPDATE ".MAIN_DB_PREFIX."facture_fourn_det"; - $sql .= " SET fk_code_ventilation = ".$_POST["codeventil"]; - $sql .= " WHERE rowid = ".$_GET["id"]; - - $db->query($sql); -} - -llxHeader("","","Fiche ventilation"); - -if ($cancel == $langs->trans("Cancel")) -{ - $action = ''; -} -/* - * - * - */ - -$sql = "SELECT rowid, numero, intitule"; -$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux"; -$sql .= " ORDER BY numero ASC"; - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $row = $db->fetch_row($result); - $cgs[$row[0]] = $row[1] . ' ' . $row[2]; - $i++; - } -} - -/* - * Creation - * - */ -$form = new Form($db); - -if($_GET["id"]) -{ - $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation "; - $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; - $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; - - $result = $db->query($sql); - - if ($result) - { - $num_lignes = $db->num_rows($result); - $i = 0; - - if ($num_lignes) - { - - $objp = $db->fetch_object($result); - - - if($objp->fk_code_ventilation == 0) - { - print '
'."\n"; - print ''; - print ''; - } - - - print_titre("Ventilation"); - - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - - if($objp->fk_code_ventilation == 0) - { - print ''; - } - print '
Facture'.$objp->facnumber.'
Ligne'.stripslashes(nl2br($objp->description)).'
Ventiler dans le compte :'; - - if($objp->fk_code_ventilation == 0) - { - print $form->selectarray("codeventil",$cgs, $objp->fk_code_ventilation); - } - else - { - print $cgs[$objp->fk_code_ventilation]; - } - - print '
 
'; - print '
'; - } - else - { - print "Error"; - } - } - else - { - print "Error"; - } -} -else -{ - print "Error ID incorrect"; -} - -$db->close(); - -llxFooter(); diff --git a/htdocs/compta/ventilation/fournisseur/index.php b/htdocs/compta/ventilation/fournisseur/index.php deleted file mode 100644 index ebd4d2c4af5..00000000000 --- a/htdocs/compta/ventilation/fournisseur/index.php +++ /dev/null @@ -1,127 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * Copyright (C) 2005 Simon TOSSER - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/fournisseur/index.php - * \ingroup compta - * \brief Page accueil ventilation - */ - -require '../../../main.inc.php'; -$langs->load("suppliers"); - - -llxHeader('','Compta - Ventilation'); - -print_titre("Ventilation Comptable"); - -print ''; - -print '
'; - - - -$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet"; -$sql .= " WHERE fk_code_ventilation = 0"; -$result = $db->query($sql); -if ($result) -{ - $row = $db->fetch_row($result); - $nbfac = $row[0]; - - $db->free($result); -} - -$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement"; -$sql .= " WHERE fk_code_ventilation = 0"; - -$result = $db->query($sql); -if ($result) -{ - $row = $db->fetch_row($result); - $nbp = $row[0]; - - $db->free($result); -} - -$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facture_fourn_det"; -$sql .= " WHERE fk_code_ventilation = 0"; -$result = $db->query($sql); -if ($result) -{ - $row = $db->fetch_row($result); - $nbfacfourn = $row[0]; - - $db->free($result); -} - -/*$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiementfourn"; -$sql .= " WHERE fk_code_ventilation = 0"; - -$result = $db->query($sql); -if ($result) -{ - $row = $db->fetch_row($result); - $nbpfourn = $row[0]; - - $db->free($result); -}*/ - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -//print ''; -print "
Lignes a ventiler
TypeNb
Factures clients'.$nbfac.'
Paiements clients'.$nbp.'
Factures fournisseurs'.$nbfacfourn.'
Paiements fournisseurs'.$nbpfourn.'
\n"; - -print '
'; - -print ''; -print ''; - -$sql = "SELECT count(*), ccg.intitule FROM ".MAIN_DB_PREFIX."facturedet as fd"; -$sql .= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg"; -$sql .= " WHERE fd.fk_code_ventilation = ccg.rowid"; -$sql .= " GROUP BY ccg.rowid"; - -$resql = $db->query($sql); -if ($resql) -{ - $i = 0; - $num = $db->num_rows($resql); - - while ($i < $num) - { - - $row = $db->fetch_row($resql); - - print ''; - $i++; - } - $db->free($resql); -} -print "
TypeNb de lignes
'.$row[1].''.$row[0].'
\n"; - -print '
'; - -llxFooter(); - diff --git a/htdocs/compta/ventilation/fournisseur/lignes.php b/htdocs/compta/ventilation/fournisseur/lignes.php deleted file mode 100644 index cb2a0e1439a..00000000000 --- a/htdocs/compta/ventilation/fournisseur/lignes.php +++ /dev/null @@ -1,114 +0,0 @@ - - * Copyright (C) 2005 Simon TOSSER - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/fournisseur/lignes.php - * \ingroup facture - * \brief Page de detail des lignes de ventilation d'une facture - */ - -require '../../../main.inc.php'; - -$langs->load("bills"); - -if (!$user->rights->facture->lire) accessforbidden(); -if (!$user->rights->compta->ventilation->creer) accessforbidden(); -/* - * Securite acces client - */ -if ($user->societe_id > 0) accessforbidden(); - -llxHeader(''); - -/* - * Lignes de factures - * - */ -$page = $_GET["page"]; -if ($page < 0) $page = 0; -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero "; -$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; -$sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; -$sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; - -$sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 "; -$sql .= " AND c.rowid = l.fk_code_ventilation"; - -if (dol_strlen(trim($_GET["search_facture"]))) -{ - $sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'"; -} - -$sql .= " ORDER BY l.rowid DESC"; -$sql .= $db->plimit($limit+1,$offset); - -$result = $db->query($sql); - -if ($result) -{ - $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste("Lignes de facture ventilées",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); - - print '
'; - print ''; - print ""; - print ''; - print ''; - print ''; - print "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $var=True; - while ($i < min($num_lignes, $limit)) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - - print ''; - - print ''; - print ''; - print ''; - print ''; - - print ""; - $i++; - } -} -else -{ - print $db->error(); -} - -print "
Facture'.$langs->trans("Description").''.$langs->trans("Montant").''.$langs->trans("Compte").'
   
'.$objp->facnumber.''.stripslashes(nl2br($objp->description)).''.price($objp->price).''.$objp->numero.''.stripslashes($objp->intitule).'
"; - -$db->close(); - -llxFooter(); diff --git a/htdocs/compta/ventilation/fournisseur/liste.php b/htdocs/compta/ventilation/fournisseur/liste.php deleted file mode 100644 index e3eb4cf487d..00000000000 --- a/htdocs/compta/ventilation/fournisseur/liste.php +++ /dev/null @@ -1,105 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -/** - * \file htdocs/compta/ventilation/liste.php - * \ingroup compta - * \brief Page de ventilation des lignes de facture - */ - -require '../../../main.inc.php'; - -$langs->load("bills"); - -if (!$user->rights->facture->lire) accessforbidden(); -if (!$user->rights->compta->ventilation->creer) accessforbidden(); -/* - * Securite acces client - */ -if ($user->societe_id > 0) accessforbidden(); - - -llxHeader('','Ventilation'); - -/* - * Lignes de factures - * - */ -$page = $_GET["page"]; -if ($page < 0) $page = 0; -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.rowid, l.fk_code_ventilation "; -$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; -$sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; -$sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND fk_code_ventilation = 0"; -$sql .= " ORDER BY l.rowid DESC ".$db->plimit($limit+1,$offset); - -$result = $db->query($sql); -if ($result) -{ - $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste("Lignes de facture à ventiler",$page,"liste.php","",$sortfield,$sortorder,'',$num_lignes); - - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $var=True; - while ($i < min($num_lignes, $limit)) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - - print ''; - print ''; - - print ''; - - print ''; - - print ""; - $i++; - } - -print "
Facture'.$langs->trans("Description").'  
'.$objp->facnumber.''.stripslashes(nl2br($objp->description)).''; - print price($objp->price); - print ''; - print img_edit(); - print '
"; - - - -} -else -{ - print $db->error(); -} -$db->close(); - -llxFooter(); diff --git a/htdocs/compta/ventilation/index.php b/htdocs/compta/ventilation/index.php deleted file mode 100644 index 8b9710844a7..00000000000 --- a/htdocs/compta/ventilation/index.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/index.php - * \ingroup compta - * \brief Page accueil ventilation - */ - -require '../../main.inc.php'; - -$langs->load("compta"); -$langs->load("bills"); - -llxHeader('','Compta - Ventilation'); - -print_fiche_titre("Ventilation Comptable"); - -//print ''; -//print '
'; -print '
'; - -$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet as fd"; -$sql.= " , ".MAIN_DB_PREFIX."facture as f"; -$sql.= " WHERE fd.fk_code_ventilation = 0"; -$sql.= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1"; - -$result = $db->query($sql); -if ($result) -{ - $row = $db->fetch_row($result); - $nbfac = $row[0]; - - $db->free($result); -} - -$var=true; - -print ''; -print ''; -print ''; -$var=!$var; -print "".''; -$var=!$var; -print "
'.$langs->trans("Lines").'
'.$langs->trans("Type").''.$langs->trans("Nb").'
'.$langs->trans("Invoices").''.$nbfac.'
\n"; - - -//print '
'; -print '
'; - - -print ''; -print ''; - -$sql = "SELECT count(*), ccg.intitule, ccg.rowid,ccg.numero FROM ".MAIN_DB_PREFIX."facturedet as fd"; -$sql.= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg"; -$sql.= " WHERE fd.fk_code_ventilation = ccg.rowid"; -$sql.= " GROUP BY ccg.rowid"; - -$resql = $db->query($sql); -if ($resql) -{ - $i = 0; - $num = $db->num_rows($resql); - $var=true; - - while ($i < $num) - { - - $row = $db->fetch_row($resql); - $var=!$var; - print ''; - print ''; - $i++; - } - $db->free($resql); -} -print "
'.$langs->trans("Type").''.$langs->trans("NbOfLines").''.$langs->trans("AccountNumber").''.$langs->trans("TransID").'
'.$row[1].''.$row[0].''.$row[3].''.$row[2].'
\n"; - -//print '
'; -print ''; - - -llxFooter(); - -$db->close(); diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php deleted file mode 100644 index 46276937afe..00000000000 --- a/htdocs/compta/ventilation/lignes.php +++ /dev/null @@ -1,141 +0,0 @@ - - * Copyright (C) 2006 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/lignes.php - * \ingroup facture - * \brief Page de detail des lignes de ventilation d'une facture - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - -$langs->load("bills"); -$langs->load("compta"); - -if (!$user->rights->facture->lire) accessforbidden(); -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - -// Securite acces client -if ($user->societe_id > 0) accessforbidden(); - - -llxHeader(''); - -/* -* Lignes de factures -* -*/ -$page = $_GET["page"]; -if ($page < 0) $page = 0; -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total_ttc as price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero,"; -$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type"; -$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql.= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; -$sql.= " , ".MAIN_DB_PREFIX."facturedet as l"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; -$sql.= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 "; -$sql.= " AND f.entity = ".$conf->entity; -$sql.= " AND c.rowid = l.fk_code_ventilation"; -if (dol_strlen(trim($_GET["search_facture"]))) -{ - $sql .= " AND f.facnumber LIKE '%".$_GET["search_facture"]."%'"; -} - -$sql .= " ORDER BY l.rowid DESC"; -$sql .= $db->plimit($limit+1,$offset); - -$result = $db->query($sql); - -if ($result) -{ - $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste($langs->trans("InvoiceDispatched"),$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $facture_static=new Facture($db); - $product_static=new Product($db); - - $var=True; - while ($i < min($num_lignes, $limit)) - { - $objp = $db->fetch_object($result); - $var=!$var; - $codeCompta = $objp->numero.' '.$objp->intitule; - - print ""; - - // Ref facture - $facture_static->ref=$objp->facnumber; - $facture_static->id=$objp->facid; - print ''; - - // Ref produit - $product_static->ref=$objp->product_ref; - $product_static->id=$objp->product_id; - $product_static->type=$objp->type; - print ''; - - print ''; - print ''; - print ''; - print ''; - - print ""; - $i++; - } -} -else -{ - print $db->error(); -} - -print "
'.$langs->trans("Invoice").''.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("Description").''.$langs->trans("Montant").''.$langs->trans("Compte").'
    '; - print ''; - print '
'.$facture_static->getNomUrl(1).''; - if ($product_static->id) print $product_static->getNomUrl(1); - else print ' '; - print ''.dol_trunc($objp->product_label,24).''.nl2br(dol_trunc($objp->description,32)).''.price($objp->price).''.$codeCompta.'
"; - - -llxFooter(); -$db->close(); diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php deleted file mode 100644 index effa7689821..00000000000 --- a/htdocs/compta/ventilation/liste.php +++ /dev/null @@ -1,129 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2006 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -/** - * \file htdocs/compta/ventilation/liste.php - * \ingroup compta - * \brief Page de ventilation des lignes de facture - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - -$langs->load("compta"); -$langs->load("bills"); - -if (!$user->rights->facture->lire) accessforbidden(); -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - -// Securite acces client -if ($user->societe_id > 0) accessforbidden(); - - -llxHeader('','Ventilation'); - -/* - * Lignes de factures - */ - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -$limit = $conf->liste_limit; - -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total as price, l.rowid, l.fk_code_ventilation,"; -$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type"; -$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql.= " , ".MAIN_DB_PREFIX."facturedet as l"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; -$sql.= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND fk_code_ventilation = 0"; -$sql.= " AND f.entity = ".$conf->entity; -$sql.= " ORDER BY l.rowid DESC ".$db->plimit($limit+1,$offset); - -$result = $db->query($sql); -if ($result) -{ - $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste($langs->trans("InvoiceLinesToDispatch"),$page,"liste.php","",$sortfield,$sortorder,'',$num_lignes); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $facture_static=new Facture($db); - $product_static=new Product($db); - - $var=True; - while ($i < min($num_lignes, $limit)) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - - // Ref facture - $facture_static->ref=$objp->facnumber; - $facture_static->id=$objp->facid; - print ''; - - // Ref produit - $product_static->ref=$objp->product_ref; - $product_static->id=$objp->product_id; - $product_static->type=$objp->type; - print ''; - - print ''; - print ''; - - print ''; - - print ''; - - print ""; - $i++; - } - print "
'.$langs->trans("Invoice").''.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("Description").''.$langs->trans("Montant").' 
'.$facture_static->getNomUrl(1).''; - if ($product_static->id) print $product_static->getNomUrl(1); - else print ' '; - print ''.dol_trunc($objp->product_label,24).''.nl2br(dol_trunc($objp->description,32)).''; - print price($objp->price); - print ''; - print img_edit(); - print '
"; -} -else -{ - print $db->error(); -} - -llxFooter(); -$db->close(); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8590f63803f..56536fc3240 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1636,14 +1636,14 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu else $original_file=$conf->facture->dir_output.'/payments/'.$original_file; } - // Wrapping pour les exports de compta + // Wrapping for accounting exports else if ($modulepart == 'export_compta') { - if ($fuser->rights->compta->ventilation->creer || preg_match('/^specimen/i',$original_file)) + if ($fuser->rights->accounting->ventilation->dispatch || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } - $original_file=$conf->compta->dir_output.'/'.$original_file; + $original_file=$conf->accounting->dir_output.'/'.$original_file; } // Wrapping pour les expedition diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 36291883755..28b0444602a 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -188,16 +188,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'Payments', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); --- Ventilation (accounting) -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'ventil', 6__+MAX_llx_menu__, '/compta/ventilation/index.php?leftmenu=ventil', 'Ventilation', 0, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/ventilation/liste.php', 'ToDispatch', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/ventilation/lignes.php', 'Dispatched', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/param/', 'Setup', 1, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2404__+MAX_llx_menu__, 'accountancy', '', 2403__+MAX_llx_menu__, '/compta/param/comptes/liste.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2405__+MAX_llx_menu__, 'accountancy', '', 2403__+MAX_llx_menu__, '/compta/param/comptes/fiche.php?action=create', 'New', 2, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2406__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/export/', 'Export', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2407__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/index.php', 'New', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2408__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/liste.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__); -- Rapports insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1d7aa1a5a9a..7c3793d1c6d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -863,13 +863,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->load("accountancy"); $newmenu->add("/accountancy/customer/index.php?leftmenu=ventil_customer",$langs->trans("CustomersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_customer'); - if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->read); + if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->dispatch); if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read); if (! empty($conf->fournisseur->enabled)) { $newmenu->add("/accountancy/supplier/index.php?leftmenu=ventil_supplier",$langs->trans("SuppliersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_supplier'); - if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->read); + if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->dispatch); if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read); } } diff --git a/htdocs/core/modules/modComptabilite.class.php b/htdocs/core/modules/modComptabilite.class.php index f4f943bc3cc..74002f0065f 100644 --- a/htdocs/core/modules/modComptabilite.class.php +++ b/htdocs/core/modules/modComptabilite.class.php @@ -93,30 +93,6 @@ class modComptabilite extends DolibarrModules $this->rights[$r][3] = 1; $this->rights[$r][4] = 'resultat'; $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 96; - $this->rights[$r][1] = 'Parametrer la ventilation'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'ventilation'; - $this->rights[$r][5] = 'parametrer'; - - $r++; - $this->rights[$r][0] = 97; - $this->rights[$r][1] = 'Lire les ventilations de factures'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'ventilation'; - $this->rights[$r][5] = 'lire'; - - $r++; - $this->rights[$r][0] = 98; - $this->rights[$r][1] = 'Ventiler les lignes de factures'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'ventilation'; - $this->rights[$r][5] = 'creer'; } diff --git a/htdocs/langs/ar_SA/admin.lang b/htdocs/langs/ar_SA/admin.lang index d38f47ae047..0abd2969be1 100644 --- a/htdocs/langs/ar_SA/admin.lang +++ b/htdocs/langs/ar_SA/admin.lang @@ -582,9 +582,6 @@ Permission92=إنشاء / تعديل المساهمات الاجتماعية و Permission93=حذف المساهمات الاجتماعية وضريبة القيمة المضافة Permission94=تصدير المساهمات الاجتماعية Permission95=قراءة تقارير -Permission96=ارسال الإعداد -Permission97=قراءة ارسال الفواتير والمحاسبة -Permission98=ارسال الفاتورة 'sخطوط المحاسبة Permission101=قراءة الإرسال Permission102=إنشاء / تعديل الإرسال Permission104=صحة الإرسال diff --git a/htdocs/langs/bg_BG/admin.lang b/htdocs/langs/bg_BG/admin.lang index 9f18e950065..b28cc902eb4 100644 --- a/htdocs/langs/bg_BG/admin.lang +++ b/htdocs/langs/bg_BG/admin.lang @@ -582,9 +582,6 @@ Permission92=Създаване / промяна на социалните вн Permission93=Изтриване на социалноосигурителните вноски и ДДС Permission94=Експортиране на социалноосигурителните вноски Permission95=Прочети доклада -Permission96=Настройка на експедиция -Permission97=Фактура за счетоводството експедиция -Permission98=Изпращането фактура линии счетоводни Permission101=Прочети sendings Permission102=Създаване / промяна sendings Permission104=Проверка на sendings diff --git a/htdocs/langs/bs_BA/admin.lang b/htdocs/langs/bs_BA/admin.lang index 74afea9adf9..8d527fff116 100644 --- a/htdocs/langs/bs_BA/admin.lang +++ b/htdocs/langs/bs_BA/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Otpremanje postavki -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index eaebca0fecb..a9dc6ca7622 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -582,9 +582,6 @@ Permission92=Crear/modificar impostos i IVA Permission93=Eliminar impostos i IVA Permission94=Exporta impostos Permission95=Consultar balanços i resultats -Permission96=Parametritzar desglossament -Permission97=Llegir línies de factures -Permission98=Desglossar línies de factures Permission101=Consultar expedicions Permission102=Crear/modificar expedicions Permission104=Validar expedicions diff --git a/htdocs/langs/cs_CZ/admin.lang b/htdocs/langs/cs_CZ/admin.lang index 982001ce693..1f0e2230599 100644 --- a/htdocs/langs/cs_CZ/admin.lang +++ b/htdocs/langs/cs_CZ/admin.lang @@ -582,9 +582,6 @@ Permission92=Vytvořit / upravit příspěvky na sociální zabezpečení a dan Permission93=Odstranění sociální příspěvky a daně z přidané hodnoty Permission94=Export příspěvky na sociální zabezpečení Permission95=Přečtěte si zprávy -Permission96=Nastavení zasílání -Permission97=Přečtěte si faktury účetnictví dispečink -Permission98=Po odeslání faktury účetní linky Permission101=Přečtěte si sendings Permission102=Vytvořit / upravit sendings Permission104=Ověřit sendings diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index 4e568f96adb..6480df62616 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -582,9 +582,6 @@ Permission92=Opret / ændre sociale bidrag og moms Permission93=Slet sociale bidrag og moms Permission94=Eksporter sociale bidrag Permission95=Læs rapporter -Permission96=Setup lastfordelingen -Permission97=Læs faktura regnskabspool lastfordelingen -Permission98=Ekspeditionscentre faktura's regnskabslinjer Permission101=Læs sendings Permission102=Opret / ændre sendings Permission104=Valider sendings diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang index 76c256dc01e..5ff8d011e79 100644 --- a/htdocs/langs/de_DE/admin.lang +++ b/htdocs/langs/de_DE/admin.lang @@ -582,9 +582,6 @@ Permission92=Steuern/Sozialbeiträge erstellen/bearbeiten Permission93=Steuern/Sozialbeiträge löschen Permission94=Sozialbeiträge exportieren Permission95=Berichte einsehen -Permission96=Verbuchung einstellen -Permission97=Rechnungszuweisung einsehen -Permission98=Zuweisung der Rechnungszeilen Permission101=Sendungen einsehen Permission102=Sendungen erstellen/bearbeiten Permission104=Sendungen freigeben diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index c0006d73d07..d3482b561ab 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 13003ea5cf3..d2a597aa7d3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -584,9 +584,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 6d136f38157..a627f83c8bb 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -582,9 +582,6 @@ Permission92=Crear/modificar impuestos e IVA Permission93=Eliminar impuestos e IVA Permission94=Exportar impuestos Permission95=Consultar balances y resultados -Permission96=Parametrizar desglose -Permission97=Leer líneas de facturas -Permission98=Desglosar líneas de facturas Permission101=Consultar expediciones Permission102=Crear/modificar expediciones Permission104=Validar expediciones diff --git a/htdocs/langs/et_EE/admin.lang b/htdocs/langs/et_EE/admin.lang index 8b54a6035fe..3eddc28456e 100644 --- a/htdocs/langs/et_EE/admin.lang +++ b/htdocs/langs/et_EE/admin.lang @@ -582,9 +582,6 @@ Permission92=Sotsiaal- ja käibemaksu loomine/muutmine Permission93=Sotsiaal- ja käibemaksu kustutamine Permission94=Sotsiaalmaksu eksport Permission95=Aruannete vaatamine -Permission96=Saatmise seadistamine -Permission97=Arvete raamatupidamisse saatmise vaatamine -Permission98=Arvete raamatupidamisse saatmise read Permission101=Saatmiste vaatamine Permission102=Saatmiste loomine/muutmine Permission104=Saatmiste kinnitamine diff --git a/htdocs/langs/eu_ES/admin.lang b/htdocs/langs/eu_ES/admin.lang index d6df2ee709c..475bf8e4b1e 100644 --- a/htdocs/langs/eu_ES/admin.lang +++ b/htdocs/langs/eu_ES/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/fa_IR/admin.lang b/htdocs/langs/fa_IR/admin.lang index a4dec3598a9..8372785b3d2 100644 --- a/htdocs/langs/fa_IR/admin.lang +++ b/htdocs/langs/fa_IR/admin.lang @@ -582,9 +582,6 @@ Permission92=ایجاد / تغییر مشارکتهای اجتماعی و مال Permission93=حذف کمک های اجتماعی و مالیات بر ارزش افزوده Permission94=کمک های اجتماعی صادرات Permission95=دفعات بازدید: گزارش -Permission96=راه اندازی اعزام -Permission97=خوانده شده فاکتور اعزام حسابداری -Permission98=خطوط حسابداری فاکتور اعزام Permission101=خوانده شده sendings Permission102=ایجاد / تغییر sendings Permission104=اعتبارسنجی sendings diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index 9e0d48b261b..1e9c918502a 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -582,9 +582,6 @@ Permission92=Luoda / muuttaa sosiaaliturvamaksut ja alv Permission93=Poista sosiaaliturvamaksut ja alv Permission94=Vienti sosiaaliturvamaksut Permission95=Lue raportit -Permission96=Setup lähetyskeskukset -Permission97=Lue laskun kirjanpitotietojen lähetyskeskukset -Permission98=Lähetysvaihetta laskun n kirjanpitotapahtumaa Permission101=Lue sendings Permission102=Luoda / muuttaa sendings Permission104=Validate sendings diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 8fa7ed80885..0ea2d9d51f4 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -584,9 +584,6 @@ Permission92=Créer/modifier les charges et la TVA Permission93=Supprimer les charges et la TVA Permission94=Exporter les charges Permission95=Consulter CA, bilans et résultats -Permission96=Paramétrer la ventilation -Permission97=Lire les lignes de factures -Permission98=Ventiler les lignes de factures Permission101=Consulter les expéditions Permission102=Créer/modifier les expéditions Permission104=Valider les expéditions diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index daf273cee3d..f2d37be1a38 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -164,9 +164,6 @@ NotUsedForGoods=Non utilisé pour les biens ProposalStats=Statistiques sur les propales OrderStats=Statistiques sur les commandes InvoiceStats=Statistiques sur les factures -Dispatch=Ventilation -Dispatched=Ventilés -ToDispatch=A ventiler ThirdPartyMustBeEditAsCustomer=Le tiers doit être défini comme client SellsJournal=Journal des ventes PurchasesJournal=Journal des achats diff --git a/htdocs/langs/he_IL/admin.lang b/htdocs/langs/he_IL/admin.lang index d06a1f0dde4..7f9c373236e 100644 --- a/htdocs/langs/he_IL/admin.lang +++ b/htdocs/langs/he_IL/admin.lang @@ -582,9 +582,6 @@ Permission92=צור / לשנות לביטוח הלאומי ומס ערך מוס Permission93=מחק לביטוח הלאומי ומס ערך מוסף Permission94=ייצוא הפרשות סוציאליות Permission95=לקרוא דוחות -Permission96=הגדרת שיגור -Permission97=קרא את חשבון חשבונית שיגור -Permission98=שדר הקווים חשבונאות של חשבוניות Permission101=לקרוא sendings Permission102=צור / לשנות sendings Permission104=אמת sendings diff --git a/htdocs/langs/hr_HR/admin.lang b/htdocs/langs/hr_HR/admin.lang index 158b2bdd437..218e2009fd5 100644 --- a/htdocs/langs/hr_HR/admin.lang +++ b/htdocs/langs/hr_HR/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/hu_HU/admin.lang b/htdocs/langs/hu_HU/admin.lang index 3a6875cd6c1..64dc34cbf8a 100644 --- a/htdocs/langs/hu_HU/admin.lang +++ b/htdocs/langs/hu_HU/admin.lang @@ -582,9 +582,6 @@ Permission92=Létrehozza / módosítja a társadalombiztosítási járulékok é Permission93=Törlés társadalombiztosítási járulékok és az áfa Permission94=Export társadalombiztosítási járulékok Permission95=Olvassa jelentések -Permission96=Setup szállítási -Permission97=Olvassa el szállítási nyilvántartási számla -Permission98=A számla elküldése számviteli vonalak Permission101=Olvassa küldések Permission102=Létrehozza / módosítja küldések Permission104=Érvényesítés küldések diff --git a/htdocs/langs/id_ID/admin.lang b/htdocs/langs/id_ID/admin.lang index c845f70844e..2f855e7e151 100644 --- a/htdocs/langs/id_ID/admin.lang +++ b/htdocs/langs/id_ID/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/is_IS/admin.lang b/htdocs/langs/is_IS/admin.lang index a648d649de8..80483ecae25 100644 --- a/htdocs/langs/is_IS/admin.lang +++ b/htdocs/langs/is_IS/admin.lang @@ -582,9 +582,6 @@ Permission92=Búa til / breyta félagslegum framlögum og VSK Permission93=Eyða félagsleg framlög og VSK Permission94=Útflutningur tryggingagjöld Permission95=Lesa skýrslur -Permission96=Skipulag dispatching -Permission97=Lesa Reikningar bókhalds dispatching -Permission98=bókhalds línur Sending Reikningar's Permission101=Lesa sendings Permission102=Búa til / breyta sendings Permission104=Staðfesta sendings diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index 0d4332fee0d..e383a6e57f8 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -582,9 +582,6 @@ Permission92=Creare/modificare contributi e iva Permission93=Eliminare contributi e iva Permission94=Esportare contributi Permission95=Vedere report -Permission96=Impostazioni della contabilità -Permission97=Vedere la contabilità delle fatture -Permission98=Contabilità linee delle fatture Permission101=Vedere invii Permission102=Creare/modificare spedizioni Permission104=Convalidare spedizioni diff --git a/htdocs/langs/ja_JP/admin.lang b/htdocs/langs/ja_JP/admin.lang index c5f883d9c31..9c9d4c0d0cf 100644 --- a/htdocs/langs/ja_JP/admin.lang +++ b/htdocs/langs/ja_JP/admin.lang @@ -582,9 +582,6 @@ Permission92=社会貢献とバットを作成/変更 Permission93=社会貢献とバットを削除します。 Permission94=社会貢献をエクスポートします。 Permission95=レポートを読む -Permission96=派遣セットアップ -Permission97=派遣請求書会計を読む -Permission98=請求書の会計の行を派遣 Permission101=sendingsを読む Permission102=sendingsを作成/変更 Permission104=sendingsを検証する diff --git a/htdocs/langs/ko_KR/admin.lang b/htdocs/langs/ko_KR/admin.lang index 2928f5fecd7..76a8938f3b5 100644 --- a/htdocs/langs/ko_KR/admin.lang +++ b/htdocs/langs/ko_KR/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/lt_LT/admin.lang b/htdocs/langs/lt_LT/admin.lang index 18fdd228ff1..56b2cf0674f 100644 --- a/htdocs/langs/lt_LT/admin.lang +++ b/htdocs/langs/lt_LT/admin.lang @@ -582,9 +582,6 @@ Permission92=Sukurti/keisti socialines įmokas ir PVM Permission93=Ištrinti socialines įmokas ir PVM Permission94=Eksportuoti socialinės įmokas Permission95=Skaityti ataskaitas -Permission96=Atlikimo/įvykdymo nustatymai -Permission97=Skaityti sąskaitų apskaitos atlikimą -Permission98=Atlikti sąskaitos apskaitos eilutes Permission101=Skaityti siuntinius Permission102=Sukurti/keisti siuntinius Permission104=Patvirtinti siuntinius diff --git a/htdocs/langs/lv_LV/admin.lang b/htdocs/langs/lv_LV/admin.lang index 3ffb466ca1d..c839e869079 100644 --- a/htdocs/langs/lv_LV/admin.lang +++ b/htdocs/langs/lv_LV/admin.lang @@ -582,9 +582,6 @@ Permission92=Izveidot/labot sociālās iemaksas un PVN Permission93=Dzēst sociālās iemaksas un PVN Permission94=Eksportēt sociālās iemaksas Permission95=Lasīt atskaites -Permission96=Nosūtīšanas iestatīšana -Permission97=Lasīt rēķina grāmatvedību nosūtīšana -Permission98=Nosūtīšanas rēķinu grāmatvedības līnijas Permission101=Lasīt sūtījumus Permission102=Izveidot/mainīt sūtījumus Permission104=Apstiprināt sūtījumus diff --git a/htdocs/langs/mk_MK/admin.lang b/htdocs/langs/mk_MK/admin.lang index 5edacce6285..d09bf84402e 100644 --- a/htdocs/langs/mk_MK/admin.lang +++ b/htdocs/langs/mk_MK/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang index ab94039a15f..8fa90e77d40 100644 --- a/htdocs/langs/nb_NO/admin.lang +++ b/htdocs/langs/nb_NO/admin.lang @@ -582,9 +582,6 @@ Permission92=Lage/endre avgifter og MVA Permission93=Slette avgifter og MVA Permission94=Eksporter sosiale bidrag Permission95=Vise rapporter -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice's accountancy lines Permission101=Vise forsendelser Permission102=Lage/endre forsendelser Permission104=Godjenne forsendelser diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index 5f351a33161..4e191a84619 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -582,9 +582,6 @@ Permission92=Creëer / wijzig sociale bijdragen en BTW Permission93=Verwijder sociale bijdragen en BTW Permission94=Exporteer sociale bijdragen Permission95=Bekijk de verslagen -Permission96=Verzendingsinstellingen -Permission97=Bekijk factuur boekhouding verzending -Permission98=Verzending van de factuur boekhoudkundige regel Permission101=Bekijk verzendingen Permission102=Creëer / wijzig verzendingen Permission104=Valideer verzendingen diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index a818d93c182..72dd5fc0842 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -582,9 +582,6 @@ Permission92=Tworzenie / modyfikacji składek na ubezpieczenia społeczne i poda Permission93=Usuń składek na ubezpieczenia społeczne i podatku VAT Permission94=Eksport składek na ubezpieczenia społeczne Permission95=Przeczytaj raporty -Permission96=Konfiguracja wysyłek -Permission97=Czytaj faktury rachunkowych wysyłkowe -Permission98=Wysłanie faktury w księgowości linie Permission101=Czytaj sendings Permission102=Utwórz / Modyfikuj sendings Permission104=Validate sendings diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index d9c7953d06f..3014e494d16 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -575,9 +575,6 @@ Permission92=Criar/Modificar Impostos e ICMS Permission93=Eliminar Impostos e ICMS Permission94=Exportar Impostos Sociais Permission95=Consultar balanços e resultados -Permission96=Parametrizar repartição -Permission97=Ler linhas de faturas -Permission98=Repartir linhas de faturas Permission101=Consultar Expedições Permission102=Criar/Modificar Expedições Permission104=Confirmar Expedições diff --git a/htdocs/langs/pt_PT/admin.lang b/htdocs/langs/pt_PT/admin.lang index 19fdcf07f24..85cfc54d096 100644 --- a/htdocs/langs/pt_PT/admin.lang +++ b/htdocs/langs/pt_PT/admin.lang @@ -582,9 +582,6 @@ Permission92=Criar/Modificar Impostos e IVA Permission93=Eliminar Impostos e IVA Permission94=Exportar Impostos Sociais Permission95=Consultar balanços e resultados -Permission96=Parametrizar repartição -Permission97=Leer linhas de facturas -Permission98=Repartir linhas de facturas Permission101=Consultar Expedições Permission102=Criar/Modificar Expedições Permission104=Confirmar Expedições diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index 384cbca7ce1..e298ca883b8 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -582,9 +582,6 @@ Permission92=Creare / Modificare a contribuţiilor sociale şi a TVA-ului Permission93=Ştergere a contribuţiilor sociale şi a TVA-ului Permission94=Export contribuţiilor sociale Permission95=Citeşte rapoarte -Permission96=Setup expediţie -Permission97=Citeşte contabilitate factura de expediţie -Permission98=Expedierii facturii de contabilitate linii Permission101=Citeşte sendings Permission102=Creare / Modificare Livrare Permission104=Validează livrari diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index 8a13b087e70..ad8925b7feb 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -582,9 +582,6 @@ Permission92=Создать / изменить социальных отчисл Permission93=Удалить социального взноса и налога на добавленную стоимость Permission94=Экспорт социальных взносов Permission95=Читать сообщения -Permission96=Установка диспетчерского -Permission97=Читать счета бухгалтерского диспетчерского -Permission98=Отправка счета в бухгалтерских линий Permission101=Читать отправок Permission102=Создать / изменить отправок Permission104=Проверка отправок diff --git a/htdocs/langs/sk_SK/admin.lang b/htdocs/langs/sk_SK/admin.lang index 257aa133bb6..33fc0967a1d 100644 --- a/htdocs/langs/sk_SK/admin.lang +++ b/htdocs/langs/sk_SK/admin.lang @@ -582,9 +582,6 @@ Permission92=Vytvoriť / upraviť príspevky na sociálne zabezpečenie a dane z Permission93=Odstránenie sociálne príspevky a dane z pridanej hodnoty Permission94=Export príspevky na sociálne zabezpečenie Permission95=Prečítajte si správy -Permission96=Nastavenie zasielania -Permission97=Prečítajte si faktúry účtovníctva dispečing -Permission98=Po odoslaní faktúry účtovné linky Permission101=Prečítajte si sendings Permission102=Vytvoriť / upraviť sendings Permission104=Overiť sendings diff --git a/htdocs/langs/sl_SI/admin.lang b/htdocs/langs/sl_SI/admin.lang index ff646146e9b..49084a49e17 100644 --- a/htdocs/langs/sl_SI/admin.lang +++ b/htdocs/langs/sl_SI/admin.lang @@ -582,9 +582,6 @@ Permission92=Kreiranje/spreminjanje socialnih prispevkov in DDV Permission93=Brisanje socialnih prispevkov in DDV Permission94=Izvoz socialnih prispevkov Permission95=Branje poročil -Permission96=Nastavitve odpreme -Permission97=Branje odposlanih računovodskih listin -Permission98=Branje postavk računovodskih listin Permission101=Branje pošiljk Permission102=Kreiranje/spreminjanje pošiljk Permission104=Potrjevanje pošiljk diff --git a/htdocs/langs/sq_AL/admin.lang b/htdocs/langs/sq_AL/admin.lang index 5edacce6285..d09bf84402e 100644 --- a/htdocs/langs/sq_AL/admin.lang +++ b/htdocs/langs/sq_AL/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/sv_SE/admin.lang b/htdocs/langs/sv_SE/admin.lang index 2f72442cb8d..5f565bc5490 100644 --- a/htdocs/langs/sv_SE/admin.lang +++ b/htdocs/langs/sv_SE/admin.lang @@ -582,9 +582,6 @@ Permission92=Skapa / ändra sociala avgifter och moms Permission93=Ta bort sociala avgifter och moms Permission94=Export sociala avgifter Permission95=Läs rapporter -Permission96=Setup avsändning -Permission97=Läs faktura bokföring expedierar -Permission98=Dispatch fakturornas bokföringsposter Permission101=Läs sendings Permission102=Skapa / ändra sendings Permission104=Validate sendings diff --git a/htdocs/langs/th_TH/admin.lang b/htdocs/langs/th_TH/admin.lang index 2438be65b08..508231555a8 100644 --- a/htdocs/langs/th_TH/admin.lang +++ b/htdocs/langs/th_TH/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/tr_TR/admin.lang b/htdocs/langs/tr_TR/admin.lang index 7901a4a402c..7660bf06ad0 100644 --- a/htdocs/langs/tr_TR/admin.lang +++ b/htdocs/langs/tr_TR/admin.lang @@ -582,9 +582,6 @@ Permission92=Sosyal katkı payı ve KDV oluştur/düzenle Permission93=Sosyal katkı payı ve KDV sil Permission94=Sosyal katkı payı dışaaktar Permission95=Rapor oku -Permission96=Dağıtım ayarla -Permission97=Fatura kayıtları dağıtımlarını oku -Permission98=Faturaların muhasebesel satırlarını dağıt Permission101=Gönderilenleri oku Permission102=Gönderilenleri oluştur/düzenle Permission104=Gönderilenleri doğrula diff --git a/htdocs/langs/uk_UA/admin.lang b/htdocs/langs/uk_UA/admin.lang index 5edacce6285..d09bf84402e 100644 --- a/htdocs/langs/uk_UA/admin.lang +++ b/htdocs/langs/uk_UA/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/uz_UZ/admin.lang b/htdocs/langs/uz_UZ/admin.lang index 5edacce6285..d09bf84402e 100644 --- a/htdocs/langs/uz_UZ/admin.lang +++ b/htdocs/langs/uz_UZ/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/vi_VN/admin.lang b/htdocs/langs/vi_VN/admin.lang index 040fed807a6..df38162024f 100644 --- a/htdocs/langs/vi_VN/admin.lang +++ b/htdocs/langs/vi_VN/admin.lang @@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat Permission93=Delete social contributions and vat Permission94=Export social contributions Permission95=Read reports -Permission96=Setup dispatching -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=Read sendings Permission102=Create/modify sendings Permission104=Validate sendings diff --git a/htdocs/langs/zh_CN/admin.lang b/htdocs/langs/zh_CN/admin.lang index b1657754173..c81842512b0 100644 --- a/htdocs/langs/zh_CN/admin.lang +++ b/htdocs/langs/zh_CN/admin.lang @@ -582,9 +582,6 @@ Permission92=建立/修改的社会贡献和增值税 Permission93=删除社会贡献和增值税 Permission94=导出社会贡献 Permission95=阅读报告 -Permission96=设置调度 -Permission97=Read invoice accountancy dispatching -Permission98=Dispatch invoice accountancy lines Permission101=读取发货资讯 Permission102=建立/修改发货单 Permission104=确认发货单 diff --git a/htdocs/langs/zh_TW/admin.lang b/htdocs/langs/zh_TW/admin.lang index 7a5926d32f9..8072eb8011e 100644 --- a/htdocs/langs/zh_TW/admin.lang +++ b/htdocs/langs/zh_TW/admin.lang @@ -582,9 +582,6 @@ Permission92=建立/修改的社會貢獻和增值稅 Permission93=刪除的社會貢獻和增值稅 Permission94=出口社會貢獻 Permission95=閲讀報告 -Permission96=安裝調度 -Permission97=瞭解會計調度發票 -Permission98=調度發票的會計行 Permission101=讀取出貨資訊 Permission102=建立/修改出貨單 Permission104=驗證出貨單 From f7aa08f3fdad623277172e4f48c55d1b6181f1b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 24 Sep 2014 17:41:05 +0200 Subject: [PATCH 04/21] Fixed invoices webservice --- htdocs/webservices/server_invoice.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 8412ed6ab1b..3e5ec83afc9 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -136,7 +136,9 @@ $server->wsdl->addComplexType( 'minOccurs' => '0', 'maxOccurs' => 'unbounded' ) - ) + ), + null, + 'tns:line' ); @@ -197,7 +199,9 @@ $server->wsdl->addComplexType( 'minOccurs' => '0', 'maxOccurs' => 'unbounded' ) - ) + ), + null, + 'tns:invoice' ); From 6149994b4308455a9dbfb6daf6657c40eab3230e Mon Sep 17 00:00:00 2001 From: jean Date: Wed, 24 Sep 2014 22:05:53 +0200 Subject: [PATCH 05/21] Adding hook 'suppliercard' on supplier cartd --- htdocs/fourn/card.php | 112 +++++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 51 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 313f82547e7..07ede4329b6 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2014 Jean Heimburger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,6 +49,9 @@ $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe'); $object = new Fournisseur($db); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('suppliercard')); + /* * Action */ @@ -425,60 +429,66 @@ if ($object->fetch($id)) /* * Barre d'actions */ + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) + { - print '
'; + print '
'; - if ($user->rights->fournisseur->commande->creer) - { - $langs->load("orders"); - print ''.$langs->trans("AddOrder").''; + if ($user->rights->fournisseur->commande->creer) + { + $langs->load("orders"); + print ''.$langs->trans("AddOrder").''; + } + + if ($user->rights->fournisseur->facture->creer) + { + $langs->load("bills"); + print ''.$langs->trans("AddBill").''; + } + + // Add action + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + { + if ($user->rights->agenda->myactions->create) + { + print ''.$langs->trans("AddAction").''; + } + else + { + print ''.$langs->trans("AddAction").''; + } + } + + print '
'; + print '
'; + + if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) + { + print '
'; + // List of contacts + show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + // Addresses list + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) + { + $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); + } + + if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + { + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + + // List of todo actions + show_actions_todo($conf,$langs,$db,$object); + + // List of done actions + show_actions_done($conf,$langs,$db,$object); + } } - - if ($user->rights->fournisseur->facture->creer) - { - $langs->load("bills"); - print ''.$langs->trans("AddBill").''; - } - - // Add action - if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) - { - if ($user->rights->agenda->myactions->create) - { - print ''.$langs->trans("AddAction").''; - } - else - { - print ''.$langs->trans("AddAction").''; - } - } - - print '
'; - print '
'; - - if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) - { - print '
'; - // List of contacts - show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) - { - $result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); - } - - if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) - { - print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - - // List of todo actions - show_actions_todo($conf,$langs,$db,$object); - - // List of done actions - show_actions_done($conf,$langs,$db,$object); - } } else { From e9374e8c08c46b1504d012bf4ffdff5a5995187f Mon Sep 17 00:00:00 2001 From: jean Date: Thu, 25 Sep 2014 09:26:32 +0200 Subject: [PATCH 06/21] adding hook for addMoreActionsbuttons --- htdocs/fourn/commande/card.php | 152 +++++++++++++++++---------------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ba3cb7e9de0..d0fa34d87ad 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1814,98 +1814,104 @@ elseif (! empty($object->id)) /** * Boutons actions */ - if ($user->societe_id == 0 && $action != 'edit_line' && $action != 'delete') + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) { - print '
'; - - // Validate - if ($object->statut == 0 && $num > 0) + if ($user->societe_id == 0 && $action != 'edit_line' && $action != 'delete') { - if ($user->rights->fournisseur->commande->valider) + print '
'; + + // Validate + if ($object->statut == 0 && $num > 0) { - print ''.$langs->trans('Validate').''; + if ($user->rights->fournisseur->commande->valider) + { + print ''.$langs->trans('Validate').''; + } } - } - - // Modify - if ($object->statut == 1) - { - if ($user->rights->fournisseur->commande->commander) + + // Modify + if ($object->statut == 1) { - print ''.$langs->trans("Modify").''; + if ($user->rights->fournisseur->commande->commander) + { + print ''.$langs->trans("Modify").''; + } } - } - - // Approve - if ($object->statut == 1) - { - if ($user->rights->fournisseur->commande->approuver) + + // Approve + if ($object->statut == 1) { - print ''.$langs->trans("ApproveOrder").''; - print ''.$langs->trans("RefuseOrder").''; + if ($user->rights->fournisseur->commande->approuver) + { + print ''.$langs->trans("ApproveOrder").''; + print ''.$langs->trans("RefuseOrder").''; + } + else + { + print ''.$langs->trans("ApproveOrder").''; + print ''.$langs->trans("RefuseOrder").''; + } } - else + + // Send + if (in_array($object->statut, array(2, 3, 4, 5))) { - print ''.$langs->trans("ApproveOrder").''; - print ''.$langs->trans("RefuseOrder").''; + if ($user->rights->fournisseur->commande->commander) + { + print ''.$langs->trans('SendByMail').''; + } } - } - - // Send - if (in_array($object->statut, array(2, 3, 4, 5))) - { - if ($user->rights->fournisseur->commande->commander) + + // Reopen + if (in_array($object->statut, array(2, 5, 6, 7, 9))) { - print ''.$langs->trans('SendByMail').''; + if ($user->rights->fournisseur->commande->commander) + { + print ''.$langs->trans("ReOpen").''; + } } - } - - // Reopen - if (in_array($object->statut, array(2, 5, 6, 7, 9))) - { - if ($user->rights->fournisseur->commande->commander) + + // Create bill + if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted { - print ''.$langs->trans("ReOpen").''; + if ($user->rights->fournisseur->facture->creer) + { + print ''.$langs->trans("CreateBill").''; + } + + //if ($user->rights->fournisseur->commande->creer && $object->statut > 2) + //{ + // print ''.$langs->trans("ClassifyBilled").''; + //} } - } - - // Create bill - if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted - { - if ($user->rights->fournisseur->facture->creer) + + // Cancel + if ($object->statut == 2) { - print ''.$langs->trans("CreateBill").''; + if ($user->rights->fournisseur->commande->commander) + { + print ''.$langs->trans("CancelOrder").''; + } } - - //if ($user->rights->fournisseur->commande->creer && $object->statut > 2) - //{ - // print ''.$langs->trans("ClassifyBilled").''; - //} - } - - // Cancel - if ($object->statut == 2) - { - if ($user->rights->fournisseur->commande->commander) + + // Clone + if ($user->rights->fournisseur->commande->creer) { - print ''.$langs->trans("CancelOrder").''; + print ''.$langs->trans("ToClone").''; } + + // Delete + if ($user->rights->fournisseur->commande->supprimer) + { + print ''.$langs->trans("Delete").''; + } + + print "
"; } - - // Clone - if ($user->rights->fournisseur->commande->creer) - { - print ''.$langs->trans("ToClone").''; - } - - // Delete - if ($user->rights->fournisseur->commande->supprimer) - { - print ''.$langs->trans("Delete").''; - } - - print "
"; } print "
"; From 82a2bb16904b08bedbac160bba136e19c8d65eea Mon Sep 17 00:00:00 2001 From: jean Date: Thu, 25 Sep 2014 17:00:44 +0200 Subject: [PATCH 07/21] list bof orders to process : status validated or in process, or closed but not billed --- htdocs/commande/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d699192acbf..d285a241b46 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -155,8 +155,9 @@ if ($viewstatut <> '') } if ($viewstatut == -3) // To bill { - $sql.= ' AND c.fk_statut in (1,2,3)'; - $sql.= ' AND c.facture = 0'; // invoice not created + //$sql.= ' AND c.fk_statut in (1,2,3)'; + //$sql.= ' AND c.facture = 0'; // invoice not created + $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed } } if ($ordermonth > 0) From 16facc81aa16d5130b4c29ffb6601ac02488477d Mon Sep 17 00:00:00 2001 From: jean Date: Fri, 26 Sep 2014 10:11:38 +0200 Subject: [PATCH 08/21] Add link with order when invoice made for a shioppoing --- htdocs/compta/facture.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 00c927bad99..168beb73b43 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -865,6 +865,16 @@ else if ($action == 'add' && $user->rights->facture->creer) // Possibility to add external linked objects with hooks $object->linked_objects [$object->origin] = $object->origin_id; + // link with order if it is a shipping invoice + if ($object->origin == 'shipping') + { + require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; + $exp = new Expedition($db); + $exp->fetch($object->origin_id); + $exp->fetchObjectLinked(); + if (count ($exp->linkedObjectsIds['commande']) > 0) $object->linked_objects['commande'] = $exp->linkedObjectsIds['commande'][0]; + } + if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) { $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); } From 52340e9176aa011feaf37db5a62816bbd1308c79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2014 14:18:04 +0200 Subject: [PATCH 09/21] Fix: Missing fields into select --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fa7130ec018..773fdb48b0f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -310,7 +310,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_element, a.elementtype,"; - $sql.= " a.priority, a.fulldayevent, a.location, a.transparency,"; + $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle,"; $sql.= " s.nom as socname,"; $sql.= " u.firstname, u.lastname as lastname"; @@ -961,7 +961,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_element, a.elementtype,"; - $sql.= " a.priority, a.fulldayevent, a.location,"; + $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " u.firstname, u.lastname,"; $sql.= " s.nom as socname,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle"; From eea034e0e5dce82b20d4a86a6382a7ac1910a5ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2014 15:33:13 +0200 Subject: [PATCH 10/21] Fix: 1 second missing into lastdaytoshow. --- htdocs/comm/action/index.php | 24 ++++++++++++------------ htdocs/comm/action/peruser.php | 21 ++++++++------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 8f3d82f5f9b..24502897ec1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -218,9 +218,9 @@ if (empty($action) || $action=='show_month') $tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2; $tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1); if ($tmpday >= 1) $tmpday -= 7; - // Define firstdaytoshow and lastdaytoshow + // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year); - $next_day=7-($max_day_in_month+1-$tmpday)%7; + $next_day=7 - ($max_day_in_month+1-$tmpday) % 7; if ($next_day < 6) $next_day+=7; $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); } @@ -242,9 +242,9 @@ if ($action=='show_week') $next_month = $next['month']; $next_day = $next['day']; - // Define firstdaytoshow and lastdaytoshow + // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); - $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); + $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd'); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); @@ -261,7 +261,7 @@ if ($action == 'show_day') $next_month = $next['month']; $next_day = $next['day']; - // Define firstdaytoshow and lastdaytoshow + // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$prev_day,$prev_year); $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); } @@ -522,14 +522,14 @@ if ($resql) // Check values if ($event->date_end_in_calendar < $firstdaytoshow || - $event->date_start_in_calendar > $lastdaytoshow) + $event->date_start_in_calendar >= $lastdaytoshow) { // This record is out of visible range } else { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1); // Add an entry in actionarray for each day $daycursor=$event->date_start_in_calendar; @@ -659,7 +659,7 @@ if (count($listofextcals)) if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event { //if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1); if ($icalevent['DTSTART;VALUE=DATE']) //fullday event { $datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1); @@ -698,10 +698,10 @@ if (count($listofextcals)) $until=empty($icalevent['RRULE']['UNTIL'])?0:dol_stringtotime($icalevent['RRULE']['UNTIL'],1); $maxrepeat=empty($icalevent['RRULE']['COUNT'])?0:$icalevent['RRULE']['COUNT']; if ($until && ($until+($datecurend-$datecurstart)) < $firstdaytoshow) continue; // We discard repeatable event that end before start date to show - if ($datecurstart > $lastdaytoshow) continue; // We discard repeatable event that start after end date to show + if ($datecurstart >= $lastdaytoshow) continue; // We discard repeatable event that start after end date to show $numofevent=0; - while (($datecurstart <= $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) + while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) { if ($datecurend >= $firstdaytoshow) // We add event { @@ -833,7 +833,7 @@ if (count($listofextcals)) } // Add event into $eventarray if date range are ok. - if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow) + if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow) { //print 'x'.$datestart.'-'.$dateend;exit; //print 'x'.$datestart.'-'.$dateend;exit; @@ -843,7 +843,7 @@ if (count($listofextcals)) else { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1); // Add an entry in actionarray for each day $daycursor=$event->date_start_in_calendar; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index d66765b139b..a8629f57d68 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -179,17 +179,11 @@ $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; -// Define firstdaytoshow and lastdaytoshow -$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); -$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); - $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $tmpday = $first_day; //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; -//print dol_print_date($firstdaytoshow,'day'); -//print dol_print_date($lastdaytoshow,'day'); $title=$langs->trans("DoneAndToDoActions"); if ($status == 'done') $title=$langs->trans("DoneActions"); @@ -225,9 +219,11 @@ $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; -// Define firstdaytoshow and lastdaytoshow +// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); -$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); +$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd'); +//print dol_print_date($firstdaytoshow,'dayhour'); +//print dol_print_date($lastdaytoshow,'dayhour'); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); @@ -440,14 +436,14 @@ if ($resql) // Check values if ($event->date_end_in_calendar < $firstdaytoshow || - $event->date_start_in_calendar > $lastdaytoshow) + $event->date_start_in_calendar >= $lastdaytoshow) { // This record is out of visible range } else { if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; - if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; + if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1); // Add an entry in actionarray for each day $daycursor=$event->date_start_in_calendar; @@ -459,7 +455,7 @@ if ($resql) $loop=true; $j=0; $daykey=dol_mktime(0,0,0,$mois,$jour,$annee); do - { + { //if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
'; $eventarray[$daykey][]=$event; @@ -482,7 +478,6 @@ else dol_print_error($db); } - $maxnbofchar=18; $cachethirdparties=array(); $cachecontacts=array(); @@ -647,7 +642,7 @@ foreach ($usernames as $username) } echo "\n"; - +var_dump($eventarray);exit; // Add js code to manage click on a box print ''."\n"; } - // Fiche action en mode edition print '
'; print ''; print ''; @@ -926,30 +906,33 @@ if ($id > 0) $listofuserid=array(); if (empty($donotclearsession)) { - if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first - $listofuserid=array_merge($listofuserid,$object->userassigned); + if ($object->userownerid > 0) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->userassigned[$user->id]['transparency'],'answer_status'=>$object->userassigned[$user->id]['answer_status'],'mandatory'=>$object->userassigned[$user->id]['mandatory']); // Owner first + if (! empty($object->userassigned)) // Now concat assigned users + { + // Restore array with key with same value than param 'id' + $tmplist1=$object->userassigned; $tmplist2=array(); + foreach($tmplist1 as $key => $val) + { + if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val; + } + } $_SESSION['assignedtouser']=dol_json_encode($listofuserid); } print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); - //print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'assignedtouser',1); - print ''; - - print '

'; - - // Busy - print ''; // Realised by if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) { print ''; } - print '
'.$langs->trans("Busy").''; - print 'transparency?' checked="checked"':'').'">'; + print $langs->trans("MyAvailability").': id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy"); print '
'.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers($object->userdone->id> 0?$object->userdone->id:-1,'doneby',1); + print $form->select_dolusers($object->userdoneid> 0?$object->userdoneid:-1,'doneby',1); print '


'; + print ''; + + print '

'; print ''; @@ -960,12 +943,12 @@ if ($id > 0) print ''; // Contact print ''; } @@ -979,10 +962,10 @@ if ($id > 0) $langs->load("project"); print ''; } @@ -1056,99 +1039,65 @@ if ($id > 0) if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++; // Date start - print ''; - print ''; print ''; // Date end - print ''; // Status - print ''; // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''; + print ''; } // Assigned to - //if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1); - print ''; - - print '
'; $events=array(); $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - print $form->select_company($object->thirdparty->id,'socid','',1,1,0,$events); + print $form->select_company($object->socid,'socid','',1,1,0,$events); print ''.$langs->trans("Contact").''; - $form->select_contacts($object->thirdparty->id, $object->contact->id,'contactid',1); + $form->select_contacts($object->socid, $object->contactid,'contactid',1); print '
'.$langs->trans("Project").''; - $numprojet=$formproject->select_projects($object->thirdparty->id,$object->fk_project,'projectid'); + $numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid'); if ($numprojet==0) { - print '   '.$langs->trans("AddProject").''; + print '   '.$langs->trans("AddProject").''; } print '
'.$langs->trans("DateActionStart").''; + print '
'.$langs->trans("DateActionStart").''; if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); else print dol_print_date($object->datep,'day'); if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print ''."\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; - print ''."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' '; - print '
'."\n"; - print '
'.$langs->trans("DateActionEnd").''; + print '
'.$langs->trans("DateActionEnd").''; if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); else print dol_print_date($object->datef,'day'); if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print $object->getLibStatut(4); print '
'.$langs->trans("Location").''.$object->location.'
'.$langs->trans("Location").''.$object->location.'
'.$langs->trans("ActionAffectedTo").''; + print '
'.$langs->trans("ActionAffectedTo").''; $listofuserid=array(); if (empty($donotclearsession)) { - if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first - $listofuserid=array_merge($listofuserid,$object->userassigned); + if (is_object($object->usertodo)) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->transparency); // Owner first + if (! empty($object->userassigned)) // Now concat assigned users + { + // Restore array with key with same value than param 'id' + $tmplist1=$object->userassigned; $tmplist2=array(); + foreach($tmplist1 as $key => $val) + { + if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val; + } + } $_SESSION['assignedtouser']=dol_json_encode($listofuserid); - //var_dump($_SESSION['assignedtouser']); } print $form->select_dolusers_forevent('view','assignedtouser',1); - print '


'; - - // Busy - print ''; + print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody + print ' '; // Done by if ($conf->global->AGENDA_ENABLE_DONEBY) { print ''; } - print '
'.$langs->trans("Busy").''; - if ($object->usertodo->id > 0) print yn(($object->transparency > 0)?1:0); // We show nothing if event is assigned to nobody - print '
'.$langs->trans("ActionDoneBy").''; - if ($object->userdone->id > 0) print $object->userdone->getNomUrl(1); + if ($object->userdoneid > 0) print $object->userdone->getNomUrl(1); print '


'; + print '
'; + + print '

'; + + print ''; // Third party - Contact if ($conf->societe->enabled) @@ -1164,12 +1113,12 @@ if ($id > 0) print ''; print ''; print '
'.$langs->trans("Contact").''; - if ($object->contact->id > 0) + if ($object->contactid > 0) { print $object->contact->getNomUrl(1); - if ($object->contact->id && $object->type_code == 'AC_TEL') + if ($object->contactid && $object->type_code == 'AC_TEL') { - if ($object->contact->fetch($object->contact->id)) + if ($object->contact->fetch($object->contactid)) { print "
".dol_print_phone($object->contact->phone_pro); } @@ -1250,7 +1199,7 @@ if ($id > 0) if ($action != 'edit') { if ($user->rights->agenda->allactions->create || - (($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->create)) + (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { print ''; } @@ -1260,7 +1209,7 @@ if ($id > 0) } if ($user->rights->agenda->allactions->delete || - (($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->delete)) + (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete)) { print ''; } @@ -1272,6 +1221,47 @@ if ($id > 0) } print ''; + + + // Link to agenda views + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' '; + print '
'."\n"; + print '
'; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 773fdb48b0f..fc75488ee3d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -39,9 +39,10 @@ class ActionComm extends CommonObject var $id; - var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) - var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required). With defautl setup, should be AC_OTH_AUTO or AC_OTH - var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) + var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set) + var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set) + var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set) var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) var $label; @@ -56,7 +57,7 @@ class ActionComm extends CommonObject var $datef; // Date action end (datep2) var $durationp = -1; // -1=Unkown duration // deprecated var $fulldayevent = 0; // 1=Event on full day - var $punctual = 1; // Milestone + var $punctual = 1; // Milestone // TODO Not sure we need this. Milestone is already event with end date = start date var $percentage; // Percentage var $location; // Location @@ -66,7 +67,8 @@ class ActionComm extends CommonObject var $userassigned = array(); // Array of user ids var $userownerid; // Id of user owner - var $usertodo; // Object user of owner // deprecated + var $userdoneid; // Id of user done + var $usertodo; // Object user of owner // deprecated var $userdone; // Object user that did action // deprecated var $socid; @@ -352,25 +354,29 @@ class ActionComm extends CommonObject $this->note = $obj->note; $this->percentage = $obj->percentage; - $this->author->id = $obj->fk_user_author; - $this->author->firstname = $obj->firstname; - $this->author->lastname = $obj->lastname; - $this->usermod->id = $obj->fk_user_mod; + $this->authorid = $obj->fk_user_author; + $this->usermodid = $obj->fk_user_mod; + $this->author->id = $obj->fk_user_author; // deprecated + $this->author->firstname = $obj->firstname; // deprecated + $this->author->lastname = $obj->lastname; // deprecated + $this->usermod->id = $obj->fk_user_mod; // deprecated $this->userownerid = $obj->fk_user_action; + $this->userdoneid = $obj->fk_user_done; $this->usertodo->id = $obj->fk_user_action; // deprecated - //$this->userdone->id = $obj->fk_user_done; + $this->userdone->id = $obj->fk_user_done; // deprecated $this->priority = $obj->priority; $this->fulldayevent = $obj->fulldayevent; $this->location = $obj->location; $this->transparency = $obj->transparency; + $this->punctual = $obj->punctual; $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working - $this->contactid = $obj->fk_contact; + $this->contactid = $obj->fk_contact; // To have fetch_contact method working $this->fk_project = $obj->fk_project; // To have fetch_project method working - $this->societe->id = $obj->fk_soc; // For backward compatibility - $this->contact->id = $obj->fk_contact; // For backward compatibility + $this->societe->id = $obj->fk_soc; // deprecated + $this->contact->id = $obj->fk_contact; // deprecated $this->fk_element = $obj->fk_element; $this->elementtype = $obj->elementtype; @@ -1041,6 +1047,7 @@ class ActionComm extends CommonObject $event['fulldayevent']=$obj->fulldayevent; $event['location']=$obj->location; $event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy) + $event['punctual']=$obj->punctual; $event['category']=$obj->libelle; // libelle type action // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -1146,7 +1153,7 @@ class ActionComm extends CommonObject $this->punctual=0; $this->percentage=0; $this->location='Location'; - $this->transparency=0; + $this->transparency=1; // 1 means opaque $this->priority=1; $this->note = 'Note'; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 24502897ec1..a1c03a7f15e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1140,7 +1140,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); - // Define $color and $cssclass of event + // Define $color (Hex string like '0088FF') and $cssclass of event $color=-1; $cssclass=''; $colorindex=-1; if (in_array($user->id, $keysofuserassigned)) { @@ -1163,8 +1163,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $color=$event->icalcolor; $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); } - else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } - else { $numother++; $cssclass='family_other'; } + else if ($event->type_code == 'BIRTHDAY') + { + $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); + } + else + { + $numother++; $cssclass='family_other'; + } if ($color == -1) // Color was not forced. Set color according to color index. { // Define color index if not yet defined diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 54dada1ff52..ad3bfddd2ef 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -108,7 +108,7 @@ $begin_d = GETPOST('begin_d')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tm $end_d = GETPOST('end_d')?GETPOST('end_d'):($tmparray[1] != '' ? $tmparray[1] : 5); if ($begin_d < 1 || $begin_d > 7) $begin_d = 1; if ($end_d < 1 || $end_d > 7) $end_d = 7; -if ($end_d <= $begin_d) $end_d = $begin_d + 1; +if ($end_d < $begin_d) $end_d = $begin_d + 1; if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); @@ -321,7 +321,7 @@ $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; -$sql.= ' ca.code'; +$sql.= ' ca.code, ca.color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; @@ -396,6 +396,7 @@ if ($resql) $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datef=$db->jdate($obj->datep2); $event->type_code=$obj->code; + $event->type_color=$obj->color; //$event->libelle=$obj->label; // deprecated $event->label=$obj->label; $event->percentage=$obj->percent; @@ -665,7 +666,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid + url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+dateselectday; window.location.href = url; } else /* One event */ @@ -744,12 +745,12 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); - // Define $color and $cssclass of event + // Define $color (Hex string like '0088FF') and $cssclass of event $color=-1; $cssclass=''; $colorindex=-1; if (in_array($user->id, $keysofuserassigned)) { $nummytasks++; $cssclass='family_mytasks'; - // TODO Set color according to event type + $color=$event->type_color; } else if ($event->type_code == 'ICALEVENT') { @@ -760,15 +761,19 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } $numicals[dol_string_nospecial($event->icalname)]++; } + $color=$event->icalcolor; $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); } - else if ($event->type_code == 'BIRTHDAY') { + else if ($event->type_code == 'BIRTHDAY') + { $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } - else { $numother++; $cssclass='family_other'; + else + { + $numother++; $cssclass='family_other'; } - if ($color == -1) // Color was not forced. Set color according to color index. + if ($color < 0) // Color was not forced. Set color according to color index. { // Define color index if not yet defined $idusertouse=($event->userownerid?$event->userownerid:0); @@ -791,7 +796,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & for ($h = $begin_h; $h < $end_h; $h++) { //if ($username->id == 1 && $day==1) print 'h='.$h; - $color = ''; //init + $newcolor = ''; //init if (empty($event->fulldayevent)) { $a = dol_mktime((int) $h,0,0,$month,$day,$year,false,false); @@ -801,6 +806,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $dateendtouse=$event->date_end_in_calendar; if ($dateendtouse==$event->date_start_in_calendar) $dateendtouse++; + //print dol_print_date($event->date_start_in_calendar,'dayhour').'-'.dol_print_date($a,'dayhour').'-'.dol_print_date($b,'dayhour').'
'; + if ($event->date_start_in_calendar < $b && $dateendtouse > $a) { $busy=$event->transparency; @@ -817,8 +824,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases1[$h][$event->id]['typecode']=$event->type_code; if ($event->socid) { - $cases1[$h][$event->id]['string'].='xxx'; + //$cases1[$h][$event->id]['string'].='xxx'; } + $cases1[$h][$event->id]['color']=$color; } if ($event->date_start_in_calendar < $c && $dateendtouse > $b) { @@ -836,8 +844,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases2[$h][$event->id]['typecode']=$event->type_code; if ($event->socid) { - $cases2[$h][$event->id]['string'].='xxx'; + //$cases2[$h][$event->id]['string'].='xxx'; } + $cases2[$h][$event->id]['color']=$color; } } else @@ -849,7 +858,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases2[$h][$event->id]['string']=$event->label; $cases1[$h][$event->id]['typecode']=$event->type_code; $cases2[$h][$event->id]['typecode']=$event->type_code; - //break; + $cases1[$h][$event->id]['color']='009900'; + $cases2[$h][$event->id]['color']='009900'; } } $i++; @@ -861,6 +871,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & for ($h = $begin_h; $h < $end_h; $h++) { + $color1='';$color2=''; $style1='';$style2=''; $string1=' ';$string2=' '; $title1='';$title2=''; @@ -893,20 +904,25 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $ids=array_keys($cases1[$h]); $output = array_slice($cases1[$h], 0, 1); if ($output[0]['string']) $title1.=' - '.$output[0]['string']; + if ($output[0]['color']) $color1 = $output[0]['color']; } + else if (count($cases1[$h]) > 1) $color1='222222'; + if (count($cases2[$h]) == 1) // 1 seul evenement { $ids=array_keys($cases2[$h]); $output = array_slice($cases2[$h], 0, 1); if ($output[0]['string']) $title2.=' - '.$output[0]['string']; + if ($output[0]['color']) $color2 = $output[0]['color']; } + else if (count($cases2[$h]) > 1) $color2='222222'; $ids1=join(',',array_keys($cases1[$h])); $ids2=join(',',array_keys($cases2[$h])); //var_dump($cases1[$h]); print ''; - print ''; print '
'; + print '
'; print $string1; - print ''; + print ''; print $string2; print '
'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e8dcce57ac4..f65136ec81d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -577,11 +577,15 @@ abstract class CommonObject /** * Charge le contact d'id $id dans this->contact * - * @param int $contactid Id du contact + * @param int $contactid Id du contact. Use this->contactid if empty. * @return int <0 if KO, >0 if OK */ - function fetch_contact($contactid) + function fetch_contact($contactid='') { + if (empty($contactid)) $contactid=$this->contactid; + + if (empty($contactid)) return 0; + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $contact = new Contact($this->db); $result=$contact->fetch($contactid); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8b6b656417e..33b1d42ca08 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1329,9 +1329,9 @@ class Form { $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); } - $numassignetouser=count($assignedtouser); + $nbassignetouser=count($assignedtouser); - if ($numassignetouser && $action != 'view') $out.='
'; + if ($nbassignetouser && $action != 'view') $out.='
'; $i=0; $ownerid=0; foreach($assignedtouser as $key => $value) { @@ -1339,7 +1339,7 @@ class Form $userstatic->fetch($value['id']); $out.=$userstatic->getNomUrl(1); if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; } - if ($numassignetouser > 1 && $action != 'view') $out.=' '; + if ($nbassignetouser > 1 && $action != 'view') $out.=' '; //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); $out.='
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 13003ea5cf3..5d67dc0b38e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -219,6 +219,7 @@ AutomaticIfJavascriptDisabled=Automatic if Javascript is disabled AvailableOnlyIfJavascriptNotDisabled=Available only if JavaScript is not disabled AvailableOnlyIfJavascriptAndAjaxNotDisabled=Available only if JavaScript is not disabled Required=Required +UsedOnlyWithTypeOption=Used by some agenda option only Security=Security Passwords=Passwords DoNotStoreClearPassword=Do no store clear passwords in database but store only encrypted value (Activated recommended) diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index c4c332336d2..dd793c7bfdd 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -88,4 +88,5 @@ ExtSiteUrlAgenda=URL to access .ical file ExtSiteNoLabel=No Description WorkingTimeRange=Working time range WorkingDaysRange=Working days range -AddEvent=Create event \ No newline at end of file +AddEvent=Create event +MyAvailability=Ma disponibilité \ No newline at end of file From c5a7dfbabb36c3af7bda87de84ab6c738b860a09 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 29 Sep 2014 14:40:02 +0200 Subject: [PATCH 19/21] Fix: Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; --- htdocs/core/class/hookmanager.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 9d8ce90e812..52dc25dd452 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2014 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -152,7 +152,7 @@ class HookManager $modulealreadyexecuted=array(); $resaction=0; $error=0; $result=''; $this->resPrint=''; $this->resArray=array(); - foreach($this->hooks as $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context + foreach($this->hooks as $context => $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context { if (! empty($modules)) { @@ -166,6 +166,8 @@ class HookManager // test to avoid to run twice a hook, when a module implements several active contexts if (in_array($module,$modulealreadyexecuted)) continue; $modulealreadyexecuted[$module]=$module; + // Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; + $parameters['currentcontext'] = $context; // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { From 3d82f0965ec3747002232d821f7a8e1087126dfd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 29 Sep 2014 15:20:54 +0200 Subject: [PATCH 20/21] Fix: Try to filter by context, use the test with $currentcontext in method for avoid to run twice (I have not found any other solution!) --- htdocs/core/class/hookmanager.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 52dc25dd452..c402353e8d7 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -156,6 +156,8 @@ class HookManager { if (! empty($modules)) { + $modulealreadyexecuted[$context]=array(); // Filter by context + foreach($modules as $module => $actionclassinstance) { //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."
\n"; @@ -164,8 +166,8 @@ class HookManager // jump to next class if method does not exists if (! method_exists($actionclassinstance,$method)) continue; // test to avoid to run twice a hook, when a module implements several active contexts - if (in_array($module,$modulealreadyexecuted)) continue; - $modulealreadyexecuted[$module]=$module; + if (in_array($module,$modulealreadyexecuted[$context])) continue; + $modulealreadyexecuted[$context][$module]=$module; // Use the $currentcontext in method for avoid to run twice // Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; $parameters['currentcontext'] = $context; // Hooks that must return int (hooks with type 'addreplace') From cb302c16e746197e91a90c12585dcc1f5a081514 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Sep 2014 16:22:00 +0200 Subject: [PATCH 21/21] Bad place of code --- htdocs/accountancy/journal/bankjournal.php | 47 +++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 537dc3476fd..cb308a7e1af 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -137,17 +137,19 @@ if ($result) { $tabpay = array (); $tabbq = array (); $tabtp = array (); - $tabcompany[$obj->rowid] = array ( - 'id' => $obj->socid, - 'name' => $obj->name, - 'code_client' => $obj->code_compta - ); $tabtype = array (); $i = 0; - while ( $i < $num ) { + while ( $i < $num ) + { $obj = $db->fetch_object($result); + $tabcompany[$obj->rowid] = array( + 'id' => $obj->socid, + 'name' => $obj->name, + 'code_client' => $obj->code_compta + ); + // Controls $compta_bank = $obj->account_number; if ($obj->label == '(SupplierInvoicePayment)') @@ -169,15 +171,15 @@ if ($result) { } $links = $object->get_url($obj->rowid); - foreach ( $links as $key => $val ) { - + foreach ( $links as $key => $val ) + { $tabtype[$obj->rowid] = $links[$key]['type']; if ($links[$key]['type'] == 'payment') { $paymentstatic->id = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2); - } + } else if ($links[$key]['type'] == 'payment_supplier') { $paymentsupplierstatic->id = $links[$key]['url_id']; @@ -232,7 +234,7 @@ if ($result) { $tabtp[$obj->rowid][$cpttva] += $obj->amount; } else if ($links[$key]['type'] == 'payment_salary') - { + { $paymentsalstatic->id = $links[$key]['url_id']; $paymentsalstatic->ref = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2); @@ -259,14 +261,17 @@ if ($result) { /* * Actions -*/ + */ // Write bookkeeping -if ($action == 'writeBookKeeping') { +if ($action == 'writeBookKeeping') +{ $error = 0; - foreach ( $tabpay as $key => $val ) { + foreach ( $tabpay as $key => $val ) + { // Bank - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ( $tabbq[$key] as $k => $mt ) + { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_ref = $val["ref"]; @@ -317,8 +322,8 @@ if ($action == 'writeBookKeeping') { } } // Third party - foreach ( $tabtp[$key] as $k => $mt ) { - + foreach ( $tabtp[$key] as $k => $mt ) + { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_ref = $val["ref"]; @@ -399,7 +404,8 @@ if ($action == 'writeBookKeeping') { } } // export csv -if ($action == 'export_csv') { +if ($action == 'export_csv') +{ $sep = $conf->global->ACCOUNTING_SEPARATORCSV; header('Content-Type: text/csv'); @@ -482,7 +488,9 @@ if ($action == 'export_csv') { } } } -} else { +} +else +{ $form = new Form($db); @@ -580,4 +588,5 @@ if ($action == 'export_csv') { // End of page llxFooter(); } -$db->close(); \ No newline at end of file + +$db->close();