mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: converting line delimiters !!!
This commit is contained in:
parent
474b68b3e4
commit
8908f977b8
|
|
@ -96,8 +96,8 @@ class Facturation
|
|||
$societe = new Societe($db);
|
||||
$societe->fetch($thirdpartyid);
|
||||
|
||||
$product = new Product($db);
|
||||
$product->fetch($this->id);
|
||||
$product = new Product($db);
|
||||
$product->fetch($this->id);
|
||||
|
||||
$sql = "SELECT taux";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva";
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class Categorie
|
|||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql) > 0)
|
||||
if ($this->db->num_rows($resql) > 0)
|
||||
{
|
||||
$res = $this->db->fetch_array($resql);
|
||||
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ if ($_POST["action"] == 'add')
|
|||
$action='create'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
if (empty($account->label))
|
||||
{
|
||||
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors');
|
||||
$action='create'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
if (empty($account->label))
|
||||
{
|
||||
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors');
|
||||
$action='create'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -280,14 +280,14 @@ else if ($action == 'setconditions' && $user->rights->facture->creer)
|
|||
$object->cond_reglement_code=0; // To clean property
|
||||
$object->cond_reglement_id=0; // To clean property
|
||||
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
|
||||
$old_date_lim_reglement=$object->date_lim_reglement;
|
||||
$new_date_lim_reglement=$object->calculate_date_lim_reglement();
|
||||
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement;
|
||||
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;
|
||||
$result=$object->update($user);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
$old_date_lim_reglement=$object->date_lim_reglement;
|
||||
$new_date_lim_reglement=$object->calculate_date_lim_reglement();
|
||||
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement;
|
||||
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;
|
||||
$result=$object->update($user);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
else if ($action == 'setpaymentterm' && $user->rights->facture->creer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -651,10 +651,10 @@ class CMailFile
|
|||
|
||||
// Sender
|
||||
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
|
||||
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
|
||||
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
|
||||
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA))
|
||||
{
|
||||
$out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2;
|
||||
$out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2;
|
||||
}
|
||||
$out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2;
|
||||
if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2;
|
||||
|
|
@ -747,8 +747,8 @@ class CMailFile
|
|||
|
||||
// Make RFC821 Compliant, replace bare linefeeds
|
||||
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
|
||||
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||
{
|
||||
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2819,54 +2819,54 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
|
|||
require DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
}
|
||||
|
||||
$ret=0;
|
||||
$found=0;
|
||||
$ret=0;
|
||||
$found=0;
|
||||
|
||||
if ($idprod > 0)
|
||||
{
|
||||
// Load product
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($idprod);
|
||||
|
||||
if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours
|
||||
{
|
||||
if ($idprod > 0)
|
||||
{
|
||||
// Load product
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($idprod);
|
||||
|
||||
if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours
|
||||
{
|
||||
/* Not defined yet, so we don't use this
|
||||
if ($local==1) $ret=$product->localtax1_tx;
|
||||
elseif ($local==2) $ret=$product->localtax2_tx;
|
||||
$found=1;
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO Read default product vat according to countrycode and product
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (! $found)
|
||||
{
|
||||
// If vat of product for the country not found or not defined, we return higher vat of country.
|
||||
$sql = "SELECT taux as vat_rate, localtax1, localtax2";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
|
||||
$sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'";
|
||||
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
|
||||
$sql.= $db->plimit(1);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
if ($local==1) $ret=$obj->localtax1;
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO Read default product vat according to countrycode and product
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (! $found)
|
||||
{
|
||||
// If vat of product for the country not found or not defined, we return higher vat of country.
|
||||
$sql = "SELECT taux as vat_rate, localtax1, localtax2";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
|
||||
$sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'";
|
||||
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
|
||||
$sql.= $db->plimit(1);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
if ($local==1) $ret=$obj->localtax1;
|
||||
elseif ($local==2) $ret=$obj->localtax2;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
dol_syslog("get_product_localtax_for_country: ret=".$ret);
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
dol_syslog("get_product_localtax_for_country: ret=".$ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,30 +57,30 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||
if (empty($seller) || ! is_object($seller)) $seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc
|
||||
$countryid=$seller->country_id;
|
||||
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
|
||||
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
|
||||
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
|
||||
|
||||
// Now we search localtaxes information ourself (rates and types).
|
||||
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
|
||||
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv";
|
||||
//$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc";
|
||||
//$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc";
|
||||
$sql.= " WHERE cv.taux = ".$txtva;
|
||||
//$sql.= " AND cv.fk_pays = cc.rowid and cc.code = '".$mysoc->country_code."'";
|
||||
$sql.= " AND cv.fk_pays = ".$countryid;
|
||||
dol_syslog("search vat information sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$sql.= " AND cv.fk_pays = ".$countryid;
|
||||
dol_syslog("search vat information sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$localtax1_rate=$obj->localtax1;
|
||||
$localtax2_rate=$obj->localtax2;
|
||||
$localtax1_type=$obj->localtax1_type;
|
||||
$localtax2_type=$obj->localtax2_type;
|
||||
{
|
||||
$localtax1_rate=$obj->localtax1;
|
||||
$localtax2_rate=$obj->localtax2;
|
||||
$localtax1_type=$obj->localtax1_type;
|
||||
$localtax2_type=$obj->localtax2_type;
|
||||
//var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
else dol_print_error($db);
|
||||
|
||||
// initialize total (may be HT or TTC depending on price_base_type)
|
||||
$tot_sans_remise = $pu * $qty;
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ class CommActionRapport
|
|||
var $title;
|
||||
var $subject;
|
||||
|
||||
var $marge_gauche;
|
||||
var $marge_droite;
|
||||
var $marge_haute;
|
||||
var $marge_basse;
|
||||
var $marge_gauche;
|
||||
var $marge_droite;
|
||||
var $marge_haute;
|
||||
var $marge_basse;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -500,8 +500,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$tab3_top = $posy + 8;
|
||||
$tab3_width = 80;
|
||||
$tab3_height = 4;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$tab3_posx -= 20;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -283,13 +283,13 @@ class pdf_azur extends ModelePDFPropales
|
|||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pageposafter=$pdf->getPage();
|
||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||
{
|
||||
$pdf->rollbackTransaction(true);
|
||||
$pageposafter=$pageposbefore;
|
||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||
$pageposafter=$pdf->getPage();
|
||||
$posyafter=$pdf->GetY();
|
||||
|
|
@ -298,15 +298,15 @@ class pdf_azur extends ModelePDFPropales
|
|||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('','',true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
|
||||
$pdf->setPage($pagenb+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We found a page break
|
||||
$showpricebeforepagebreak=0;
|
||||
// We found a page break
|
||||
$showpricebeforepagebreak=0;
|
||||
}
|
||||
}
|
||||
else // No pagebreak
|
||||
|
|
|
|||
|
|
@ -739,9 +739,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||
$tab3_top = $posy + 8;
|
||||
$tab3_width = 80;
|
||||
$tab3_height = 4;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$tab3_posx -= 20;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$tab3_posx -= 20;
|
||||
}
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
|||
print_fiche_titre($langs->trans("ExternalSiteSetup"),$linkback,'setup');
|
||||
|
||||
print $langs->trans("Module100Desc")."<br>\n";
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form name="externalsiteconfig" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class Entrepot extends CommonObject
|
|||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->num_rows($result) > 0)
|
||||
if ($this->db->num_rows($result) > 0)
|
||||
{
|
||||
$obj=$this->db->fetch_object($result);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user