示例#1
0
文件: results.php 项目: alcf/chms
 public function cblColumns_Click()
 {
     foreach ($this->cblColumns->GetAllItems() as $objItem) {
         $intId = substr($objItem->Value, 1);
         if (substr($objItem->Value, 0, 1) == 'q') {
             $objQuestion = FormQuestion::Load($intId);
             $objQuestion->ViewFlag = $objItem->Selected;
             $objQuestion->Save();
         } else {
             $objProduct = FormProduct::Load($intId);
             $objProduct->ViewFlag = $objItem->Selected;
             $objProduct->Save();
         }
     }
     $this->dtgSignupEntries_SetupColumns();
     $this->dtgSignupEntries->Refresh();
 }
示例#2
0
 public function MoveDown()
 {
     $blnFound = false;
     foreach (FormProduct::LoadArrayBySignupFormIdFormProductTypeId($this->intSignupFormId, $this->intFormProductTypeId, QQ::OrderBy(QQN::FormProduct()->OrderNumber)) as $objFormProduct) {
         if ($blnFound) {
             break;
         }
         if ($objFormProduct->Id == $this->Id) {
             $blnFound = true;
         }
     }
     $this->OrderNumber++;
     $this->Save();
     if ($objFormProduct) {
         $objFormProduct->OrderNumber--;
         $objFormProduct->Save();
     }
     self::RefreshOrderNumber($this->intSignupFormId, $this->intFormProductTypeId);
 }
