Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2
This commit is contained in:
commit
b73014c044
@ -94,14 +94,15 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
|
||||
//Local taxes
|
||||
if ($txlocaltax1>0)
|
||||
{
|
||||
$result[14] = price2num(($tot_sans_remise * (1 + ( $txlocaltax1 / 100))) - $tot_sans_remise, 'MT');
|
||||
$result[14] = price2num(($result[6] * ( 1 + ( $txlocaltax1 / 100))) - $result[6], 'MT');
|
||||
$result[8] = price2num($result[8] + $result[14], 'MT');
|
||||
|
||||
$result[9] = price2num(($tot_avec_remise * (1 + ( $txlocaltax1 / 100))) - $tot_avec_remise, 'MT');
|
||||
$result[9] = price2num(($result[0] * ( 1 + ( $txlocaltax1 / 100))) - $result[0], 'MT');
|
||||
$result[2] = price2num($result[2] + $result[9], 'MT');
|
||||
|
||||
$result[11] = price2num(($pu * (1 + ( $txlocaltax1 / 100))) - $pu, 'MT');
|
||||
$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MT');
|
||||
$result[5] = price2num($result[5] + $result[11], 'MT');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -111,10 +112,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
|
||||
}
|
||||
|
||||
if ($txlocaltax2>0)
|
||||
{
|
||||
$result[15] = price2num(($tot_sans_remise * (1 + ( $txlocaltax2 / 100))) - $tot_sans_remise, 'MT');
|
||||
$result[10] = price2num(($tot_avec_remise * (1 + ( $txlocaltax2 / 100))) - $tot_avec_remise, 'MT');
|
||||
$result[12] = price2num(($pu * (1 + ( $txlocaltax2 / 100))) - $pu, 'MT');
|
||||
{
|
||||
$result[15] = price2num(($result[6] * ( 1 + ( $txlocaltax2 / 100))) - $result[6], 'MT');
|
||||
$result[10] = price2num(($result[0] * ( 1 + ( $txlocaltax2 / 100))) - $result[0], 'MT');
|
||||
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MT');
|
||||
|
||||
//If Country is Spain, localtax2 (IRPF) will be subtracted
|
||||
if ($mysoc->country_code=='ES')
|
||||
|
||||
@ -98,7 +98,8 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ",".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn ";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.paye = 0 AND f.fk_statut = 1";
|
||||
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
|
||||
@ -72,7 +72,8 @@ if ($mode == 'search')
|
||||
if ($modesearch == 'soc')
|
||||
{
|
||||
$sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s ";
|
||||
$sql.= " WHERE s.nom like '%".$db->escape(strtolower($socname))."%'";
|
||||
$sql.= " WHERE s.nom LIKE '%".$db->escape(strtolower($socname))."%'";
|
||||
$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
|
||||
}
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -106,7 +107,8 @@ $sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_stat
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE fac.fk_soc = s.rowid";
|
||||
$sql.= " WHERE fac.entity = ".$conf->entity;
|
||||
$sql.= " AND fac.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
{
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -193,10 +194,10 @@ if ($action == 'create' || $action == 'add_paiement')
|
||||
$sql = 'SELECT s.nom, s.rowid as socid,';
|
||||
$sql.= ' f.rowid as ref, f.facnumber, f.amount, f.total_ttc as total';
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= ' WHERE f.fk_soc = s.rowid';
|
||||
$sql .= ' AND f.rowid = '.$facid;
|
||||
$sql.= ' WHERE f.fk_soc = s.rowid';
|
||||
$sql.= ' AND f.rowid = '.$facid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -254,13 +255,14 @@ if ($action == 'create' || $action == 'add_paiement')
|
||||
* Autres factures impayees
|
||||
*/
|
||||
$sql = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc, f.datef as df';
|
||||
$sql .= ', sum(pf.amount) as am';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
||||
$sql .= ' WHERE f.fk_soc = '.$facture->socid;
|
||||
$sql .= ' AND f.paye = 0';
|
||||
$sql .= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
||||
$sql .= ' GROUP BY f.rowid,f.facnumber,f.total_ttc,f.datef';
|
||||
$sql.= ', sum(pf.amount) as am';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= ' AND f.fk_soc = '.$facture->socid;
|
||||
$sql.= ' AND f.paye = 0';
|
||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
||||
$sql.= ' GROUP BY f.rowid,f.facnumber,f.total_ttc,f.datef';
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -370,7 +372,7 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
|
||||
$sql.= ' WHERE 1=1';
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
{
|
||||
|
||||
@ -57,6 +57,8 @@ SendShippingRef=Enviament d'expedició %s
|
||||
ActionsOnShipping=Events sobre l'expedició
|
||||
LinkToTrackYourPackage=Enllaç per al seguiment del seu paquet
|
||||
ShipmentCreationIsDoneFromOrder=De moment, la creació d'una nova expedició es realitza des de la fitxa de comanda.
|
||||
RelatedShippings=Expedició(ns) associada(s)
|
||||
|
||||
# Sending methods
|
||||
SendingMethodCATCH=Recollit pel client
|
||||
SendingMethodTRANS=Transportista
|
||||
|
||||
@ -6,4 +6,6 @@ ThereIsNoWorkflowToModify=No hi ha workflow modificable per als mòduls que té
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear una comanda de client automàticament a la signatura d'un pressupost
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a client automàticament a la signatura d'un pressupost
|
||||
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Crear una factura a client automàticament a la validació d'un contracte
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Crear una factura a client automàticament al tancament d'una comanda de client
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Crear una factura a client automàticament al tancament d'una comanda de client
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturado el presupuesto al mismo tiempo que el pedido
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Clasificar como facturados los pedidos al mismo tiempo que la factura
|
||||
@ -57,6 +57,8 @@ SendShippingRef=Envío expedición %s
|
||||
ActionsOnShipping=Eventos sobre la expedición
|
||||
LinkToTrackYourPackage=Enlace para el seguimento de su paquete
|
||||
ShipmentCreationIsDoneFromOrder=De momento, la creación de una nueva expedición se realiza desde la ficha de pedido.
|
||||
RelatedShippings=Expedición(es) asociada(s)
|
||||
|
||||
# Sending methods
|
||||
SendingMethodCATCH=Recogido por el cliente
|
||||
SendingMethodTRANS=Transportista
|
||||
|
||||
@ -6,4 +6,6 @@ ThereIsNoWorkflowToModify=No hay workflow modificable para los módulos que tien
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de un presupuesto
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de un presupuesto
|
||||
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la validación de un contrato
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente al cierre de un pedido de cliente
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente al cierre de un pedido de cliente
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturado el presupuesto al mismo tiempo que el pedido
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Clasificar como facturados los pedidos al mismo tiempo que la factura
|
||||
Loading…
Reference in New Issue
Block a user