Support of deposit invoices
This commit is contained in:
parent
76e0a7a37b
commit
6dbe70b2f5
@ -33,7 +33,7 @@ $langs->load("orders");
|
||||
$langs->load("bills");
|
||||
$langs->load("companies");
|
||||
|
||||
// Sécurité si un client essaye d'accéder à une autre fiche que la sienne
|
||||
// S<EFBFBD>curit<EFBFBD> si un client essaye d'acc<63>der <20> une autre fiche que la sienne
|
||||
$_socid = $_GET["id"];
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
@ -251,7 +251,7 @@ if ($_socid > 0)
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Liste ristournes appliquées (=liees a une ligne de facture ou facture)
|
||||
* Liste ristournes appliqu<EFBFBD>es (=liees a une ligne de facture ou facture)
|
||||
*/
|
||||
// Remises liees a lignes de factures
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
|
||||
@ -2189,7 +2189,7 @@ else
|
||||
print '. ';
|
||||
if ($absolute_discount > 0)
|
||||
{
|
||||
if ($fac->statut > 0 || $fac->type == 2)
|
||||
if ($fac->statut > 0 || $fac->type == 2 || $fac->type == 3)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)).'. ';
|
||||
}
|
||||
@ -2204,7 +2204,7 @@ else
|
||||
if ($absolute_creditnote > 0)
|
||||
{
|
||||
// If validated, we show link "add credit note to payment"
|
||||
if ($fac->statut != 1 || $fac->type == 2)
|
||||
if ($fac->statut != 1 || $fac->type == 2 || $fac->type == 3)
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'. ';
|
||||
}
|
||||
@ -2376,7 +2376,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
// Solde avoir
|
||||
// Sold credit note
|
||||
print '<tr><td colspan="2" align="right">'.$langs->trans('TotalTTCToYourCredit').' :</td>';
|
||||
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price(abs($fac->total_ttc)).'</b></td><td> </td></tr>';
|
||||
}
|
||||
@ -2971,8 +2971,10 @@ else
|
||||
|
||||
// Validate
|
||||
if ($fac->statut == 0 && $num_lignes > 0 &&
|
||||
(
|
||||
(($fac->type == 0 || $fac->type == 1 || $fac->type == 3 || $fac->type == 4) && $fac->total_ttc >= 0)
|
||||
|| ($fac->type == 2 && $fac->total_ttc <= 0))
|
||||
)
|
||||
{
|
||||
if ($user->rights->facture->valider)
|
||||
{
|
||||
@ -3069,7 +3071,7 @@ else
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=payed">'.$langs->trans('ClassifyPayed').'</a>';
|
||||
}
|
||||
|
||||
// Classift 'closed not completely payed' (possible si validée et pas encore classée payée)
|
||||
// Classify 'closed not completely payed' (possible si validée et pas encore classée payée)
|
||||
if ($fac->statut == 1 && $fac->paye == 0 && $resteapayer > 0
|
||||
&& $user->rights->facture->paiement)
|
||||
{
|
||||
|
||||
@ -187,9 +187,9 @@ class DiscountAbsolute
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture";
|
||||
$sql.=" set paye=0, fk_statut=1";
|
||||
$sql.=" WHERE type = 2 AND rowid=".$this->fk_facture_source;
|
||||
$sql.=" WHERE (type = 2 or type = 3) AND rowid=".$this->fk_facture_source;
|
||||
|
||||
dol_syslog("DiscountAbsolute::delete Update credit note statut sql=".$sql);
|
||||
dol_syslog("DiscountAbsolute::delete Update credit note or deposit invoice statut sql=".$sql);
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/product.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/client.class.php");
|
||||
|
||||
|
||||
/**
|
||||
* \class Facture
|
||||
* \brief Classe permettant la gestion des factures clients
|
||||
|
||||
@ -16,7 +16,7 @@ InvoiceStandardAsk=Facture standard
|
||||
InvoiceStandardDesc=Ce type de facture est la facture traditionnelle. On l'appelle aussi <b>facture de doit</b> (du verbe devoir).
|
||||
InvoiceDeposit=Facture d'accompte
|
||||
InvoiceDepositAsk=Facture d'accompte
|
||||
InvoiceDepositDesc=La <b>facture d'accompte</b> est le type de facture faite suite à réception d'un accompte.
|
||||
InvoiceDepositDesc=La <b>facture d'accompte</b> est le type de facture qui fait suite à réception d'un accompte, s'il n'est pas encore possible de saisir le paiement sur une facture définitive.
|
||||
InvoiceProFormat=Facture proformat
|
||||
InvoiceProFormatAsk=Facture proformat
|
||||
InvoiceProFormatDesc=La <b>facture proformat</b> est une image de facture définitive mais qui n'a aucune valeure comptable.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user