示例#3
0
文件: payment.php 项目: alcf/chms
 public function lstRequiredWithChoice_Change()
 {
     // Erase any old entries
     foreach ($this->objSignupEntry->GetSignupProductArray() as $objSignupProduct) {
         if ($objSignupProduct->FormProduct->FormProductTypeId == FormProductType::RequiredWithChoice && $objSignupProduct->FormProductId != $this->lstRequiredWithChoice->SelectedValue) {
             $objSignupProduct->Delete();
         }
     }
     // Create the new entry
     $objFormProduct = FormProduct::Load($this->lstRequiredWithChoice->SelectedValue);
     if ($objFormProduct) {
         $this->objSignupEntry->AddProduct($objFormProduct);
     }
     $this->RefreshForm();
 }
 /**
  * Refresh this MetaControl with Data from the local SignupProduct object.
  * @param boolean $blnReload reload SignupProduct from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objSignupProduct->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objSignupProduct->Id;
         }
     }
     if ($this->lstSignupEntry) {
         $this->lstSignupEntry->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstSignupEntry->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objSignupEntryArray = SignupEntry::LoadAll();
         if ($objSignupEntryArray) {
             foreach ($objSignupEntryArray as $objSignupEntry) {
                 $objListItem = new QListItem($objSignupEntry->__toString(), $objSignupEntry->Id);
                 if ($this->objSignupProduct->SignupEntry && $this->objSignupProduct->SignupEntry->Id == $objSignupEntry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstSignupEntry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblSignupEntryId) {
         $this->lblSignupEntryId->Text = $this->objSignupProduct->SignupEntry ? $this->objSignupProduct->SignupEntry->__toString() : null;
     }
     if ($this->lstFormProduct) {
         $this->lstFormProduct->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstFormProduct->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objFormProductArray = FormProduct::LoadAll();
         if ($objFormProductArray) {
             foreach ($objFormProductArray as $objFormProduct) {
                 $objListItem = new QListItem($objFormProduct->__toString(), $objFormProduct->Id);
                 if ($this->objSignupProduct->FormProduct && $this->objSignupProduct->FormProduct->Id == $objFormProduct->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstFormProduct->AddItem($objListItem);
             }
         }
     }
     if ($this->lblFormProductId) {
         $this->lblFormProductId->Text = $this->objSignupProduct->FormProduct ? $this->objSignupProduct->FormProduct->__toString() : null;
     }
     if ($this->txtQuantity) {
         $this->txtQuantity->Text = $this->objSignupProduct->Quantity;
     }
     if ($this->lblQuantity) {
         $this->lblQuantity->Text = $this->objSignupProduct->Quantity;
     }
     if ($this->txtAmount) {
         $this->txtAmount->Text = $this->objSignupProduct->Amount;
     }
     if ($this->lblAmount) {
         $this->lblAmount->Text = $this->objSignupProduct->Amount;
     }
     if ($this->txtDeposit) {
         $this->txtDeposit->Text = $this->objSignupProduct->Deposit;
     }
     if ($this->lblDeposit) {
         $this->lblDeposit->Text = $this->objSignupProduct->Deposit;
     }
 }
示例#5
0
       	require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
       	$notify=new Notify($db);
       	$text.='<br>';
       	$text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid, $object);
       }*/
     $formquestion = array();
     $qualified_for_stock_change = 0;
     if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
         $qualified_for_stock_change = $object->hasProductsOrServices(2);
     } else {
         $qualified_for_stock_change = $object->hasProductsOrServices(1);
     }
     if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) {
         $langs->load("stocks");
         require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
         $formproduct = new FormProduct($db);
         $formquestion = array(array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1)));
     }
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240);
 }
 // Confirmation set paid
 if ($action == 'paid') {
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1);
 }
 // Confirmation de la suppression de la facture fournisseur
 if ($action == 'delete') {
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
 }
 // Confirmation to delete line
 if ($action == 'ask_deleteline') {
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
示例#6
0
文件: card.php 项目: Albertopf/prueba
 */
$helpurl = '';
if (GETPOST("type") == '0' || $object->type == Product::TYPE_PRODUCT) {
    $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || $object->type == Product::TYPE_SERVICE) {
    $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
if (isset($_GET['type'])) {
    $title = $langs->trans('CardProduct' . GETPOST('type'));
} else {
    $title = $langs->trans('ProductServiceCard');
}
llxHeader('', $title, $helpurl);
$form = new Form($db);
$formproduct = new FormProduct($db);
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
    // -----------------------------------------
    // When used with CANVAS
    // -----------------------------------------
    if (empty($object->error) && $id) {
        $object = new Product($db);
        $result = $object->fetch($id);
        if ($result <= 0) {
            dol_print_error('', $object->error);
        }
    }
    $objcanvas->assign_values($action, $object->id, $object->ref);
    // Set value for templates
    $objcanvas->display_canvas($action);
    // Show template
require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$langs->load("admin");
$langs->load("cashdesk");
// Test if user logged
if ($_SESSION['uid'] > 0) {
    header('Location: ' . DOL_URL_ROOT . '/cashdesk/affIndex.php');
    exit;
}
$usertxt = GETPOST('user', '', 1);
$err = GETPOST("err");
/*
 * View
 */
$form = new Form($db);
$formproduct = new FormProduct($db);
$arrayofcss = array('/cashdesk/css/style.css');
top_htmlhead('', '', 0, 0, '', $arrayofcss);
?>

<body>
<div class="conteneur">
<div class="conteneur_img_gauche">
<div class="conteneur_img_droite">

<h1 class="entete"></h1>

<div class="menu_principal">
</div>

<div class="contenu">
    // Modification
    $cash = new Cash($db);
    $cash->delete(GETPOST('id'));
    header("Location: " . dol_buildpath("/pos/backend/terminal/cash.php", 1));
    exit;
}
/*
 * View
 */
$countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
$helpurl = 'EN:Module_DoliPos|FR:Module_DoliPos_FR|ES:M&oacute;dulo_DoliPos';
llxHeader('', '', $helpurl);
$form = new Form($db);
$htmlcompany = new FormCompany($db);
if ($conf->stock->enabled) {
    $formproduct = new FormProduct($db);
}
/* ************************************************************************** */
/*                                                                            */
/* Affichage page en mode creation                                            */
/*                                                                            */
/* ************************************************************************** */
if ($action == 'create') {
    $cash = new Cash($db);
    print_fiche_titre($langs->trans("NewCash"));
    print '<form action="' . $_SERVER["PHP_SELF"] . '" name="formsoc" method="post">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="action" value="add">';
    print '<input type="hidden" name="clos" value="0">';
    print '<table class="border" width="100%">';
    // Code
示例#9
0
文件: product.php 项目: alcf/chms
 protected function btnDelete_Click()
 {
     $this->mctProduct->DeleteFormProduct();
     FormProduct::RefreshOrderNumber($this->objSignupForm->Id, $this->mctProduct->FormProduct->FormProductTypeId);
     QApplication::Redirect('/events/form.php/' . $this->objSignupForm->Id);
 }
示例#10
0
	dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",$_POST["CASHDESK_ID_BANKACCOUNT_CASH"],'chaine',0,'',$conf->entity);
	dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",$_POST["CASHDESK_ID_BANKACCOUNT_CHEQUE"],'chaine',0,'',$conf->entity);
	dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",$_POST["CASHDESK_ID_BANKACCOUNT_CB"],'chaine',0,'',$conf->entity);
	dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",$_POST["CASHDESK_ID_WAREHOUSE"],'chaine',0,'',$conf->entity);

	dol_syslog("admin/cashdesk: level ".$_POST["level"]);
}



/*
 * View
 */

$form=new Form($db);
$formproduct=new FormProduct($db);

llxHeader();

$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("CashDeskSetup"),$linkback,'setup');
print '<br>';


