New: Added a link to vat payment on bank transaction view for vat payment.
This commit is contained in:
parent
1880373019
commit
c7569e6316
@ -43,7 +43,7 @@ class Account extends CommonObject
|
||||
var $rowid;
|
||||
var $ref;
|
||||
var $label;
|
||||
var $type;
|
||||
var $type; // 'payment', 'company', 'member', 'banktransfert', 'payment_supplier', 'sc', 'payment_vat', ...
|
||||
var $bank;
|
||||
var $clos;
|
||||
var $rappro;
|
||||
@ -97,13 +97,13 @@ class Account extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Ajoute lien entre ecriture bancaire et sources
|
||||
* \param line_id Id ecriture bancaire
|
||||
* \param url_id Id parametre url
|
||||
* \param url Url
|
||||
* \param label Libell<EFBFBD> du lien
|
||||
* \param type Type de lien (payment, company, member, ...)
|
||||
* \return int <0 si ko, id line si ok
|
||||
* Add a link between bank line record and its source
|
||||
* @param line_id Id ecriture bancaire
|
||||
* @param url_id Id parametre url
|
||||
* @param url Url
|
||||
* @param label Link label
|
||||
* @param type Type of link ('payment', 'company', 'member', ...)
|
||||
* @return int <0 if KO, id line if OK
|
||||
*/
|
||||
function add_url_line($line_id, $url_id, $url, $label, $type)
|
||||
{
|
||||
|
||||
@ -21,11 +21,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/bank/account.php
|
||||
\ingroup banque
|
||||
\brief Page de détail des transactions bancaires
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/compta/bank/account.php
|
||||
* \ingroup banque
|
||||
* \brief Page de détail des transactions bancaires
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
|
||||
@ -33,6 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/chargesociales.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fourn/facture/paiementfourn.class.php");
|
||||
|
||||
// Security check
|
||||
@ -121,6 +122,7 @@ $chargestatic=new ChargeSociales($db);
|
||||
$memberstatic=new Adherent($db);
|
||||
$paymentstatic=new Paiement($db);
|
||||
$paymentsupplierstatic=new PaiementFourn($db);
|
||||
$paymentvatstatic=new TVA($db);
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
@ -427,9 +429,8 @@ if ($account || $_GET["ref"])
|
||||
}
|
||||
if ($mode_search && $conf->tax->enabled)
|
||||
{
|
||||
// \TODO Mettre jointure sur charges sociales pour recherche sur une charge
|
||||
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND bu.type='company'";
|
||||
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND bu.type='payment_vat'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu.url_id = t.rowid";
|
||||
}
|
||||
$sql.= " WHERE fk_account=".$acct->id;
|
||||
$sql.= $sql_rech;
|
||||
@ -503,18 +504,19 @@ if ($account || $_GET["ref"])
|
||||
foreach($links as $key=>$val)
|
||||
{
|
||||
if ($links[$key]['type']=='payment') {
|
||||
$paymentstatic->rowid=$links[$key]['url_id'];
|
||||
$paymentstatic->id=$links[$key]['url_id'];
|
||||
print ' '.$paymentstatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_supplier') {
|
||||
|
||||
$paymentsupplierstatic->rowid=$links[$key]['url_id'];
|
||||
print ' '.$paymentsupplierstatic->getNomUrl(2);
|
||||
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
||||
$paymentsupplierstatic->ref=$links[$key]['url_id'];
|
||||
print ' '.$paymentsupplierstatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='company') {
|
||||
}
|
||||
else if ($links[$key]['type']=='sc') { // This is waiting for card to link to payment_sc
|
||||
$chargestatic->id=$links[$key]['url_id'];
|
||||
$chargestatic->ref=$links[$key]['url_id'];
|
||||
print ' '.$chargestatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_sc')
|
||||
@ -527,6 +529,12 @@ if ($account || $_GET["ref"])
|
||||
print '</a>';
|
||||
*/
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_vat')
|
||||
{
|
||||
$paymentvatstatic->id=$links[$key]['url_id'];
|
||||
$paymentvatstatic->ref=$links[$key]['url_id'];
|
||||
print ' '.$paymentvatstatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='banktransfert') {
|
||||
/* Do not show this link (avoid confusion). Can already be accessed from transaction detail */
|
||||
}
|
||||
@ -551,9 +559,7 @@ if ($account || $_GET["ref"])
|
||||
print '</td>';
|
||||
|
||||
|
||||
/*
|
||||
* Ajout les liens tiers
|
||||
*/
|
||||
// Add third party column
|
||||
print '<td>';
|
||||
foreach($links as $key=>$val)
|
||||
{
|
||||
|
||||
@ -32,6 +32,7 @@ if (! $user->rights->banque->lire && ! $user->rights->banque->consolidate)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("categories");
|
||||
if ($conf->adherent->enabled) $langs->load("members");
|
||||
@ -311,7 +312,7 @@ if ($result)
|
||||
print '<input name="label" class="flat" value="';
|
||||
if (eregi('^\((.*)\)$',$objp->label,$reg))
|
||||
{
|
||||
// Label g<EFBFBD>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
@ -327,7 +328,7 @@ if ($result)
|
||||
print '<td colspan="4">';
|
||||
if (eregi('^\((.*)\)$',$objp->label,$reg))
|
||||
{
|
||||
// Label g<EFBFBD>n<EFBFBD>rique car entre parenth<74>ses. On l'affiche en le traduisant
|
||||
// Label generique car entre parentheses. On l'affiche en le traduisant
|
||||
print $langs->trans($reg[1]);
|
||||
}
|
||||
else
|
||||
@ -375,6 +376,12 @@ if ($result)
|
||||
print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_vat') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/tva/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowVAT'),'payment').' ';
|
||||
print $langs->trans("VATPayment");
|
||||
print '</a>';
|
||||
}
|
||||
else if ($links[$key]['type']=='member') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowMember'),'user').' ';
|
||||
|
||||
@ -223,7 +223,7 @@ if ($resql)
|
||||
// Date value
|
||||
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td align="center" nowrap="nowrap">';
|
||||
print dolibarr_print_date($objp->dv,"day");
|
||||
print ' ';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&account='.$_GET["account"].'&rowid='.$objp->rowid.'">';
|
||||
|
||||
@ -92,8 +92,8 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
||||
create_exdir($diroutputpdf);
|
||||
|
||||
// enregistre le fichier pdf concatene
|
||||
$filename=sanitizeFileName(strtolower($langs->transnoentities("Unpayed")));
|
||||
if ($option=='late') $filename.='_'.sanitizeFileName(strtolower($langs->transnoentities("Late")));
|
||||
$filename=strtolower(sanitizeFileName($langs->transnoentities("Unpayed")));
|
||||
if ($option=='late') $filename.='_'.strtolower(sanitizeFileName($langs->transnoentities("Late")));
|
||||
if ($pagecount)
|
||||
{
|
||||
$file=$diroutputpdf.'/'.$filename.'_'.dolibarr_print_date(mktime(),'dayhourlog').'.pdf';
|
||||
|
||||
@ -128,7 +128,7 @@ $head[$h][1] = $langs->trans("Info");
|
||||
$h++;
|
||||
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Payment"));
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression du paiement
|
||||
|
||||
@ -55,7 +55,7 @@ $hselected = $h;
|
||||
$h++;
|
||||
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Payment"));
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/paiement/liste.php
|
||||
\ingroup compta
|
||||
\brief Page liste des paiements des factures clients
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/compta/paiement/liste.php
|
||||
* \ingroup compta
|
||||
* \brief Page liste des paiements des factures clients
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
|
||||
@ -154,7 +154,8 @@ if ($resql)
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td width="40">';
|
||||
$paymentstatic->rowid=$objp->rowid;
|
||||
$paymentstatic->id=$objp->rowid;
|
||||
$paymentstatic->ref=$objp->rowid;
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/tva/fiche.php
|
||||
\ingroup tax
|
||||
\brief Page des règlements de TVA
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/compta/tva/fiche.php
|
||||
* \ingroup tax
|
||||
* \brief Page des règlements de TVA
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php");
|
||||
@ -50,10 +50,13 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
|
||||
$db->begin();
|
||||
|
||||
$datev=dolibarr_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
|
||||
$datep=dolibarr_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
|
||||
|
||||
$tva->accountid=$_POST["accountid"];
|
||||
$tva->paymenttype=$_POST["paiementtype"];
|
||||
$tva->datev=dolibarr_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
|
||||
$tva->datep=dolibarr_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
|
||||
$tva->datev=$datev;
|
||||
$tva->datep=$datep;
|
||||
$tva->amount=$_POST["amount"];
|
||||
$tva->label=$_POST["label"];
|
||||
|
||||
@ -150,27 +153,27 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td>';
|
||||
print $html->select_date("","datev",'','','','add');
|
||||
print $html->select_date($datep,"datep",'','','','add');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
||||
print $html->select_date("","datep",'','','','add');
|
||||
print $html->select_date($datev,"datev",'','','','add');
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input name="label" size="40" value="'.$langs->trans("VATPayment").'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input name="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$langs->trans("VATPayment")).'"></td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value=""></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Account").'</td><td>';
|
||||
$html->select_comptes($vatpayment->fk_account,"accountid",0,"courant=1",1); // Affiche liste des comptes courant
|
||||
$html->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$html->select_types_paiements($vatpayment->fk_type, "paiementtype");
|
||||
$html->select_types_paiements($_POST["paiementtype"], "paiementtype");
|
||||
print "</td>\n";
|
||||
}
|
||||
|
||||
@ -216,29 +219,24 @@ if ($id)
|
||||
print dolibarr_print_date($vatpayment->datev,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Account").'</td>';
|
||||
if ($vatpayment->fk_account > 0)
|
||||
{
|
||||
$account=new Account($db);
|
||||
$result=$account->fetch($vatpayment->fk_account);
|
||||
print '<td>'.$account->getNomUrl(1).'</td>';
|
||||
print '<td width="25%">'.$langs->trans("BankLineConciliated").'</td><td width="25%">'.yn($vatpayment->rappro).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="3"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td colspan="3">';
|
||||
print $vatpayment->fk_type ? $langs->trans("PaymentTypeShort".$vatpayment->fk_type) : ' ';
|
||||
print "</td>\n";
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
if ($vatpayment->fk_account > 0)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($vatpayment->fk_bank);
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -42,6 +42,7 @@ class Tva extends CommonObject
|
||||
//var $table_element='tva'; //!< Name of table without prefix where object is stored
|
||||
|
||||
var $id;
|
||||
var $ref;
|
||||
|
||||
var $tms;
|
||||
var $datep;
|
||||
@ -461,7 +462,7 @@ class Tva extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Ajoute un paiement de TVA
|
||||
* \param user Object user that insert
|
||||
* \return int <0 if KO, rowid in tva table if OK
|
||||
@ -538,16 +539,13 @@ class Tva extends CommonObject
|
||||
$ok=0;
|
||||
}
|
||||
|
||||
// Mise a jour liens (pour chaque charge concernée par le paiement)
|
||||
//foreach ($paiement->amounts as $key => $value)
|
||||
//{
|
||||
// $chid = $key;
|
||||
// $fac = new Facture($db);
|
||||
// $fac->fetch($chid);
|
||||
// $fac->fetch_client();
|
||||
// $acc->add_url_line($bank_line_id, $paiement_id, DOL_URL_ROOT.'/compta/paiement/fiche.php?id=', "(paiement)");
|
||||
// $acc->add_url_line($bank_line_id, $fac->client->id, DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->client->nom);
|
||||
//}
|
||||
// Mise a jour liens
|
||||
$result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/tva/fiche.php?id=', "(VATPayment)", "payment_vat");
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$acc->error;
|
||||
$ok=0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($ok)
|
||||
|
||||
@ -479,12 +479,12 @@ class PaiementFourn
|
||||
|
||||
$result='';
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$this->rowid.'">';
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"),'payment').$lienfin);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$lien.$this->rowid.$lienfin;
|
||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
|
||||
@ -47,6 +47,10 @@ AccountancyTreasuryArea=Accountancy/Treasury area
|
||||
AccountancySetup=Accountancy setup
|
||||
NewPayment=New payment
|
||||
Payments=Payments
|
||||
PaymentCustomerInvoice=Customer invoice payment
|
||||
PaymentSupplierInvoice=Supplier invoice payment
|
||||
PaymentSocialContribution=Social contribution payment
|
||||
PaymentVat=VAT payment
|
||||
ListPayment=List of payments
|
||||
ListOfPayments=List of payments
|
||||
ListOfCustomerPayments=List of customer payments
|
||||
@ -55,6 +59,7 @@ DatePayment=Payment date
|
||||
NewVATPayment=New VAT payment
|
||||
VATPayment=VAT Payment
|
||||
VATPayments=VAT Payments
|
||||
ShowVatPayment=Show VAT payement
|
||||
TotalToPay=Total to pay
|
||||
TotalVATReceived=Total VAT received
|
||||
CustomerAccountancyCode=Customer accountancy code
|
||||
|
||||
@ -47,6 +47,10 @@ AccountancyTreasuryArea=Espace Compta/Tr
|
||||
AccountancySetup=Configuration compta
|
||||
NewPayment=Nouveau réglement
|
||||
Payments=Réglements
|
||||
PaymentCustomerInvoice=Réglement facture client
|
||||
PaymentSupplierInvoice=Réglement facture fournisseur
|
||||
PaymentSocialContribution=Réglement charge sociale
|
||||
PaymentVat=Réglement TVA
|
||||
ListPayment=Liste des réglements
|
||||
ListOfPayments=Liste des réglements
|
||||
ListOfCustomerPayments=Liste des réglements clients
|
||||
@ -55,6 +59,7 @@ DatePayment=Date de r
|
||||
NewVATPayment=Nouveau réglement de TVA
|
||||
VATPayment=Réglement TVA
|
||||
VATPayments=Réglements TVA
|
||||
ShowVatPayment=Affiche payment TVA
|
||||
TotalToPay=Total à payer
|
||||
TotalVATReceived=Total TVA perçue
|
||||
CustomerAccountancyCode=Code compta client
|
||||
|
||||
@ -422,12 +422,12 @@ class Paiement
|
||||
|
||||
$result='';
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$this->rowid.'">';
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"),'payment').$lienfin);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$lien.$this->rowid.$lienfin;
|
||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user