Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2014-06-29 23:59:10 +02:00
commit ebc6bede13
4 changed files with 25 additions and 9 deletions

View File

@ -97,10 +97,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
$this->posxcomm=112;
$this->posxcomm=900;
//$this->posxtva=112;
//$this->posxup=126;
$this->posxqty=174;
$this->posxqty=140;
$this->posxremainingqty=165;
//$this->posxdiscount=162;
//$this->postotalht=174;
if ($this->page_largeur < 210) // To work with US executive format
@ -207,6 +208,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$commande->fetch($expedition->origin_id);
}
$object->commande=$commande; // We set order of shipment onto delivery.
$object->commande->loadExpeditions();
$pdf->Open();
@ -355,7 +357,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Quantity
//$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxqty, 3, $object->lines[$i]->qty_shipped, 0, 'R');
$pdf->MultiCell($this->posxremainingqty - $this->posxqty, 3, $object->lines[$i]->qty_shipped, 0, 'R');
// Remaining to ship
$pdf->SetXY($this->posxremainingqty, $curY);
$qtyRemaining = $object->lines[$i]->qty_asked - $object->commande->expeditions[$object->lines[$i]->fk_origin_line];
$pdf->MultiCell($this->page_largeur-$this->marge_droite - $this->posxremainingqty, 3, $qtyRemaining, 0, 'R');
/*
// Remise sur ligne
$pdf->SetXY($this->posxdiscount, $curY);
@ -606,7 +613,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell($this->posxcomm - $this->posxdesc,2, $outputlangs->transnoentities("Designation"),'','L');
}
// Modif SEB pour avoir une col en plus pour les commentaires clients
$pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height);
if (empty($hidetop)) {
@ -615,12 +622,18 @@ class pdf_typhon extends ModelePDFDeliveryOrder
}
// Qty
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
$pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','R');
$pdf->SetXY($this->posxqty, $tab_top+1);
$pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','C');
}
// Remain to ship
$pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxremainingqty, $tab_top+1);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxremainingqty, 2, $outputlangs->transnoentities("KeepToShip"),'','C');
}
}
/**

View File

@ -590,6 +590,8 @@ class Expedition extends CommonObject
$cpt = $this->db->num_rows($resql);
for ($i = 0; $i < $cpt; $i++)
{
if($obj->qty <= 0) continue;
dol_syslog(get_class($this)."::valid movement index ".$i);
$obj = $this->db->fetch_object($resql);

View File

@ -163,7 +163,7 @@ if ($action == 'add')
{
$qty = "qtyl".$i;
if (! isset($batch_line[$i])) {
if (GETPOST($qty,'int') > 0)
if (GETPOST($qty,'int') > 0 || (GETPOST($qty,'int') == 0 && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS))
{
$ent = "entl".$i;
$idl = "idl".$i;

View File

@ -677,7 +677,7 @@ class Livraison extends CommonObject
{
$this->lines = array();
$sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped,";
$sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped, ld.fk_origin_line, ";
$sql.= " cd.qty as qty_asked, cd.label as custom_label,";
$sql.= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc";
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld";
@ -709,6 +709,7 @@ class Livraison extends CommonObject
$line->product_ref = $obj->product_ref; // Product ref
$line->product_desc = $obj->product_desc; // Product description
$line->product_type = $obj->fk_product_type;
$line->fk_origin_line = $obj->fk_origin_line;
$line->price = $obj->price;
$line->total_ht = $obj->total_ht;