// Mode
$var=true;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set">';

print '<table class="noborder" width="100%">';
示例#11
0
文件: result.php 项目: alcf/chms
 protected function pxyEditFormProduct_Click($strFormId, $strControlId, $strParameter)
 {
     $objFormProduct = FormProduct::Load($strParameter);
     if ($objFormProduct->SignupFormId != $this->objSignupForm->Id) {
         return;
     }
     /**
      * @var SignupEntry
      */
     $objSignupEntry = $this->mctSignupEntry->SignupEntry;
     /**
      * @var Person
      */
     $objPerson = $this->mctSignupEntry->SignupEntry->Person;
     $this->dlgEdit->ShowDialogBox();
     $this->dlgEdit->Template = dirname(__FILE__) . '/dlgEditResult_SignupProduct.tpl.php';
     $this->intEditTag = self::EditTagProduct;
     $this->objSignupProduct = SignupProduct::LoadBySignupEntryIdFormProductId($objSignupEntry->Id, $objFormProduct->Id);
     if (!$this->objSignupProduct) {
         $this->objSignupProduct = new SignupProduct();
         $this->objSignupProduct->SignupEntryId = $objSignupEntry->Id;
         $this->objSignupProduct->FormProductId = $objFormProduct->Id;
         $this->objSignupProduct->Amount = $objFormProduct->Cost;
         $this->objSignupProduct->Deposit = $objFormProduct->Deposit;
         $this->objSignupProduct->Quantity = $objFormProduct->MinimumQuantity;
         $this->btnDelete->Visible = false;
     } else {
         $this->btnDelete->Visible = true;
     }
     // Reset
     $this->ResetDialogControls();
     $this->lstListbox->Name = 'Quantity';
     for ($i = $objFormProduct->MinimumQuantity; $i <= $objFormProduct->MaximumQuantity; $i++) {
         $this->lstListbox->AddItem($i, $i, $i == $this->objSignupProduct->Quantity);
     }
     $this->txtFloat->Name = 'Cost per Item';
     $this->txtFloat->Text = $this->objSignupProduct->Amount;
 }
示例#12
0
 /**
  * Main utility method to aid with data binding.  It is used by the default BindAllRows() databinder but
  * could and should be used by any custom databind methods that would be used for instances of this
  * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. 
  *
  * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
  * It will also perform any sorting (if applicable).
  *
  * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query		 
  * @return void
  */
 public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     // Setup input parameters to default values if none passed in
     if (!$objCondition) {
         $objCondition = QQ::All();
     }
     $objClauses = $objOptionalClauses ? $objOptionalClauses : array();
     // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = FormProduct::QueryCount($objCondition, $objClauses);
     }
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from FormProduct, given the clauses above
     $this->DataSource = FormProduct::QueryArray($objCondition, $objClauses);
 }
function _measuringUnits($type, $name)
{
    global $db;
    require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
    require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
    $html = new FormProduct($db);
    if ($type == 'unit') {
        return array(' unité(s)');
    } else {
        return array($html->load_measuring_units($name, $type, 0));
    }
}
示例#14
0
// Test if user logged
if ( $_SESSION['uid'] > 0 )
{
	header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php');
	exit;
}

$usertxt=GETPOST('user','',1);


/*
 * View
 */

$form=new Form($db);
$formproduct=new FormProduct($db);

$arrayofcss=array('/cashdesk/css/style.css');
top_htmlhead('','',0,0,'',$arrayofcss);
?>

<body>
<div class="conteneur">
<div class="conteneur_img_gauche">
<div class="conteneur_img_droite">

<h1 class="entete"></h1>

