Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
32d2615e93
@ -53,6 +53,7 @@ For users:
|
||||
- New: User permissions on margin module
|
||||
- New: Add ref supplier into muscadet model
|
||||
- New: Can use tag {mm} before {yy} even when there is a reset into numbering masks.
|
||||
- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables
|
||||
|
||||
For translators:
|
||||
- Qual: Normalized sort order of all languages files with english reference files.
|
||||
@ -126,6 +127,7 @@ Fix: Edit propal line was losing product supplier price id
|
||||
Fix: Delete linked element to supplier invoice when deleted
|
||||
Fix: [ bug #1061 ] Bad info shipped products
|
||||
Fix: [ bug #1062 ] Documents lost in propals and contracts validating
|
||||
Fix: Supplier price displayed on document lines didnt take discount
|
||||
Qual: Add travis-ci integration
|
||||
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -377,11 +377,14 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
|
||||
// TODO : store local taxes types into object lines and remove this
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
|
||||
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
|
||||
//end TODO
|
||||
// Retrieve type from database for backward compatibility with old records
|
||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
if ($localtax1_type && $localtax1ligne != 0)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -377,11 +377,14 @@ class pdf_proforma extends ModelePDFCommandes
|
||||
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
|
||||
// TODO : store local taxes types into object lines and remove this
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
|
||||
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
|
||||
//end TODO
|
||||
// Retrieve type from database for backward compatibility with old records
|
||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
if ($localtax1_type && $localtax1ligne != 0)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -378,12 +378,15 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
|
||||
// TODO : store local taxes types into object lines and remove this
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
|
||||
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
|
||||
//end TODO
|
||||
|
||||
// Retrieve type from database for backward compatibility with old records
|
||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
if ($localtax1_type && $localtax1ligne != 0)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -432,11 +432,14 @@ class pdf_azur extends ModelePDFPropales
|
||||
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
|
||||
// TODO : store local taxes types into object lines and remove this
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
|
||||
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
|
||||
//end TODO
|
||||
// Retrieve type from database for backward compatibility with old records
|
||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
if ($localtax1_type && $localtax1ligne != 0)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -377,11 +377,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
if (! empty($object->remise_percent)) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
// TODO : store local taxes types into object lines and remove this
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0];
|
||||
if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2];
|
||||
//end TODO
|
||||
|
||||
// Retrieve type from database for backward compatibility with old records
|
||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||
{
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
$localtax1_type = $localtaxtmp_array[0];
|
||||
$localtax2_type = $localtaxtmp_array[2];
|
||||
}
|
||||
|
||||
// retrieve global local tax
|
||||
if ($localtax1_type && $localtax1ligne != 0)
|
||||
|
||||
@ -48,7 +48,7 @@ if (! empty($idprod))
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
|
||||
$sql.= " pfp.ref_fourn,";
|
||||
$sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,";
|
||||
$sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,";
|
||||
$sql.= " s.nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product";
|
||||
@ -72,13 +72,15 @@ if (! empty($idprod))
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$price = $objp->fprice * (1 - $objp->remise_percent / 100);
|
||||
$unitprice = $objp->unitprice * (1 - $objp->remise_percent / 100);
|
||||
|
||||
$title = $objp->nom.' - '.$objp->ref_fourn.' - ';
|
||||
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$title.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/";
|
||||
|
||||
$price = $objp->fprice;
|
||||
$title.= price($price);
|
||||
$title.= $langs->getCurrencySymbol($conf->currency)."/";
|
||||
}
|
||||
|
||||
$title.= $objp->quantity.' ';
|
||||
@ -94,18 +96,18 @@ if (! empty($idprod))
|
||||
if ($objp->quantity > 1)
|
||||
{
|
||||
$title.=" - ";
|
||||
$title.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
|
||||
$title.= price($unitprice).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
|
||||
|
||||
$price = $objp->unitprice;
|
||||
$price = $unitprice;
|
||||
}
|
||||
if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) {
|
||||
$title.=" + ";
|
||||
$title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency);
|
||||
$title.= price($objp->unitcharges).$langs->getCurrencySymbol($conf->currency);
|
||||
$price += $objp->unitcharges;
|
||||
}
|
||||
if ($objp->duration) $label .= " - ".$objp->duration;
|
||||
|
||||
$label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
|
||||
$label = price($price).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
|
||||
|
||||
$prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title);
|
||||
$i++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user