本文整理汇总了PHP中GetPeriod函数的典型用法代码示例。如果您正苦于以下问题:PHP GetPeriod函数的具体用法?PHP GetPeriod怎么用?PHP GetPeriod使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPeriod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _makeExtra
function _makeExtra($value, $title = '')
{
global $THIS_RET;
if ($THIS_RET['WITH_TEACHER_ID']) {
$return .= Localize('colon', _('With')) . ' ' . GetTeacher($THIS_RET['WITH_TEACHER_ID']) . '<BR>';
}
if ($THIS_RET['NOT_TEACHER_ID']) {
$return .= Localize('colon', _('Not With')) . ' ' . GetTeacher($THIS_RET['NOT_TEACHER_ID']) . '<BR>';
}
if ($THIS_RET['WITH_PERIOD_ID']) {
$return .= Localize('colon', _('On')) . ' ' . GetPeriod($THIS_RET['WITH_PERIOD_ID']) . '<BR>';
}
if ($THIS_RET['NOT_PERIOD_ID']) {
$return .= Localize('colon', _('Not On')) . ' ' . GetPeriod($THIS_RET['NOT_PERIOD_ID']) . '<BR>';
}
if ($THIS_RET['PRIORITY']) {
$return .= Localize('colon', _('Priority')) . ' ' . $THIS_RET['PRIORITY'] . '<BR>';
}
if ($THIS_RET['MARKING_PERIOD_ID']) {
$return .= Localize('colon', _('Marking Period')) . ' ' . GetMP($THIS_RET['MARKING_PERIOD_ID']) . '<BR>';
}
return $return;
}
示例2: DB_query
$ProcessResult = DB_query($SQL, $db, '', '', false, false);
if (DB_error_no($db) != 0) {
$title = _('Payment Processing - Problem Report');
include 'header.inc';
prnMsg(_('None of the payments will be processed because the bank account payment record for') . ' ' . $SupplierName . ' ' . _('could not be inserted because') . ' - ' . DB_error_msg($db), 'error');
echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>';
if ($debug == 1) {
prnMsg(_('The SQL that failed was') . ' ' . $SQL, 'error');
}
$ProcessResult = DB_Txn_Rollback($db);
include 'footer.inc';
exit;
}
/*If the General Ledger Link is activated */
if ($_SESSION['CompanyRecord']['gllink_creditors'] == 1) {
$PeriodNo = GetPeriod($_POST['AmountsDueBy'], $db);
/*Do the GL trans for the payment CR bank */
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\taccount,\n\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\tamount )\n\t\t\t\tVALUES (22,\n\t\t\t\t\t'" . $SuppPaymentNo . "',\n\t\t\t\t\t'" . FormatDateForSQL($_POST['AmountsDueBy']) . "',\n\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t'" . $_POST['BankAccount'] . "',\n\t\t\t\t\t'" . $SupplierID . " - " . $SupplierName . ' ' . _('payment run on') . ' ' . Date($_SESSION['DefaultDateFormat']) . ' - ' . $PaytReference . "',\n\t\t\t\t\t'" . -$AccumBalance / $_POST['ExRate'] . "')";
$ProcessResult = DB_query($SQL, $db, '', '', false, false);
if (DB_error_no($db) != 0) {
$title = _('Payment Processing') . ' - ' . _('Problem Report') . '.... ';
include 'header.inc';
prnMsg(_('None of the payments will be processed since the general ledger posting for the payment to') . ' ' . $SupplierName . ' ' . _('could not be inserted because') . ' - ' . DB_error_msg($db), 'error');
echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>';
if ($debug == 1) {
prnMsg(_('The SQL that failed was') . ':<br />' . $SQL, 'error');
}
$ProcessResult = DB_Txn_Rollback($db);
include 'footer.inc';
exit;
}
示例3: filter_number_format
$Department = $_POST[$RequestID . 'Department' . $LineID];
$Tag = $_POST[$RequestID . 'Tag' . $LineID];
$RequestedQuantity = filter_number_format($_POST[$RequestID . 'RequestedQuantity' . $LineID]);
if (isset($_POST[$RequestID . 'Completed' . $LineID])) {
$Completed = True;
} else {
$Completed = False;
}
$sql = "SELECT materialcost, labourcost, overheadcost, decimalplaces FROM stockmaster WHERE stockid='" . $StockID . "'";
$result = DB_query($sql, $db);
$myrow = DB_fetch_array($result);
$StandardCost = $myrow['materialcost'] + $myrow['labourcost'] + $myrow['overheadcost'];
$DecimalPlaces = $myrow['decimalplaces'];
$Narrative = _('Issue') . ' ' . $Quantity . ' ' . _('of') . ' ' . $StockID . ' ' . _('to department') . ' ' . $Department . ' ' . _('from') . ' ' . $Location;
$AdjustmentNumber = GetNextTransNo(17, $db);
$PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db);
$SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat']));
$Result = DB_Txn_Begin($db);
// Need to get the current location quantity will need it later for the stock movement
$SQL = "SELECT locstock.quantity\n\t\t\t\t\tFROM locstock\n\t\t\t\t\tWHERE locstock.stockid='" . $StockID . "'\n\t\t\t\t\t\tAND loccode= '" . $Location . "'";
$Result = DB_query($SQL, $db);
if (DB_num_rows($Result) == 1) {
$LocQtyRow = DB_fetch_row($Result);
$QtyOnHandPrior = $LocQtyRow[0];
} else {
// There must actually be some error this should never happen
$QtyOnHandPrior = 0;
}
if ($_SESSION['ProhibitNegativeStock'] == 0 or $_SESSION['ProhibitNegativeStock'] == 1 and $QtyOnHandPrior >= $Quantity) {
$SQL = "INSERT INTO stockmoves (\n\t\t\t\t\t\t\t\t\tstockid,\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\ttransno,\n\t\t\t\t\t\t\t\t\tloccode,\n\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\tprd,\n\t\t\t\t\t\t\t\t\treference,\n\t\t\t\t\t\t\t\t\tqty,\n\t\t\t\t\t\t\t\t\tnewqoh)\n\t\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t'" . $StockID . "',\n\t\t\t\t\t\t\t\t\t17,\n\t\t\t\t\t\t\t\t\t'" . $AdjustmentNumber . "',\n\t\t\t\t\t\t\t\t\t'" . $Location . "',\n\t\t\t\t\t\t\t\t\t'" . $SQLAdjustmentDate . "',\n\t\t\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t\t\t'" . $Narrative . "',\n\t\t\t\t\t\t\t\t\t'" . -$Quantity . "',\n\t\t\t\t\t\t\t\t\t'" . ($QtyOnHandPrior - $Quantity) . "'\n\t\t\t\t\t\t\t\t)";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because');
示例4: _
echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>';
if ($debug == 1) {
echo '<br />' . $SQL;
}
include 'includes/footer.inc';
exit;
}
$Period_0_Name = GetMonthText(mktime(0, 0, 0, Date('m'), Date('d'), Date('Y')));
$Period_1_Name = GetMonthText(mktime(0, 0, 0, Date('m') - 1, Date('d'), Date('Y')));
$Period_2_Name = GetMonthText(mktime(0, 0, 0, Date('m') - 2, Date('d'), Date('Y')));
$Period_3_Name = GetMonthText(mktime(0, 0, 0, Date('m') - 3, Date('d'), Date('Y')));
$Period_4_Name = GetMonthText(mktime(0, 0, 0, Date('m') - 4, Date('d'), Date('Y')));
$Period_5_Name = GetMonthText(mktime(0, 0, 0, Date('m') - 5, Date('d'), Date('Y')));
include 'includes/PDFInventoryPlanPageHeader.inc';
$Category = '';
$CurrentPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db);
$Period_1 = $CurrentPeriod - 1;
$Period_2 = $CurrentPeriod - 2;
$Period_3 = $CurrentPeriod - 3;
$Period_4 = $CurrentPeriod - 4;
$Period_5 = $CurrentPeriod - 5;
while ($InventoryPlan = DB_fetch_array($InventoryResult)) {
if ($Category != $InventoryPlan['categoryid']) {
$FontSize = 10;
if ($Category != '') {
/*Then it's NOT the first time round */
/*draw a line under the CATEGORY TOTAL*/
$YPos -= $line_height;
$pdf->line($Left_Margin, $YPos, $Page_Width - $Right_Margin, $YPos);
$YPos -= 2 * $line_height;
}
示例5: MonthAndYearFromSQLDate
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
}
} else {
if ($myrow['lastdate_in_period'] == $DefaultFromDate) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
}
}
}
echo '</select></td>
</tr>';
if (!isset($_POST['ToPeriod']) or $_POST['ToPeriod'] == '') {
$DefaultToPeriod = GetPeriod(date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, Date('m') + 1, 0, Date('Y'))), $db);
} else {
$DefaultToPeriod = $_POST['ToPeriod'];
}
echo '<tr>
<td>' . _('Select Period To:') . '</td>
<td><select name="ToPeriod">';
$RetResult = DB_data_seek($Periods, 0);
while ($myrow = DB_fetch_array($Periods, $db)) {
if ($myrow['periodno'] == $DefaultToPeriod) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value ="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>';
}
}
echo '</select></td>
示例6: unset
unset($_openSIS['DrawHeader']);
//DrawHeader(Config('TITLE').' Class List');
//DrawHeader($course_period['TEACHER'],$course_period['COURSE_TITLE'].' '.GetPeriod($course_period['PERIOD_ID']).($course_period['MARKING_PERIOD_ID']!="$fy_id"?' - '.GetMP($course_period['MARKING_PERIOD_ID']):'').(strlen($course_period['DAYS'])<5?' - '.$course_period['DAYS']:''));
//DrawHeader(GetSchool(UserSchool()),ProperDate(DBDate()));
$_openSIS['User'] = array(1 => array('STAFF_ID' => $course_period['TEACHER_ID'], 'NAME' => 'name', 'PROFILE' => 'teacher', 'SCHOOLS' => ',' . UserSchool() . ',', 'SYEAR' => UserSyear()));
$_SESSION['UserCoursePeriod'] = $course_period['COURSE_PERIOD_ID'];
echo "<table width=100% style=\" font-family:Arial; font-size:12px;\" >";
echo "<tr><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Teacher Class List</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\"> </td></tr></table>";
echo "<table >";
echo '<table border=0>';
echo '<tr><td>Teacher Name:</td>';
echo '<td>' . $course_period['TEACHER'] . '</td></tr>';
echo '<tr><td>Course Program Name:</td>';
echo '<td>' . $course_period['COURSE_TITLE'] . '</td></tr>';
echo '<tr><td>Course Period Name:</td>';
echo '<td>' . GetPeriod($course_period['PERIOD_ID']) . '</td></tr>';
echo '<tr><td>Marking Period:</td>';
echo '<td>' . GetMP($course_period['MARKING_PERIOD_ID']) . '</td></tr>';
echo '</table>';
$extra = $first_extra;
$extra['MP'] = $course_period['MARKING_PERIOD_ID'];
include 'modules/misc/Export.php';
echo "<div style=\"page-break-before: always;\"></div>";
}
$_SESSION['UserCoursePeriod'] = $PCL_UserCoursePeriod;
PDFStop($handle);
} else {
BackPrompt('You must choose at least one course period.');
}
}
if (!$_REQUEST['modfunc']) {
示例7: _
echo '<tr><td>' . _('Tax Authority To Report On:') . ':</td>
<td><select name="TaxAuthority">';
$result = DB_query("SELECT taxid, description FROM taxauthorities", $db);
while ($myrow = DB_fetch_array($result)) {
echo '<option value="' . $myrow['taxid'] . '">' . $myrow['description'] . '</option>';
}
echo '</select></td></tr>';
echo '<tr>
<td>' . _('Return Covering') . ':</td>
<td><select name="NoOfPeriods">
<option value="1">' . _('One Month') . '</option>' . '<option selected="selected" value="2">' . _('Two Months') . '</option>' . '<option value="3">' . _('Quarter') . '</option>' . '<option value="6">' . _('Six Months') . '</option>' . '</select></td>
</tr>';
echo '<tr>
<td>' . _('Return To') . ':</td>
<td><select name="ToPeriod">';
$DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), 0, Date('Y'))), $db);
$sql = "SELECT periodno,\n\t\t\tlastdate_in_period\n\t\tFROM periods";
$ErrMsg = _('Could not retrieve the period data because');
$Periods = DB_query($sql, $db, $ErrMsg);
while ($myrow = DB_fetch_array($Periods, $db)) {
if ($myrow['periodno'] == $DefaultPeriod) {
echo '<option selected="selected" value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>';
} else {
echo '<option value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>';
}
}
echo '</select></td>
</tr>';
echo '<tr>
<td>' . _('Detail Or Summary Only') . ':</td>
<td><select name="DetailOrSummary">
示例8: get_period
function get_period($bln)
{
echo GetPeriod(urldecode($bln));
}
示例9: prnMsg
}
if ($_POST['BankAccount'] == '') {
prnMsg(_('No bank account has been selected so this payment cannot be processed'), 'warn');
include 'includes/footer.inc';
exit;
}
/*Make an array of the defined bank accounts */
$SQL = "SELECT bankaccounts.accountcode\n\t\t\tFROM bankaccounts,\n\t\t\t\tchartmaster\n\t\t\tWHERE bankaccounts.accountcode=chartmaster.accountcode";
$result = DB_query($SQL, $db);
$BankAccounts = array();
$i = 0;
while ($Act = DB_fetch_row($result)) {
$BankAccounts[$i] = $Act[0];
$i++;
}
$PeriodNo = GetPeriod($_SESSION['PaymentDetail' . $identifier]->DatePaid, $db);
$sql = "SELECT usepreprintedstationery\n\t\t\tFROM paymentmethods\n\t\t\tWHERE paymentname='" . $_SESSION['PaymentDetail' . $identifier]->Paymenttype . "'";
$result = DB_query($sql, $db);
$myrow = DB_fetch_row($result);
// first time through commit if supplier cheque then print it first
if (!isset($_POST['ChequePrinted']) and !isset($_POST['PaymentCancelled']) and $myrow[0] == 1) {
// it is a supplier payment by cheque and haven't printed yet so print cheque
echo '<br />
<a href="' . $rootpath . '/PrintCheque.php?ChequeNum=' . $_POST['ChequeNum'] . '&identifier=' . $identifier . '">' . _('Print Cheque using pre-printed stationery') . '</a>
<br />
<br />';
echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo _('Has the cheque been printed') . '?
<br />
示例10: _
<?php
/* $Id: DailySalesInquiry.php 6944 2014-10-27 07:15:34Z daintree $*/
include 'includes/session.inc';
$Title = _('Daily Sales Inquiry');
include 'includes/header.inc';
echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . '</p>';
echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div>
<br />';
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if (!isset($_POST['MonthToShow'])) {
$_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db);
$Result = DB_query("SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['MonthToShow'] . "'");
$myrow = DB_fetch_array($Result);
$EndDateSQL = $myrow['lastdate_in_period'];
}
echo '<table class="selection">
<tr>
<td>' . _('Month to Show') . ':</td>
<td><select tabindex="1" name="MonthToShow">';
$PeriodsResult = DB_query("SELECT periodno, lastdate_in_period FROM periods");
while ($PeriodRow = DB_fetch_array($PeriodsResult)) {
if ($_POST['MonthToShow'] == $PeriodRow['periodno']) {
echo '<option selected="selected" value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>';
$EndDateSQL = $PeriodRow['lastdate_in_period'];
} else {
echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>';
}
}
示例11: gltrans
/* end of the costing specific updates */
if ($_SESSION['CompanyRecord']['gllink_stock'] == 1) {
/*we always need to reverse entries relating to the GRN suspense during delivery and entry of shipment charges */
$sql = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\tamount)\n\t\t\t\tVALUES (31,\n\t\t\t\t\t" . $_GET['SelectedShipment'] . ",\n\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t" . $PeriodNo . ",\n\t\t\t\t\t" . $_SESSION['CompanyRecord']['grnact'] . ",\n\t\t\t\t\t'" . $myrow['itemcode'] . ' ' . _('shipt cost') . ' ' . number_format($ItemShipmentCost, 2) . ' x ' . _('Qty invoiced') . ' ' . $myrow['totqtyinvoiced'] . "',\n " . $Variance * $myrow['totqtyinvoiced'] . ")";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit GL entry for the shipment variance posting for') . ' ' . $myrow['itemcode'] . ' ' . _('could not be inserted because');
$result = DB_query($sql, $db, $ErrMsg, '', TRUE);
}
if ($_POST['UpdateCost'] == 'Yes') {
/*Only ever a standard costing option
Weighted average costing implies cost updates taking place automatically */
$QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'", $db);
$QOHRow = DB_fetch_row($QOHResult);
$QOH = $QOHRow[0];
if ($_SESSION['CompanyRecord']['gllink_stock'] == 1) {
$CostUpdateNo = GetNextTransNo(35, $db);
$PeriodNo = GetPeriod(Date("d/m/Y"), $db);
$ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit);
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\tVALUES (35,\n\t\t\t\t\t\t\t" . $CostUpdateNo . ",\n\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t" . $PeriodNo . ",\n\t\t\t\t\t\t\t" . $StockGLCodes['adjglact'] . ",\n\t\t\t\t\t\t\t'" . _('Shipment of') . ' ' . $myrow['itemcode'] . " " . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . number_format($ItemShipmentCost, 2) . ' x ' . _('QOH of') . ' ' . $QOH . "', " . -$ValueOfChange . ")";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the shipment stock cost adjustment posting could not be inserted because') . ' ' . DB_error_msg($db);
$Result = DB_query($SQL, $db, $ErrMsg, '', TRUE);
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\tVALUES (35,\n\t\t\t\t\t\t\t" . $CostUpdateNo . ",\n\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t" . $PeriodNo . ",\n\t\t\t\t\t\t\t" . $StockGLCodes['stockact'] . ",\n\t\t\t\t\t\t\t'" . _('Shipment of') . ' ' . $myrow['itemcode'] . ' ' . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . number_format($ItemShipmentCost, 2) . ' x ' . _('QOH of') . ' ' . $QOH . "',\n " . $ValueOfChange . ")";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because') . ' ' . DB_error_msg($db);
$Result = DB_query($SQL, $db, $ErrMsg, '', TRUE);
}
/*end of GL entries for a standard cost update */
/* Only the material cost is important for imported items */
$sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ",\n\t\t\t\t\t\t\t\tlabourcost=0,\n\t\t\t\t\t\t\t\toverheadcost=0,\n\t\t\t\t\t\t\t\tlastcost=" . $StdCostUnit . "\n\t\t\t\t\t\tWHERE stockid='" . $myrow['itemcode'] . "'";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment cost details for the stock item could not be updated because') . ': ' . DB_error_msg($db);
$result = DB_query($sql, $db, $ErrMsg, '', TRUE);
}
// end of update cost code
示例12: GetPeriod
<td><input id="phone" class="idle" style="width: 200px;" ' . $other_disabled . ' type="text" value="' . $res[phone] . '" /></td>
<td><input id="phone1" class="idle" style="width: 200px;" ' . $other_disabled . ' type="text" value="' . $res[phone1] . '" /></td>
<td><input id="addres" class="idle" style="width: 200px;" ' . $other_disabled . ' type="text" value="' . $res[address] . '" /></td>
</tr>
</table>
</fieldset >
<fieldset style="margin-top: 5px;">
<legend>დავალების ტიპი</legend>
<table class="dialog-form-table" >
<tr>
<td style="width: 280px;"><label for="period">პერიოდი</label></td>
<td colspan="2" style="width: 280px;"><label for="book">გამოცემა</label></td>
</tr>
<tr>
<td>
<select style="width: 200px;" id="period" class="idls object">' . GetPeriod($res['period_id']) . '</select>
</td>
<td colspan="2"><input style="width: 444px;" id="book" value="' . $res[books] . '" class="idls object" ' . $other_disabled . '></td>
</tr>
<tr>
<td style="width: 280px;"><label for="date">ქოლ-ცენტრის დარეკვის თარიღი</label></td>
<td style="width: 280px;"><label for="op_id">ოპერატორი</label></td>
</tr>
<tr>
<td><input style="width: 200px;" id="date" value="' . $res[call_date] . '" class="idls object" ' . $other_disabled . '></td>
<td><input style="width: 200px;" id="op_id" value="' . $res[operator_id] . '" class="idls object" disabled></td>
</tr>
</table>
<table class="dialog-form-table" >
<tr>
<td style="width: 270px;"><label> გადასახდელი თანხა </label></td>
示例13: DB_query
if ($OldWIPAccount != $NewWIPAct and $_SESSION['CompanyRecord']['gllink_stock'] == 1) {
/*Then we need to make a journal to transfer the cost of WIP to the new WIP account */
/*First get the total cost of WIP for this category */
$WOCostsResult = DB_query("SELECT workorders.costissued,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSUM(woitems.qtyreqd * woitems.stdcost) AS costrecd\n\t\t\t\t\t\t\t\t\t\t\t\tFROM woitems INNER JOIN workorders\n\t\t\t\t\t\t\t\t\t\t\t\tON woitems.wo = workorders.wo\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN stockmaster\n\t\t\t\t\t\t\t\t\t\t\t\tON woitems.stockid=stockmaster.stockid\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE stockmaster.stockid='" . $StockID . "'\n\t\t\t\t\t\t\t\t\t\t\t\tAND workorders.closed=0\n\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY workorders.costissued", _('Error retrieving value of finished goods received and cost issued against work orders for this item'));
$WIPValue = 0;
while ($WIPRow = DB_fetch_array($WOCostsResult)) {
$WIPValue += $WIPRow['costissued'] - $WIPRow['costrecd'];
}
if ($WIPValue != 0) {
$JournalNo = GetNextTransNo(0, $db);
//enter as a journal
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ( 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $JournalNo . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . GetPeriod(Date($_SESSION['DefaultDateFormat']), $db, true) . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $NewWIPAct . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $StockID . ' ' . _('Change stock category') . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $WIPValue . "')";
$ErrMsg = _('The WIP cost journal could not be inserted because');
$DbgMsg = _('The SQL that was used to create the WIP cost journal and failed was');
$result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ( 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $JournalNo . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . GetPeriod(Date($_SESSION['DefaultDateFormat']), $db, true) . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $OldWIPAccount . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . $StockID . ' ' . _('Change stock category') . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'" . -$WIPValue . "')";
$result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
}
}
/* end if the stock category changed and forced a change in WIP account */
DB_Txn_Commit();
prnMsg(_('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success');
echo '<br />';
}
} else {
//it is a NEW part
//but lets be really sure here
$result = DB_query("SELECT stockid\n\t\t\t\t\t\t\t\tFROM stockmaster\n\t\t\t\t\t\t\t\tWHERE stockid='" . $StockID . "'");
if (DB_num_rows($result) == 1) {
prnMsg(_('The stock code entered is actually already in the database - duplicate stock codes are prohibited by the system. Try choosing an alternative stock code'), 'error');
$InputError = 1;
示例14: gltrans
/* end of the costing specific updates */
if ($_SESSION['CompanyRecord']['gllink_stock'] == 1) {
/*we always need to reverse entries relating to the GRN suspense during delivery and entry of shipment charges */
$sql = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\t\t\t\tdefaulttag,\n\t\t\t\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\t\t\t\t\tVALUES (31,\n\t\t\t\t\t\t\t\t\t\t\t'" . $_GET['SelectedShipment'] . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['CompanyRecord']['grnact'] . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['DefaulTag'] . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . $Variance * $myrow['totqtyinvoiced'] . ")";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit GL entry for the shipment variance posting for') . ' ' . $myrow['itemcode'] . ' ' . _('could not be inserted because');
$result = DB_query($sql, $db, $ErrMsg, '', TRUE);
}
if ($_POST['UpdateCost'] == 'Yes') {
/*Only ever a standard costing option
Weighted average costing implies cost updates taking place automatically */
$QOHResult = DB_query("SELECT SUM(quantity) AS totalquantity FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'", $db);
$QOHRow = DB_fetch_array($QOHResult);
$QOH = $QOHRow['totalquantity'];
if ($_SESSION['CompanyRecord']['gllink_stock'] == 1) {
$CostUpdateNo = GetNextTransNo(35, $db);
$PeriodNo = GetPeriod(Date('d/m/Y'), $db);
$ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit);
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\t\t\t\t\tdefaulttag,\n\t\t\t\t\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\t\t\t\t\t\tVALUES (35,\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $CostUpdateNo . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $StockGLCodes['adjglact'] . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['DefaulTag'] . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . _('Shipment of') . ' ' . $myrow['itemcode'] . " " . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . locale_money_format($ItemShipmentCost, $ShipmentCurrency) . ' x ' . _('QOH of') . ' ' . $QOH . "', " . -$ValueOfChange . ")";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the shipment stock cost adjustment posting could not be inserted because') . ' ' . DB_error_msg($db);
$Result = DB_query($SQL, $db, $ErrMsg, '', TRUE);
$SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\t\t\t\t\tdefaulttag'\n\t\t\t\t\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\t\t\t\t\t\tVALUES (35,\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $CostUpdateNo . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . Date('Y-m-d') . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $StockGLCodes['stockact'] . "',\n\t\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['DefaulTag'] . "',\n\t\t\t\t\t\t\t\t\t'" . _('Shipment of') . ' ' . $myrow['itemcode'] . ' ' . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . locale_money_format($ItemShipmentCost, $ShipmentCurrency) . ' x ' . _('QOH of') . ' ' . $QOH . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $ValueOfChange . ")";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because') . ' ' . DB_error_msg($db);
$Result = DB_query($SQL, $db, $ErrMsg, '', TRUE);
}
/*end of GL entries for a standard cost update */
/* Only the material cost is important for imported items */
$sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ",\n\t\t\t\t\t\t\t\t\t\t\t\tlabourcost=0,\n\t\t\t\t\t\t\t\t\t\t\t\toverheadcost=0,\n\t\t\t\t\t\t\t\t\t\t\t\tlastcost='" . $StdCostUnit . "'\n\t\t\t\t\t\t\t\t\t\tWHERE stockid='" . $myrow['itemcode'] . "'";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment cost details for the stock item could not be updated because') . ': ' . DB_error_msg($db);
$result = DB_query($sql, $db, $ErrMsg, '', TRUE);
}
// end of update cost code
示例15: _
}
if (abs($TotalAllocated + $_SESSION['Alloc']->TransAmt) < 0.01) {
$Settled = 1;
} else {
$Settled = 0;
}
// Update the receipt or credit note
$SQL = "UPDATE debtortrans\n\t\t\t\tSET alloc = '" . -$AllAllocations . "',\n\t\t\t\tdiffonexch = '" . -$TotalDiffOnExch . "',\n\t\t\t\tsettled='" . $Settled . "'\n\t\t\t\tWHERE id = '" . $_POST['AllocTrans'] . "'";
if (!($Result = DB_query($SQL, $db))) {
$Error = _('Could not update receipt or credit note');
}
// If GLLink to debtors active post diff on exchange to GL
$MovtInDiffOnExch = -$_SESSION['Alloc']->PrevDiffOnExch - $TotalDiffOnExch;
if ($MovtInDiffOnExch != 0) {
if ($_SESSION['CompanyRecord']['gllink_debtors'] == 1) {
$PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate, $db);
$_SESSION['Alloc']->TransDate = FormatDateForSQL($_SESSION['Alloc']->TransDate);
$SQL = "INSERT INTO gltrans (\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\tamount\n\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->TransType . "',\n\t\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->TransNo . "',\n\t\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->TransDate . "',\n\t\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t\t'" . $_SESSION['CompanyRecord']['exchangediffact'] . "',\n\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t'" . $MovtInDiffOnExch . "'\n\t\t\t\t\t\t\t)";
if (!($Result = DB_query($SQL, $db))) {
$Error = _('Could not update exchange difference in General Ledger');
}
$SQL = "INSERT INTO gltrans (\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\tamount\n\t\t \t\t\t\t) VALUES (\n\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->TransType . "',\n\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->TransNo . "',\n\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->TransDate . "',\n\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t'" . $_SESSION['CompanyRecord']['debtorsact'] . "',\n\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t'" . -$MovtInDiffOnExch . "'\n\t\t\t\t\t\t)";
if (!($Result = DB_query($SQL, $db))) {
$Error = _('Could not update debtors control in General Ledger');
}
}
}
//
//========[ COMMIT TRANSACTION ]===========
//
if (empty($Error)) {