<div class="menu_principal">
</div>
示例#15
0
         $label = $object->type == 2 ? $langs->trans("SelectWarehouseForStockIncrease") : $langs->trans("SelectWarehouseForStockDecrease");
         $formquestion = array(array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1)));
     }
     if ($object->type != 2 && $object->total_ttc < 0) {
         $text .= '<br>' . img_warning() . ' ' . $langs->trans("ErrorInvoiceOfThisTypeMustBePositive");
     }
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, $object->type != 2 && $object->total_ttc < 0 ? "no" : "yes", $conf->notification->enabled ? 0 : 2);
 }
 // Confirm back to draft status
 if ($action == 'modif') {
     $text = $langs->trans('ConfirmUnvalidateBill', $object->ref);
     $formquestion = array();
     if ($object->type != 3 && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) {
         $langs->load("stocks");
         require_once DOL_DOCUMENT_ROOT . "/product/class/html.formproduct.class.php";
         $formproduct = new FormProduct($db);
         $label = $object->type == 2 ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease");
         $formquestion = array(array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'), 'idwarehouse', '', 1)));
     }
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('UnvalidateBill'), $text, 'confirm_modif', $formquestion, "yes", 1);
 }
 // Confirmation du classement paye
 if ($action == 'paid' && $resteapayer <= 0) {
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
 }
 if ($action == 'paid' && $resteapayer > 0) {
     // Code
     $i = 0;
     $close[$i]['code'] = 'discount_vat';
     $i++;
     $close[$i]['code'] = 'badcustomer';
示例#16
0
            $error++;
        }
    }
    if ($result >= 0 && !$error) {
        $db->commit();
        header("Location: dispatch.php?id=" . $id);
        exit;
    } else {
        $db->rollback();
    }
}
/*
 * View
 */
$form = new Form($db);
$formproduct = new FormProduct($db);
$warehouse_static = new Entrepot($db);
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$help_url = 'EN:CommandeFournisseur';
llxHeader('', $langs->trans("OrderCard"), $help_url, '', 0, 0, array('/fourn/js/lib_dispatch.js'));
$now = dol_now();
$id = GETPOST('id', 'int');
$ref = GETPOST('ref');
if ($id > 0 || !empty($ref)) {
    //if ($mesg) print $mesg.'<br>';
    $commande = new CommandeFournisseur($db);
    $result = $commande->fetch($id, $ref);
    if ($result >= 0) {
        $soc = new Societe($db);
        $soc->fetch($commande->socid);
        $author = new User($db);
        $db->commit();
        setEventMessage($langs->trans("StockMovementRecorded"), 'mesgs');
        header("Location: " . DOL_URL_ROOT . '/product/stock/index.php');
        // Redirect to avoid pb when using back
        exit;
    } else {
        $db->rollback();
        setEventMessage($langs->trans("Error"), 'errors');
    }
}
/*
 * View
 */
$now = dol_now();
$form = new Form($db);
$formproduct = new FormProduct($db);
$productstatic = new Product($db);
$warehousestatics = new Entrepot($db);
$warehousestatict = new Entrepot($db);
$title = $langs->trans('MassMovement');
llxHeader('', $title, $helpurl, '');
print_fiche_titre($langs->trans("MassStockMovement")) . '<br><br>';
$titletoadd = $langs->trans("Select");
$titletoaddnoent = $langs->transnoentitiesnoconv("Select");
$buttonrecord = $langs->trans("RecordMovement");
$buttonrecordnoent = $langs->trans("RecordMovement");
print $langs->trans("SelectProductInAndOutWareHouse", $titletoaddnoent, $buttonrecordnoent) . '<br>';
print '<br>' . "\n";
$var = true;
// Form to add a line
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formulaire">';
 if ($conf->clinomadic->enabled) {
     print_liste_field_titre($langs->trans('Règlement'), $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
 }
 print_liste_field_titre($langs->trans('RefCustomerOrder'), $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('Company'), $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('OrderDate'), $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('DeliveryDate'), $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('AmountHT'), $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('AmountHTToShip'), $_SERVER["PHP_SELF"], '', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('Status'), $_SERVER["PHP_SELF"], 'c.fk_statut', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('QtyProd'), $_SERVER["PHP_SELF"], 'qty_prod', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('InStock'), $_SERVER["PHP_SELF"], 'qty_prod', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('Warehouse'), $_SERVER["PHP_SELF"], 'qty_prod', '', $param, 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans('CreateShipment'), $_SERVER["PHP_SELF"], 'qty_prod', '', $param, 'align="right"', $sortfield, $sortorder);
 $generic_commande = new Commande($db);
 $formproduct = new FormProduct($db);
 $shippableOrder = new ShippableOrder($db);
 print '</tr>';
 print '<tr class="liste_titre">';
 print '<td class="liste_titre">';
 print '<input class="flat" size="6" type="text" name="sref" value="' . $sref . '">';
 print '</td>';
 print '<td class="liste_titre" align="left">';
 print '<input class="flat" type="text" size="6" name="sref_client" value="' . $sref_client . '">';
 print '</td>';
 print '<td class="liste_titre" align="left">';
 print '<input class="flat" type="text" name="snom" value="' . $snom . '">';
 print '</td>';
 print '<td class="liste_titre">&nbsp;</td>';
 print '<td class="liste_titre">&nbsp;</td>';
 print '<td class="liste_titre">&nbsp;</td>';
示例#19
0
         print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editshippingmethod&amp;id=' . $object->id . '">' . img_edit($langs->trans('SetShippingMode'), 1) . '</a></td>';
     }
     print '</tr></table>';
     print '</td><td colspan="3">';
     if ($action == 'editshippingmethod') {
         $form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->shipping_method_id, 'shipping_method_id', 1);
     } else {
         $form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->shipping_method_id, 'none');
     }
     print '</td>';
     print '</tr>';
 }
 // Warehouse
 if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
     require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
     $formproduct = new FormProduct($db);
     print '<tr><td>';
     print '<table width="100%" class="nobordernopadding"><tr><td>';
     print $langs->trans('Warehouse');
     print '</td>';
     if ($action != 'editwarehouse' && $user->rights->commande->creer) {
         print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editwarehouse&amp;id=' . $object->id . '">' . img_edit($langs->trans('SetWarehouse'), 1) . '</a></td>';
     }
     print '</tr></table>';
     print '</td><td colspan="3">';
     if ($action == 'editwarehouse') {
         $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
     } else {
         $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
     }
     print '</td>';
