diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 945e7d36ca7..fa84aedc26a 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -105,7 +105,7 @@ JQUERYFILETREE: RESTLER: -------- -* Add 2 lines into function +* Add 2 lines into file AutoLoader.php to complete function private function alias($className, $currentClass) { ... diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 24876a0a8fb..25ddfd8c1f8 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -114,10 +114,13 @@ switch($action) { if (count($prodcustprice->lines) > 0) { - $pu_ht = price($prodcustprice->lines [0]->price); - $pu_ttc = price($prodcustprice->lines [0]->price_ttc); - $price_base_type = $prodcustprice->lines [0]->price_base_type; - $tva_tx = $prodcustprice->lines [0]->tva_tx; + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + $tva_tx = $prodcustprice->lines[0]->tva_tx; + if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) $tva_npr=0; } } else diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 78c96ff3610..7527c6e1076 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1324,6 +1324,8 @@ if ($id > 0) print ''; if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid))) { + //var_dump($object->userassigned); + //var_dump($listofuserid); print '
'; print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody print '
'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a66a4635281..d43e84ebe1e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -225,11 +225,11 @@ class ActionComm extends CommonObject if ($this->elementtype=='commande') $this->elementtype='order'; if ($this->elementtype=='contrat') $this->elementtype='contract'; - if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility + if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array { $tmpid=$this->userassigned; $this->userassigned=array(); - $this->userassigned[$tmpid]=array('id'=>$tmpid); + $this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency); } if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated @@ -240,7 +240,7 @@ class ActionComm extends CommonObject // Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...). if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned)) - $this->userassigned = array($userownerid=>array('id'=>$userownerid)); + $this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency)); if (! $this->type_id || ! $this->type_code) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a15ed888a6e..85ba6f56981 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -808,6 +808,9 @@ if (empty($reshook)) $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; $tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); + if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) $tva_npr=0; } } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 54ff5e1afc0..f212b790e3d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -364,42 +364,42 @@ class Propal extends CommonObject } } - /** - * Add a proposal line into database (linked to product/service or not) - * The parameters are already supposed to be appropriate and with final values to the call - * of this method. Also, for the VAT rate, it must have already been defined - * by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product) - * and desc must already have the right value (it's up to the caller to manage multilanguage) - * - * @param string $desc Description de la ligne - * @param float $pu_ht Prix unitaire - * @param float $qty Quantite - * @param float $txtva Taux de tva - * @param float $txlocaltax1 Local tax 1 rate - * @param float $txlocaltax2 Local tax 2 rate - * @param int $fk_product Id du produit/service predefini - * @param float $remise_percent Pourcentage de remise de la ligne - * @param string $price_base_type HT or TTC - * @param float $pu_ttc Prix unitaire TTC - * @param int $info_bits Bits de type de lignes - * @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used. - * @param int $rang Position of line - * @param int $special_code Special code (also used by externals modules!) - * @param int $fk_parent_line Id of parent line - * @param int $fk_fournprice Id supplier price - * @param int $pa_ht Buying price without tax - * @param string $label ??? - * @param int $date_start Start date of the line - * @param int $date_end End date of the line - * @param array $array_options extrafields array - * @param string $fk_unit Code of the unit to use. Null to use the default one - * @param string $origin 'order', ... - * @param int $origin_id Id of origin object - * @param double $pu_ht_devise Unit price in currency - * @param int $fk_remise_except Id discount if line is from a discount - * @return int >0 if OK, <0 if KO - * @see add_product - */ + /** + * Add a proposal line into database (linked to product/service or not) + * The parameters are already supposed to be appropriate and with final values to the call + * of this method. Also, for the VAT rate, it must have already been defined + * by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product) + * and desc must already have the right value (it's up to the caller to manage multilanguage) + * + * @param string $desc Description of line + * @param float $pu_ht Unit price + * @param float $qty Quantity + * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) + * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) + * @param int $fk_product Id du produit/service predefini + * @param float $remise_percent Pourcentage de remise de la ligne + * @param string $price_base_type HT or TTC + * @param float $pu_ttc Prix unitaire TTC + * @param int $info_bits Bits de type de lignes + * @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used. + * @param int $rang Position of line + * @param int $special_code Special code (also used by externals modules!) + * @param int $fk_parent_line Id of parent line + * @param int $fk_fournprice Id supplier price + * @param int $pa_ht Buying price without tax + * @param string $label ??? + * @param int $date_start Start date of the line + * @param int $date_end End date of the line + * @param array $array_options extrafields array + * @param string $fk_unit Code of the unit to use. Null to use the default one + * @param string $origin 'order', ... + * @param int $origin_id Id of origin object + * @param double $pu_ht_devise Unit price in currency + * @param int $fk_remise_except Id discount if line is from a discount + * @return int >0 if OK, <0 if KO + * @see add_product + */ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise=0, $fk_remise_except=0) { global $mysoc, $conf, $langs; @@ -1018,11 +1018,15 @@ class Propal extends CommonObject $fk_parent_line = 0; } + // Complete vat rate with code + $vatrate = $this->lines[$i]->tva_tx; + if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')'; + $result = $this->addline( $this->lines[$i]->desc, $this->lines[$i]->subprice, $this->lines[$i]->qty, - $this->lines[$i]->tva_tx, + $vatrate, $this->lines[$i]->localtax1_tx, $this->lines[$i]->localtax2_tx, $this->lines[$i]->fk_product, @@ -1234,7 +1238,6 @@ class Propal extends CommonObject if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = ''; // Create clone - $result=$clonedObj->create($user); if ($result < 0) $error++; else diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 238b677395e..bf0ee8aa993 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -761,10 +761,13 @@ if (empty($reshook)) { if (count($prodcustprice->lines) > 0) { - $pu_ht = price($prodcustprice->lines [0]->price); - $pu_ttc = price($prodcustprice->lines [0]->price_ttc); - $price_base_type = $prodcustprice->lines [0]->price_base_type; - $tva_tx = $prodcustprice->lines [0]->tva_tx; + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + $tva_tx = $prodcustprice->lines[0]->tva_tx; + if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) $tva_npr=0; } } else diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 26674818027..73c39e756df 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -824,11 +824,15 @@ class Commande extends CommonOrder $fk_parent_line = 0; } + // Complete vat rate with code + $vatrate = $line->tva_tx; + if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')'; + $result = $this->addline( $line->desc, $line->subprice, $line->qty, - $line->tva_tx, + $vatrate, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, @@ -1215,9 +1219,9 @@ class Commande extends CommonOrder * @param string $desc Description of line * @param float $pu_ht Unit price (without tax) * @param float $qty Quantite - * @param float $txtva Taux de tva force, sinon -1 - * @param float $txlocaltax1 Local tax 1 rate - * @param float $txlocaltax2 Local tax 2 rate + * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) + * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) * @param int $fk_product Id of product * @param float $remise_percent Pourcentage de remise de la ligne * @param int $info_bits Bits de type de lignes diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 22edcdbd925..8ac3ed81951 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1655,6 +1655,9 @@ if (empty($reshook)) $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; $tva_tx = $prodcustprice->lines[0]->tva_tx; + if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) $tva_npr=0; } } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9801726246b..ea92156aca8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -583,11 +583,15 @@ class Facture extends CommonInvoice $fk_parent_line = 0; } + // Complete vat rate with code + $vatrate = $line->tva_tx; + if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')'; + $result = $this->addline( $line->desc, $line->subprice, $line->qty, - $line->tva_tx, + $vatrate, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, @@ -2486,8 +2490,8 @@ class Facture extends CommonInvoice * @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $qty Quantity * @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') - * @param double $txlocaltax1 Local tax 1 rate (deprecated) - * @param double $txlocaltax2 Local tax 2 rate (deprecated) + * @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) + * @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) * @param int $fk_product Id of predefined product/service * @param double $remise_percent Percent of discount on line * @param int $date_start Date start of service diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 64e7eb3e15d..37570d0874f 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -545,6 +545,9 @@ if (empty($reshook)) $pu_ttc = price($prodcustprice->lines[0]->price_ttc); $price_base_type = $prodcustprice->lines[0]->price_base_type; $tva_tx = $prodcustprice->lines[0]->tva_tx; + if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) $tva_npr=0; } } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index b761eb1864b..b014dd107f4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -517,6 +517,9 @@ if (empty($reshook)) $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; $tva_tx = $prodcustprice->lines [0]->tva_tx; + if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) $tva_npr=0; } } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1553c9f3e53..c73d260784d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3878,9 +3878,10 @@ abstract class CommonObject $this->tpl['description'] = ' '; } - // VAT Rate - $this->tpl['vat_rate'] = vatrate($line->tva_tx, true); - if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')'; + // VAT Rate + $this->tpl['vat_rate'] = vatrate($line->tva_tx, true); + $this->tpl['vat_rate'] .= (($line->info_bits & 1) == 1) ? '*' : ''; + if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')'; $this->tpl['price'] = price($line->subprice); $this->tpl['multicurrency_price'] = price($line->multicurrency_subprice); diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index d4c97deecf0..214ce91b032 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -20,9 +20,9 @@ */ /** - * \file htdocs/core/modules/import/import_csv.modules.php + * \file htdocs/core/modules/import/import_xlsx.modules.php * \ingroup import - * \brief File to load import files with CSV format + * \brief File to load import files with Excel format */ require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php'; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 0cdbb9665c6..4807564e65f 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1291,7 +1291,7 @@ class Expedition extends CommonObject $sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type"; $sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva"; - $sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht"; + $sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.info_bits, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht"; $sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc"; $sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot"; $sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type"; @@ -1389,6 +1389,7 @@ class Expedition extends CommonObject $line->tva_tx = $obj->tva_tx; $line->localtax1_tx = $obj->localtax1_tx; $line->localtax2_tx = $obj->localtax2_tx; + $line->info_bits = $obj->info_bits; $line->price = $obj->price; $line->subprice = $obj->subprice; $line->remise_percent = $obj->remise_percent; diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index e31fee63c5b..1e0388cff94 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -382,6 +382,8 @@ ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_tx d ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL; ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL; +ALTER TABLE llx_product_customer_price_log ADD COLUMN default_vat_code varchar(10); + UPDATE llx_contrat SET ref = rowid WHERE ref IS NULL OR ref = ''; ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT ''; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 27885d72be1..321e1dc335b 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -920,7 +920,7 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha')) { print '
*** Force page code and collation of tables into utf8/utf8_unicode_ci (for mysql/mariadb only)'; - if ($db->type == "mysql") + if ($db->type == "mysql" || $db->type == "mysqli") { $listoftables = $db->DDLListTables($db->database_name); diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 9eb795ea7d1..f5e1ee8f366 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -77,7 +77,7 @@ BoxTitleLastModifiedSupplierBills=Latest %s modified supplier bills BoxTitleLatestModifiedSupplierOrders=Latest %s modified supplier orders BoxTitleLastModifiedCustomerBills=Latest %s modified customer bills BoxTitleLastModifiedCustomerOrders=Latest %s modified customer orders -BoxTitleLastModifiedPropals=Latest %s modified propals +BoxTitleLastModifiedPropals=Latest %s modified proposals ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders ForProposals=Proposals diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 43b8e3a6cbb..379027b6561 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -374,6 +374,7 @@ TotalLT1IN=Total CGST TotalLT2IN=Total SGST HT=Net of tax TTC=Inc. tax +INCVATONLY=Inc. VAT INCT=Inc. all taxes VAT=Sales tax VATIN=IGST diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 88eb244713e..62d2e23e66c 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -135,7 +135,7 @@ DateMovement=Date of movement InventoryCode=Movement or inventory code IsInPackage=Contained into package WarehouseAllowNegativeTransfer=Stock can be negative -qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse +qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse and your setup does not allow negative stocks. ShowWarehouse=Show warehouse MovementCorrectStock=Stock correction for product %s MovementTransferStock=Stock transfer of product %s into another warehouse diff --git a/htdocs/product/price.php b/htdocs/product/price.php index e00973902dd..3b33ea952b2 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1801,8 +1801,15 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print '' . $langs->trans("PriceBase") . ''; print '' . $langs->trans("DefaultTaxRate") . ''; print '' . $langs->trans("HT") . ''; - print '' . $langs->trans("TTC") . ''; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . $langs->trans("INCT") . ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") + { + //print '' . $langs->trans("INCVATONLY") . ''; + print '' . $langs->trans("INCT") . ''; + } + else + { + print '' . $langs->trans("TTC") . ''; + } print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . ''; print '' . $langs->trans("ChangedBy") . ''; @@ -1844,20 +1851,28 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print "" . dol_print_date($line->datec, "dayhour") . ""; print '' . $langs->trans($line->price_base_type) . ""; print ''; -var_dump($prodcustprice);exit; + $positiverates=''; - if (price2num($objp->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($objp->tva_tx); - if (price2num($objp->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax1_tx); - if (price2num($objp->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax2_tx); + if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); + if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0'; - echo vatrate($positiverates.($objp->default_vat_code?' ('.$objp->default_vat_code.')':''), '%', $objp->tva_npr); + + echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', ($line->tva_npr?$line->tva_npr:$line->recuperableonly)); //. vatrate($tva_tx, true, $line->recuperableonly) . print ""; print '' . price($line->price) . ""; - print '' . price($line->price_ttc) . ""; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . price($resultarray[2]) . ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") + { + //print '' . price($line->price_ttc) . ""; + print '' . price($resultarray[2]) . ''; + } + else + { + print '' . price($line->price_ttc) . ""; + } print '' . price($line->price_min) . ''; print '' . price($line->price_min_ttc) . ''; @@ -1903,7 +1918,7 @@ var_dump($prodcustprice);exit; if (count($prodcustprice->lines) > 0 || $search_soc) { $colspan=8; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++; + //if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++; print ''; print ''; @@ -1922,8 +1937,16 @@ var_dump($prodcustprice);exit; print '' . $langs->trans("PriceBase") . ''; print '' . $langs->trans("DefaultTaxRate") . ''; print '' . $langs->trans("HT") . ''; - print '' . $langs->trans("TTC") . ''; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . $langs->trans("INCT") . ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") + { + //print '' . $langs->trans("INCVATONLY") . ''; + print '' . $langs->trans("INCT") . ''; + } + else + { + print '' . $langs->trans("TTC") . ''; + } + print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . ''; print '' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . ''; print '' . $langs->trans("ChangedBy") . ''; @@ -1970,9 +1993,17 @@ var_dump($prodcustprice);exit; print ""; print '' . price($object->price) . ""; - print '' . price($object->price_ttc) . ""; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . price($resultarray[2]) . ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") + { + //print '' . price($object->price_ttc) . ""; + print '' . price($resultarray[2]) . ''; + } + else + { + print '' . price($object->price_ttc) . ""; + } + print '' . price($object->price_min) . ''; print '' . price($object->price_min_ttc) . ''; @@ -1993,7 +2024,6 @@ var_dump($prodcustprice);exit; } print "\n"; - if (count($prodcustprice->lines) > 0) { foreach ($prodcustprice->lines as $line) @@ -2038,13 +2068,20 @@ var_dump($prodcustprice);exit; if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0'; - echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', $line->tva_npr); + echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', ($line->tva_npr?$line->tva_npr:$line->recuperableonly)); print ""; print '' . price($line->price) . ""; - print '' . price($line->price_ttc) . ""; - if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '' . price($resultarray[2]) . ''; + if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") + { + //print '' . price($line->price_ttc) . ""; + print '' . price($resultarray[2]) . ''; + } + else + { + print '' . price($line->price_ttc) . ""; + } print '' . price($line->price_min) . ''; print '' . price($line->price_min_ttc) . ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c24caf2f22b..f67466eb52a 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3515,7 +3515,7 @@ table.cal_month td:last-child { border-right: 0px; } .cal_today_peruser { background: #FDFDF0; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_today_peruser_peruserleft { background: #FDFDF0; border-left: solid 2px #6C7C7B; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_past { } -.cal_peruser { padding: 0px; } +.cal_peruser { padding-top: 0 !important; padding-bottom: 0 !important; padding-: 1px !important; padding-: 1px !important; } .cal_impair { background: #F8F8F8; } .cal_today_peruser_impair { background: #F8F8F0; } .peruser_busy { background: #CC8888; }