Enhancement in ecm module
This commit is contained in:
parent
f67962a049
commit
32801a3655
@ -236,7 +236,7 @@ print '<table class="nobordernopadding" width="100%"><tr><td valign="top">';
|
|||||||
|
|
||||||
if (eregi('search',$action))
|
if (eregi('search',$action))
|
||||||
{
|
{
|
||||||
//print_fiche_titre($langs->trans("ECMManualOrg"));
|
//print_fiche_titre($langs->trans("ECMSectionsManual"));
|
||||||
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/ecm/search.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/ecm/search.php">';
|
||||||
print '<table class="nobordernopadding" width="100%">';
|
print '<table class="nobordernopadding" width="100%">';
|
||||||
@ -249,7 +249,7 @@ if (eregi('search',$action))
|
|||||||
print "</table></form>";
|
print "</table></form>";
|
||||||
//print $langs->trans("ECMManualOrgDesc");
|
//print $langs->trans("ECMManualOrgDesc");
|
||||||
|
|
||||||
//print_fiche_titre($langs->trans("ECMAutoOrg"));
|
//print_fiche_titre($langs->trans("ECMSectionAuto"));
|
||||||
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/ecm/search.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/ecm/search.php">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -279,7 +279,7 @@ if (eregi('search',$action))
|
|||||||
|
|
||||||
print '<tr '. $bc[false].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
print '<tr '. $bc[false].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
||||||
print "</table></form>";
|
print "</table></form>";
|
||||||
//print $langs->trans("ECMAutoOrgDesc");
|
//print $langs->trans("ECMSectionAutoDesc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre" align="left">'.$langs->trans("ECMSections").'</td>';
|
print '<td class="liste_titre" align="left">'.$langs->trans("ECMSections").'</td>';
|
||||||
print '<td class="liste_titre" colspan="4" align="right">';
|
print '<td class="liste_titre" colspan="5" align="right">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshmanual'.($section?'&section='.$section:'').'">'.$langs->trans("Refresh").' '.img_picto($langs->trans("Refresh"),'refresh').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshmanual'.($section?'&section='.$section:'').'">'.$langs->trans("Refresh").' '.img_picto($langs->trans("Refresh"),'refresh').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -313,13 +313,14 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
|
||||||
print '<td align="left" width="24px">';
|
print '<td align="left" width="24px">';
|
||||||
print img_picto_common('','treemenu/base.gif');
|
print img_picto_common('','treemenu/base.gif');
|
||||||
print '</td><td align="left">'.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionAuto").')';
|
print '</td><td align="left">'.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsAuto").')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
||||||
print $form->textwithhelp('',$htmltooltip,1,0);
|
print $form->textwithhelp('',$htmltooltip,1,0);
|
||||||
@ -343,15 +344,28 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
||||||
tree_showpad($sectionauto,$key);
|
tree_showpad($sectionauto,$key);
|
||||||
print '</td><td valign="top">';
|
print '</td>';
|
||||||
print img_picto('','object_dir');
|
|
||||||
print '</td><td valign="middle"> ';
|
print '<td valign="top">';
|
||||||
|
$n=3;
|
||||||
|
$ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/plustop'.$n.'.gif','',1);
|
||||||
|
$oldref=$ecmdirstatic->ref;
|
||||||
|
$ecmdirstatic->ref=$ref;
|
||||||
|
print $ecmdirstatic->getNomUrl(0,$option);
|
||||||
|
$ecmdirstatic->ref=$oldref;
|
||||||
|
print img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/folder.gif','',1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td valign="middle">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/ecm/docother.php">';
|
print '<a href="'.DOL_URL_ROOT.'/ecm/docother.php">';
|
||||||
print $val['label'];
|
print $val['label'];
|
||||||
print '</a></td></tr></table>';
|
print '</a></td></tr></table>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Nb of doc
|
// Nb of doc in dir
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
|
||||||
|
// Nb of doc in subdir
|
||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
|
|
||||||
// Edit link
|
// Edit link
|
||||||
@ -363,7 +377,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
// Info
|
// Info
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMAutoOrg").'<br>';
|
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
|
||||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
|
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
|
||||||
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
|
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
|
||||||
print $form->textwithhelp('',$htmltooltip,1,0);
|
print $form->textwithhelp('',$htmltooltip,1,0);
|
||||||
@ -382,7 +396,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
|
||||||
print '<td align="left" width="24px">';
|
print '<td align="left" width="24px">';
|
||||||
print img_picto_common('','treemenu/base.gif');
|
print img_picto_common('','treemenu/base.gif');
|
||||||
print '</td><td align="left">'.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionManual").')';
|
print '</td><td align="left">'.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsManual").')';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
@ -390,6 +404,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
//print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create">'.img_edit_add().'</a></td>';
|
//print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create">'.img_edit_add().'</a></td>';
|
||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
||||||
print $form->textwithhelp('',$htmltooltip,1,0);
|
print $form->textwithhelp('',$htmltooltip,1,0);
|
||||||
@ -488,8 +503,11 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
||||||
$resarray=tree_showpad($fulltree,$key);
|
$resarray=tree_showpad($fulltree,$key);
|
||||||
$a=$resarray[0];
|
$a=$resarray[0];
|
||||||
$b=$resarray[1];
|
$nbofsubdir=$resarray[1];
|
||||||
|
$c=$resarray[2];
|
||||||
|
$nboffilesinsubdir=$resarray[3];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Show picto
|
// Show picto
|
||||||
print '<td valign="top">';
|
print '<td valign="top">';
|
||||||
//print $val['fullpath']."(".$showline.")";
|
//print $val['fullpath']."(".$showline.")";
|
||||||
@ -515,8 +533,13 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Nb of docs
|
// Nb of docs
|
||||||
print '<td align="right">'.$val['cachenbofdoc'].'</td>';
|
print '<td align="right">';
|
||||||
|
print $val['cachenbofdoc'];
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="left">';
|
||||||
|
if ($nbofsubdir && $nboffilesinsubdir) print '<font color="#AAAAAA">+'.$nboffilesinsubdir.'</font> ';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Edit link
|
// Edit link
|
||||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$val['id'].'">'.img_edit().'</a></td>';
|
print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$val['id'].'">'.img_edit().'</a></td>';
|
||||||
|
|
||||||
@ -529,10 +552,13 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
$userstatic->id=$val['fk_user_c'];
|
$userstatic->id=$val['fk_user_c'];
|
||||||
$userstatic->nom=$val['login_c'];
|
$userstatic->nom=$val['login_c'];
|
||||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMManualOrg").'<br>';
|
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
|
||||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
|
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
|
||||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.dolibarr_print_date($val['date_c'],"dayhour").'<br>';
|
$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.dolibarr_print_date($val['date_c'],"dayhour").'<br>';
|
||||||
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['description'];
|
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
|
||||||
|
$htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>';
|
||||||
|
if ($nbofsubdir) $htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
|
||||||
|
else $htmltooltip.='<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.$nbofsubdir.'<br>';
|
||||||
print $form->textwithhelp('',$htmltooltip,1,0);
|
print $form->textwithhelp('',$htmltooltip,1,0);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
See http://dolibarr.com/wikidev/index.php/Documentation_traducteur
|
See http://dolibarr.com/wikidev/index.php/Documentation_traducteur
|
||||||
|
|||||||
@ -13,6 +13,8 @@ ECMNbOfDocsSmall=Nb of doc.
|
|||||||
ECMSection=Directory
|
ECMSection=Directory
|
||||||
ECMSectionManual=Manual directory
|
ECMSectionManual=Manual directory
|
||||||
ECMSectionAuto=Automatic directory
|
ECMSectionAuto=Automatic directory
|
||||||
|
ECMSectionsManual=Manual directories
|
||||||
|
ECMSectionsAuto=Automatic directories
|
||||||
ECMSections=Directories
|
ECMSections=Directories
|
||||||
ECMRoot=Root
|
ECMRoot=Root
|
||||||
ECMNewSection=New directory
|
ECMNewSection=New directory
|
||||||
@ -20,6 +22,9 @@ ECMAddSection=Add a manual directory
|
|||||||
ECMNewSection=New manual directory
|
ECMNewSection=New manual directory
|
||||||
ECMNewDocument=New document
|
ECMNewDocument=New document
|
||||||
ECMCreationDate=Creation date
|
ECMCreationDate=Creation date
|
||||||
|
ECMNbOfFilesInDir=Number of files in directory
|
||||||
|
ECMNbOfSubDir=Number of sub-directories
|
||||||
|
ECMNbOfFilesInSubDir=Nunber of iles in sub-directories
|
||||||
ECMCreationUser=Creator
|
ECMCreationUser=Creator
|
||||||
ECMArea=ECM area
|
ECMArea=ECM area
|
||||||
ECMAreaDesc=The ECM (Electronic Content Management) area allows you to save, share and search quickly all kind of documents in Dolibarr.
|
ECMAreaDesc=The ECM (Electronic Content Management) area allows you to save, share and search quickly all kind of documents in Dolibarr.
|
||||||
@ -37,8 +42,6 @@ ECMDocsByOrders=Documents linked to customers orders
|
|||||||
ECMDocsByContracts=Documents linked to contracts
|
ECMDocsByContracts=Documents linked to contracts
|
||||||
ECMDocsByInvoices=Documents linked to customers invoices
|
ECMDocsByInvoices=Documents linked to customers invoices
|
||||||
ECMDocsByProducts=Documents linked to products
|
ECMDocsByProducts=Documents linked to products
|
||||||
ECMManualOrg=Manual directory
|
|
||||||
ECMAutoOrg=Automatic directory
|
|
||||||
ECMNoDirecotyYet=No directory created
|
ECMNoDirecotyYet=No directory created
|
||||||
ShowECMSection=Show directory
|
ShowECMSection=Show directory
|
||||||
DeleteSection=Remove directory
|
DeleteSection=Remove directory
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
google.lang
|
google.lang
|
||||||
|
|||||||
@ -8,28 +8,33 @@ DocsContracts=Documents contrats
|
|||||||
DocsProposals=Documents propositions
|
DocsProposals=Documents propositions
|
||||||
DocsOrders=Documents commandes
|
DocsOrders=Documents commandes
|
||||||
DocsInvoices=Documents factures
|
DocsInvoices=Documents factures
|
||||||
ECMNbOfDocs=Nb de documents de la rubrique
|
ECMNbOfDocs=Nb de documents du répertoire
|
||||||
ECMNbOfDocsSmall=Nb de doc.
|
ECMNbOfDocsSmall=Nb de doc.
|
||||||
ECMSection=Rubrique
|
ECMSection=Répertoire
|
||||||
ECMSectionManual=Rubriques manuelles
|
ECMSectionManual=Répertoire manuel
|
||||||
ECMSectionAuto=Rubriques automatiques
|
ECMSectionAuto=Répertoire automatique
|
||||||
ECMSections=Rubriques
|
ECMSectionsManual=Répertoires manuels
|
||||||
|
ECMSectionsAuto=Répertoires automatiques
|
||||||
|
ECMSections=Répertoires
|
||||||
ECMRoot=Racine
|
ECMRoot=Racine
|
||||||
ECMNewSection=Nouvelle rubrique
|
ECMNewSection=Nouveau répertoire
|
||||||
ECMAddSection=Ajouter rubrique manuelle
|
ECMAddSection=Ajouter répertoire manuel
|
||||||
ECMNewSection=Nouvelle rubrique manuelle
|
ECMNewSection=Nouveau répertoire manuel
|
||||||
ECMNewDocument=Nouveau document
|
ECMNewDocument=Nouveau document
|
||||||
ECMCreationDate=Date création
|
ECMCreationDate=Date création
|
||||||
|
ECMNbOfFilesInDir=Nombre de fichiers dans le répertoire
|
||||||
|
ECMNbOfSubDir=Nombre de sous-répertoires
|
||||||
|
ECMNbOfFilesInSubDir=Nombre de fichiers dans les sous-répertoires
|
||||||
ECMCreationUser=Créateur
|
ECMCreationUser=Créateur
|
||||||
ECMArea=Espace GED
|
ECMArea=Espace GED
|
||||||
ECMAreaDesc=L'espace GED (Gestion Electronique de Documents) vous permet de stocker dans Dolibarr et retrouver rapidement tout type de documents.
|
ECMAreaDesc=L'espace GED (Gestion Electronique de Documents) vous permet de stocker dans Dolibarr et retrouver rapidement tout type de documents.
|
||||||
ECMAreaDesc2=* Les rubriques automatiques sont alimentées automatiquement lors de l'ajout d'un document depuis une fiche objet (propal, facture...).<br>* Les rubriques manuelles peuvent etre utilisées pour stocker des documents divers, non liés à un objet particulier.
|
ECMAreaDesc2=* Les répertoires automatiques sont alimentées automatiquement lors de l'ajout d'un document depuis une fiche objet (propal, facture...).<br>* Les répertoires manuels peuvent etre utilisées pour stocker des documents divers, non liés à un objet particulier.
|
||||||
ECMSectionWasRemoved=La rubrique <b>%s</b> a été effacée.
|
ECMSectionWasRemoved=Le répertoire <b>%s</b> a été effacée.
|
||||||
ECMDocumentsSection=Document de la section
|
ECMDocumentsSection=Document de la section
|
||||||
ECMSearchByKeywords=Recherche par mots clés
|
ECMSearchByKeywords=Recherche par mots clés
|
||||||
ECMSearchByEntity=Recherche par objet
|
ECMSearchByEntity=Recherche par objet
|
||||||
ECMSectionOfDocuments=Rubriques des documents
|
ECMSectionOfDocuments=Répertoires des documents
|
||||||
ECMTypeManual=Manuelle
|
ECMTypeManual=Manuel
|
||||||
ECMTypeAuto=Automatique
|
ECMTypeAuto=Automatique
|
||||||
ECMDocsByThirdParties=Documents associés aux tiers
|
ECMDocsByThirdParties=Documents associés aux tiers
|
||||||
ECMDocsByProposals=Documents associés aux propositions
|
ECMDocsByProposals=Documents associés aux propositions
|
||||||
@ -37,13 +42,11 @@ ECMDocsByOrders=Documents associ
|
|||||||
ECMDocsByContracts=Documents associés aux contrats
|
ECMDocsByContracts=Documents associés aux contrats
|
||||||
ECMDocsByInvoices=Documents associés aux factures
|
ECMDocsByInvoices=Documents associés aux factures
|
||||||
ECMDocsByProducts=Documents associés aux produits
|
ECMDocsByProducts=Documents associés aux produits
|
||||||
ECMManualOrg=Rubrique manuelle
|
ECMNoDirecotyYet=Aucun répertoire créée
|
||||||
ECMAutoOrg=Rubrique automatique
|
ShowECMSection=Afficher répertoire
|
||||||
ECMNoDirecotyYet=Aucune rubrique créée
|
DeleteSection=Suppression répertoire
|
||||||
ShowECMSection=Afficher rubrique
|
ConfirmDeleteSection=Confirmez-vous la suppression du répertoire <b>%s</b> ?
|
||||||
DeleteSection=Suppression rubrique
|
|
||||||
ConfirmDeleteSection=Confirmez-vous la suppression de la rubrique <b>%s</b> ?
|
|
||||||
ECMDirectoryForFiles=Répertoire relatif pour les fichiers
|
ECMDirectoryForFiles=Répertoire relatif pour les fichiers
|
||||||
CannotRemoveDirectoryContainsFiles=Suppression impossible car des fichiers sont présents
|
CannotRemoveDirectoryContainsFiles=Suppression impossible car des fichiers sont présents
|
||||||
ECMFileManager=Gestionnaire fichier
|
ECMFileManager=Gestionnaire fichier
|
||||||
ECMSelectASection=Selectionner une rubrique sur l'arbre de gauche...
|
ECMSelectASection=Selectionner un répertoire sur l'arbre de gauche...
|
||||||
@ -23,4 +23,4 @@ Enfin, la loi pour la confiance dans l'
|
|||||||
|
|
||||||
<P class="bodytext">Ainsi, les entreprises peuvent jusqu'au 22 décembre 2004 adresser, à partir de fichiers constitués dans le respect des dispositions de la loi Informatique et libertés du 6 janvier 1978, un courrier électronique afin de recueillir le consentement des personnes. L'absence de réponse de celles-ci dans la période des 6 mois équivaudra à un refus d'être démarché. </P>
|
<P class="bodytext">Ainsi, les entreprises peuvent jusqu'au 22 décembre 2004 adresser, à partir de fichiers constitués dans le respect des dispositions de la loi Informatique et libertés du 6 janvier 1978, un courrier électronique afin de recueillir le consentement des personnes. L'absence de réponse de celles-ci dans la période des 6 mois équivaudra à un refus d'être démarché. </P>
|
||||||
<P class="bodytext">Indépendamment des règles spécifiques prévues dans le code des postes et des télécommunications et dans celui de la consommation, les opérations de prospection par courrier électronique, quelque soit leur nature (commerciale, caritative, politique, religieuse ou associative par exemple), sont soumises au respect de la législation relative à la protection des données personnelles, à savoir la <a href="http://www.cnil.fr/index.php?id=301" target="cnil">loi Informatique et Libertés du 6 janvier 1978</a>.
|
<P class="bodytext">Indépendamment des règles spécifiques prévues dans le code des postes et des télécommunications et dans celui de la consommation, les opérations de prospection par courrier électronique, quelque soit leur nature (commerciale, caritative, politique, religieuse ou associative par exemple), sont soumises au respect de la législation relative à la protection des données personnelles, à savoir la <a href="http://www.cnil.fr/index.php?id=301" target="cnil">loi Informatique et Libertés du 6 janvier 1978</a>.
|
||||||
</P>
|
</P>
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
htmlMimeMail
|
htmlMimeMail
|
||||||
|
|||||||
@ -1,69 +1,69 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/lib/invoice.lib.php
|
\file htdocs/lib/invoice.lib.php
|
||||||
\brief Ensemble de fonctions de base pour le module factures
|
\brief Ensemble de fonctions de base pour le module factures
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
|
|
||||||
Ensemble de fonctions de base de dolibarr sous forme d'include
|
Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showArrayOfBookmark($fac)
|
function showArrayOfBookmark($fac)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.rowid as socid, s.nom, b.rowid as bid";
|
$sql = "SELECT s.rowid as socid, s.nom, b.rowid as bid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b";
|
||||||
$sql .= " WHERE b.fk_soc = s.rowid AND b.fk_user = ".$user->id;
|
$sql .= " WHERE b.fk_soc = s.rowid AND b.fk_user = ".$user->id;
|
||||||
$sql .= " ORDER BY lower(s.nom) ASC";
|
$sql .= " ORDER BY lower(s.nom) ASC";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Bookmarks")."</td></tr>\n";
|
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Bookmarks")."</td></tr>\n";
|
||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="fiche.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
|
print '<td><a href="fiche.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
|
||||||
print '<td align="right"><a href="index.php?action=del_bookmark&bid='.$obj->bid.'">'.img_delete().'</a></td>';
|
print '<td align="right"><a href="index.php?action=del_bookmark&bid='.$obj->bid.'">'.img_delete().'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -21,41 +21,41 @@
|
|||||||
\file htdocs/lib/contract.lib.php
|
\file htdocs/lib/contract.lib.php
|
||||||
\brief Ensemble de fonctions de base pour le module contrat
|
\brief Ensemble de fonctions de base pour le module contrat
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function contract_prepare_head($contrat)
|
function contract_prepare_head($contrat)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/fiche.php?id='.$contrat->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/fiche.php?id='.$contrat->id;
|
||||||
$head[$h][1] = $langs->trans("ContractCard");
|
$head[$h][1] = $langs->trans("ContractCard");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$contrat->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$contrat->id;
|
||||||
$head[$h][1] = $langs->trans("ContractContacts");
|
$head[$h][1] = $langs->trans("ContractContacts");
|
||||||
$head[$h][2] = 'contact';
|
$head[$h][2] = 'contact';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$contrat->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$contrat->id;
|
||||||
$head[$h][1] = $langs->trans("Note");
|
$head[$h][1] = $langs->trans("Note");
|
||||||
$head[$h][2] = 'note';
|
$head[$h][2] = 'note';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$contrat->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$contrat->id;
|
||||||
$head[$h][1] = $langs->trans("Documents");
|
$head[$h][1] = $langs->trans("Documents");
|
||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$contrat->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$contrat->id;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -1,27 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \mainpage Dolibarr project
|
* \mainpage Dolibarr project
|
||||||
*
|
*
|
||||||
* This is source documentation for Dolibarr.<br>
|
* This is source documentation for Dolibarr.<br>
|
||||||
* This documentation can be built or updated running the script <b>dolibarr-doxygen-build.pl</b><br>
|
* This documentation can be built or updated running the script <b>dolibarr-doxygen-build.pl</b><br>
|
||||||
* <br>
|
* <br>
|
||||||
* Dolibarr official web site: <a href="http://dolibarr.org">dolibarr.org</a><br>
|
* Dolibarr official web site: <a href="http://dolibarr.org">dolibarr.org</a><br>
|
||||||
*/
|
*/
|
||||||
@ -1,11 +1,11 @@
|
|||||||
// Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
// Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
//
|
//
|
||||||
// Script javascript mis en bas de page (avant fin de body)
|
// Script javascript mis en bas de page (avant fin de body)
|
||||||
//
|
//
|
||||||
// \file htdocs/lib/lib_foot.js
|
// \file htdocs/lib/lib_foot.js
|
||||||
// \brief File that include javascript functions (included if option use_javascript activated)
|
// \brief File that include javascript functions (included if option use_javascript activated)
|
||||||
// \version $Revision$
|
// \version $Revision$
|
||||||
|
|
||||||
|
|
||||||
/***********************************************
|
/***********************************************
|
||||||
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
|
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
|
||||||
@ -81,4 +81,4 @@ function hidetip()
|
|||||||
|
|
||||||
document.onmousemove=positiontip;
|
document.onmousemove=positiontip;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,415 +1,415 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/lib/tax.lib.php
|
\file htdocs/lib/tax.lib.php
|
||||||
\ingroup tax
|
\ingroup tax
|
||||||
\brief Library for tax module
|
\brief Library for tax module
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Look for collectable VAT clients in the chosen year
|
* \brief Look for collectable VAT clients in the chosen year
|
||||||
* \param db Database handle
|
* \param db Database handle
|
||||||
* \param y Year
|
* \param y Year
|
||||||
* \param modetax 0 or 1 (option vat on debit)
|
* \param modetax 0 or 1 (option vat on debit)
|
||||||
* \param direction 'sell' or 'buy'
|
* \param direction 'sell' or 'buy'
|
||||||
* \return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
|
* \return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
|
||||||
*/
|
*/
|
||||||
function vat_by_thirdparty($db, $y, $modetax, $direction)
|
function vat_by_thirdparty($db, $y, $modetax, $direction)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$list=array();
|
$list=array();
|
||||||
//print "xx".$conf->global->MAIN_MODULE_COMPTABILITEEXPERT;
|
//print "xx".$conf->global->MAIN_MODULE_COMPTABILITEEXPERT;
|
||||||
//print "xx".$conf->global->MAIN_MODULE_COMPTABILITE;
|
//print "xx".$conf->global->MAIN_MODULE_COMPTABILITE;
|
||||||
|
|
||||||
if ($direction == 'sell')
|
if ($direction == 'sell')
|
||||||
{
|
{
|
||||||
$invoicetable='facture';
|
$invoicetable='facture';
|
||||||
$invoicedettable='facturedet';
|
$invoicedettable='facturedet';
|
||||||
$fk_facture='fk_facture';
|
$fk_facture='fk_facture';
|
||||||
$total_tva='total_tva';
|
$total_tva='total_tva';
|
||||||
}
|
}
|
||||||
if ($direction == 'buy')
|
if ($direction == 'buy')
|
||||||
{
|
{
|
||||||
$invoicetable='facture_fourn';
|
$invoicetable='facture_fourn';
|
||||||
$invoicedettable='facture_fourn_det';
|
$invoicedettable='facture_fourn_det';
|
||||||
$fk_facture='fk_facture_fourn';
|
$fk_facture='fk_facture_fourn';
|
||||||
$total_tva='tva';
|
$total_tva='tva';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define sql request
|
// Define sql request
|
||||||
$sql='';
|
$sql='';
|
||||||
if ($modetax == 1)
|
if ($modetax == 1)
|
||||||
{
|
{
|
||||||
// If vat payed on due invoices (non draft)
|
// If vat payed on due invoices (non draft)
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
||||||
{
|
{
|
||||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||||
// n'est pas stocké dans la table des payments.
|
// n'est pas stocké dans la table des payments.
|
||||||
// Seul le module compta expert peut résoudre ce problème.
|
// Seul le module compta expert peut résoudre ce problème.
|
||||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||||
// detail part tva et part ht).
|
// detail part tva et part ht).
|
||||||
$sql = 'TODO';
|
$sql = 'TODO';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom as nom, s.tva_intra as tva_intra,";
|
$sql = "SELECT s.nom as nom, s.tva_intra as tva_intra,";
|
||||||
$sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,";
|
$sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,";
|
||||||
$sql.= " s.tva_assuj as assuj, s.rowid as socid";
|
$sql.= " s.tva_assuj as assuj, s.rowid as socid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f, ".MAIN_DB_PREFIX.$invoicedettable." as fd, ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f, ".MAIN_DB_PREFIX.$invoicedettable." as fd, ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= " WHERE ";
|
$sql.= " WHERE ";
|
||||||
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
||||||
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
||||||
$sql.= " AND s.rowid = f.fk_soc AND f.rowid = fd.".$fk_facture;
|
$sql.= " AND s.rowid = f.fk_soc AND f.rowid = fd.".$fk_facture;
|
||||||
$sql.= " GROUP BY s.rowid";
|
$sql.= " GROUP BY s.rowid";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
||||||
{
|
{
|
||||||
// If vat payed on payments
|
// If vat payed on payments
|
||||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||||
// n'est pas stocké dans la table des payments.
|
// n'est pas stocké dans la table des payments.
|
||||||
// Seul le module compta expert peut résoudre ce problème.
|
// Seul le module compta expert peut résoudre ce problème.
|
||||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||||
// detail part tva et part ht).
|
// detail part tva et part ht).
|
||||||
$sql = 'TODO';
|
$sql = 'TODO';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
||||||
{
|
{
|
||||||
// Tva sur factures payés (should be on payment)
|
// Tva sur factures payés (should be on payment)
|
||||||
/* $sql = "SELECT s.nom as nom, s.tva_intra as tva_intra,";
|
/* $sql = "SELECT s.nom as nom, s.tva_intra as tva_intra,";
|
||||||
$sql.= " sum(fd.total_ht) as amount, sum(".$total_tva.") as tva,";
|
$sql.= " sum(fd.total_ht) as amount, sum(".$total_tva.") as tva,";
|
||||||
$sql.= " s.tva_assuj as assuj, s.rowid as socid";
|
$sql.= " s.tva_assuj as assuj, s.rowid as socid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f, ".MAIN_DB_PREFIX.$invoicetable." as fd, ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f, ".MAIN_DB_PREFIX.$invoicetable." as fd, ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= " WHERE ";
|
$sql.= " WHERE ";
|
||||||
$sql.= " f.fk_statut in (2)"; // Payed (partially or completely)
|
$sql.= " f.fk_statut in (2)"; // Payed (partially or completely)
|
||||||
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
||||||
$sql.= " AND s.rowid = f.fk_soc AND f.rowid = fd.".$fk_facture;
|
$sql.= " AND s.rowid = f.fk_soc AND f.rowid = fd.".$fk_facture;
|
||||||
$sql.= " GROUP BY s.rowid";
|
$sql.= " GROUP BY s.rowid";
|
||||||
*/
|
*/
|
||||||
$sql = 'TODO';
|
$sql = 'TODO';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $sql) return -1;
|
if (! $sql) return -1;
|
||||||
if ($sql && $sql=='TODO') return -2;
|
if ($sql && $sql=='TODO') return -2;
|
||||||
if ($sql && $sql!='TODO')
|
if ($sql && $sql!='TODO')
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Client::vat_by_customer sql=".$sql);
|
dolibarr_syslog("Client::vat_by_customer sql=".$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
while($assoc = $db->fetch_array($resql))
|
while($assoc = $db->fetch_array($resql))
|
||||||
{
|
{
|
||||||
$list[] = $assoc;
|
$list[] = $assoc;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Gets VAT to collect for the given month of the given year
|
* \brief Gets VAT to collect for the given month of the given year
|
||||||
* The function gets the VAT in split results, as the VAT declaration asks
|
* The function gets the VAT in split results, as the VAT declaration asks
|
||||||
* to report the amounts for different VAT rates as different lines.
|
* to report the amounts for different VAT rates as different lines.
|
||||||
* This function also accounts recurrent invoices
|
* This function also accounts recurrent invoices
|
||||||
* \param db Database handler object
|
* \param db Database handler object
|
||||||
* \param y Year
|
* \param y Year
|
||||||
* \param q Year quarter (1-4)
|
* \param q Year quarter (1-4)
|
||||||
* \param modetax 0 or 1 (option vat on debit)
|
* \param modetax 0 or 1 (option vat on debit)
|
||||||
* \param direction 'sell' or 'buy'
|
* \param direction 'sell' or 'buy'
|
||||||
* \return array List of quarters with vat
|
* \return array List of quarters with vat
|
||||||
*/
|
*/
|
||||||
function vat_by_quarter($db, $y, $q, $modetax, $direction)
|
function vat_by_quarter($db, $y, $q, $modetax, $direction)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$list=array();
|
$list=array();
|
||||||
|
|
||||||
if ($direction == 'sell')
|
if ($direction == 'sell')
|
||||||
{
|
{
|
||||||
$invoicetable='facture';
|
$invoicetable='facture';
|
||||||
$invoicedettable='facturedet';
|
$invoicedettable='facturedet';
|
||||||
$fk_facture='fk_facture';
|
$fk_facture='fk_facture';
|
||||||
$fk_facture2='fk_facture';
|
$fk_facture2='fk_facture';
|
||||||
$fk_payment='fk_paiement';
|
$fk_payment='fk_paiement';
|
||||||
$total_tva='total_tva';
|
$total_tva='total_tva';
|
||||||
$paymenttable='paiement';
|
$paymenttable='paiement';
|
||||||
$paymentfacturetable='paiement_facture';
|
$paymentfacturetable='paiement_facture';
|
||||||
}
|
}
|
||||||
if ($direction == 'buy')
|
if ($direction == 'buy')
|
||||||
{
|
{
|
||||||
$invoicetable='facture_fourn';
|
$invoicetable='facture_fourn';
|
||||||
$invoicedettable='facture_fourn_det';
|
$invoicedettable='facture_fourn_det';
|
||||||
$fk_facture='fk_facture_fourn';
|
$fk_facture='fk_facture_fourn';
|
||||||
$fk_facture2='fk_facturefourn';
|
$fk_facture2='fk_facturefourn';
|
||||||
$fk_payment='fk_paiementfourn';
|
$fk_payment='fk_paiementfourn';
|
||||||
$total_tva='tva';
|
$total_tva='tva';
|
||||||
$paymenttable='paiementfourn';
|
$paymenttable='paiementfourn';
|
||||||
$paymentfacturetable='paiementfourn_facturefourn';
|
$paymentfacturetable='paiementfourn_facturefourn';
|
||||||
}
|
}
|
||||||
|
|
||||||
// CAS DES BIENS
|
// CAS DES BIENS
|
||||||
|
|
||||||
// Define sql request
|
// Define sql request
|
||||||
$sql='';
|
$sql='';
|
||||||
if ($modetax == 1)
|
if ($modetax == 1)
|
||||||
{
|
{
|
||||||
// If vat payed on due invoices (non draft)
|
// If vat payed on due invoices (non draft)
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
||||||
{
|
{
|
||||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||||
// n'est pas stocké dans la table des payments.
|
// n'est pas stocké dans la table des payments.
|
||||||
// Seul le module compta expert peut résoudre ce problème.
|
// Seul le module compta expert peut résoudre ce problème.
|
||||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||||
// detail part tva et part ht).
|
// detail part tva et part ht).
|
||||||
$sql='TODO';
|
$sql='TODO';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE ";
|
$sql.= " WHERE ";
|
||||||
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
||||||
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")";
|
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")";
|
||||||
$sql.= " AND d.product_type = 0"; // Limit to products
|
$sql.= " AND d.product_type = 0"; // Limit to products
|
||||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If vat payed on payments
|
// If vat payed on payments
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
||||||
{
|
{
|
||||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||||
// n'est pas stocké dans la table des payments.
|
// n'est pas stocké dans la table des payments.
|
||||||
// Seul le module compta expert peut résoudre ce problème.
|
// Seul le module compta expert peut résoudre ce problème.
|
||||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||||
// detail part tva et part ht).
|
// detail part tva et part ht).
|
||||||
$sql='TODO';
|
$sql='TODO';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
||||||
{
|
{
|
||||||
// Tva sur factures payés (should be on payment)
|
// Tva sur factures payés (should be on payment)
|
||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE ";
|
$sql.= " WHERE ";
|
||||||
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
||||||
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")";
|
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")";
|
||||||
$sql.= " AND d.product_type = 0"; // Limit to products
|
$sql.= " AND d.product_type = 0"; // Limit to products
|
||||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $sql) return -1;
|
if (! $sql) return -1;
|
||||||
if ($sql && $sql=='TODO') return -2;
|
if ($sql && $sql=='TODO') return -2;
|
||||||
if ($sql && $sql!='TODO')
|
if ($sql && $sql!='TODO')
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Client::vat_by_quarter sql=".$sql);
|
dolibarr_syslog("Client::vat_by_quarter sql=".$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$rate = -1;
|
$rate = -1;
|
||||||
$oldrowid='';
|
$oldrowid='';
|
||||||
while($assoc = $db->fetch_array($resql))
|
while($assoc = $db->fetch_array($resql))
|
||||||
{
|
{
|
||||||
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['total_ht']=0;
|
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['total_ht']=0;
|
||||||
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['total_vat']=0;
|
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['total_vat']=0;
|
||||||
|
|
||||||
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
|
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
|
||||||
{
|
{
|
||||||
$oldrowid=$assoc['rowid'];
|
$oldrowid=$assoc['rowid'];
|
||||||
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
||||||
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
|
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
|
||||||
}
|
}
|
||||||
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||||
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['facid'][] = $assoc['facid'];
|
$list[$assoc['rate']]['facid'][] = $assoc['facid'];
|
||||||
$list[$assoc['rate']]['facnum'][] = $assoc['facnum'];
|
$list[$assoc['rate']]['facnum'][] = $assoc['facnum'];
|
||||||
$list[$assoc['rate']]['ftotal_ttc'][] = $assoc['ftotal_ttc'];
|
$list[$assoc['rate']]['ftotal_ttc'][] = $assoc['ftotal_ttc'];
|
||||||
$list[$assoc['rate']]['descr'][] = $assoc['descr'];
|
$list[$assoc['rate']]['descr'][] = $assoc['descr'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
|
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
|
||||||
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
|
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
|
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
|
||||||
$list[$assoc['rate']]['pref'][] = $assoc['pref'];
|
$list[$assoc['rate']]['pref'][] = $assoc['pref'];
|
||||||
$list[$assoc['rate']]['ptype'][] = $assoc['ptype'];
|
$list[$assoc['rate']]['ptype'][] = $assoc['ptype'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
||||||
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
||||||
|
|
||||||
$rate = $assoc['rate'];
|
$rate = $assoc['rate'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CAS DES SERVICES
|
// CAS DES SERVICES
|
||||||
|
|
||||||
// Define sql request
|
// Define sql request
|
||||||
$sql='';
|
$sql='';
|
||||||
if ($modetax == 1) // Option vat on debit
|
if ($modetax == 1) // Option vat on debit
|
||||||
{
|
{
|
||||||
// If vat payed on due invoices (non draft)
|
// If vat payed on due invoices (non draft)
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
||||||
{
|
{
|
||||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||||
// n'est pas stocké dans la table des payments.
|
// n'est pas stocké dans la table des payments.
|
||||||
// Seul le module compta expert peut résoudre ce problème.
|
// Seul le module compta expert peut résoudre ce problème.
|
||||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||||
// detail part tva et part ht).
|
// detail part tva et part ht).
|
||||||
$sql='TODO';
|
$sql='TODO';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE ";
|
$sql.= " WHERE ";
|
||||||
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
$sql.= " f.fk_statut in (1,2)"; // Validated or payed (partially or completely)
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
$sql.= " AND f.datef >= '".$y."0101000000' AND f.datef <= '".$y."1231235959'";
|
||||||
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")";
|
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")";
|
||||||
$sql.= " AND d.product_type = 1"; // Limit to services
|
$sql.= " AND d.product_type = 1"; // Limit to services
|
||||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If vat payed on payments
|
// If vat payed on payments
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
if ($conf->global->MAIN_MODULE_COMPTABILITEEXPERT)
|
||||||
{
|
{
|
||||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||||
// n'est pas stocké dans la table des payments.
|
// n'est pas stocké dans la table des payments.
|
||||||
// Seul le module compta expert peut résoudre ce problème.
|
// Seul le module compta expert peut résoudre ce problème.
|
||||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||||
// detail part tva et part ht).
|
// detail part tva et part ht).
|
||||||
$sql='TODO';
|
$sql='TODO';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
if ($conf->global->MAIN_MODULE_COMPTABILITE)
|
||||||
{
|
{
|
||||||
// Tva sur factures payés (should be on payment)
|
// Tva sur factures payés (should be on payment)
|
||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_taux as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.facnumber as facnum, f.total_ttc as ftotal_ttc,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||||
$sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount";
|
$sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,";
|
$sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,";
|
$sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d";
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE ";
|
$sql.= " WHERE ";
|
||||||
$sql.= " f.fk_statut in (1,2)"; // Payed (partially or completely)
|
$sql.= " f.fk_statut in (1,2)"; // Payed (partially or completely)
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;;
|
$sql.= " AND f.rowid = d.".$fk_facture;;
|
||||||
$sql.= " AND pf.".$fk_facture2." = f.rowid";
|
$sql.= " AND pf.".$fk_facture2." = f.rowid";
|
||||||
$sql.= " AND pa.rowid = pf.".$fk_payment;
|
$sql.= " AND pa.rowid = pf.".$fk_payment;
|
||||||
$sql.= " AND pa.datep >= '".$y."0101000000' AND pa.datep <= '".$y."1231235959'";
|
$sql.= " AND pa.datep >= '".$y."0101000000' AND pa.datep <= '".$y."1231235959'";
|
||||||
$sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")";
|
$sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")";
|
||||||
$sql.= " AND d.product_type = 1"; // Limit to services
|
$sql.= " AND d.product_type = 1"; // Limit to services
|
||||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid";
|
$sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $sql) return -1;
|
if (! $sql) return -1;
|
||||||
if ($sql && $sql=='TODO') return -2;
|
if ($sql && $sql=='TODO') return -2;
|
||||||
if ($sql && $sql!='TODO')
|
if ($sql && $sql!='TODO')
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Client::vat_by_quarter sql=".$sql);
|
dolibarr_syslog("Client::vat_by_quarter sql=".$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$rate = -1;
|
$rate = -1;
|
||||||
$oldrowid='';
|
$oldrowid='';
|
||||||
while($assoc = $db->fetch_array($resql))
|
while($assoc = $db->fetch_array($resql))
|
||||||
{
|
{
|
||||||
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['total_ht']=0;
|
if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['total_ht']=0;
|
||||||
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['total_vat']=0;
|
if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['total_vat']=0;
|
||||||
|
|
||||||
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
|
if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid
|
||||||
{
|
{
|
||||||
$oldrowid=$assoc['rowid'];
|
$oldrowid=$assoc['rowid'];
|
||||||
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
|
||||||
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
|
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
|
||||||
}
|
}
|
||||||
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||||
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['facid'][] = $assoc['facid'];
|
$list[$assoc['rate']]['facid'][] = $assoc['facid'];
|
||||||
$list[$assoc['rate']]['facnum'][] = $assoc['facnum'];
|
$list[$assoc['rate']]['facnum'][] = $assoc['facnum'];
|
||||||
$list[$assoc['rate']]['ftotal_ttc'][] = $assoc['ftotal_ttc'];
|
$list[$assoc['rate']]['ftotal_ttc'][] = $assoc['ftotal_ttc'];
|
||||||
$list[$assoc['rate']]['descr'][] = $assoc['descr'];
|
$list[$assoc['rate']]['descr'][] = $assoc['descr'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
|
$list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht'];
|
||||||
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
|
$list[$assoc['rate']]['vat_list'][] = $assoc['total_vat'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
|
$list[$assoc['rate']]['pid'][] = $assoc['pid'];
|
||||||
$list[$assoc['rate']]['pref'][] = $assoc['pref'];
|
$list[$assoc['rate']]['pref'][] = $assoc['pref'];
|
||||||
$list[$assoc['rate']]['ptype'][] = $assoc['ptype'];
|
$list[$assoc['rate']]['ptype'][] = $assoc['ptype'];
|
||||||
|
|
||||||
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
||||||
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
||||||
|
|
||||||
$rate = $assoc['rate'];
|
$rate = $assoc['rate'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -91,6 +91,8 @@ function tree_showpad(&$fulltree,$key,$selected=0)
|
|||||||
|
|
||||||
$atleastonofthislevelafter=0;
|
$atleastonofthislevelafter=0;
|
||||||
$nbofhigherlevelafter=0;
|
$nbofhigherlevelafter=0;
|
||||||
|
$nbofdirinsub=0;
|
||||||
|
$nbofdocinsub=0;
|
||||||
$found=0;
|
$found=0;
|
||||||
//print 'x'.$key;
|
//print 'x'.$key;
|
||||||
foreach($fulltree as $key2 => $val2)
|
foreach($fulltree as $key2 => $val2)
|
||||||
@ -99,6 +101,8 @@ function tree_showpad(&$fulltree,$key,$selected=0)
|
|||||||
{
|
{
|
||||||
if ($fulltree[$key2]['level'] > $pos)
|
if ($fulltree[$key2]['level'] > $pos)
|
||||||
{
|
{
|
||||||
|
$nbofdirinsub++;
|
||||||
|
$nbofdocinsub+=$fulltree[$key2]['cachenbofdoc'];
|
||||||
$nbofhigherlevelafter++;
|
$nbofhigherlevelafter++;
|
||||||
}
|
}
|
||||||
if ($fulltree[$key2]['level'] == $pos)
|
if ($fulltree[$key2]['level'] == $pos)
|
||||||
@ -110,7 +114,10 @@ function tree_showpad(&$fulltree,$key,$selected=0)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($key2 == $key) $found=1;
|
if ($key2 == $key)
|
||||||
|
{
|
||||||
|
$found=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//print $atleastonofthislevelafter;
|
//print $atleastonofthislevelafter;
|
||||||
|
|
||||||
@ -127,7 +134,7 @@ function tree_showpad(&$fulltree,$key,$selected=0)
|
|||||||
$pos++;
|
$pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array($atleastonofthislevelafter,$nbofhigherlevelafter);
|
return array($atleastonofthislevelafter,$nbofhigherlevelafter,$nbofdirinsub,$nbofdocinsub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user