示例#20
0
    if (!$res > 0) {
        $error++;
    }
    if (!$error) {
        $db->commit();
        setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
    } else {
        $db->rollback();
        setEventMessages($langs->trans("Error"), null, 'errors');
    }
}
/*
 * View
 */
$form = new Form($db);
$formproduct = new FormProduct($db);
llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("CashDeskSetup"), $linkback, 'title_setup');
print '<br>';
// Mode
$var = true;
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Parameters") . '</td><td>' . $langs->trans("Value") . '</td>';
print "</tr>\n";
$var = !$var;
print '<tr ' . $bc[$var] . '><td width=\\"50%\\">' . $langs->trans("CashDeskThirdPartyForSell") . '</td>';
示例#21
0
	$commande->fetch($_GET['id']);
	$result=$commande->mode_reglement($_POST['mode_reglement_id']);
	if ($result < 0) dol_print_error($db,$commande->error);
}

if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
{
	$commande = new Commande($db);
	$commande->fetch($_GET['id']);
	$result=$commande->cond_reglement($_POST['cond_reglement_id']);
	if ($result < 0) dol_print_error($db,$commande->error);
}


$html = new Form($db);
$formproduct = new FormProduct($db);
$formfile = new FormFile($db);


/* *************************************************************************** */
/*                                                                             */
/* Mode vue et edition                                                         */
/*                                                                             */
/* *************************************************************************** */

llxHeader('',$langs->trans('OrderCard'),'');

$id = $_GET['id'];
$ref= $_GET['ref'];
if ($id > 0 || ! empty($ref))
{
示例#22
0
 if ($action != 'editshippingmethod' && $user->rights->expedition->creer) {
     print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editshippingmethod&amp;id=' . $commande->id . '">' . img_edit($langs->trans('SetShippingMode'), 1) . '</a></td>';
 }
 print '</tr></table>';
 print '</td><td colspan="2">';
 if ($action == 'editshippingmethod') {
     $form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $commande->id, $commande->shipping_method_id, 'shipping_method_id', 1);
 } else {
     $form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $commande->id, $commande->shipping_method_id, 'none');
 }
 print '</td>';
 print '</tr>';
 // Warehouse
 if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
     require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
     $formproduct = new FormProduct($db);
     print '<tr><td>';
     print '<table width="100%" class="nobordernopadding"><tr><td>';
     print $langs->trans('Warehouse');
     print '</td>';
     if ($action != 'editwarehouse' && $user->rights->commande->creer) {
         print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editwarehouse&amp;id=' . $commande->id . '">' . img_edit($langs->trans('SetWarehouse'), 1) . '</a></td>';
     }
     print '</tr></table>';
     print '</td><td colspan="2">';
     if ($action == 'editwarehouse') {
         $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $commande->id, $commande->warehouse_id, 'warehouse_id', 1);
     } else {
         $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $commande->id, $commande->warehouse_id, 'none');
     }
     print '</td>';
 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this FormProductMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing FormProduct object creation - defaults to CreateOrEdit
  * @return FormProductMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objFormProduct = FormProduct::Load($intId);
         // FormProduct was found -- return it!
         if ($objFormProduct) {
             return new FormProductMetaControl($objParentObject, $objFormProduct);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a FormProduct object with PK arguments: ' . $intId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new FormProductMetaControl($objParentObject, new FormProduct());
 }
                if ($result1 >= 0 && $result2 >= 0) {
                    $db->commit();
                    header("Location: product.php?id=" . $product->id);
                    exit;
                } else {
                    setEventMessage($product->error, 'errors');
                    $db->rollback();
                }
            }
        }
    }
}
/*
 * View
 */
