Add select account in product card

This commit is contained in:
aspangaro 2015-12-17 12:57:08 +01:00
parent c34e698d59
commit 85f87d45df
2 changed files with 24 additions and 10 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> /* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -126,7 +126,7 @@ class FormVentilation extends Form
if ($num) { if ($num) {
while ( $i < $num ) { while ( $i < $num ) {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$label = $obj->account_number . ' - ' . $obj->label; $label = length_accountg($obj->account_number) . ' - ' . $obj->label;
$label = dol_trunc($label, $trunclength); $label = dol_trunc($label, $trunclength);
if ($select_in == 0 ) $select_value_in = $obj->rowid; if ($select_in == 0 ) $select_value_in = $obj->rowid;
if ($select_in == 1 ) $select_value_in = $obj->account_number; if ($select_in == 1 ) $select_value_in = $obj->account_number;

View File

@ -186,12 +186,14 @@ if (empty($reshook))
$action = "create"; $action = "create";
$error++; $error++;
} }
/*
if (! empty(GETPOST('duration_value')) && empty(GETPOST('duration_unit'))) if (! empty(GETPOST('duration_value')) && empty(GETPOST('duration_unit')))
{ {
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Unit')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Unit')), 'errors');
$action = "create"; $action = "create";
$error++; $error++;
} }
*/
if (! $error) if (! $error)
{ {
@ -263,7 +265,7 @@ if (empty($reshook))
if (GETPOST('accountancy_code_sell') <= 0) { $accountancy_code_sell = ''; } else { $accountancy_code_sell = GETPOST('accountancy_code_sell'); } if (GETPOST('accountancy_code_sell') <= 0) { $accountancy_code_sell = ''; } else { $accountancy_code_sell = GETPOST('accountancy_code_sell'); }
if (GETPOST('accountancy_code_buy') <= 0) { $accountancy_code_buy = ''; } else { $accountancy_code_buy = GETPOST('accountancy_code_buy'); } if (GETPOST('accountancy_code_buy') <= 0) { $accountancy_code_buy = ''; } else { $accountancy_code_buy = GETPOST('accountancy_code_buy'); }
$object->accountancy_code_sell = $accountancy_code_sell; $object->accountancy_code_sell = $accountancy_code_sell;
$object->accountancy_code_buy = GETPOST('accountancy_code_buy'); $object->accountancy_code_buy = $accountancy_code_buy;
// MultiPrix // MultiPrix
if (! empty($conf->global->PRODUIT_MULTIPRICES)) if (! empty($conf->global->PRODUIT_MULTIPRICES))
@ -372,6 +374,8 @@ if (empty($reshook))
$object->barcode_type_coder = $stdobject->barcode_type_coder; $object->barcode_type_coder = $stdobject->barcode_type_coder;
$object->barcode_type_label = $stdobject->barcode_type_label; $object->barcode_type_label = $stdobject->barcode_type_label;
if (GETPOST('accountancy_code_sell') <= 0) { $accountancy_code_sell = ''; } else { $accountancy_code_sell = GETPOST('accountancy_code_sell'); }
if (GETPOST('accountancy_code_buy') <= 0) { $accountancy_code_buy = ''; } else { $accountancy_code_buy = GETPOST('accountancy_code_buy'); }
$object->accountancy_code_sell = GETPOST('accountancy_code_sell'); $object->accountancy_code_sell = GETPOST('accountancy_code_sell');
$object->accountancy_code_buy = GETPOST('accountancy_code_buy'); $object->accountancy_code_buy = GETPOST('accountancy_code_buy');
@ -1367,7 +1371,7 @@ else
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("BarcodeType"); print $langs->trans("BarcodeType");
print '<td>'; print '</td>';
if (($action != 'editbarcodetype') && ! empty($user->rights->barcode->creer)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbarcodetype&amp;id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>'; if (($action != 'editbarcodetype') && ! empty($user->rights->barcode->creer)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbarcodetype&amp;id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td colspan="2">';
@ -1388,7 +1392,7 @@ else
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("BarcodeValue"); print $langs->trans("BarcodeValue");
print '<td>'; print '</td>';
if (($action != 'editbarcode') && ! empty($user->rights->barcode->creer)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbarcode&amp;id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>'; if (($action != 'editbarcode') && ! empty($user->rights->barcode->creer)) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbarcode&amp;id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td colspan="2">';
@ -1409,13 +1413,23 @@ else
} }
// Accountancy sell code // Accountancy sell code
print '<tr><td>'.$form->editfieldkey("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').'</td><td colspan="2">'; print '<tr><td class="nowrap">';
print $form->editfieldval("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string'); print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("ProductAccountancySellCode");
print '</td>';
print '</tr></table>';
print '</td><td colspan="2">';
print length_accountg($object->accountancy_code_sell);
print '</td></tr>'; print '</td></tr>';
// Accountancy buy code // Accountancy sell code
print '<tr><td>'.$form->editfieldkey("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').'</td><td colspan="2">'; print '<tr><td class="nowrap">';
print $form->editfieldval("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string'); print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("ProductAccountancyBuyCode");
print '</td>';
print '</tr></table>';
print '</td><td colspan="2">';
print length_accountg($object->accountancy_code_buy);
print '</td></tr>'; print '</td></tr>';
// Status (to sell) // Status (to sell)