Changes to support deposit invoices
This commit is contained in:
parent
5071f101d6
commit
4333e8cb2a
@ -1,6 +1,6 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
*
|
*
|
||||||
* 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,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/comm/remx.php
|
* \file htdocs/comm/remx.php
|
||||||
* \ingroup commercial, invoice
|
* \ingroup commercial, invoice
|
||||||
* \brief Onglet de définition des avoirs
|
* \brief Page to edit absolute discounts for a customer
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -217,6 +217,13 @@ if ($_socid > 0)
|
|||||||
$facturestatic->type=$obj->type;
|
$facturestatic->type=$obj->type;
|
||||||
print $langs->trans("CreditNote").' '.$facturestatic->getNomURl(1);
|
print $langs->trans("CreditNote").' '.$facturestatic->getNomURl(1);
|
||||||
}
|
}
|
||||||
|
elseif ($obj->description == '(DEPOSIT)')
|
||||||
|
{
|
||||||
|
$facturestatic->id=$obj->fk_facture_source;
|
||||||
|
$facturestatic->ref=$obj->ref;
|
||||||
|
$facturestatic->type=$obj->type;
|
||||||
|
print $langs->trans("InvoiceDeposit").' '.$facturestatic->getNomURl(1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $obj->description;
|
print $obj->description;
|
||||||
|
|||||||
@ -429,9 +429,14 @@ if ($_POST['action'] == 'confirm_converttoreduc' && $_POST['confirm'] == 'yes' &
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insère une remise par famille de taux tva
|
// Insert one discount by VAT rate category
|
||||||
$discount = new DiscountAbsolute($db);
|
$discount = new DiscountAbsolute($db);
|
||||||
$discount->desc='(CREDIT_NOTE)';
|
if ($fac->type == 2) $discount->desc='(CREDIT_NOTE)';
|
||||||
|
elseif ($fac->type == 3) $discount->desc='(DEPOSIT)';
|
||||||
|
else {
|
||||||
|
$this->error="CantConvertToReducAnInvoiceOfThisType";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
$discount->tva_tx=abs($fac->total_ttc);
|
$discount->tva_tx=abs($fac->total_ttc);
|
||||||
$discount->fk_soc=$fac->socid;
|
$discount->fk_soc=$fac->socid;
|
||||||
$discount->fk_facture_source=$fac->id;
|
$discount->fk_facture_source=$fac->id;
|
||||||
@ -1849,6 +1854,12 @@ if ($_GET['action'] == 'create')
|
|||||||
$discount->fetch($objp->fk_remise_except);
|
$discount->fetch($objp->fk_remise_except);
|
||||||
print $langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
print $langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
|
elseif ($obj->description == '(DEPOSIT)')
|
||||||
|
{
|
||||||
|
$discount=new DiscountAbsolute($db);
|
||||||
|
$discount->fetch($objp->fk_remise_except);
|
||||||
|
print $langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print dol_trunc($objp->description,60);
|
print dol_trunc($objp->description,60);
|
||||||
@ -2612,6 +2623,12 @@ else
|
|||||||
$discount->fetch($objp->fk_remise_except);
|
$discount->fetch($objp->fk_remise_except);
|
||||||
print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
print ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
|
elseif ($objp->description == '(DEPOSIT)')
|
||||||
|
{
|
||||||
|
$discount=new DiscountAbsolute($db);
|
||||||
|
$discount->fetch($objp->fk_remise_except);
|
||||||
|
print ' - '.$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print ' - '.nl2br($objp->description);
|
print ' - '.nl2br($objp->description);
|
||||||
|
|||||||
@ -23,7 +23,8 @@
|
|||||||
* \file htdocs/document.php
|
* \file htdocs/document.php
|
||||||
* \brief Wrapper to download data files
|
* \brief Wrapper to download data files
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
* \remarks L'appel est document.php?file=pathrelatifdufichier&modulepart=repfichierconcerne
|
* \remarks Call of this wrapper is mad with URL:
|
||||||
|
* document.php?modulepart=repfichierconcerne&file=pathrelatifdufichier
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$original_file = urldecode($_GET["file"]);
|
$original_file = urldecode($_GET["file"]);
|
||||||
@ -32,6 +33,7 @@ $type = isset($_GET["type"]) ? urldecode($_GET["type"]) : '';
|
|||||||
|
|
||||||
// Define if we need master or master+main
|
// Define if we need master or master+main
|
||||||
$needmasteronly=false;
|
$needmasteronly=false;
|
||||||
|
if ($modulepart == 'bittorrent') $needmasteronly=true;
|
||||||
//if ($modulepart == 'webcal') $needmasteronly=true;
|
//if ($modulepart == 'webcal') $needmasteronly=true;
|
||||||
//if ($modulepart == 'agenda') $needmasteronly=true;
|
//if ($modulepart == 'agenda') $needmasteronly=true;
|
||||||
|
|
||||||
@ -391,6 +393,14 @@ if ($modulepart)
|
|||||||
$original_file=DOL_DATA_ROOT.'/admin/temp/'.$original_file;
|
$original_file=DOL_DATA_ROOT.'/admin/temp/'.$original_file;
|
||||||
$sqlprotectagainstexternals = '';
|
$sqlprotectagainstexternals = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrapping pour BitTorrent
|
||||||
|
if ($modulepart == 'bittorrent')
|
||||||
|
{
|
||||||
|
$accessallowed=1;
|
||||||
|
$original_file=DOL_DATA_ROOT.'/bittorrent/files/'.$original_file;
|
||||||
|
$sqlprotectagainstexternals = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Basic protection (against external users only)
|
// Basic protection (against external users only)
|
||||||
|
|||||||
@ -1997,6 +1997,7 @@ class Facture extends CommonObject
|
|||||||
global $langs;
|
global $langs;
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
|
|
||||||
|
//print "$paye,$statut,$mode,$alreadypayed,$type";
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
$prefix='';
|
$prefix='';
|
||||||
|
|||||||
@ -229,6 +229,7 @@ GlobalDiscount=Global discount
|
|||||||
CreditNote=Credit note
|
CreditNote=Credit note
|
||||||
CreditNotes=Credit notes
|
CreditNotes=Credit notes
|
||||||
DiscountFromCreditNote=Discount from credit note %s
|
DiscountFromCreditNote=Discount from credit note %s
|
||||||
|
DiscountFromDeposit=Payments from deposit invoice %s
|
||||||
NewGlobalDiscount=New discount
|
NewGlobalDiscount=New discount
|
||||||
NoteReason=Note/Reason
|
NoteReason=Note/Reason
|
||||||
ReasonDiscount=Reason
|
ReasonDiscount=Reason
|
||||||
@ -324,7 +325,7 @@ ChequesReceipts=Cheques receipts
|
|||||||
ChequesArea=Cheques deposits area
|
ChequesArea=Cheques deposits area
|
||||||
ChequeDeposits=Cheques deposits
|
ChequeDeposits=Cheques deposits
|
||||||
Cheques=Cheques
|
Cheques=Cheques
|
||||||
CreditNoteConvertedIntoDiscount=This credit note has been converted into %s
|
CreditNoteConvertedIntoDiscount=This credit note or deposit invoice has been converted into %s
|
||||||
UsBillingContactAsIncoiveRecipientIfExist=Use customer billing contact address instead of third party address as recipient for invoices
|
UsBillingContactAsIncoiveRecipientIfExist=Use customer billing contact address instead of third party address as recipient for invoices
|
||||||
PaymentInvoiceRef=Payment invoice %s
|
PaymentInvoiceRef=Payment invoice %s
|
||||||
# oursin PDF model
|
# oursin PDF model
|
||||||
|
|||||||
@ -228,6 +228,7 @@ GlobalDiscount=Remise fixe
|
|||||||
CreditNote=Avoir
|
CreditNote=Avoir
|
||||||
CreditNotes=Avoirs
|
CreditNotes=Avoirs
|
||||||
DiscountFromCreditNote=Remise issue de l'avoir %s
|
DiscountFromCreditNote=Remise issue de l'avoir %s
|
||||||
|
DiscountFromDeposit=Paiements issue de l'accompte %s
|
||||||
NewGlobalDiscount=Nouvelle remise fixe
|
NewGlobalDiscount=Nouvelle remise fixe
|
||||||
NoteReason=Note/Motif
|
NoteReason=Note/Motif
|
||||||
ReasonDiscount=Motif
|
ReasonDiscount=Motif
|
||||||
@ -325,7 +326,7 @@ ChequesReceipts=Bordereaux de remise de chèques
|
|||||||
ChequesArea=Espace remises de chèques
|
ChequesArea=Espace remises de chèques
|
||||||
ChequeDeposits=Dépots de chèques
|
ChequeDeposits=Dépots de chèques
|
||||||
Cheques=Chèques
|
Cheques=Chèques
|
||||||
CreditNoteConvertedIntoDiscount=Cet avoir a été converti en %s
|
CreditNoteConvertedIntoDiscount=Cet avoir ou accompte a été converti en %s
|
||||||
UsBillingContactAsIncoiveRecipientIfExist=Utiliser l'adresse du contact facturation client de la facture plutot que l'adresse du tiers comme destinataire des factures
|
UsBillingContactAsIncoiveRecipientIfExist=Utiliser l'adresse du contact facturation client de la facture plutot que l'adresse du tiers comme destinataire des factures
|
||||||
ShowUnpayedAll=Afficher tous les impayés
|
ShowUnpayedAll=Afficher tous les impayés
|
||||||
ShowUnpayedLateOnly=Afficher impayés en retard uniquement
|
ShowUnpayedLateOnly=Afficher impayés en retard uniquement
|
||||||
|
|||||||
@ -834,17 +834,61 @@ function top_menu($head, $title='', $target='')
|
|||||||
* \brief Affiche barre de menu gauche
|
* \brief Affiche barre de menu gauche
|
||||||
* \param menu_array Tableau des entrees de menu
|
* \param menu_array Tableau des entrees de menu
|
||||||
* \param helppagename Url pour le lien aide ('' par defaut)
|
* \param helppagename Url pour le lien aide ('' par defaut)
|
||||||
* \param form_search Formulaire de recherche permanant supplementaire
|
* \param moresearchform Formulaire de recherche permanant supplementaire
|
||||||
*/
|
*/
|
||||||
function left_menu($menu_array, $helppagename='', $form_search='')
|
function left_menu($menu_array, $helppagename='', $moresearchform='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $db;
|
global $user, $conf, $langs, $db;
|
||||||
|
|
||||||
|
$searchform='';
|
||||||
|
$bookmarks='';
|
||||||
|
|
||||||
// print '<div class="vmenuplusfiche">'."\n";
|
// print '<div class="vmenuplusfiche">'."\n";
|
||||||
print '<table width="100%" class="notopnoleftnoright"><tr><td class="vmenu" valign="top">';
|
print '<table width="100%" class="notopnoleftnoright"><tr><td class="vmenu" valign="top">';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Define $searchform
|
||||||
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
||||||
|
{
|
||||||
|
$langs->load("companies");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe.php', DOL_URL_ROOT.'/societe.php',
|
||||||
|
img_object($langs->trans("List"),'company').' '.$langs->trans("Companies"), 'soc', 'socname');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
||||||
|
{
|
||||||
|
$langs->load("companies");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/index.php', DOL_URL_ROOT.'/contact/index.php',
|
||||||
|
img_object($langs->trans("List"),'contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE && $user->rights->produit->lire)
|
||||||
|
{
|
||||||
|
$langs->load("products");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/index.php',
|
||||||
|
img_object($langs->trans("List"),'product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire)
|
||||||
|
{
|
||||||
|
$langs->load("members");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php',
|
||||||
|
img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define $bookmarks
|
||||||
|
if ($conf->bookmark->enabled && $user->rights->bookmark->lire)
|
||||||
|
{
|
||||||
|
include_once (DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php');
|
||||||
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
|
$bookmarks=printBookmarksList($db, $langs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Colonne de gauche
|
// Colonne de gauche
|
||||||
print '<!-- Begin left vertical menu -->'."\n";
|
print '<!-- Begin left vertical menu -->'."\n";
|
||||||
print '<div class="vmenu">'."\n";
|
print '<div class="vmenu">'."\n";
|
||||||
@ -859,63 +903,28 @@ function left_menu($menu_array, $helppagename='', $form_search='')
|
|||||||
$menuleft=new MenuLeft($db,$menu_array);
|
$menuleft=new MenuLeft($db,$menu_array);
|
||||||
$menuleft->showmenu();
|
$menuleft->showmenu();
|
||||||
|
|
||||||
// Affichage des zones de recherche permanantes
|
|
||||||
$ret='';
|
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
|
||||||
{
|
|
||||||
$langs->load("companies");
|
|
||||||
$ret.=printSearchForm(DOL_URL_ROOT.'/societe.php', DOL_URL_ROOT.'/societe.php',
|
|
||||||
img_object($langs->trans("List"),'company').' '.$langs->trans("Companies"), 'soc', 'socname');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
if ($searchform)
|
||||||
{
|
|
||||||
$langs->load("companies");
|
|
||||||
$ret.=printSearchForm(DOL_URL_ROOT.'/contact/index.php', DOL_URL_ROOT.'/contact/index.php',
|
|
||||||
img_object($langs->trans("List"),'contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE && $user->rights->produit->lire)
|
|
||||||
{
|
|
||||||
$langs->load("products");
|
|
||||||
$ret.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/index.php',
|
|
||||||
img_object($langs->trans("List"),'product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire)
|
|
||||||
{
|
|
||||||
$langs->load("members");
|
|
||||||
$ret.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php',
|
|
||||||
img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ret)
|
|
||||||
{
|
{
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin SearchForm -->\n";
|
print "<!-- Begin SearchForm -->\n";
|
||||||
print '<div class="blockvmenupair">'."\n";
|
print '<div class="blockvmenupair">'."\n";
|
||||||
print $ret;
|
print $searchform;
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print "<!-- End SearchForm -->\n";
|
print "<!-- End SearchForm -->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zone de recherche supplementaire
|
if ($moresearchform)
|
||||||
if ($form_search)
|
|
||||||
{
|
{
|
||||||
print $form_search;
|
print $moresearchform;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zone d'affichage permanente des marque pages
|
if ($bookmarks)
|
||||||
if ($conf->bookmark->enabled && $user->rights->bookmark->lire)
|
|
||||||
{
|
{
|
||||||
include_once (DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php');
|
|
||||||
$langs->load("bookmarks");
|
|
||||||
|
|
||||||
$ret=printBookmarksList($db, $langs);
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin Bookmarks -->\n";
|
print "<!-- Begin Bookmarks -->\n";
|
||||||
print '<div class="blockvmenupair">'."\n";
|
print '<div class="blockvmenupair">'."\n";
|
||||||
print $ret;
|
print $bookmarks;
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print "<!-- End Bookmarks -->\n";
|
print "<!-- End Bookmarks -->\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user