$formproduct = new FormProduct($db);
if ($id > 0 || $ref) {
    $product = new Product($db);
    $result = $product->fetch($id, $ref);
    $product->load_stock();
    $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
    llxHeader("", $langs->trans("CardProduct" . $product->type), $help_url);
    if ($result > 0) {
        $head = product_prepare_head($product, $user);
        $titre = $langs->trans("CardProduct" . $product->type);
        $picto = $product->type == 1 ? 'service' : 'product';
        dol_fiche_head($head, 'stock', $titre, 0, $picto);
        dol_htmloutput_events();
        $form = new Form($db);
        print '<table class="border" width="100%">';
        // Ref
示例#25
0
文件: fiche.php 项目: netors/dolibarr
            $mesg = '<div class="error">' . $langs->trans('ErrorCantReadFile', $file) . '</div>';
            dol_syslog('Failed to read file: ' . $file);
        }
    } else {
        $langs->load("other");
        $mesg = '<div class="error">' . $langs->trans('ErrorFailedToReadEntity', $langs->trans("Shipping")) . '</div>';
        dol_syslog($langs->trans('ErrorFailedToReadEntity', $langs->trans("Shipping")));
    }
}
/*
 * View
 */
llxHeader('', $langs->trans('Sending'), 'Expedition');
$html = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
/*********************************************************************
 *
 * Mode creation
 *
 *********************************************************************/
