Add: Permettre de déterminer une ligne produit ayant une quantité nulle comme option
This commit is contained in:
parent
890c74ca7a
commit
a8ac4cf565
@ -100,6 +100,13 @@ if ($_POST["action"] == 'setadddeliveryaddress')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_POST["action"] == 'setuseoptionline')
|
||||||
|
{
|
||||||
|
dolibarr_set_const($db, "PROPALE_USE_OPTION_LINE",$_POST["value"]);
|
||||||
|
Header("Location: propale.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'setclassifiedinvoiced')
|
if ($_POST["action"] == 'setclassifiedinvoiced')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PROPALE_CLASSIFIED_INVOICED_WITH_ORDER",$_POST["value"]);
|
dolibarr_set_const($db, "PROPALE_CLASSIFIED_INVOICED_WITH_ORDER",$_POST["value"]);
|
||||||
@ -107,9 +114,9 @@ if ($_POST["action"] == 'setclassifiedinvoiced')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'set_use_customer_contact_as_recipient')
|
if ($_POST["action"] == 'setusecustomercontactasrecipient')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["use_customer_contact_as_recipient"]);
|
dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["value"]);
|
||||||
Header("Location: propale.php");
|
Header("Location: propale.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -429,11 +436,23 @@ print '</form>';
|
|||||||
|
|
||||||
$var=! $var;
|
$var=! $var;
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="set_use_customer_contact_as_recipient">';
|
print '<input type="hidden" name="action" value="setusecustomercontactasrecipient">';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("UseCustomerContactAsPropalRecipientIfExist");
|
print $langs->trans("UseCustomerContactAsPropalRecipientIfExist");
|
||||||
print '</td><td width="60" align="center">';
|
print '</td><td width="60" align="center">';
|
||||||
print $html->selectyesno("use_customer_contact_as_recipient",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1);
|
print $html->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1);
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print "</td></tr>\n";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
$var=! $var;
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
|
print '<input type="hidden" name="action" value="setuseoptionline">';
|
||||||
|
print '<tr '.$bc[$var].'><td>';
|
||||||
|
print $langs->trans("UseOptionLineIfNoQuantity");
|
||||||
|
print '</td><td width="60" align="center">';
|
||||||
|
print $html->selectyesno("value",$conf->global->PROPALE_USE_OPTION_LINE,1);
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|||||||
@ -506,7 +506,7 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer)
|
|||||||
*/
|
*/
|
||||||
if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
|
if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
if ($_POST['qty'] && (($_POST['np_price']!='' && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprod']))
|
if (isset($_POST['qty']) && (($_POST['np_price']!='' && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprod']))
|
||||||
{
|
{
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
$ret=$propal->fetch($_POST['propalid']);
|
$ret=$propal->fetch($_POST['propalid']);
|
||||||
@ -1068,7 +1068,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
|
|
||||||
$sql = 'SELECT pt.rowid, pt.description, pt.fk_product, pt.fk_remise_except,';
|
$sql = 'SELECT pt.rowid, pt.description, pt.fk_product, pt.fk_remise_except,';
|
||||||
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
|
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
|
||||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.marge_tx, pt.marque_tx,pt.pa_ht,';
|
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.marge_tx, pt.marque_tx, pt.pa_ht, pt.special_code,';
|
||||||
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid,';
|
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid,';
|
||||||
$sql.= ' p.description as product_desc';
|
$sql.= ' p.description as product_desc';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
|
||||||
@ -1112,8 +1112,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
|
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne;
|
||||||
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
|
||||||
|
|
||||||
// Affiche ligne produit
|
// Affiche ligne produit
|
||||||
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||||
@ -1223,7 +1222,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
|
|
||||||
// Qty
|
// Qty
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if (($objp->info_bits & 2) != 2)
|
if ((($objp->info_bits & 2) != 2) && $objp->special_code != 3)
|
||||||
{
|
{
|
||||||
print $objp->qty;
|
print $objp->qty;
|
||||||
}
|
}
|
||||||
@ -1231,7 +1230,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Remise %
|
// Remise %
|
||||||
if ($objp->remise_percent > 0)
|
if ($objp->remise_percent > 0 && $objp->special_code != 3)
|
||||||
{
|
{
|
||||||
print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent)."</td>\n";
|
print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent)."</td>\n";
|
||||||
}
|
}
|
||||||
@ -1239,7 +1238,17 @@ if ($_GET['propalid'] > 0)
|
|||||||
{
|
{
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Montant total HT
|
||||||
|
if ($objp->special_code == 3)
|
||||||
|
{
|
||||||
|
// Si ligne en option
|
||||||
|
print '<td align="right">'.$langs->trans('Option').'</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Icone d'edition et suppression
|
// Icone d'edition et suppression
|
||||||
if ($propal->statut == 0 && $user->rights->propale->creer)
|
if ($propal->statut == 0 && $user->rights->propale->creer)
|
||||||
|
|||||||
@ -288,19 +288,27 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
// Quantité
|
// Quantité
|
||||||
$pdf->SetXY ($this->posxqty, $curY);
|
$pdf->SetXY ($this->posxqty, $curY);
|
||||||
$pdf->MultiCell(10, 4, $propale->lignes[$i]->qty, 0, 'R');
|
if ($propale->lignes[$i]->special_code != 3) $pdf->MultiCell(10, 4, $propale->lignes[$i]->qty, 0, 'R');
|
||||||
|
|
||||||
// Remise sur ligne
|
// Remise sur ligne
|
||||||
$pdf->SetXY ($this->posxdiscount, $curY);
|
$pdf->SetXY ($this->posxdiscount, $curY);
|
||||||
if ($propale->lignes[$i]->remise_percent)
|
if ($propale->lignes[$i]->remise_percent && $propale->lignes[$i]->special_code != 3)
|
||||||
{
|
{
|
||||||
$pdf->MultiCell(14, 4, dolibarr_print_reduction($propale->lignes[$i]->remise_percent), 0, 'R');
|
$pdf->MultiCell(14, 4, dolibarr_print_reduction($propale->lignes[$i]->remise_percent), 0, 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total HT ligne
|
// Total HT ligne
|
||||||
$pdf->SetXY ($this->postotalht, $curY);
|
$pdf->SetXY ($this->postotalht, $curY);
|
||||||
|
if ($propale->lignes[$i]->special_code == 3)
|
||||||
|
{
|
||||||
|
// Ligne produit en option
|
||||||
|
$pdf->MultiCell(23, 4, $outputlangs->transnoentities("Option"), 0, 'R', 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$total = price($propale->lignes[$i]->total_ht);
|
$total = price($propale->lignes[$i]->total_ht);
|
||||||
$pdf->MultiCell(23, 4, $total, 0, 'R', 0);
|
$pdf->MultiCell(23, 4, $total, 0, 'R', 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||||
$tvaligne=$propale->lignes[$i]->total_tva;
|
$tvaligne=$propale->lignes[$i]->total_tva;
|
||||||
|
|||||||
@ -547,6 +547,7 @@ ClassifiedInvoicedWithOrder=Classify invoiced proposal at the same time as the o
|
|||||||
HideTreadedPropal=Hide the treated commercial proposals in the list
|
HideTreadedPropal=Hide the treated commercial proposals in the list
|
||||||
AddShippingDateAbility=Add shipping date ability
|
AddShippingDateAbility=Add shipping date ability
|
||||||
AddDeliveryAddressAbility=Add delivery date ability
|
AddDeliveryAddressAbility=Add delivery date ability
|
||||||
|
UseOptionLineIfNoQuantity=A line of product/service with a zero amount is considered as an option
|
||||||
##### Orders #####
|
##### Orders #####
|
||||||
OrdersSetup=Orders' management setup
|
OrdersSetup=Orders' management setup
|
||||||
OrdersNumberingModules=Orders numbering modules
|
OrdersNumberingModules=Orders numbering modules
|
||||||
|
|||||||
@ -546,6 +546,7 @@ ClassifiedInvoicedWithOrder=Class
|
|||||||
HideTreadedPropal=Cacher les propositions commerciales traitées de la liste
|
HideTreadedPropal=Cacher les propositions commerciales traitées de la liste
|
||||||
AddShippingDateAbility=Possibilité de déterminer une date de livraison
|
AddShippingDateAbility=Possibilité de déterminer une date de livraison
|
||||||
AddDeliveryAddressAbility=Possibilité de sélectionner une adresse de livraison
|
AddDeliveryAddressAbility=Possibilité de sélectionner une adresse de livraison
|
||||||
|
UseOptionLineIfNoQuantity=Une ligne de produit/service ayant une quantité nulle est considérée comme une option
|
||||||
##### Orders #####
|
##### Orders #####
|
||||||
OrdersSetup=Configuration du module Commandes
|
OrdersSetup=Configuration du module Commandes
|
||||||
OrdersNumberingModules=Modules de numérotation des commandes
|
OrdersNumberingModules=Modules de numérotation des commandes
|
||||||
|
|||||||
@ -270,6 +270,8 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0)
|
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
dolibarr_syslog("Propal::Addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc");
|
dolibarr_syslog("Propal::Addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc");
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
|
|
||||||
@ -280,7 +282,14 @@ class Propal extends CommonObject
|
|||||||
// Nettoyage paramètres
|
// Nettoyage paramètres
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
if (! $qty) $qty=1;
|
if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty)
|
||||||
|
{
|
||||||
|
$qty=0;
|
||||||
|
}
|
||||||
|
else if (! $qty)
|
||||||
|
{
|
||||||
|
$qty=1;
|
||||||
|
}
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht=price2num($pu_ht);
|
||||||
$pu_ttc=price2num($pu_ttc);
|
$pu_ttc=price2num($pu_ttc);
|
||||||
$txtva=price2num($txtva);
|
$txtva=price2num($txtva);
|
||||||
@ -330,6 +339,9 @@ class Propal extends CommonObject
|
|||||||
$ligne->total_tva=$total_tva;
|
$ligne->total_tva=$total_tva;
|
||||||
$ligne->total_ttc=$total_ttc;
|
$ligne->total_ttc=$total_ttc;
|
||||||
|
|
||||||
|
// Mise en option de la ligne
|
||||||
|
if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty) $ligne->special_code=3;
|
||||||
|
|
||||||
// \TODO Ne plus utiliser
|
// \TODO Ne plus utiliser
|
||||||
$ligne->price=$price;
|
$ligne->price=$price;
|
||||||
$ligne->remise=$remise;
|
$ligne->remise=$remise;
|
||||||
@ -337,8 +349,9 @@ class Propal extends CommonObject
|
|||||||
$result=$ligne->insert();
|
$result=$ligne->insert();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Mise a jour informations denormalisees au niveau de la facture meme
|
// Mise a jour informations denormalisees au niveau de la propale meme
|
||||||
$result=$this->update_price($propalid);
|
$result=$this->update_price($propalid);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -375,6 +388,8 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function updateline($rowid, $pu, $qty, $remise_percent=0, $txtva, $desc='', $price_base_type='HT')
|
function updateline($rowid, $pu, $qty, $remise_percent=0, $txtva, $desc='', $price_base_type='HT')
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
dolibarr_syslog("Propal::UpdateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type");
|
dolibarr_syslog("Propal::UpdateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type");
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
|
|
||||||
@ -385,7 +400,15 @@ class Propal extends CommonObject
|
|||||||
// Nettoyage paramètres
|
// Nettoyage paramètres
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
if (! $qty) $qty=1;
|
if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty)
|
||||||
|
{
|
||||||
|
$qty=0;
|
||||||
|
$remise_percent=0;
|
||||||
|
}
|
||||||
|
else if (! $qty)
|
||||||
|
{
|
||||||
|
$qty=1;
|
||||||
|
}
|
||||||
$pu = price2num($pu);
|
$pu = price2num($pu);
|
||||||
$txtva = price2num($txtva);
|
$txtva = price2num($txtva);
|
||||||
|
|
||||||
@ -416,6 +439,14 @@ class Propal extends CommonObject
|
|||||||
$sql.= " , total_ht=".price2num($total_ht);
|
$sql.= " , total_ht=".price2num($total_ht);
|
||||||
$sql.= " , total_tva=".price2num($total_tva);
|
$sql.= " , total_tva=".price2num($total_tva);
|
||||||
$sql.= " , total_ttc=".price2num($total_ttc);
|
$sql.= " , total_ttc=".price2num($total_ttc);
|
||||||
|
if ($conf->global->PROPALE_USE_OPTION_LINE && !$qty)
|
||||||
|
{
|
||||||
|
$sql.= " , special_code=3";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql.= " , special_code=0";
|
||||||
|
}
|
||||||
$sql.= " WHERE rowid = '".$rowid."';";
|
$sql.= " WHERE rowid = '".$rowid."';";
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
@ -440,6 +471,7 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Supprime une ligne de detail
|
* \brief Supprime une ligne de detail
|
||||||
* \param idligne Id de la ligne detail à supprimer
|
* \param idligne Id de la ligne detail à supprimer
|
||||||
@ -604,7 +636,7 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
// Liste des lignes a sommer
|
// Liste des lignes a sommer
|
||||||
$sql = "SELECT qty, tva_tx, subprice, remise_percent,";
|
$sql = "SELECT qty, tva_tx, subprice, remise_percent,";
|
||||||
$sql.= " total_ht, total_tva, total_ttc";
|
$sql.= " total_ht, total_tva, total_ttc, special_code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet";
|
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet";
|
||||||
$sql.= " WHERE fk_propal = ".$this->id;
|
$sql.= " WHERE fk_propal = ".$this->id;
|
||||||
|
|
||||||
@ -622,11 +654,15 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
if ($this->special_code != 3)
|
||||||
|
{
|
||||||
$this->total_ht += $obj->total_ht;
|
$this->total_ht += $obj->total_ht;
|
||||||
$this->total_tva += ($obj->total_ttc - $obj->total_ht);
|
$this->total_tva += ($obj->total_ttc - $obj->total_ht);
|
||||||
$this->total_ttc += $obj->total_ttc;
|
$this->total_ttc += $obj->total_ttc;
|
||||||
|
|
||||||
$tvas[$obj->tva_taux] += ($obj->total_ttc - $obj->total_ht);
|
$tvas[$obj->tva_taux] += ($obj->total_ttc - $obj->total_ht);
|
||||||
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,7 +912,7 @@ class Propal extends CommonObject
|
|||||||
* Lignes propales liées à un produit ou non
|
* Lignes propales liées à un produit ou non
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT d.description, d.price, d.tva_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,";
|
$sql = "SELECT d.description, d.price, d.tva_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,";
|
||||||
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_ttc, d.marge_tx, d.marque_tx, d.rang,";
|
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_ttc, d.marge_tx, d.marque_tx, d.special_code, d.rang,";
|
||||||
$sql.= " p.ref, p.label, p.description as product_desc";
|
$sql.= " p.ref, p.label, p.description as product_desc";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
|
||||||
@ -909,6 +945,7 @@ class Propal extends CommonObject
|
|||||||
$ligne->total_ttc = $objp->total_ttc;
|
$ligne->total_ttc = $objp->total_ttc;
|
||||||
$ligne->marge_tx = $objp->marge_tx;
|
$ligne->marge_tx = $objp->marge_tx;
|
||||||
$ligne->marque_tx = $objp->marque_tx;
|
$ligne->marque_tx = $objp->marque_tx;
|
||||||
|
$ligne->special_code = $objp->special_code;
|
||||||
$ligne->rang = $objp->rang;
|
$ligne->rang = $objp->rang;
|
||||||
|
|
||||||
$ligne->fk_product = $objp->fk_product;
|
$ligne->fk_product = $objp->fk_product;
|
||||||
@ -2237,8 +2274,12 @@ class PropaleLigne
|
|||||||
var $rang = 0;
|
var $rang = 0;
|
||||||
var $marge_tx;
|
var $marge_tx;
|
||||||
var $marque_tx;
|
var $marque_tx;
|
||||||
|
|
||||||
|
var $special_code; // Bit 3: ligne en option
|
||||||
|
|
||||||
var $info_bits = 0; // Bit 0: 0 si TVA normal - 1 si TVA NPR
|
var $info_bits = 0; // Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||||
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
|
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
|
||||||
|
|
||||||
var $total_ht; // Total HT de la ligne toute quantité et incluant la remise ligne
|
var $total_ht; // Total HT de la ligne toute quantité et incluant la remise ligne
|
||||||
var $total_tva; // Total TVA de la ligne toute quantité et incluant la remise ligne
|
var $total_tva; // Total TVA de la ligne toute quantité et incluant la remise ligne
|
||||||
var $total_ttc; // Total TTC de la ligne toute quantité et incluant la remise ligne
|
var $total_ttc; // Total TTC de la ligne toute quantité et incluant la remise ligne
|
||||||
@ -2270,7 +2311,7 @@ class PropaleLigne
|
|||||||
{
|
{
|
||||||
$sql = 'SELECT pd.rowid, pd.fk_propal, pd.fk_product, pd.description, pd.price, pd.qty, pd.tva_tx,';
|
$sql = 'SELECT pd.rowid, pd.fk_propal, pd.fk_product, pd.description, pd.price, pd.qty, pd.tva_tx,';
|
||||||
$sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,';
|
$sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,';
|
||||||
$sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.marge_tx, pd.marque_tx, pd.rang,';
|
$sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.marge_tx, pd.marque_tx, pd.special_code, pd.rang,';
|
||||||
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
|
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pd';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pd';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pd.fk_product = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pd.fk_product = p.rowid';
|
||||||
@ -2296,6 +2337,7 @@ class PropaleLigne
|
|||||||
$this->total_ttc = $objp->total_ttc;
|
$this->total_ttc = $objp->total_ttc;
|
||||||
$this->marge_tx = $objp->marge_tx;
|
$this->marge_tx = $objp->marge_tx;
|
||||||
$this->marque_tx = $objp->marque_tx;
|
$this->marque_tx = $objp->marque_tx;
|
||||||
|
$this->special_code = $objp->special_code;
|
||||||
$this->rang = $objp->rang;
|
$this->rang = $objp->rang;
|
||||||
|
|
||||||
$this->ref = $objp->product_ref;
|
$this->ref = $objp->product_ref;
|
||||||
@ -2348,7 +2390,7 @@ class PropaleLigne
|
|||||||
$sql.= ' (fk_propal, description, fk_product, fk_remise_except, qty, tva_tx,';
|
$sql.= ' (fk_propal, description, fk_product, fk_remise_except, qty, tva_tx,';
|
||||||
$sql.= ' subprice, remise_percent, ';
|
$sql.= ' subprice, remise_percent, ';
|
||||||
$sql.= ' info_bits, ';
|
$sql.= ' info_bits, ';
|
||||||
$sql.= ' total_ht, total_tva, total_ttc, marge_tx, marque_tx, rang)';
|
$sql.= ' total_ht, total_tva, total_ttc, marge_tx, marque_tx, special_code, rang)';
|
||||||
$sql.= " VALUES (".$this->fk_propal.",";
|
$sql.= " VALUES (".$this->fk_propal.",";
|
||||||
$sql.= " '".addslashes($this->desc)."',";
|
$sql.= " '".addslashes($this->desc)."',";
|
||||||
if ($this->fk_product) { $sql.= "'".$this->fk_product."',"; }
|
if ($this->fk_product) { $sql.= "'".$this->fk_product."',"; }
|
||||||
@ -2367,6 +2409,8 @@ class PropaleLigne
|
|||||||
else $sql.= ' null,';
|
else $sql.= ' null,';
|
||||||
if (isset($this->marque_tx)) $sql.= ' '.$this->marque_tx.',';
|
if (isset($this->marque_tx)) $sql.= ' '.$this->marque_tx.',';
|
||||||
else $sql.= ' null,';
|
else $sql.= ' null,';
|
||||||
|
if (isset($this->special_code)) $sql.= ' '.$this->special_code.',';
|
||||||
|
else $sql.= ' 0,';
|
||||||
$sql.= ' '.$rangtouse;
|
$sql.= ' '.$rangtouse;
|
||||||
$sql.= ')';
|
$sql.= ')';
|
||||||
|
|
||||||
|
|||||||
@ -47,4 +47,5 @@ create table llx_propaldet
|
|||||||
--
|
--
|
||||||
-- 1 : frais de port
|
-- 1 : frais de port
|
||||||
-- 2 : ecotaxe
|
-- 2 : ecotaxe
|
||||||
|
-- 3 : option
|
||||||
--
|
--
|
||||||
Loading…
Reference in New Issue
Block a user