forked from Wavyzz/dolibarr
FIX #15199
This commit is contained in:
@@ -283,6 +283,7 @@ PriceExpressionEditorHelp5=Available global values:
|
|||||||
PriceMode=Price mode
|
PriceMode=Price mode
|
||||||
PriceNumeric=Number
|
PriceNumeric=Number
|
||||||
DefaultPrice=Default price
|
DefaultPrice=Default price
|
||||||
|
DefaultPriceLog=Log of previous default prices
|
||||||
ComposedProductIncDecStock=Increase/Decrease stock on parent change
|
ComposedProductIncDecStock=Increase/Decrease stock on parent change
|
||||||
ComposedProduct=Child products
|
ComposedProduct=Child products
|
||||||
MinSupplierPrice=Minimum buying price
|
MinSupplierPrice=Minimum buying price
|
||||||
|
|||||||
@@ -1622,7 +1622,7 @@ class Product extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param Societe $thirdparty_seller Seller
|
* @param Societe $thirdparty_seller Seller
|
||||||
* @param Societe $thirdparty_buyer Buyer
|
* @param Societe $thirdparty_buyer Buyer
|
||||||
* @param int $pqp Id of product per price if a selection was done of such a price
|
* @param int $pqp Id of product price per quantity if a selection was done of such a price
|
||||||
* @return array Array of price information array('pu_ht'=> , 'pu_ttc'=> , 'tva_tx'=>'X.Y (code)', ...), 'tva_npr'=>0, ...)
|
* @return array Array of price information array('pu_ht'=> , 'pu_ttc'=> , 'tva_tx'=>'X.Y (code)', ...), 'tva_npr'=>0, ...)
|
||||||
* @see get_buyprice(), find_min_price_product_fournisseur()
|
* @see get_buyprice(), find_min_price_product_fournisseur()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1466,9 +1466,9 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
|||||||
{
|
{
|
||||||
// Default prices or
|
// Default prices or
|
||||||
// Log of previous customer prices
|
// Log of previous customer prices
|
||||||
$backbutton = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'.$langs->trans("Back").'</a>';
|
$backbutton = '<a class="justalink" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'.$langs->trans("Back").'</a>';
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPrice"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png');
|
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPriceLog"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png');
|
||||||
else print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png');
|
else print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png');
|
||||||
//if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPrice"),'','','','','',$backbutton, 0, 0, 'title_accountancy.png');
|
//if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPrice"),'','','','','',$backbutton, 0, 0, 'title_accountancy.png');
|
||||||
//else print_barre_liste($langs->trans("PriceByCustomerLog"),'','','','','','', 0, 0, 'title_accountancy.png');
|
//else print_barre_liste($langs->trans("PriceByCustomerLog"),'','','','','','', 0, 0, 'title_accountancy.png');
|
||||||
@@ -2100,7 +2100,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
print img_info($langs->trans('PriceByCustomerLog'));
|
print img_info($langs->trans('PriceByCustomerLog'));
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=edit_price&id='.$object->id.'">';
|
print '<a class="marginleftonly editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_price&id='.$object->id.'">';
|
||||||
print img_edit('default', 0, 'style="vertical-align: middle;"');
|
print img_edit('default', 0, 'style="vertical-align: middle;"');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
@@ -2186,11 +2186,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
print img_info($langs->trans('PriceByCustomerLog'));
|
print img_info($langs->trans('PriceByCustomerLog'));
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=edit_customer_price&id='.$object->id.'&lineid='.$line->id.'">';
|
print '<a class="marginleftonly editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_customer_price&id='.$object->id.'&lineid='.$line->id.'">';
|
||||||
print img_edit('default', 0, 'style="vertical-align: middle;"');
|
print img_edit('default', 0, 'style="vertical-align: middle;"');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete_customer_price&id='.$object->id.'&lineid='.$line->id.'">';
|
print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?action=delete_customer_price&id='.$object->id.'&lineid='.$line->id.'">';
|
||||||
print img_delete('default', 'style="vertical-align: middle;"');
|
print img_delete('default', 'style="vertical-align: middle;"');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@@ -363,13 +363,9 @@ if ($action == 'confirm_generateinvoice')
|
|||||||
{
|
{
|
||||||
if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||||
|
|
||||||
|
if (!($projectstatic->thirdparty->id > 0)) {
|
||||||
if (!($projectstatic->thirdparty->id > 0))
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
|
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
@@ -403,6 +399,7 @@ if ($action == 'confirm_generateinvoice')
|
|||||||
$prodDurationHours *= $tmpproduct->duration_value;
|
$prodDurationHours *= $tmpproduct->duration_value;
|
||||||
|
|
||||||
$dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0);
|
$dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0);
|
||||||
|
|
||||||
$pu_ht = empty($dataforprice['pu_ht']) ? 0 : $dataforprice['pu_ht'];
|
$pu_ht = empty($dataforprice['pu_ht']) ? 0 : $dataforprice['pu_ht'];
|
||||||
$txtva = $dataforprice['tva_tx'];
|
$txtva = $dataforprice['tva_tx'];
|
||||||
$localtax1 = $dataforprice['localtax1'];
|
$localtax1 = $dataforprice['localtax1'];
|
||||||
@@ -962,11 +959,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
||||||
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
||||||
|
|
||||||
|
// Form to convert time spent into invoice
|
||||||
if ($massaction == 'generateinvoice')
|
if ($massaction == 'generateinvoice')
|
||||||
{
|
{
|
||||||
//var_dump($_REQUEST);
|
|
||||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||||
|
|
||||||
|
if ($projectstatic->thirdparty->id > 0) {
|
||||||
print '<table class="noborder" width="100%" >';
|
print '<table class="noborder" width="100%" >';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">';
|
print '<td class="titlefield">';
|
||||||
@@ -976,6 +974,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print $form->selectDate('', '', '', '', '', '', 1, 1);
|
print $form->selectDate('', '', '', '', '', '', 1, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('Mode');
|
print $langs->trans('Mode');
|
||||||
@@ -989,6 +988,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
|
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($conf->service->enabled)
|
if ($conf->service->enabled)
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@@ -996,10 +996,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print $langs->trans('ServiceToUseOnLines');
|
print $langs->trans('ServiceToUseOnLines');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->select_produits('', 'productid', '1', 0, 0, 1, 2, '', 0, array(), 0, 'None', 0, 'maxwidth500');
|
$form->select_produits('', 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">';
|
print '<td class="titlefield">';
|
||||||
print $langs->trans('InvoiceToUse');
|
print $langs->trans('InvoiceToUse');
|
||||||
@@ -1025,6 +1026,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
} else {
|
||||||
|
print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>';
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
|
print '</div>';
|
||||||
|
$massaction = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1118,7 +1126,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Form to add time spent
|
* Form to add a new line of time spent
|
||||||
*/
|
*/
|
||||||
if ($action == 'createtime' && $user->rights->projet->lire)
|
if ($action == 'createtime' && $user->rights->projet->lire)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user