if ($action == 'create') {
    $expe = new Expedition($db);
    print_fiche_titre($langs->trans("CreateASending"));
    if (!$origin) {
        $mesg = '<div class="error">' . $langs->trans("ErrorBadParameters") . '</div>';
    }
    if ($mesg) {
        print $mesg . '<br>';
    }
    if ($origin) {
function fiche(&$PDOdb, &$expedition, &$TImport)
{
    global $langs, $db;
    llxHeader();
    $head = shipping_prepare_head($expedition);
    $title = $langs->trans("Shipment");
    dol_fiche_head($head, 'dispatch', $title, 0, 'dispatch');
    enteteexpedition($expedition);
    echo '<br>';
    if ($expedition->statut == 0) {
        //Form pour import de fichier
        if ($conf->global->DISPATCH_USE_IMPORT_FILE) {
            $form = new TFormCore('auto', 'formimport', 'post', true);
            echo $form->hidden('action', 'SAVE');
            echo $form->hidden('id', $expedition->id);
            echo $form->fichier('Fichier à importer', 'file1', '', 80);
            echo $form->btsubmit('Envoyer', 'btsend');
            $form->end();
        }
        ?>
		<script>
			$(document).ready(function() {

				$('#lot_number').change(function() {
					var lot_number = $(this).val();

					$.ajax({
						url: 'script/interface.php',
						method: 'GET',
						data: {
							lot_number: lot_number,
							productid: $('#lineexpeditionid').find(':selected').attr('fk-product'),
							type:'get',
							get:'autocomplete_asset'
						}
					}).done(function(results) {
						var json_results = $.parseJSON(results);

						$('#numserie option').remove();
						cpt = 0;
						$.each(json_results, function(index) {
							var obj = json_results[index];
							cpt ++;
							$('#numserie').append($('<option>', {
								value: obj.serial_number,
								text: obj.serial_number + ' - ' + obj.qty + ' ' +obj.unite_string
							}));

							$('#quantity').val(obj.qty);
							if(obj.unite != 'unité(s)'){
								$('#quantity_unit').show();
								$('#units_lable').remove();
								$('#quantity_unit option[value='+obj.unite+']').attr("selected","selected");
							}
							else{
								$('#quantity_unit').hide();
								$('#quantity_unit option[value=0]').attr("selected","selected");
								$('#quantity').after('<span id="units_lable"> unité(s)</span>');
							}
						});
					});
				});
				
				$('#lineexpeditionid').change(function() {
					var productid = $(this).find(':selected').attr('fk-product');

					$.ajax({
						url: 'script/interface.php',
						method: 'GET',
						data: {
							productid: productid,
							type:'get',
							get:'autocomplete_lot_number'
						}
					}).done(function(results) {
						var json_results = $.parseJSON(results);

						$('#lot_number option').remove();
						
						$.each(json_results, function(index) {
							var obj = json_results[index];
							
							$('#lot_number').append($('<option>', {
								value: obj.lot_number,
								text: obj.label
							}));
						});
					});
				});
			});
		</script>
		<?php 
        //Form pour ajouter un équipement directement
        $DoliForm = new FormProduct($db);
        $form = new TFormCore('auto', 'formaddasset', 'post', true);
        echo $form->hidden('action', 'edit');
        echo $form->hidden('mode', 'addasset');
        echo $form->hidden('id', $expedition->id);
        $TLotNumber = array(' -- aucun produit sélectionné -- ');
        /*$sql = "SELECT DISTINCT(lot_number),rowid, SUM(contenancereel_value) as qty, contenancereel_units as unit FROM ".MAIN_DB_PREFIX."asset GROUP BY lot_number ORDER BY lot_number ASC";
        
        		$PDOdb->Execute($sql);
        		$Tres = $PDOdb->Get_All();
        		foreach($Tres as $res){
        			
        			$asset = new TAsset;
        			$asset->load($PDOdb, $res->rowid);
        			$asset->load_asset_type($PDOdb);
        			//pre($asset,true);exit;
        			$TLotNumber[$res->lot_number] = $res->lot_number." / ".$res->qty." ".(($asset->assetType->measuring_units == 'unit') ? 'unité(s)' : measuring_units_string($res->unit,$asset->assetType->measuring_units));
        		}
        		*/
        $TSerialNumber = array(' -- aucun lot sélectionné -- ');
        /*$sql = "SELECT DISTINCT(serial_number),contenancereel_value, contenancereel_units FROM ".MAIN_DB_PREFIX."asset ORDER BY serial_number ASC";
        		$PDOdb->Execute($sql);
        		while ($PDOdb->Get_line()) {
        			$TSerialNumber[$PDOdb->Get_field('serial_number')] = $PDOdb->Get_field('serial_number').' / '.$PDOdb->Get_field('contenancereel_value')." ".measuring_units_string($PDOdb->Get_field('contenancereel_units'),'weight');
        		}
        		*/
        echo 'Produit expédié<select id="lineexpeditionid" name="lineexpeditionid"><option value=""></option>';
        $TProduct = array('');
        $sql = "SELECT DISTINCT(ed.rowid),p.rowid as fk_product,p.ref,p.label ,ed.qty\n\t\t\t\tFROM " . MAIN_DB_PREFIX . "product as p\n\t\t\t\t\tLEFT JOIN " . MAIN_DB_PREFIX . "commandedet as cd ON (cd.fk_product = p.rowid)\n\t\t\t\t\tLEFT JOIN " . MAIN_DB_PREFIX . "expeditiondet as ed ON (ed.fk_origin_line = cd.rowid)\n\t\t\t\tWHERE ed.fk_expedition = " . $expedition->id . "";
        $PDOdb->Execute($sql);
        while ($obj = $PDOdb->Get_line()) {
            //$TProduct[$PDOdb->Get_field('rowid')] = $PDOdb->Get_field('ref').' - '.$PDOdb->Get_field('label');
            echo '<option value="' . $obj->rowid . '" fk-product="' . $obj->fk_product . '">' . $obj->ref . ' - ' . $obj->label . ' x ' . $obj->qty . '</option>';
        }
        echo '</select><br />';
        //echo $form->combo('Produit expédié', 'lineexpeditionid', $TProduct, '').'<br>';
        echo $form->combo('Numéro de Lot', 'lot_number', $TLotNumber, '') . '<br>';
        echo $form->combo('Numéro de série à ajouter', 'numserie', $TSerialNumber, '') . '<br>';
        echo $form->texte('Quantité', 'quantity', '', 10) . " " . $DoliForm->load_measuring_units('quantity_unit" id="quantity_unit', 'weight');
        echo $form->btsubmit('Ajouter', 'btaddasset');
        $form->end();
        echo '<br>';
    }
    tabImport($TImport, $expedition);
    llxFooter();
}
示例#27
0
    if (empty($id)) {
        $id = $facid;
    }
    $actiontypecode = 'AC_SHIP';
    $trigger_name = 'SHIPPING_SENTBYMAIL';
    $paramname = 'id';
    $mode = 'emailfromshipment';
    include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
}
/*
 * View
 */
llxHeader('', $langs->trans('Shipment'), 'Expedition');
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
$product_static = new Product($db);
if ($action == 'create2') {
    print load_fiche_titre($langs->trans("CreateASending")) . '<br>';
    print $langs->trans("ShipmentCreationIsDoneFromOrder");
    $action = '';
    $id = '';
    $ref = '';
}
// Mode creation.
if ($action == 'create') {
    $expe = new Expedition($db);
    print load_fiche_titre($langs->trans("CreateASending"));
    if (!$origin) {
        setEventMessages($langs->trans("ErrorBadParameters"), null, 'errors');
    }
// Add shipment as titles in invoice
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>' . ($ent_by_user_activated ? '<s>' : '') . $langs->trans("StockEntrepot") . ($ent_by_user_activated ? '</s>' : '');
if ($ent_by_user_activated) {
    print ' <span style="color:red;">' . $langs->trans('EntrepotByUserActivated') . '</span>';
}
print '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="right" width="300">';
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set_SHIPPABLEORDER_SPECIFIC_WAREHOUSE">';
dol_include_once('/product/class/html.formproduct.class.php');
$formDoli = new Form($db);
$formprod = new FormProduct($db);
$formprod->loadWarehouses();
$TWareHouse = array();
foreach ($formprod->cache_warehouses as $id => $ent) {
    $TWareHouse[$id] = $ent['label'];
}
echo $formDoli->multiselectarray('SHIPPABLEORDER_SPECIFIC_WAREHOUSE', $TWareHouse, explode(',', $conf->global->SHIPPABLEORDER_SPECIFIC_WAREHOUSE));
print '<input type="submit" ' . ($ent_by_user_activated ? 'disabled="disabled"' : '') . ' class="button" value="' . $langs->trans("Modify") . '">';
print '</form>';
print '</td></tr>';
// Entrepot par utilisateur
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>' . $langs->trans("EntrepotByUser") . '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="right" width="300">';
示例#29
0
 }
 // Confirm back to draft status
 if ($action == 'modif') {
     $text = $langs->trans('ConfirmUnvalidateBill', $object->ref);
     $formquestion = array();
     $qualified_for_stock_change = 0;
     if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
         $qualified_for_stock_change = $object->hasProductsOrServices(2);
     } else {
         $qualified_for_stock_change = $object->hasProductsOrServices(1);
     }
     if ($object->type != Facture::TYPE_DEPOSIT && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) {
         $langs->load("stocks");
         require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
         require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
         $formproduct = new FormProduct($db);
         $warehouse = new Entrepot($db);
         $warehouse_array = $warehouse->list_array();
         if (count($warehouse_array) == 1) {
             $label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("WarehouseForStockDecrease", current($warehouse_array)) : $langs->trans("WarehouseForStockIncrease", current($warehouse_array));
             $value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
         } else {
             $label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease");
             $value = $formproduct->selectWarehouses(GETPOST('idwarehouse') ? GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
         }
         $formquestion = array(array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value));
     }
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('UnvalidateBill'), $text, 'confirm_modif', $formquestion, "yes", 1);
 }
 // Confirmation du classement paye
 if ($action == 'paid' && $resteapayer <= 0) {
                if ($result1 >= 0 && $result2 >= 0) {
                    $db->commit();
                    header("Location: product.php?id=" . $product->id);
                    exit;
                } else {
                    setEventMessage($product->error, 'errors');
                    $db->rollback();
                }
            }
        }
    }
}
/*
 * View
 */
$formproduct = new FormProduct($db);
if ($id > 0 || $ref) {
    $product = new Product($db);
    $result = $product->fetch($id, $ref);
    $product->load_stock();
    $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
    llxHeader("", $langs->trans("CardProduct" . $product->type), $help_url);
    if ($result > 0) {
        $head = product_prepare_head($product, $user);
        $titre = $langs->trans("CardProduct" . $product->type);
        $picto = $product->type == 1 ? 'service' : 'product';
        dol_fiche_head($head, 'stock', $titre, 0, $picto);
        $form = new Form($db);
        print '<table class="border" width="100%">';
        // Ref
        print '<tr>';