forked from Wavyzz/dolibarr
Debug inventory module
This commit is contained in:
@@ -3511,7 +3511,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
|
||||
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes',
|
||||
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'external-link-alt', 'external-link-square-alt',
|
||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
|
||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
|
||||
'help', 'holiday',
|
||||
'info', 'intervention', 'inventory', 'intracommreport',
|
||||
'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'long-arrow-alt-right',
|
||||
@@ -3558,7 +3558,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
}
|
||||
|
||||
$arrayconvpictotofa = array(
|
||||
'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'search-dollar', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', 'asset'=>'money-check-alt',
|
||||
'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'search-dollar', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', 'asset'=>'money-check-alt', 'autofill'=>'fill',
|
||||
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical',
|
||||
'bom'=>'shapes',
|
||||
'chart'=>'chart-line', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'collab'=>'people-arrows', 'conversation'=>'comments', 'country'=>'globe-americas', 'cron'=>'business-time',
|
||||
|
||||
@@ -130,6 +130,7 @@ $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_d
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'expedition', $object->id, '');
|
||||
|
||||
|
||||
@@ -1035,7 +1036,7 @@ if ($action == 'create') {
|
||||
print '<td class="center">'.$langs->trans("QtyShipped").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyToShip");
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">'.$langs->trans("Fill").'</a>';
|
||||
print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Autofill"), 'autofill', 'class="paddingrightonly"').$langs->trans("Fill").'</a>';
|
||||
print ' / ';
|
||||
} else {
|
||||
print '<br>';
|
||||
|
||||
@@ -65,6 +65,7 @@ if (!empty($user->socid)) {
|
||||
$result = restrictedArea($user, 'commande', $id);
|
||||
|
||||
$object = new Commande($db);
|
||||
$shipment = new Expedition($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@@ -77,7 +78,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'expedition', $object->id, '');
|
||||
|
||||
$result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, because there is no particular shipment on this tab, only id of order is known
|
||||
|
||||
|
||||
|
||||
@@ -94,13 +96,11 @@ if ($reshook < 0) {
|
||||
if (empty($reshook)) {
|
||||
// Categorisation dans projet
|
||||
if ($action == 'classin') {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
}
|
||||
|
||||
if ($action == 'confirm_cloture' && GETPOST('confirm', 'alpha') == 'yes') {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->cloture($user);
|
||||
} elseif ($action == 'setref_client' && $user->rights->commande->creer) {
|
||||
@@ -132,7 +132,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
*/
|
||||
if ($action == 'setmode' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@@ -141,7 +140,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if ($action == 'setavailability' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->availability(GETPOST('availability_id'));
|
||||
if ($result < 0) {
|
||||
@@ -150,7 +148,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if ($action == 'setdemandreason' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->demand_reason(GETPOST('demand_reason_id'));
|
||||
if ($result < 0) {
|
||||
@@ -159,7 +156,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if ($action == 'setconditions' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@@ -175,7 +171,6 @@ if (empty($reshook)) {
|
||||
|
||||
// shipping method
|
||||
if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@@ -185,7 +180,6 @@ if (empty($reshook)) {
|
||||
|
||||
// warehouse
|
||||
if ($action == 'setwarehouse' && $user->rights->commande->creer) {
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
|
||||
if ($result < 0) {
|
||||
|
||||
@@ -254,4 +254,4 @@ ReOpen=Reopen
|
||||
ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock.
|
||||
ObjectNotFound=%s not found
|
||||
MakeMovementsAndClose=Generate movements and close
|
||||
AutofillWithExpected=Auto-fill expected quantity with real quantity
|
||||
AutofillWithExpected=Fill real quantity with expected quantity
|
||||
@@ -448,15 +448,16 @@ if ($object->id > 0) {
|
||||
print '<a href="#" class="butAction">'.$langs->trans('UpdateByScaningLot').'</a>';
|
||||
}*/
|
||||
if (!empty($conf->barcode->enabled) || !empty($conf->productbatch->enabled)) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=updatebyscaning" class="">'.$langs->trans("UpdateByScaning").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=updatebyscaning" class="">'.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Save").'</a>'."\n";
|
||||
print '<a class="classfortooltip marginrightonly paddingright marginleftonly paddingleft" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Save").'</a>'."\n";
|
||||
}
|
||||
if ($permissiontoadd && $conf->use_javascript_ajax) {
|
||||
print ' ';
|
||||
print '<button type="button" class="butAction" id="fillwithexpected">'.$langs->trans('AutofillWithExpected').'</button>';
|
||||
print '<a id="fillwithexpected" class="marginrightonly paddingright marginleftonly paddingleft" href="#">'.img_picto('', 'autofill', 'class="paddingrightonly"').$langs->trans('AutofillWithExpected').'</a>';
|
||||
|
||||
print '<script>';
|
||||
print '$( document ).ready(function() {';
|
||||
print ' $("#fillwithexpected").on("click",function fillWithExpected(){
|
||||
$(".expectedqty").each(function(){
|
||||
var object = $(this)[0];
|
||||
@@ -465,6 +466,7 @@ if ($object->id > 0) {
|
||||
})
|
||||
console.log("Values filled");
|
||||
});';
|
||||
print '});';
|
||||
print '</script>';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
Reference in New Issue
Block a user