Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
0d11fce834
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
File diff suppressed because one or more lines are too long
@ -449,18 +449,18 @@ class Adherent extends CommonObject
|
||||
$sql.= ", town=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
|
||||
$sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null");
|
||||
$sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null");
|
||||
$sql.= ", email='".$this->email."'";
|
||||
$sql.= ", skype='".$this->skype."'";
|
||||
$sql.= ", email='".$this->db->escape($this->email)."'";
|
||||
$sql.= ", skype='".$this->db->escape($this->skype)."'";
|
||||
$sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null");
|
||||
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
|
||||
$sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
||||
$sql.= ", note_private=" .($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
|
||||
$sql.= ", note_public=" .($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
|
||||
$sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null");
|
||||
$sql.= ", public='".$this->public."'";
|
||||
$sql.= ", public='".$this->db->escape($this->public)."'";
|
||||
$sql.= ", statut=" .$this->statut;
|
||||
$sql.= ", fk_adherent_type=".$this->typeid;
|
||||
$sql.= ", morphy='".$this->morphy."'";
|
||||
$sql.= ", morphy='".$this->db->escape($this->morphy)."'";
|
||||
$sql.= ", birth=" .($this->birth?"'".$this->db->idate($this->birth)."'":"null");
|
||||
if ($this->datefin) $sql.= ", datefin='".$this->db->idate($this->datefin)."'"; // Must be modified only when deleting a subscription
|
||||
if ($this->datevalid) $sql.= ", datevalid='".$this->db->idate($this->datevalid)."'"; // Must be modified only when validating a member
|
||||
@ -659,7 +659,7 @@ class Adherent extends CommonObject
|
||||
// Search for last subscription id and end date
|
||||
$sql = "SELECT rowid, datec as dateop, dateadh as datedeb, datef as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||
$sql.= " WHERE fk_adherent='".$this->id."'";
|
||||
$sql.= " WHERE fk_adherent=".$this->id;
|
||||
$sql.= " ORDER by dateadh DESC"; // Sort by start subscription date
|
||||
|
||||
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
|
||||
|
||||
@ -770,7 +770,7 @@ if (empty($reshook))
|
||||
$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;
|
||||
|
||||
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
@ -795,15 +795,16 @@ if (empty($reshook))
|
||||
|
||||
$prodcustprice = new Productcustomerprice($db);
|
||||
|
||||
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
|
||||
$filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id);
|
||||
|
||||
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
||||
if ($result) {
|
||||
// If there is some prices specific to the customer
|
||||
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;
|
||||
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -947,7 +947,7 @@ class Propal extends CommonObject
|
||||
if ($this->id)
|
||||
{
|
||||
$this->ref='(PROV'.$this->id.')';
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->ref."' WHERE rowid=".$this->id;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -3949,14 +3949,14 @@ class PropaleLigne extends CommonObjectLine
|
||||
$sql.= ", tva_tx='".price2num($this->tva_tx)."'";
|
||||
$sql.= ", localtax1_tx=".price2num($this->localtax1_tx);
|
||||
$sql.= ", localtax2_tx=".price2num($this->localtax2_tx);
|
||||
$sql.= ", localtax1_type='".$this->localtax1_type."'";
|
||||
$sql.= ", localtax2_type='".$this->localtax2_type."'";
|
||||
$sql.= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'";
|
||||
$sql.= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'";
|
||||
$sql.= ", qty='".price2num($this->qty)."'";
|
||||
$sql.= ", subprice=".price2num($this->subprice)."";
|
||||
$sql.= ", remise_percent=".price2num($this->remise_percent)."";
|
||||
$sql.= ", price=".price2num($this->price).""; // TODO A virer
|
||||
$sql.= ", remise=".price2num($this->remise).""; // TODO A virer
|
||||
$sql.= ", info_bits='".$this->info_bits."'";
|
||||
$sql.= ", info_bits='".$this->db->escape($this->info_bits)."'";
|
||||
if (empty($this->skip_update_total))
|
||||
{
|
||||
$sql.= ", total_ht=".price2num($this->total_ht)."";
|
||||
|
||||
@ -3882,7 +3882,7 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';";
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid=".$this->rowid;
|
||||
|
||||
dol_syslog("OrderLine::delete", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -4130,8 +4130,8 @@ class OrderLine extends CommonOrderLine
|
||||
$sql.= " , tva_tx=".price2num($this->tva_tx);
|
||||
$sql.= " , localtax1_tx=".price2num($this->localtax1_tx);
|
||||
$sql.= " , localtax2_tx=".price2num($this->localtax2_tx);
|
||||
$sql.= " , localtax1_type='".$this->localtax1_type."'";
|
||||
$sql.= " , localtax2_type='".$this->localtax2_type."'";
|
||||
$sql.= " , localtax1_type='".$this->db->escape($this->localtax1_type)."'";
|
||||
$sql.= " , localtax2_type='".$this->db->escape($this->localtax2_type)."'";
|
||||
$sql.= " , qty=".price2num($this->qty);
|
||||
$sql.= " , subprice=".price2num($this->subprice)."";
|
||||
$sql.= " , remise_percent=".price2num($this->remise_percent)."";
|
||||
|
||||
@ -705,17 +705,17 @@ class Account extends CommonObject
|
||||
$sql.= ",fk_accountancy_journal = '".$this->fk_accountancy_journal."'";
|
||||
|
||||
$sql.= ",bank = '".$this->db->escape($this->bank)."'";
|
||||
$sql.= ",code_banque='".$this->code_banque."'";
|
||||
$sql.= ",code_guichet='".$this->code_guichet."'";
|
||||
$sql.= ",number='".$this->number."'";
|
||||
$sql.= ",cle_rib='".$this->cle_rib."'";
|
||||
$sql.= ",bic='".$this->bic."'";
|
||||
$sql.= ",iban_prefix = '".$this->iban."'";
|
||||
$sql.= ",code_banque='".$this->db->escape($this->code_banque)."'";
|
||||
$sql.= ",code_guichet='".$this->db->escape($this->code_guichet)."'";
|
||||
$sql.= ",number='".$this->db->escape($this->number)."'";
|
||||
$sql.= ",cle_rib='".$this->db->escape($this->cle_rib)."'";
|
||||
$sql.= ",bic='".$this->db->escape($this->bic)."'";
|
||||
$sql.= ",iban_prefix = '".$this->db->escape($this->iban)."'";
|
||||
$sql.= ",domiciliation='".$this->db->escape($this->domiciliation)."'";
|
||||
$sql.= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql.= ",owner_address = '".$this->db->escape($this->owner_address)."'";
|
||||
|
||||
$sql.= ",currency_code = '".$this->currency_code."'";
|
||||
$sql.= ",currency_code = '".$this->db->escape($this->currency_code)."'";
|
||||
|
||||
$sql.= ",min_allowed = ".($this->min_allowed != '' ? price2num($this->min_allowed) : "null");
|
||||
$sql.= ",min_desired = ".($this->min_desired != '' ? price2num($this->min_desired) : "null");
|
||||
@ -797,12 +797,12 @@ class Account extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_account SET ";
|
||||
$sql.= " bank = '".$this->db->escape($this->bank)."'";
|
||||
$sql.= ",code_banque='".$this->code_banque."'";
|
||||
$sql.= ",code_guichet='".$this->code_guichet."'";
|
||||
$sql.= ",number='".$this->number."'";
|
||||
$sql.= ",cle_rib='".$this->cle_rib."'";
|
||||
$sql.= ",bic='".$this->bic."'";
|
||||
$sql.= ",iban_prefix = '".$this->iban."'";
|
||||
$sql.= ",code_banque='".$this->db->escape($this->code_banque)."'";
|
||||
$sql.= ",code_guichet='".$this->db->escape($this->code_guichet)."'";
|
||||
$sql.= ",number='".$this->db->escape($this->number)."'";
|
||||
$sql.= ",cle_rib='".$this->db->escape($this->cle_rib)."'";
|
||||
$sql.= ",bic='".$this->db->escape($this->bic)."'";
|
||||
$sql.= ",iban_prefix = '".$this->db->escape($this->iban)."'";
|
||||
$sql.= ",domiciliation='".$this->db->escape($this->domiciliation)."'";
|
||||
$sql.= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql.= ",owner_address = '".$this->db->escape($this->owner_address)."'";
|
||||
|
||||
@ -434,7 +434,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Update ref with new one
|
||||
$this->ref='(PROV'.$this->id.')';
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -4590,18 +4590,18 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql.= ", remise_percent=".price2num($this->remise_percent)."";
|
||||
if ($this->fk_remise_except) $sql.= ", fk_remise_except=".$this->fk_remise_except;
|
||||
else $sql.= ", fk_remise_except=null";
|
||||
$sql.= ", vat_src_code = '".(empty($this->vat_src_code)?'':$this->vat_src_code)."'";
|
||||
$sql.= ", vat_src_code = '".(empty($this->vat_src_code)?'':$this->db->escape($this->vat_src_code))."'";
|
||||
$sql.= ", tva_tx=".price2num($this->tva_tx)."";
|
||||
$sql.= ", localtax1_tx=".price2num($this->localtax1_tx)."";
|
||||
$sql.= ", localtax2_tx=".price2num($this->localtax2_tx)."";
|
||||
$sql.= ", localtax1_type='".$this->localtax1_type."'";
|
||||
$sql.= ", localtax2_type='".$this->localtax2_type."'";
|
||||
$sql.= ", qty=".price2num($this->qty)."";
|
||||
$sql.= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'";
|
||||
$sql.= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'";
|
||||
$sql.= ", qty=".price2num($this->qty);
|
||||
$sql.= ", date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null");
|
||||
$sql.= ", date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
|
||||
$sql.= ", product_type=".$this->product_type;
|
||||
$sql.= ", info_bits='".$this->info_bits."'";
|
||||
$sql.= ", special_code='".$this->special_code."'";
|
||||
$sql.= ", info_bits='".$this->db->escape($this->info_bits)."'";
|
||||
$sql.= ", special_code='".$this->db->escape($this->special_code)."'";
|
||||
if (empty($this->skip_update_total))
|
||||
{
|
||||
$sql.= ", total_ht=".price2num($this->total_ht)."";
|
||||
|
||||
@ -154,12 +154,12 @@ class Localtax extends CommonObject
|
||||
$sql.= " tms=".$this->db->idate($this->tms).",";
|
||||
$sql.= " datep=".$this->db->idate($this->datep).",";
|
||||
$sql.= " datev=".$this->db->idate($this->datev).",";
|
||||
$sql.= " amount='".$this->amount."',";
|
||||
$sql.= " amount=".price2num($this->amount).",";
|
||||
$sql.= " label='".$this->db->escape($this->label)."',";
|
||||
$sql.= " note='".$this->db->escape($this->note)."',";
|
||||
$sql.= " fk_bank='".$this->fk_bank."',";
|
||||
$sql.= " fk_user_creat='".$this->fk_user_creat."',";
|
||||
$sql.= " fk_user_modif='".$this->fk_user_modif."'";
|
||||
$sql.= " fk_bank=".$this->fk_bank.",";
|
||||
$sql.= " fk_user_creat=".$this->fk_user_creat.",";
|
||||
$sql.= " fk_user_modif=".$this->fk_user_modif;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
|
||||
@ -178,7 +178,7 @@ class RemiseCheque extends CommonObject
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql.= " SET ref='(PROV".$this->id.")'";
|
||||
$sql.= " WHERE rowid='".$this->id."';";
|
||||
$sql.= " WHERE rowid=".$this->id."";
|
||||
|
||||
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -98,19 +98,19 @@ class PaymentSalary extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET";
|
||||
|
||||
$sql.= " tms=".$this->db->idate($this->tms).",";
|
||||
$sql.= " fk_user='".$this->fk_user."',";
|
||||
$sql.= " fk_user=".$this->fk_user.",";
|
||||
$sql.= " datep=".$this->db->idate($this->datep).",";
|
||||
$sql.= " datev=".$this->db->idate($this->datev).",";
|
||||
$sql.= " amount='".$this->amount."',";
|
||||
$sql.= " amount=".price2num($this->amount).",";
|
||||
$sql.= " fk_typepayment=".$this->fk_typepayment."',";
|
||||
$sql.= " num_payment='".$this->num_payment."',";
|
||||
$sql.= " num_payment='".$this->db->escape($this->num_payment)."',";
|
||||
$sql.= " label='".$this->db->escape($this->label)."',";
|
||||
$sql.= " datesp=".$this->db->idate($this->datesp).",";
|
||||
$sql.= " dateep=".$this->db->idate($this->dateep).",";
|
||||
$sql.= " note='".$this->db->escape($this->note)."',";
|
||||
$sql.= " fk_bank=".($this->fk_bank > 0 ? "'".$this->fk_bank."'":"null").",";
|
||||
$sql.= " fk_user_author='".$this->fk_user_author."',";
|
||||
$sql.= " fk_user_modif='".$this->fk_user_modif."'";
|
||||
$sql.= " fk_user_author=".$this->fk_user_author.",";
|
||||
$sql.= " fk_user_modif=".$this->fk_user_modif;
|
||||
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ class ChargeSociales extends CommonObject
|
||||
// Delete payments
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge WHERE fk_charge='".$this->id."'";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge WHERE fk_charge=".$this->id;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
@ -249,7 +249,7 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales WHERE rowid='".$this->id."'";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales WHERE rowid=".$this->id;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
|
||||
@ -175,12 +175,12 @@ class Tva extends CommonObject
|
||||
$sql.= " tms=".$this->db->idate($this->tms).",";
|
||||
$sql.= " datep=".$this->db->idate($this->datep).",";
|
||||
$sql.= " datev=".$this->db->idate($this->datev).",";
|
||||
$sql.= " amount='".$this->amount."',";
|
||||
$sql.= " amount=".price2num($this->amount).",";
|
||||
$sql.= " label='".$this->db->escape($this->label)."',";
|
||||
$sql.= " note='".$this->db->escape($this->note)."',";
|
||||
$sql.= " fk_bank='".$this->fk_bank."',";
|
||||
$sql.= " fk_user_creat='".$this->fk_user_creat."',";
|
||||
$sql.= " fk_user_modif='".$this->fk_user_modif."'";
|
||||
$sql.= " fk_bank=".$this->fk_bank.",";
|
||||
$sql.= " fk_user_creat=".$this->fk_user_creat.",";
|
||||
$sql.= " fk_user_modif=".$this->fk_user_modif."";
|
||||
|
||||
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -2787,9 +2787,9 @@ class ContratLigne extends CommonObjectLine
|
||||
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";
|
||||
$sql.= " fk_contrat='".$this->fk_contrat."',";
|
||||
$sql.= " fk_contrat=".$this->fk_contrat.",";
|
||||
$sql.= " fk_product=".($this->fk_product?"'".$this->fk_product."'":'null').",";
|
||||
$sql.= " statut='".$this->statut."',";
|
||||
$sql.= " statut=".$this->statut.",";
|
||||
$sql.= " label='".$this->db->escape($this->label)."',";
|
||||
$sql.= " description='".$this->db->escape($this->description)."',";
|
||||
$sql.= " date_commande=".($this->date_commande!=''?"'".$this->db->idate($this->date_commande)."'":"null").",";
|
||||
@ -2797,24 +2797,24 @@ class ContratLigne extends CommonObjectLine
|
||||
$sql.= " date_ouverture=".($this->date_ouverture!=''?"'".$this->db->idate($this->date_ouverture)."'":"null").",";
|
||||
$sql.= " date_fin_validite=".($this->date_fin_validite!=''?"'".$this->db->idate($this->date_fin_validite)."'":"null").",";
|
||||
$sql.= " date_cloture=".($this->date_cloture!=''?"'".$this->db->idate($this->date_cloture)."'":"null").",";
|
||||
$sql.= " vat_src_code='".$this->vat_src_code."',";
|
||||
$sql.= " tva_tx='".$this->tva_tx."',";
|
||||
$sql.= " localtax1_tx='".$this->localtax1_tx."',";
|
||||
$sql.= " localtax2_tx='".$this->localtax2_tx."',";
|
||||
$sql.= " vat_src_code='".$this->db->escape($this->vat_src_code)."',";
|
||||
$sql.= " tva_tx=".price2num($this->tva_tx).",";
|
||||
$sql.= " localtax1_tx=".price2num($this->localtax1_tx).",";
|
||||
$sql.= " localtax2_tx=".price2num($this->localtax2_tx).",";
|
||||
$sql.= " qty='".$this->qty."',";
|
||||
$sql.= " remise_percent='".$this->remise_percent."',";
|
||||
$sql.= " remise_percent=".price2num($this->remise_percent).",";
|
||||
$sql.= " remise=".($this->remise?"'".$this->remise."'":"null").",";
|
||||
$sql.= " fk_remise_except=".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").",";
|
||||
$sql.= " subprice=".($this->subprice != '' ? $this->subprice : "null").",";
|
||||
$sql.= " price_ht=".($this->price_ht != '' ? $this->price_ht : "null").",";
|
||||
$sql.= " total_ht='".$this->total_ht."',";
|
||||
$sql.= " total_tva='".$this->total_tva."',";
|
||||
$sql.= " total_localtax1='".$this->total_localtax1."',";
|
||||
$sql.= " total_localtax2='".$this->total_localtax2."',";
|
||||
$sql.= " total_ttc='".$this->total_ttc."',";
|
||||
$sql.= " total_ht=".$this->total_ht.",";
|
||||
$sql.= " total_tva=".$this->total_tva.",";
|
||||
$sql.= " total_localtax1=".$this->total_localtax1.",";
|
||||
$sql.= " total_localtax2=".$this->total_localtax2.",";
|
||||
$sql.= " total_ttc=".$this->total_ttc.",";
|
||||
$sql.= " fk_product_fournisseur_price=".(!empty($this->fk_fournprice)?$this->fk_fournprice:"NULL").",";
|
||||
$sql.= " buy_price_ht='".price2num($this->pa_ht)."',";
|
||||
$sql.= " info_bits='".$this->info_bits."',";
|
||||
$sql.= " info_bits='".$this->db->escape($this->info_bits)."',";
|
||||
$sql.= " fk_user_author=".($this->fk_user_author >= 0?$this->fk_user_author:"NULL").",";
|
||||
$sql.= " fk_user_ouverture=".($this->fk_user_ouverture > 0?$this->fk_user_ouverture:"NULL").",";
|
||||
$sql.= " fk_user_cloture=".($this->fk_user_cloture > 0?$this->fk_user_cloture:"NULL").",";
|
||||
|
||||
@ -264,6 +264,9 @@ UPDATE llx_accounting_account set account_parent = 0 where account_parent = '';
|
||||
ALTER TABLE llx_product_price ALTER COLUMN date_price SET DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||
ALTER TABLE llx_product_customer_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||
ALTER TABLE llx_product_customer_price_log ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||
|
||||
|
||||
ALTER TABLE llx_events MODIFY COLUMN ip varchar(250);
|
||||
|
||||
@ -33,6 +33,7 @@ create table llx_product_customer_price
|
||||
price_min double(24,8) DEFAULT 0,
|
||||
price_min_ttc double(24,8) DEFAULT 0,
|
||||
price_base_type varchar(3) DEFAULT 'HT',
|
||||
default_vat_code varchar(10), -- Same code than into table llx_c_tva (but no constraints). Should be used in priority to find default vat, npr, localtaxes for product.
|
||||
tva_tx double(6,3),
|
||||
recuperableonly integer NOT NULL DEFAULT '0', -- Other NPR VAT
|
||||
localtax1_tx double(6,3) DEFAULT 0, -- Other local VAT 1
|
||||
|
||||
@ -30,6 +30,7 @@ create table llx_product_customer_price_log
|
||||
price_min double(24,8) DEFAULT 0,
|
||||
price_min_ttc double(24,8) DEFAULT 0,
|
||||
price_base_type varchar(3) DEFAULT 'HT',
|
||||
default_vat_code varchar(10), -- Same code than into table llx_c_tva (but no constraints). Should be used in priority to find default vat, npr, localtaxes for product.
|
||||
tva_tx double(6,3),
|
||||
recuperableonly integer NOT NULL DEFAULT '0', -- Other NPR VAT
|
||||
localtax1_tx double(6,3) DEFAULT 0, -- Other local VAT 1
|
||||
|
||||
@ -236,6 +236,12 @@ ProfId3TN=Prof Id 3 (Douane code)
|
||||
ProfId4TN=Prof Id 4 (BAN)
|
||||
ProfId5TN=-
|
||||
ProfId6TN=-
|
||||
ProfId1US=Prof Id
|
||||
ProfId2US=-
|
||||
ProfId3US=-
|
||||
ProfId4US=-
|
||||
ProfId5US=-
|
||||
ProfId6US=-
|
||||
ProfId1RU=Prof Id 1 (OGRN)
|
||||
ProfId2RU=Prof Id 2 (INN)
|
||||
ProfId3RU=Prof Id 3 (KPP)
|
||||
|
||||
@ -140,7 +140,6 @@ class Productcustomerprice extends CommonObject
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_customer_price(";
|
||||
|
||||
$sql .= "entity,";
|
||||
$sql .= "datec,";
|
||||
$sql .= "fk_product,";
|
||||
@ -150,6 +149,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= "price_min,";
|
||||
$sql .= "price_min_ttc,";
|
||||
$sql .= "price_base_type,";
|
||||
$sql .= "default_vat_code,";
|
||||
$sql .= "tva_tx,";
|
||||
$sql .= "recuperableonly,";
|
||||
$sql .= "localtax1_type,";
|
||||
@ -158,9 +158,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= "localtax2_tx,";
|
||||
$sql .= "fk_user,";
|
||||
$sql .= "import_key";
|
||||
|
||||
$sql .= ") VALUES (";
|
||||
|
||||
$sql .= " " . $conf->entity . ",";
|
||||
$sql .= " '" . $this->db->idate(dol_now()) . "',";
|
||||
$sql .= " " . (! isset($this->fk_product) ? 'NULL' : "'" . $this->fk_product . "'") . ",";
|
||||
@ -170,6 +168,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " " . (empty($this->price_min) ? '0' : "'" . $this->price_min . "'") . ",";
|
||||
$sql .= " " . (empty($this->price_min_ttc) ? '0' : "'" . $this->price_min_ttc . "'") . ",";
|
||||
$sql .= " " . (! isset($this->price_base_type) ? 'NULL' : "'" . $this->db->escape($this->price_base_type) . "'") . ",";
|
||||
$sql .= " ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
|
||||
$sql .= " " . (! isset($this->tva_tx) ? 'NULL' : "'" . $this->tva_tx . "'") . ",";
|
||||
$sql .= " " . (! isset($this->recuperableonly) ? 'NULL' : "'" . $this->recuperableonly . "'") . ",";
|
||||
$sql .= " " . (empty($this->localtax1_type) ? "'0'" : "'" . $this->localtax1_type . "'") . ",";
|
||||
@ -178,7 +177,6 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : "'" . $this->localtax2_tx . "'") . ",";
|
||||
$sql .= " " . $user->id . ",";
|
||||
$sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . "";
|
||||
|
||||
$sql .= ")";
|
||||
|
||||
$this->db->begin();
|
||||
@ -250,6 +248,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " t.price_min,";
|
||||
$sql .= " t.price_min_ttc,";
|
||||
$sql .= " t.price_base_type,";
|
||||
$sql .= " t.default_vat_code,";
|
||||
$sql .= " t.tva_tx,";
|
||||
$sql .= " t.recuperableonly,";
|
||||
$sql .= " t.localtax1_tx,";
|
||||
@ -278,6 +277,7 @@ class Productcustomerprice extends CommonObject
|
||||
$this->price_min = $obj->price_min;
|
||||
$this->price_min_ttc = $obj->price_min_ttc;
|
||||
$this->price_base_type = $obj->price_base_type;
|
||||
$this->default_vat_code = $obj->default_vat_code;
|
||||
$this->tva_tx = $obj->tva_tx;
|
||||
$this->recuperableonly = $obj->recuperableonly;
|
||||
$this->localtax1_tx = $obj->localtax1_tx;
|
||||
@ -324,6 +324,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " t.price_min,";
|
||||
$sql .= " t.price_min_ttc,";
|
||||
$sql .= " t.price_base_type,";
|
||||
$sql .= " t.default_vat_code,";
|
||||
$sql .= " t.tva_tx,";
|
||||
$sql .= " t.recuperableonly,";
|
||||
$sql .= " t.localtax1_tx,";
|
||||
@ -380,6 +381,7 @@ class Productcustomerprice extends CommonObject
|
||||
$line->price_min = $obj->price_min;
|
||||
$line->price_min_ttc = $obj->price_min_ttc;
|
||||
$line->price_base_type = $obj->price_base_type;
|
||||
$line->default_vat_code = $obj->default_vat_code;
|
||||
$line->tva_tx = $obj->tva_tx;
|
||||
$line->recuperableonly = $obj->recuperableonly;
|
||||
$line->localtax1_tx = $obj->localtax1_tx;
|
||||
@ -429,6 +431,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " t.price_min,";
|
||||
$sql .= " t.price_min_ttc,";
|
||||
$sql .= " t.price_base_type,";
|
||||
$sql .= " t.default_vat_code,";
|
||||
$sql .= " t.tva_tx,";
|
||||
$sql .= " t.recuperableonly,";
|
||||
$sql .= " t.localtax1_tx,";
|
||||
@ -484,6 +487,7 @@ class Productcustomerprice extends CommonObject
|
||||
$line->price_min = $obj->price_min;
|
||||
$line->price_min_ttc = $obj->price_min_ttc;
|
||||
$line->price_base_type = $obj->price_base_type;
|
||||
$line->default_vat_code = $obj->default_vat_code;
|
||||
$line->tva_tx = $obj->tva_tx;
|
||||
$line->recuperableonly = $obj->recuperableonly;
|
||||
$line->localtax1_tx = $obj->localtax1_tx;
|
||||
@ -595,6 +599,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= "price_min,";
|
||||
$sql .= "price_min_ttc,";
|
||||
$sql .= "price_base_type,";
|
||||
$sql .= "default_vat_code,";
|
||||
$sql .= "tva_tx,";
|
||||
$sql .= "recuperableonly,";
|
||||
$sql .= "localtax1_tx,";
|
||||
@ -616,6 +621,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " t.price_min,";
|
||||
$sql .= " t.price_min_ttc,";
|
||||
$sql .= " t.price_base_type,";
|
||||
$sql .= " t.default_vat_code,";
|
||||
$sql .= " t.tva_tx,";
|
||||
$sql .= " t.recuperableonly,";
|
||||
$sql .= " t.localtax1_tx,";
|
||||
@ -649,6 +655,7 @@ class Productcustomerprice extends CommonObject
|
||||
$sql .= " price_min=" . (isset($this->price_min) ? $this->price_min : "null") . ",";
|
||||
$sql .= " price_min_ttc=" . (isset($this->price_min_ttc) ? $this->price_min_ttc : "null") . ",";
|
||||
$sql .= " price_base_type=" . (isset($this->price_base_type) ? "'" . $this->db->escape($this->price_base_type) . "'" : "null") . ",";
|
||||
$sql .= " default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
|
||||
$sql .= " tva_tx=" . (isset($this->tva_tx) ? $this->tva_tx : "null") . ",";
|
||||
$sql .= " recuperableonly=" . (isset($this->recuperableonly) ? $this->recuperableonly : "null") . ",";
|
||||
$sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? $this->localtax1_tx : "null") . ",";
|
||||
@ -918,6 +925,7 @@ class Productcustomerprice extends CommonObject
|
||||
$this->price_min = '';
|
||||
$this->price_min_ttc = '';
|
||||
$this->price_base_type = '';
|
||||
$this->default_vat_code = '';
|
||||
$this->tva_tx = '';
|
||||
$this->recuperableonly = '';
|
||||
$this->localtax1_tx = '';
|
||||
@ -943,6 +951,7 @@ class PriceByCustomerLine
|
||||
var $price_min;
|
||||
var $price_min_ttc;
|
||||
var $price_base_type;
|
||||
var $default_vat_code;
|
||||
var $tva_tx;
|
||||
var $recuperableonly;
|
||||
var $localtax1_tx;
|
||||
|
||||
@ -1519,13 +1519,13 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">' . $langs->trans('ThirdParty') . '</td>';
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', 's.client in (1,2,3) AND s.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price WHERE fk_product='.$object->id.')', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300');
|
||||
print $form->select_company('', 'socid', 's.client in (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// VAT
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("VATRate") . '</td><td>';
|
||||
print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr, $object->type, false, 1);
|
||||
print $form->load_tva("tva_tx", $object->default_vat_code ? $object->tva_tx.' ('.$object->default_vat_code.')' : $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr, $object->type, false, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Price base
|
||||
@ -1611,9 +1611,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
|
||||
// VAT
|
||||
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">';
|
||||
print $form->load_tva("tva_tx", $prodcustprice->tva_tx, $mysoc, '', $object->id, $prodcustprice->recuperableonly, $object->type, false, 1);
|
||||
print $form->load_tva("tva_tx", $prodcustprice->default_vat_code ? $prodcustprice->tva_tx.' ('.$prodcustprice->default_vat_code.')' : $prodcustprice->tva_tx, $mysoc, '', $object->id, $prodcustprice->recuperableonly, $object->type, false, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Price base
|
||||
print '<tr><td width="15%">';
|
||||
print $langs->trans('PriceBase');
|
||||
@ -1732,8 +1732,10 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
print "<td>" . $staticsoc->getNomUrl(1) . "</td>";
|
||||
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
|
||||
|
||||
$tva_tx = $line->default_vat_code ? $line->tva_tx.' ('.$line->default_vat_code.')' : $line->tva_tx;
|
||||
|
||||
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
|
||||
print '<td align="right">' . vatrate($line->tva_tx, true, $line->recuperableonly) . "</td>";
|
||||
print '<td align="right">' . vatrate($tva_tx, true, $line->recuperableonly) . "</td>";
|
||||
print '<td align="right">' . price($line->price) . "</td>";
|
||||
print '<td align="right">' . price($line->price_ttc) . "</td>";
|
||||
print '<td align="right">' . price($line->price_min) . '</td>';
|
||||
@ -1845,11 +1847,13 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
$staticsoc = new Societe($db);
|
||||
$staticsoc->fetch($line->fk_soc);
|
||||
|
||||
$tva_tx = $line->default_vat_code ? $line->tva_tx.' ('.$line->default_vat_code.')' : $line->tva_tx;
|
||||
|
||||
print "<td>" . $staticsoc->getNomUrl(1) . "</td>";
|
||||
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
|
||||
|
||||
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
|
||||
print '<td align="right">' . vatrate($line->tva_tx, true, $line->recuperableonly) . "</td>";
|
||||
print '<td align="right">' . vatrate($tva_tx, true, $line->recuperableonly) . "</td>";
|
||||
print '<td align="right">' . price($line->price) . "</td>";
|
||||
print '<td align="right">' . price($line->price_ttc) . "</td>";
|
||||
print '<td align="right">' . price($line->price_min) . '</td>';
|
||||
|
||||
@ -75,8 +75,8 @@ else header('Cache-Control: no-cache');
|
||||
// On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1.
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }
|
||||
|
||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL
|
||||
if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on URL
|
||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang', 'alpha')); // If language was forced on URL
|
||||
if (GETPOST('theme')) $conf->theme=GETPOST('theme', 'alpha'); // If theme was forced on URL
|
||||
$langs->load("main",0,1);
|
||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
||||
@ -149,18 +149,20 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
|
||||
|
||||
//$colortopbordertitle1=$colorbackhmenu1;
|
||||
|
||||
|
||||
// Set text color to black or white
|
||||
$colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbackhmenu1);
|
||||
$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) $colortextbackhmenu='FFFFFF';
|
||||
else $colortextbackhmenu='000000';
|
||||
|
||||
$colorbackvmenu1=join(',',colorStringToArray($colorbackvmenu1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbackvmenu1);
|
||||
$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortextbackvmenu='FFFFFF'; }
|
||||
else { $colortextbackvmenu='000000'; }
|
||||
|
||||
$colorbacktitle1=join(',',colorStringToArray($colorbacktitle1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbacktitle1);
|
||||
if ($colortexttitle == '')
|
||||
{
|
||||
@ -169,6 +171,7 @@ if ($colortexttitle == '')
|
||||
else { $colortexttitle='000000'; $colorshadowtitle='FFFFFF'; }
|
||||
}
|
||||
|
||||
$colorbacktabcard1=join(',',colorStringToArray($colorbacktabcard1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbacktabcard1);
|
||||
$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortextbacktab='FFFFFF'; }
|
||||
@ -362,7 +365,7 @@ select.flat, form.flat select {
|
||||
opacity: 0;
|
||||
}
|
||||
select:invalid { color: gray; }
|
||||
input:disabled {
|
||||
input:disabled {
|
||||
background:#ddd;
|
||||
}
|
||||
|
||||
|
||||
@ -154,16 +154,19 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
|
||||
|
||||
|
||||
// Set text color to black or white
|
||||
$colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbackhmenu1);
|
||||
$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) $colortextbackhmenu='FFFFFF';
|
||||
else $colortextbackhmenu='000000';
|
||||
|
||||
$colorbackvmenu1=join(',',colorStringToArray($colorbackvmenu1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbackvmenu1);
|
||||
$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortextbackvmenu='FFFFFF'; }
|
||||
else { $colortextbackvmenu='000000'; }
|
||||
|
||||
$colorbacktitle1=join(',',colorStringToArray($colorbacktitle1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbacktitle1);
|
||||
if ($colortexttitle == '')
|
||||
{
|
||||
@ -172,6 +175,7 @@ if ($colortexttitle == '')
|
||||
else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; }
|
||||
}
|
||||
|
||||
$colorbacktabcard1=join(',',colorStringToArray($colorbacktabcard1)); // Normalize value to 'x,y,z'
|
||||
$tmppart=explode(',',$colorbacktabcard1);
|
||||
$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortextbacktab='FFFFFF'; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user