Skip to content
Tim Schofield edited this page Sep 22, 2024 · 3 revisions

Changes to the input element

The current date picker in webERP was coded back in 2008 and is now showing it's age, despite doing excellent service for 16 years. The suggestion is to replace it with the built in HTML5 date picker. This gives a consistent look and feel accross browsers and operating systems.

Currently the elements have the following attributes:

type="text" class="date"

This needs to be changed to just

type="date"

This will show the date picker, as pictured above.

Default values

The default values passed to the date picker must be in SQL format - "Y-m-d" for example 22/9/2024 is passed as 2024-09-22

Hence

$_POST['FromDate']=Date($_SESSION['DefaultDateFormat']);

becomes

$_POST['FromDate']=Date('Y-m-d');

Decoding return values

The webERP scripts expect the dates to be returned in the default date format. So in the UK the scripts expect a date in the format 'd/m/Y'. The new date picker will return values in SQL format - 'Y-m-d'

The easiest way to deal with this is to convert all the dates back to $_SESSION['DefaultDateFormat'] immediately they are returned. So lines such as this:

$_POST['FromDate'] = ConvertSQLDate($_POST['FromDate']);
$_POST['ToDate'] = ConvertSQLDate($_POST['ToDate']);

need to be inserted as soon as the script returns values to be processed.

Scripts to be altered

The following scripts need to be altered:

  • AddCustomerTypeNotes.php
  • AuditTrail.php
  • BankMatching.php
  • BOMs.php
  • BOMs_SingleLevel.php
  • CollectiveWorkOrderCost.php
  • ConfirmDispatch_Invoice.php
  • Contracts.php
  • CounterReturns.php
  • CounterSales.php
  • CustomerAccount.php
  • CustomerBalancesMovement.php
  • CustomerInquiry.php
  • CustomerReceipt.php
  • Customers.php
  • CustomerTransInquiry.php
  • DailyBankTransactions.php
  • DeliveryDetails.php
  • FixedAssetDepreciation.php
  • FixedAssetRegister.php
  • GeneratePickingList.php
  • GLJournalInquiry.php
  • GLJournal.php
  • GoodsReceived.php
  • HistoricalTestResults.php
  • includes/OutputSerialItems.php
  • includes/InputSerialItemsKeyed.php
  • InternalStockRequestInquiry.php
  • InternalStockRequest.php
  • MRPCalendar.php
  • MRPCreateDemands.php
  • MRPDemands.php
  • MRPPlannedPurchaseOrders.php
  • MRPPlannedWorkOrders.php
  • Payments.php
  • PcAssignCashTabToTab.php
  • PcAssignCashToTab.php
  • PcClaimExpensesFromTab.php
  • PcReportExpense.php
  • PcReportTab.php
  • PcTabExpensesList.php
  • PDFChequeListing.php
  • PDFCustomerList.php
  • PDFCustTransListing.php
  • PDFDeliveryDifferences.php
  • PDFDIFOT.php
  • PDFLowGP.php
  • PDFOrdersInvoiced.php
  • PDFOrderStatus.php
  • PDFPeriodStockTransListing.php
  • PDFPickingList.php
  • PDFPriceList.php
  • PDFPrintLabel.php
  • PDFRemittanceAdvice.php
  • PDFSellThroughSupportClaim.php
  • PDFSuppTransListing.php
  • PO_Header.php
  • PO_Items.php
  • POReport.php
  • PO_SelectOSPurchOrder.php
  • PriceMatrix.php
  • PricesBasedOnMarkUp.php
  • Prices_Customer.php
  • Prices.php
  • PurchasesReport.php
  • PurchData.php
  • RecurringSalesOrders.php
  • RegularPaymentsSetup.php
  • ReverseGRN.php
  • SalesByTypePeriodInquiry.php
  • SalesCategoryPeriodInquiry.php
  • SalesInquiry.php
  • SalesReport.php
  • SalesTopCustomersInquiry.php
  • SalesTopItemsInquiry.php
  • SelectCompletedOrder.php
  • SelectOrderItems.php
  • SelectQASamples.php
  • SelectSalesOrder.php
  • SellThroughSupport.php
  • Shipments.php
  • SpecialOrder.php
  • StockCategorySalesInquiry.php
  • StockLocMovements.php
  • StockMovements.php
  • StockQuantityByDate.php
  • SuppCreditGRNs.php
  • SupplierCredit.php
  • SupplierInquiry.php
  • SupplierInvoice.php
  • SupplierPriceList.php
  • Suppliers.php
  • SupplierTenderCreate.php
  • SupplierTenders.php
  • SupplierTransInquiry.php
  • SuppPaymentRun.php
  • TestPlanResults.php
  • WorkOrderEntry.php
  • WorkOrderIssue.php
  • WorkOrderReceive.php
  • Z_ImportPriceList.php
Clone this wiki locally