96 |
*/ |
*/ |
97 |
if ($_GET["propalid"]) |
if ($_GET["propalid"]) |
98 |
{ |
{ |
99 |
$propal = new Propal($db); |
$propal = new Propal($db); |
100 |
$propal->fetch($_GET["propalid"]); |
$propal->fetch($_GET["propalid"]); |
101 |
$h=0; |
$h=0; |
102 |
|
|
103 |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; |
104 |
$head[$h][1] = $langs->trans('CommercialCard'); |
$head[$h][1] = $langs->trans('CommercialCard'); |
105 |
$h++; |
$h++; |
106 |
|
|
107 |
$head[$h][0] = DOL_URL_ROOT.'/compta/propal.php?propalid='.$propal->id; |
$head[$h][0] = DOL_URL_ROOT.'/compta/propal.php?propalid='.$propal->id; |
108 |
$head[$h][1] = $langs->trans('AccountancyCard'); |
$head[$h][1] = $langs->trans('AccountancyCard'); |
109 |
$hselected=$h; |
$hselected=$h; |
110 |
$h++; |
$h++; |
111 |
|
|
112 |
if ($conf->use_preview_tabs) |
if ($conf->use_preview_tabs) |
113 |
{ |
{ |
114 |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id; |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id; |
115 |
$head[$h][1] = $langs->trans("Preview"); |
$head[$h][1] = $langs->trans("Preview"); |
116 |
$h++; |
$h++; |
117 |
} |
} |
118 |
|
|
119 |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; |
120 |
$head[$h][1] = $langs->trans('Note'); |
$head[$h][1] = $langs->trans('Note'); |
121 |
$h++; |
$h++; |
122 |
|
|
123 |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id; |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id; |
124 |
$head[$h][1] = $langs->trans('Info'); |
$head[$h][1] = $langs->trans('Info'); |
125 |
$h++; |
$h++; |
126 |
|
|
127 |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?propalid='.$propal->id; |
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?propalid='.$propal->id; |
128 |
$head[$h][1] = $langs->trans('Documents'); |
$head[$h][1] = $langs->trans('Documents'); |
129 |
$h++; |
$h++; |
130 |
|
|
131 |
dolibarr_fiche_head($head, $hselected, $langs->trans('Proposal').': '.$propal->ref); |
dolibarr_fiche_head($head, $hselected, $langs->trans('Proposal').': '.$propal->ref); |
132 |
|
|
133 |
|
|
134 |
/* |
/* |
135 |
* Fiche propal |
* Fiche propal |
136 |
* |
* |
137 |
*/ |
*/ |
138 |
$sql = 'SELECT s.nom, s.idp, p.price, p.fk_projet, p.remise, p.tva, p.total, p.ref,'.$db->pdate('p.datep').' as dp, c.id as statut, c.label as lst, p.note,'; |
$sql = 'SELECT s.nom, s.idp, p.price, p.fk_projet, p.remise, p.tva, p.total, p.ref,'.$db->pdate('p.datep').' as dp, c.id as statut, c.label as lst, p.note,'; |
139 |
$sql.= ' x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture'; |
$sql.= ' x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture'; |
140 |
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c, '.MAIN_DB_PREFIX.'socpeople as x'; |
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c, '.MAIN_DB_PREFIX.'socpeople as x'; |
141 |
$sql.= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = '.$propal->id; |
$sql.= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = '.$propal->id; |
142 |
if ($socidp) $sql .= ' AND s.idp = '.$socidp; |
if ($socidp) $sql .= ' AND s.idp = '.$socidp; |
143 |
|
|
144 |
$resql = $db->query($sql); |
$resql = $db->query($sql); |
145 |
if ($resql) |
if ($resql) |
146 |
{ |
{ |
147 |
if ($db->num_rows($resql)) |
if ($db->num_rows($resql)) |
148 |
{ |
{ |
149 |
$obj = $db->fetch_object($resql); |
$obj = $db->fetch_object($resql); |
150 |
|
|
151 |
$societe = new Societe($db); |
$societe = new Societe($db); |
152 |
$societe->fetch($obj->idp); |
$societe->fetch($obj->idp); |
153 |
|
|
154 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
155 |
$rowspan=6; |
$rowspan=6; |
156 |
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'; |
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'; |
157 |
if ($societe->client == 1) |
if ($societe->client == 1) |
158 |
{ |
{ |
159 |
$url ='fiche.php?socid='.$societe->id; |
$url ='fiche.php?socid='.$societe->id; |
160 |
} |
} |
161 |
else |
else |
162 |
{ |
{ |
163 |
$url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id; |
$url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id; |
164 |
} |
} |
165 |
print '<a href="'.$url.'">'.$societe->nom.'</a></td>'; |
print '<a href="'.$url.'">'.$societe->nom.'</a></td>'; |
166 |
print '<td align="left">Conditions de réglement</td>'; |
print '<td align="left">Conditions de réglement</td>'; |
167 |
print '<td>'.' '.'</td>'; |
print '<td>'.' '.'</td>'; |
168 |
print '</tr>'; |
print '</tr>'; |
169 |
|
|
170 |
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; |
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; |
171 |
print dolibarr_print_date($propal->date,'%a %d %B %Y'); |
print dolibarr_print_date($propal->date,'%a %d %B %Y'); |
172 |
print '</td>'; |
print '</td>'; |
173 |
|
|
174 |
print '<td>'.$langs->trans('DateEndPropal').'</td><td>'; |
print '<td>'.$langs->trans('DateEndPropal').'</td><td>'; |
175 |
if ($propal->fin_validite) |
if ($propal->fin_validite) |
176 |
{ |
{ |
177 |
print dolibarr_print_date($propal->fin_validite,'%a %d %B %Y'); |
print dolibarr_print_date($propal->fin_validite,'%a %d %B %Y'); |
178 |
if ($propal->statut == 1 && $propal->fin_validite < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); |
if ($propal->statut == 1 && $propal->fin_validite < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); |
179 |
} |
} |
180 |
else |
else |
181 |
{ |
{ |
182 |
print $langs->trans("Unknown"); |
print $langs->trans("Unknown"); |
183 |
} |
} |
184 |
print '</td>'; |
print '</td>'; |
185 |
print '</tr>'; |
print '</tr>'; |
186 |
|
|
187 |
// Destinataire |
// Destinataire |
188 |
$langs->load('mails'); |
$langs->load('mails'); |
189 |
print '<tr>'; |
print '<tr>'; |
190 |
print '<td>'.$langs->trans('MailTo').'</td>'; |
print '<td>'.$langs->trans('MailTo').'</td>'; |
191 |
|
|
192 |
$dests=$societe->contact_array($societe->id); |
$dests=$societe->contact_array($societe->id); |
193 |
$numdest = count($dests); |
$numdest = count($dests); |
194 |
if ($numdest==0) |
if ($numdest==0) |
195 |
{ |
{ |
196 |
print '<td colspan="3">'; |
print '<td colspan="3">'; |
197 |
print '<font class="error">Cette societe n\'a pas de contact, veuillez en créer un avant de faire votre proposition commerciale</font><br>'; |
print '<font class="error">Cette societe n\'a pas de contact, veuillez en créer un avant de faire votre proposition commerciale</font><br>'; |
198 |
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$langs->trans('AddContact').'</a>'; |
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$langs->trans('AddContact').'</a>'; |
199 |
print '</td>'; |
print '</td>'; |
200 |
} |
} |
201 |
else |
else |
202 |
{ |
{ |
203 |
if ($propal->statut == 0 && $user->rights->propale->creer) |
if ($propal->statut == 0 && $user->rights->propale->creer) |
204 |
{ |
{ |
205 |
print '<td colspan="2">'; |
print '<td colspan="2">'; |
206 |
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; |
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; |
207 |
print '<input type="hidden" name="action" value="set_contact">'; |
print '<input type="hidden" name="action" value="set_contact">'; |
208 |
$form->select_contacts($societe->id, $propal->contactid, 'contactidp'); |
$form->select_contacts($societe->id, $propal->contactid, 'contactidp'); |
209 |
print '</td><td>'; |
print '</td><td>'; |
210 |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
211 |
print '</form>'; |
print '</form>'; |
212 |
print '</td>'; |
print '</td>'; |
213 |
} |
} |
214 |
else |
else |
215 |
{ |
{ |
216 |
if (!empty($propal->contactid)) |
if (!empty($propal->contactid)) |
217 |
{ |
{ |
218 |
print '<td colspan="3">'; |
print '<td colspan="3">'; |
219 |
require_once(DOL_DOCUMENT_ROOT.'/contact.class.php'); |
require_once(DOL_DOCUMENT_ROOT.'/contact.class.php'); |
220 |
$contact=new Contact($db); |
$contact=new Contact($db); |
221 |
$contact->fetch($propal->contactid); |
$contact->fetch($propal->contactid); |
222 |
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$propal->contactid.'" title="'.$langs->trans('ShowContact').'">'; |
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$propal->contactid.'" title="'.$langs->trans('ShowContact').'">'; |
223 |
print $contact->firstname.' '.$contact->name; |
print $contact->firstname.' '.$contact->name; |
224 |
print '</a>'; |
print '</a>'; |
225 |
print '</td>'; |
print '</td>'; |
226 |
} |
} |
227 |
else { |
else { |
228 |
print '<td colspan="3"> </td>'; |
print '<td colspan="3"> </td>'; |
229 |
} |
} |
230 |
} |
} |
231 |
} |
} |
232 |
print '</td>'; |
print '</td>'; |
233 |
|
|
234 |
if ($conf->projet->enabled) |
if ($conf->projet->enabled) |
235 |
$rowspan++; |
$rowspan++; |
236 |
|
|
237 |
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('Note').' :<br>'. nl2br($propal->note).'</td></tr>'; |
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('Note').' :<br>'. nl2br($propal->note).'</td></tr>'; |
238 |
|
|
239 |
if ($conf->projet->enabled) |
if ($conf->projet->enabled) |
240 |
{ |
{ |
241 |
$langs->load("projects"); |
$langs->load("projects"); |
242 |
print '<tr><td>'.$langs->trans('Project').'</td>'; |
print '<tr><td>'.$langs->trans('Project').'</td>'; |
243 |
$numprojet = $societe->has_projects(); |
$numprojet = $societe->has_projects(); |
244 |
if (! $numprojet) |
if (! $numprojet) |
245 |
{ |
{ |
246 |
print '<td colspan="2">'; |
print '<td colspan="2">'; |
247 |
print $langs->trans("NoProject").'</td><td>'; |
print $langs->trans("NoProject").'</td><td>'; |
248 |
print '<a href=../projet/fiche.php?socidp='.$societe->id.'&action=create>'.$langs->trans('AddProject').'</a>'; |
print '<a href=../projet/fiche.php?socidp='.$societe->id.'&action=create>'.$langs->trans('AddProject').'</a>'; |
249 |
print '</td>'; |
print '</td>'; |
250 |
} |
} |
251 |
else |
else |
252 |
{ |
{ |
253 |
if ($propal->statut == 0 && $user->rights->propale->creer) |
if ($propal->statut == 0 && $user->rights->propale->creer) |
254 |
{ |
{ |
255 |
print '<td colspan="2">'; |
print '<td colspan="2">'; |
256 |
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; |
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; |
257 |
print '<input type="hidden" name="action" value="set_project">'; |
print '<input type="hidden" name="action" value="set_project">'; |
258 |
$form->select_projects($societe->id, $propal->projetidp, 'projetidp'); |
$form->select_projects($societe->id, $propal->projetidp, 'projetidp'); |
259 |
print '</td><td>'; |
print '</td><td>'; |
260 |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
261 |
print '</form>'; |
print '</form>'; |
262 |
print '</td>'; |
print '</td>'; |
263 |
} |
} |
264 |
else |
else |
265 |
{ |
{ |
266 |
if (!empty($propal->projetidp)) |
if (!empty($propal->projetidp)) |
267 |
{ |
{ |
268 |
print '<td colspan="3">'; |
print '<td colspan="3">'; |
269 |
$proj = new Project($db); |
$proj = new Project($db); |
270 |
$proj->fetch($propal->projetidp); |
$proj->fetch($propal->projetidp); |
271 |
print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">'; |
print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">'; |
272 |
print $proj->title; |
print $proj->title; |
273 |
print '</a>'; |
print '</a>'; |
274 |
print '</td>'; |
print '</td>'; |
275 |
} |
} |
276 |
else { |
else { |
277 |
print '<td colspan="3"> </td>'; |
print '<td colspan="3"> </td>'; |
278 |
} |
} |
279 |
} |
} |
280 |
} |
} |
281 |
print '</tr>'; |
print '</tr>'; |
282 |
} |
} |
283 |
|
|
284 |
print '<tr><td height="10" nowrap>'.$langs->trans('GlobalDiscount').'</td>'; |
print '<tr><td height="10" nowrap>'.$langs->trans('GlobalDiscount').'</td>'; |
285 |
if ($propal->brouillon == 1 && $user->rights->propale->creer) |
if ($propal->brouillon == 1 && $user->rights->propale->creer) |
286 |
{ |
{ |
287 |
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; |
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; |
288 |
print '<input type="hidden" name="action" value="setremise">'; |
print '<input type="hidden" name="action" value="setremise">'; |
289 |
print '<td colspan="2"><input type="text" name="remise" size="3" value="'.$propal->remise_percent.'">% '; |
print '<td colspan="2"><input type="text" name="remise" size="3" value="'.$propal->remise_percent.'">% '; |
290 |
print '</td><td>'; |
print '</td><td>'; |
291 |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
292 |
print ' <a href="propal/aideremise.php?propalid='.$propal->id.'">?</a>'; |
print ' <a href="propal/aideremise.php?propalid='.$propal->id.'">?</a>'; |
293 |
print '</td>'; |
print '</td>'; |
294 |
print '</form>'; |
print '</form>'; |
295 |
} |
} |
296 |
else |
else |
297 |
{ |
{ |
298 |
print '<td colspan="3">'.$propal->remise_percent.'%</td>'; |
print '<td colspan="3">'.$propal->remise_percent.'%</td>'; |
299 |
} |
} |
300 |
print '</tr>'; |
print '</tr>'; |
301 |
|
|
302 |
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>'; |
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>'; |
303 |
print '<td align="right" colspan="2"><b>'.price($propal->price).'</b></td>'; |
print '<td align="right" colspan="2"><b>'.price($propal->price).'</b></td>'; |
304 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
305 |
|
|
306 |
print '<tr><td height="10">'.$langs->trans('VAT').'</td><td align="right" colspan="2">'.price($propal->total_tva).'</td>'; |
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2">'.price($propal->total_tva).'</td>'; |
307 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
308 |
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2">'.price($propal->total_ttc).'</td>'; |
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2">'.price($propal->total_ttc).'</td>'; |
309 |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
310 |
|
|
311 |
// Statut |
// Statut |
312 |
print '<tr><td height="10">'.$langs->trans('Status').'</td><td align="left" colspan="3">'.$propal->getLibStatut().'</td></tr>'; |
print '<tr><td height="10">'.$langs->trans('Status').'</td><td align="left" colspan="3">'.$propal->getLibStatut().'</td></tr>'; |
313 |
print '</table><br>'; |
print '</table><br>'; |
314 |
if ($propal->brouillon == 1 && $user->rights->propale->creer) |
if ($propal->brouillon == 1 && $user->rights->propale->creer) |
315 |
{ |
{ |
316 |
print '</form>'; |
print '</form>'; |
317 |
} |
} |
318 |
|
|
319 |
/* |
/* |
320 |
* Lignes de propale |
* Lignes de propale |
321 |
* |
* |
322 |
*/ |
*/ |
323 |
$sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; |
$sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; |
324 |
$sql .= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; |
$sql .= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; |
325 |
$sql .= ' WHERE pt.fk_propal = '.$propal->id; |
$sql .= ' WHERE pt.fk_propal = '.$propal->id; |
326 |
$sql .= ' ORDER BY pt.rowid ASC'; |
$sql .= ' ORDER BY pt.rowid ASC'; |
327 |
$resql = $db->query($sql); |
$resql = $db->query($sql); |
328 |
if ($resql) |
if ($resql) |
329 |
{ |
{ |
330 |
$num_lignes = $db->num_rows($resql); |
$num_lignes = $db->num_rows($resql); |
331 |
$i = 0; |
$i = 0; |
332 |
$total = 0; |
$total = 0; |
333 |
|
|
334 |
print '<table class="noborder" width="100%">'; |
print '<table class="noborder" width="100%">'; |
335 |
if ($num_lignes) |
if ($num_lignes) |
336 |
{ |
{ |
337 |
print '<tr class="liste_titre">'; |
print '<tr class="liste_titre">'; |
338 |
print '<td>'.$langs->trans('Description').'</td>'; |
print '<td>'.$langs->trans('Description').'</td>'; |
339 |
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; |
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; |
340 |
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; |
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; |
341 |
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; |
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; |
342 |
print '<td align="right" width="50">'.$langs->trans('Discount').'</td>'; |
print '<td align="right" width="50">'.$langs->trans('Discount').'</td>'; |
343 |
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>'; |
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>'; |
344 |
print '<td> </td><td> </td>'; |
print '<td> </td><td> </td>'; |
345 |
print "</tr>\n"; |
print "</tr>\n"; |
346 |
} |
} |
347 |
$var=true; |
$var=true; |
348 |
while ($i < $num_lignes) |
while ($i < $num_lignes) |
349 |
{ |
{ |
350 |
$objp = $db->fetch_object($resql); |
$objp = $db->fetch_object($resql); |
351 |
$var=!$var; |
$var=!$var; |
352 |
if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) |
if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) |
353 |
{ |
{ |
354 |
print '<tr '.$bc[$var].'>'; |
print '<tr '.$bc[$var].'>'; |
355 |
if ($objp->fk_product > 0) |
if ($objp->fk_product > 0) |
356 |
{ |
{ |
357 |
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'; |
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'; |
358 |
if ($objp->fk_product_type) |
if ($objp->fk_product_type) |
359 |
print img_object($langs->trans('ShowService'),'service'); |
print img_object($langs->trans('ShowService'),'service'); |
360 |
else |
else |
361 |
print img_object($langs->trans('ShowProduct'),'product'); |
print img_object($langs->trans('ShowProduct'),'product'); |
362 |
print ' '.$objp->ref.'</a> - '.stripslashes(nl2br($objp->product)); |
print ' '.$objp->ref.'</a> - '.stripslashes(nl2br($objp->product)); |
363 |
if ($objp->date_start && $objp->date_end) |
if ($objp->date_start && $objp->date_end) |
364 |
{ |
{ |
365 |
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; |
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; |
366 |
} |
} |
367 |
if ($objp->date_start && ! $objp->date_end) |
if ($objp->date_start && ! $objp->date_end) |
368 |
{ |
{ |
369 |
print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; |
print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; |
370 |
} |
} |
371 |
if (! $objp->date_start && $objp->date_end) |
if (! $objp->date_start && $objp->date_end) |
372 |
{ |
{ |
373 |
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; |
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; |
374 |
} |
} |
375 |
print $objp->description?'<br>'.$objp->description:''; |
print $objp->description?'<br>'.$objp->description:''; |
376 |
print '</td>'; |
print '</td>'; |
377 |
} |
} |
378 |
else |
else |
379 |
{ |
{ |
380 |
print '<td>'.stripslashes(nl2br($objp->description)); |
print '<td>'.stripslashes(nl2br($objp->description)); |
381 |
if ($objp->date_start && $objp->date_end) |
if ($objp->date_start && $objp->date_end) |
382 |
{ |
{ |
383 |
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; |
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; |
384 |
} |
} |
385 |
if ($objp->date_start && ! $objp->date_end) |
if ($objp->date_start && ! $objp->date_end) |
386 |
{ |
{ |
387 |
print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; |
print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; |
388 |
} |
} |
389 |
if (! $objp->date_start && $objp->date_end) |
if (! $objp->date_start && $objp->date_end) |
390 |
{ |
{ |
391 |
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; |
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; |
392 |
} |
} |
393 |
print "</td>\n"; |
print "</td>\n"; |
394 |
} |
} |
395 |
print '<td align="right">'.$objp->tva_tx.'%</td>'; |
print '<td align="right">'.$objp->tva_tx.'%</td>'; |
396 |
print '<td align="right">'.price($objp->subprice)."</td>\n"; |
print '<td align="right">'.price($objp->subprice)."</td>\n"; |
397 |
print '<td align="right">'.$objp->qty.'</td>'; |
print '<td align="right">'.$objp->qty.'</td>'; |
398 |
if ($objp->remise_percent > 0) |
if ($objp->remise_percent > 0) |
399 |
{ |
{ |
400 |
print '<td align="right">'.$objp->remise_percent."%</td>\n"; |
print '<td align="right">'.$objp->remise_percent."%</td>\n"; |
401 |
} |
} |
402 |
else |
else |
403 |
{ |
{ |
404 |
print '<td> </td>'; |
print '<td> </td>'; |
405 |
} |
} |
406 |
print '<td align="right">'.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."</td>\n"; |
print '<td align="right">'.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."</td>\n"; |
407 |
|
|
408 |
print '<td> </td><td> </td>'; |
print '<td> </td><td> </td>'; |
409 |
|
|
410 |
print '</tr>'; |
print '</tr>'; |
411 |
} |
} |
412 |
|
|
413 |
|
|
414 |
|
|
415 |
$total = $total + ($objp->qty * $objp->price); |
$total = $total + ($objp->qty * $objp->price); |
416 |
$i++; |
$i++; |
417 |
} |
} |
418 |
$db->free($resql); |
$db->free($resql); |
419 |
} |
} |
420 |
else |
else |
421 |
{ |
{ |
422 |
dolibarr_print_error($db); |
dolibarr_print_error($db); |
423 |
} |
} |
424 |
|
|
425 |
print '</table>'; |
print '</table>'; |
426 |
|
|
427 |
} |
} |
428 |
} |
} |
429 |
else |
else |
430 |
{ |
{ |
431 |
dolibarr_print_error($db); |
dolibarr_print_error($db); |
432 |
} |
} |
433 |
|
|
434 |
print '</div>'; |
print '</div>'; |
435 |
|
|
436 |
|
|
437 |
/* |
/* |