';
-
print '| ';
print $langs->trans('Date');
print ' | ';
@@ -660,13 +643,15 @@ else
print price($object->amount);
print ' ';
- print '| '.$langs->trans('Status').' | ';
+ /*print ' | | '.$langs->trans('Status').' | ';
print $object->getLibStatut(4);
- print ' | ';
+ print '';*/
print '
';
+ print '';
+
// List of cheques
$sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,";
$sql.= " b.dateo as date, b.datec as datec, b.banque,";
@@ -684,6 +669,7 @@ else
{
$num = $db->num_rows($resql);
+ print '';
print ' ';
$param="&id=".$object->id;
@@ -760,6 +746,7 @@ else
$i++;
}
print " ";
+ print " ";
}
else
{
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 998fd1db7c3..ad53e98693e 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -35,7 +35,8 @@ class RemiseCheque extends CommonObject
{
public $element='chequereceipt';
public $table_element='bordereau_cheque';
-
+ public $picto = 'payment';
+
var $num;
var $intitule;
//! Numero d'erreur Plage 1024-1279
@@ -977,7 +978,7 @@ class RemiseCheque extends CommonObject
* Return label of a status
*
* @param int $status Statut
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
* @return string Libelle du statut
*/
function LibStatut($status,$mode=0)
@@ -1014,6 +1015,11 @@ class RemiseCheque extends CommonObject
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0');
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
}
+ if ($mode == 6)
+ {
+ if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0');
+ if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
+ }
return $langs->trans('Unknown');
}
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index bc32d090f84..d7489b8aca0 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -1594,7 +1594,7 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .=' '.$CrLf;
$XML_DEBITOR .=' '.$CrLf;
// $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf;
- $XML_DEBITOR .=' '.$row_facnumber.''.$CrLf;
+ $XML_DEBITOR .=' '.dol_trunc($row_facnumber, 135).''.$CrLf; // 140 max
$XML_DEBITOR .=' '.$CrLf;
$XML_DEBITOR .=' '.$CrLf;
return $XML_DEBITOR;
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index b13ea2d4166..84940bae414 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -82,10 +82,8 @@ if (empty($date_start) || empty($date_end)) {// We define date_start and date_en
}
}
-$min = GETPOST("min");
-if (empty($min)) {
- $min = 0;
-}
+$min = price2num(GETPOST("min"));
+if (empty($min)) $min = 0;
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index bea5af7e795..f95a60ab130 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -62,13 +62,12 @@ $origin=GETPOST('origin','alpha');
$originid=GETPOST('originid','int');
$datecontrat='';
+$usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:0);
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'contrat',$id);
-$usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:0);
-
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('contractcard','globalcard'));
@@ -408,21 +407,21 @@ if (empty($reshook))
// Set if we used free entry or predefined product
$predef='';
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
+ $price_ht = GETPOST('price_ht');
+ $price_ht_devise = GETPOST('multicurrency_price_ht');
if (GETPOST('prod_entry_mode') == 'free')
{
$idprod=0;
- $price_ht = GETPOST('price_ht');
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
}
else
{
$idprod=GETPOST('idprod', 'int');
- $price_ht = '';
$tva_tx = '';
}
$qty = GETPOST('qty'.$predef);
- $remise_percent=GETPOST('remise_percent'.$predef);
+ $remise_percent = GETPOST('remise_percent'.$predef);
if ($qty == '')
{
@@ -456,13 +455,14 @@ if (empty($reshook))
// Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit
- // Ecrase $txtva par celui du produit
+ // Ecrase $tva_tx par celui du produit
// Ecrase $base_price_type par celui du produit
if ($idprod > 0)
{
$prod = new Product($db);
$prod->fetch($idprod);
+ // Update if prices fields are defined
$tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id);
$tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id);
if (empty($tva_tx)) $tva_npr=0;
@@ -499,17 +499,20 @@ if (empty($reshook))
}
}
- // On reevalue prix selon taux tva car taux tva transaction peut etre different
+ $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
+ $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
+
+ // On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
- if ($tva_tx != $prod->tva_tx)
+ if ($tmpvat != $tmpprodvat)
{
if ($price_base_type != 'HT')
{
- $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU');
+ $pu_ht = price2num($pu_ttc / (1 + ($tmpvat/100)), 'MU');
}
else
{
- $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
+ $pu_ttc = price2num($pu_ht * (1 + ($tmpvat/100)), 'MU');
}
}
@@ -627,7 +630,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST('cancel'))
+ else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel'))
{
$objectline = new ContratLigne($db);
if ($objectline->fetch(GETPOST('elrowid')))
@@ -637,9 +640,27 @@ if (empty($reshook))
if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture;
if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture;
- $localtax1_tx=get_localtax(GETPOST('eltva_tx'),1,$object->thirdparty);
- $localtax2_tx=get_localtax(GETPOST('eltva_tx'),2,$object->thirdparty);
-
+ $vat_rate = GETPOST('eltva_tx');
+ // Define info_bits
+ $info_bits = 0;
+ if (preg_match('/\*/', $vat_rate))
+ $info_bits |= 0x01;
+
+ // Define vat_rate
+ $vat_rate = str_replace('*', '', $vat_rate);
+ $localtax1_tx=get_localtax($vat_rate, 1, $object->thirdparty, $mysoc);
+ $localtax2_tx=get_localtax($vat_rate, 2, $object->thirdparty, $mysoc);
+
+ $txtva = $vat_rate;
+
+ // Clean vat code
+ $vat_src_code='';
+ if (preg_match('/\((.*)\)/', $txtva, $reg))
+ {
+ $vat_src_code = $reg[1];
+ $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
+ }
+
// ajout prix d'achat
$fk_fournprice = $_POST['fournprice'];
if ( ! empty($_POST['buying_price']) )
@@ -654,7 +675,8 @@ if (empty($reshook))
$objectline->subprice=GETPOST('elprice');
$objectline->qty=GETPOST('elqty');
$objectline->remise_percent=GETPOST('elremise_percent');
- $objectline->tva_tx=GETPOST('eltva_tx')?GETPOST('eltva_tx'):0; // Field may be disabled, so we use vat rate 0
+ $objectline->tva_tx=($txtva?$txtva:0); // Field may be disabled, so we use vat rate 0
+ $objectline->vat_src_code=$vat_src_code;
$objectline->localtax1_tx=is_numeric($localtax1_tx)?$localtax1_tx:0;
$objectline->localtax2_tx=is_numeric($localtax2_tx)?$localtax2_tx:0;
$objectline->date_ouverture_prevue=$date_start_update;
@@ -1445,7 +1467,7 @@ else
{
print ' |