';
- print '| '.$langs->trans("Company").' | '.$soc->nom.' | ';
- print '
';
+ print '| '.$langs->trans("Ref").' | '.$langs->trans("Draft").' |
';
+ print '';
- print '| '.$langs->trans("Author").' | '.$user->fullname.' | ';
- print ''.$langs->trans("Comments").' | ';
- print '
';
+ print '| '.$langs->trans("Company").' | '.$soc->nom.' | ';
+ print '
';
- print '| '.$langs->trans("Date").' | ';
- $html->select_date();
- print ' | ';
+ print '
| '.$langs->trans("Author").' | '.$user->fullname.' | ';
+ print ''.$langs->trans("Comments").' | ';
+ print '
';
- print '';
- print ' | ';
+ print '| '.$langs->trans("Date").' | ';
+ $html->select_date();
+ print ' | ';
- print '
| '.$langs->trans("Ref").' | Provisoire |
';
- print '';
+ // Notes
+ print '';
+ print ' | ';
- // Conditions de réglement
- $id_condition_paiements_defaut=1;
- print "| ".$langs->trans("PaymentConditions")." | ";
- $html->select_conditions_paiements($id_condition_paiements_defaut,'cond_reglement_id');
- print " |
";
+ // Conditions de réglement
+ $id_condition_paiements_defaut=1;
+ print "| ".$langs->trans("PaymentConditions")." | ";
+ $html->select_conditions_paiements($id_condition_paiements_defaut,'cond_reglement_id');
+ print " |
";
- // Mode de réglement
- print "| ".$langs->trans("PaymentMode")." | ";
- $html->select_types_paiements('','mode_reglement_id');
- print " |
";
+ // Mode de réglement
+ print "| ".$langs->trans("PaymentMode")." | ";
+ $html->select_types_paiements('','mode_reglement_id');
+ print " |
";
- // Projet
- if ($conf->projet->enabled)
- {
- $langs->load("projects");
- print '| '.$langs->trans("Project").' | ';
- $html->select_projects($socidp);
- print " |
";
- }
- else
- {
- print '| |
';
- }
-
- if ($_GET["propalid"] > 0)
- {
- $amount = ($obj->price);
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print '';
-
- print '| '.$langs->trans("Proposal").' | '.$obj->ref.' |
';
- print '| '.$langs->trans("TotalHT").' | '.price($amount).' |
';
- print '| '.$langs->trans("VAT").' | '.price($obj->tva)." |
";
- print '| '.$langs->trans("TotalTTC").' | '.price($obj->total)." |
";
- }
- elseif ($_GET["commandeid"] > 0)
- {
- print '';
- print '| '.$langs->trans("Order").' | '.$commande->ref.' |
';
- print '| '.$langs->trans("TotalHT").' | '.price($commande->total_ht).' |
';
- print '| '.$langs->trans("VAT").' | '.price($commande->total_tva)." |
";
- print '| '.$langs->trans("TotalTTC").' | '.price($commande->total_ttc)." |
";
- }
- else
- {
- print '| |
';
- print '';
-
- print '';
- print '| Services/Produits prédéfinis | '.$langs->trans("Qty").' | '.$langs->trans("Discount").' | | ';
- if ($conf->service->enabled)
- {
- print 'Si produit de type service à durée limitée | ';
- }
- for ($i = 1 ; $i <= $NBLINES ; $i++)
- {
- print '| ';
- $html->select_produits('',"idprod$i");
- print ' | ';
- print ' | ';
- print '% | ';
- print ' | ';
- // Si le module service est actif, on propose des dates de début et fin à la ligne
- if ($conf->service->enabled) {
- print '';
- print 'Du ';
- print $html->select_date('',"date_start$i",0,0,1);
- print ' au ';
- print $html->select_date('',"date_end$i",0,0,1);
- print ' | ';
- }
- print " \n";
- }
-
- print ' ';
- print ' |
';
- }
-
- /*
- * Factures récurrentes
- */
- if ($_GET["propalid"] == 0 && $_GET["commandeid"] == 0)
- {
- $sql = "SELECT r.rowid, r.titre, r.amount FROM ".MAIN_DB_PREFIX."facture_rec as r";
- $sql .= " WHERE r.fk_soc = ".$soc->id;
- if ( $db->query($sql) )
- {
- $num = $db->num_rows();
- $i = 0;
-
- if ($num > 0)
- {
- print '| Factures récurrentes : |
';
- }
- $db->free();
- }
- else
- {
- dolibarr_print_error($db);
- }
- }
-
- /*
- *
- */
- print ' |
';
- print "\n";
- print "
\n";
-
- // Si creation depuis un propal
- if ($_GET["propalid"])
- {
- print '';
- print '| '.$langs->trans("Ref").' | '.$langs->trans("Product").' | ';
- print ''.$langs->trans("Price").' | '.$langs->trans("Discount").' | '.$langs->trans("Qty").' |
';
-
- $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.subprice, pt.qty, p.rowid as prodid, pt.remise_percent, pt.description";
- $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as pt, ".MAIN_DB_PREFIX."product as p";
- $sql .= " WHERE pt.fk_product = p.rowid AND pt.fk_commande = ".$commande->id;
- $sql .= " ORDER BY pt.rowid ASC";
-
- $result = $db->query($sql);
- if ($result)
- {
- $num = $db->num_rows();
- $i = 0;
- $var=True;
- while ($i < $num)
- {
- $objp = $db->fetch_object();
- $var=!$var;
- print '| '.img_object($langs->trans(""),"product")." ".$objp->ref."";
- print $objp->product?' - '.$objp->product:'';
- print " | \n";
- print '';
- print $objp->description;
- print ' | ';
- print ''.price($objp->subprice).' | ';
- print ''.$objp->remise_percent.'% | ';
- print ''.$objp->qty.' |
';
- $i++;
- }
- }
- else
- {
- dolibarr_print_error($db);
- }
- // Lignes de commande non produits prédéfinis
- $sql = "SELECT pt.rowid, pt.description as product, pt.subprice, pt.qty, pt.remise_percent";
- $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as pt";
- $sql .= " WHERE pt.fk_commande = ".$commande->id;
- $sql .= " AND pt.fk_product = 0";
- $sql .= " ORDER BY pt.rowid ASC";
-
- $result=$db->query($sql);
- if ($result)
- {
- $num = $db->num_rows($result);
- $i = 0;
- while ($i < $num)
- {
- $objp = $db->fetch_object($result);
- $var=!$var;
- print "| | \n";
- print ''.$objp->product.' | ';
- print ''.price($objp->subprice).' | ';
- print ''.$objp->remise_percent.'% | ';
- print ''.$objp->qty.' | ';
- print '
';
- $i++;
- }
- }
- else
- {
- dolibarr_print_error($db);
- }
-
- print '
';
- }
-
- }
+ // Projet
+ if ($conf->projet->enabled)
+ {
+ $langs->load("projects");
+ print '';
+
+ print '';
+ print '| '.$langs->trans("ProductsAndServices").' | '.$langs->trans("Qty").' | '.$langs->trans("Discount").' | | ';
+ if ($conf->service->enabled)
+ {
+ print 'Si produit de type service à durée limitée | ';
+ }
+ for ($i = 1 ; $i <= $NBLINES ; $i++)
+ {
+ print '| ';
+ $html->select_produits('',"idprod$i");
+ print ' | ';
+ print ' | ';
+ print '% | ';
+ print ' | ';
+ // Si le module service est actif, on propose des dates de début et fin à la ligne
+ if ($conf->service->enabled) {
+ print '';
+ print 'Du ';
+ print $html->select_date('',"date_start$i",0,0,1);
+ print ' au ';
+ print $html->select_date('',"date_end$i",0,0,1);
+ print ' | ';
+ }
+ print " \n";
+ }
+
+ print ' ';
+ print ' |
';
+ }
+
+ /*
+ * Factures récurrentes
+ */
+ if ($_GET["propalid"] == 0 && $_GET["commandeid"] == 0)
+ {
+ $sql = "SELECT r.rowid, r.titre, r.amount FROM ".MAIN_DB_PREFIX."facture_rec as r";
+ $sql .= " WHERE r.fk_soc = ".$soc->id;
+ if ( $db->query($sql) )
+ {
+ $num = $db->num_rows();
+ $i = 0;
+
+ if ($num > 0)
+ {
+ print '