• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP filter_currency_input函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中filter_currency_input函数的典型用法代码示例。如果您正苦于以下问题:PHP filter_currency_input函数的具体用法?PHP filter_currency_input怎么用?PHP filter_currency_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了filter_currency_input函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: DB_query

    $OldResult = DB_query($sql, $db, $ErrMsg);
    $OldRow = DB_fetch_array($OldResult);
    $_POST['QOH'] = $OldRow['totalqoh'];
    $_POST['OldMaterialCost'] = $OldRow['materialcost'];
    if ($OldRow['mbflag'] == 'M') {
        $_POST['OldLabourCost'] = $OldRow['labourcost'];
        $_POST['OldOverheadCost'] = $OldRow['overheadcost'];
    } else {
        $_POST['OldLabourCost'] = 0;
        $_POST['OldOverheadCost'] = 0;
        $_POST['LabourCost'] = 0;
        $_POST['OverheadCost'] = 0;
    }
    DB_free_result($OldResult);
    $OldCost = filter_currency_input($_POST['OldMaterialCost'] + $_POST['OldLabourCost'] + $_POST['OldOverheadCost']);
    $NewCost = filter_currency_input($_POST['MaterialCost'] + $_POST['LabourCost'] + $_POST['OverheadCost']);
    $result = DB_query("SELECT stockid FROM stockmaster WHERE stockid='" . $StockID . "'", $db);
    if (DB_num_rows($result) == 0) {
        prnMsg(_('The entered item code does not exist'), 'error', _('Non-existent Item'));
    } elseif ($OldCost != $NewCost) {
        $Result = DB_Txn_Begin($db);
        ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']);
        $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "',\n\t\t\t\t\t\t\t\t\t\tlabourcost='" . $_POST['LabourCost'] . "',\n\t\t\t\t\t\t\t\t\t\toverheadcost='" . $_POST['OverheadCost'] . "',\n\t\t\t\t\t\t\t\t\t\tlastcost='" . $OldCost . "',\n\t\t\t\t\t\t\t\t\t\tlastcurcostdate='" . Date('Y-m-d') . "'\n\t\t\t\t\t\t\t\t\tWHERE stockid='" . $StockID . "'";
        $ErrMsg = _('The cost details for the stock item could not be updated because');
        $DbgMsg = _('The SQL that failed was');
        $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
        $Result = DB_Txn_Commit($db);
        UpdateCost($db, $StockID);
        //Update any affected BOMs
    }
}
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:StockCostUpdate.php


示例2: foreach

     if ($QuantityAlreadyDelivered == 0) {
         $_SESSION['Items' . $identifier]->remove_from_cart($_GET['Delete'], 'Yes');
         /*Do update DB */
     } else {
         $_SESSION['Items' . $identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered;
     }
 }
 $AlreadyWarnedAboutCredit = false;
 foreach ($_SESSION['Items' . $identifier]->LineItems as $OrderLine) {
     if (isset($_POST['Quantity_' . $OrderLine->LineNumber])) {
         if (!isset($PropertiesArray[$OrderLine->LineNumber])) {
             $PropertiesArray[$OrderLine->LineNumber] = '';
         }
         $Quantity = filter_number_input($_POST['Quantity_' . $OrderLine->LineNumber]);
         if (ABS($OrderLine->Price - $_POST['Price_' . $OrderLine->LineNumber]) > 0.01) {
             $Price = filter_currency_input($_POST['Price_' . $OrderLine->LineNumber]);
             $_POST['GPPercent_' . $OrderLine->LineNumber] = ($Price * (1 - $_POST['Discount_' . $OrderLine->LineNumber] / 100) - $OrderLine->StandardCost * $ExRate) / ($Price * (1 - $_POST['Discount_' . $OrderLine->LineNumber]) / 100);
         } elseif (ABS($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber]) >= 0.01) {
             //then do a recalculation of the price at this new GP Percentage
             $Price = $OrderLine->StandardCost * $ExRate / (1 - ($_POST['GPPercent_' . $OrderLine->LineNumber] + $_POST['Discount_' . $OrderLine->LineNumber]) / 100);
         } else {
             $Price = $_POST['Price_' . $OrderLine->LineNumber];
         }
         $DiscountPercentage = $_POST['Discount_' . $OrderLine->LineNumber];
         if ($_SESSION['AllowOrderLineItemNarrative'] == 1) {
             $Narrative = $_POST['Narrative_' . $OrderLine->LineNumber];
         } else {
             $Narrative = '';
         }
         if (!isset($OrderLine->DiscountPercent)) {
             $OrderLine->DiscountPercent = 0;
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:SelectOrderItems.php


示例3: _

 }
 if (Date1GreaterThanDate2($_POST['StartDate'], $_POST['EndDate']) and $_POST['EndDate'] != '') {
     $InputError = 1;
     $msg = _('The end date is expected to be after the start date, enter an end date after the start date for this price');
 }
 if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']), $_POST['EndDate']) and $_POST['EndDate'] != '') {
     $InputError = 1;
     $msg = _('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!');
 }
 if (isset($_POST['Editing']) and $_POST['Editing'] == 'Yes' and strlen($Item) > 1 and $InputError != 1) {
     //editing an existing price
     $sql = "UPDATE prices SET typeabbrev='" . $SalesType . "',\n\t\t                        currabrev='" . $CurrCode . "',\n\t\t\t\t\t\t\t\tprice='" . filter_currency_input($_POST['Price']) . "',\n\t\t\t\t\t\t\t\tunits='" . $_POST['Units'] . "',\n\t\t\t\t\t\t\t\tconversionfactor='" . filter_number_input($_POST['ConversionFactor']) . "',\n\t\t\t\t\t\t\t\tdecimalplaces='" . round($_POST['DecimalPlaces'], 0) . "',\n\t\t\t\t\t\t\t\tbranchcode='" . $_POST['Branch'] . "',\n\t\t\t\t\t\t\t\tstartdate='" . FormatDateForSQL($_POST['StartDate']) . "',\n\t\t\t\t\t\t\t\tenddate='" . FormatDateForSQL($_POST['EndDate']) . "'\n\t\t\t\tWHERE prices.stockid='" . $Item . "'\n\t\t\t\tAND prices.typeabbrev='" . $SalesType . "'\n\t\t\t\tAND prices.currabrev='" . $CurrCode . "'\n\t\t\t\tAND prices.startdate='" . $_POST['OldStartDate'] . "'\n\t\t\t\tAND prices.enddate='" . $_POST['OldEndDate'] . "'\n\t\t\t\tAND prices.debtorno='" . $_SESSION['CustomerID'] . "'";
     $msg = _('Price Updated');
 } elseif ($InputError != 1) {
     /*Selected price is null cos no item selected on first time round so must be adding a	record must be submitting new entries in the new price form */
     $sql = "INSERT INTO prices (stockid,\n\t\t                            typeabbrev,\n\t\t\t\t\t\t\t\t\tcurrabrev,\n\t\t\t\t\t\t\t\t\tdebtorno,\n\t\t\t\t\t\t\t\t\tprice,\n\t\t\t\t\t\t\t\t\tunits,\n\t\t\t\t\t\t\t\t\tconversionfactor,\n\t\t\t\t\t\t\t\t\tdecimalplaces,\n\t\t\t\t\t\t\t\t\tbranchcode,\n\t\t\t\t\t\t\t\t\tstartdate,\n\t\t\t\t\t\t\t\t\tenddate)\n\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t'" . $Item . "',\n\t\t\t\t\t\t\t\t\t'" . $SalesType . "',\n\t\t\t\t\t\t\t\t\t'" . $CurrCode . "',\n\t\t\t\t\t\t\t\t\t'" . $_SESSION['CustomerID'] . "',\n\t\t\t\t\t\t\t\t\t'" . filter_currency_input($_POST['Price']) . "',\n\t\t\t\t\t\t\t\t\t'" . $_POST['Units'] . "',\n\t\t\t\t\t\t\t\t\t'" . filter_number_input($_POST['ConversionFactor']) . "',\n\t\t\t\t\t\t\t\t\t'" . round($_POST['DecimalPlaces'], 0) . "',\n\t\t\t\t\t\t\t\t\t'" . $_POST['Branch'] . "',\n\t\t\t\t\t\t\t\t\t'" . FormatDateForSQL($_POST['StartDate']) . "',\n\t\t\t\t\t\t\t\t\t'" . FormatDateForSQL($_POST['EndDate']) . "'\n\t\t\t\t\t\t\t\t\t)";
     $msg = _('Price added') . '.';
 }
 //run the SQL from either of the above possibilites
 if ($InputError != 1) {
     $result = DB_query($sql, $db, '', '', false, false);
     if (DB_error_no($db) != 0) {
         if ($msg == _('Price Updated')) {
             $msg = _('The price could not be updated because') . ' - ' . DB_error_msg($db);
         } else {
             $msg = _('The price could not be added because') . ' - ' . DB_error_msg($db);
         }
     } else {
         ReSequenceEffectiveDates($Item, $SalesType, $CurrCode, $_SESSION['CustomerID'], $db);
         unset($_POST['EndDate']);
         unset($_POST['StartDate']);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:Prices_Customer.php


示例4: DB_query

 $result = DB_query($sql, $db);
 if (DB_num_rows($result) > 0) {
     echo '<tr><td>' . _('Doctors Name') . ':</td>';
     echo '<td><select name="Doctor">';
     echo '<option value="">' . _('Select a doctor from list') . '</option>';
     while ($myrow = DB_fetch_array($result)) {
         if (isset($_POST['Doctor']) and $_POST['Doctor'] == $myrow['supplierid']) {
             echo '<option selected="selected" value="' . $myrow['supplierid'] . '">' . $myrow['supplierid'] . ' - ' . $myrow['suppname'] . '</option>';
         } else {
             echo '<option value="' . $myrow['supplierid'] . '">' . $myrow['supplierid'] . ' - ' . $myrow['suppname'] . '</option>';
         }
     }
     echo '</select></td></tr>';
     echo '<tr><td>';
     if (isset($_POST['DoctorsFee']) and $_POST['DoctorsFee'] != '') {
         echo _('Doctors Fee') . ':</td><td><input type="text" class="number" size="10" name="DoctorsFee" value="' . locale_money_format(filter_currency_input($_POST['DoctorsFee']), $_SESSION['CompanyRecord']['currencydefault']) . '" />';
     } else {
         echo _('Doctors Fee') . ':</td><td><input type="text" class="number" size="10" name="DoctorsFee" value="" />';
     }
     if (isset($_POST['AddDoctorFee'])) {
         echo '<input type="checkbox" checked="checked" name="AddDoctorFee" value="Add Doctors fee to balance" onChange="ReloadForm(ChangeItem)" />' . _('Add Doctors fee to balance') . '</td></tr>';
     } else {
         echo '<input type="checkbox" name="AddDoctorFee" value="Add Doctors fee to balance" onChange="ReloadForm(ChangeItem)" />' . _('Add Doctors fee to balance') . '</td></tr>';
     }
 }
 if ($Patient[1] == 'CASH') {
     if (!isset($Received)) {
         $Received = $_SESSION['Items']['Value'];
     }
     echo '<tr><td>' . _('Amount Received') . '</td>';
     echo '<td><input type="text" class="number" size="10" name="Received" value="' . locale_money_format($Received, $_SESSION['CompanyRecord']['currencydefault']) . '" /></td></tr>';
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:KCMCRadiology.php


示例5: filter_currency_input

     $i++;
 }
 if (isset($SelectedTab) and $InputError != 1) {
     $sql = "UPDATE pctabs\r\n\t\t\tSET usercode = '" . $_POST['SelectUser'] . "',\r\n\t\t\ttypetabcode = '" . $_POST['SelectTabs'] . "',\r\n\t\t\tcurrency = '" . $_POST['SelectCurrency'] . "',\r\n\t\t\ttablimit = '" . filter_currency_input($_POST['tablimit']) . "',\r\n\t\t\tassigner = '" . $_POST['SelectAssigner'] . "',\r\n\t\t\tauthorizer = '" . $_POST['SelectAuthorizer'] . "',\r\n\t\t\tglaccountassignment = '" . $_POST['glaccountcash'] . "',\r\n\t\t\tglaccountpcash = '" . $_POST['glaccountpcashtab'] . "'\r\n\t\t\tWHERE tabcode = '" . $SelectedTab . "'";
     $msg = _('The Petty Cash Tab') . ' ' . $SelectedTab . ' ' . _('has been updated');
 } elseif ($InputError != 1) {
     // First check the type is not being duplicated
     $checkSql = "SELECT count(*)\r\n\t\t\t\t FROM pctabs\r\n\t\t\t\t WHERE tabcode = '" . $_POST['tabcode'] . "'";
     $checkresult = DB_query($checkSql, $db);
     $checkrow = DB_fetch_row($checkresult);
     if ($checkrow[0] > 0) {
         $InputError = 1;
         prnMsg(_('The Tab ') . $_POST['tabcode'] . _(' already exist.'), 'error');
     } else {
         // Add new record on submit
         $sql = "INSERT INTO pctabs\r\n\t\t\t\t\t\t(tabcode,\r\n\t\t\t \t\t\t usercode,\r\n\t\t\t\t\t\t typetabcode,\r\n\t\t\t\t\t\t currency,\r\n\t\t\t\t\t\t tablimit,\r\n\t\t\t\t\t\t assigner,\r\n\t\t\t\t\t\t authorizer,\r\n\t\t\t\t\t\t glaccountassignment,\r\n\t\t\t\t\t\t glaccountpcash)\r\n\t\t\t\tVALUES ('" . $_POST['tabcode'] . "',\r\n\t\t\t\t\t'" . $_POST['SelectUser'] . "',\r\n\t\t\t\t\t'" . $_POST['SelectTabs'] . "',\r\n\t\t\t\t\t'" . $_POST['SelectCurrency'] . "',\r\n\t\t\t\t\t'" . filter_currency_input($_POST['tablimit']) . "',\r\n\t\t\t\t\t'" . $_POST['SelectAssigner'] . "',\r\n\t\t\t\t\t'" . $_POST['SelectAuthorizer'] . "',\r\n\t\t\t\t\t'" . $_POST['glaccountcash'] . "',\r\n\t\t\t\t\t'" . $_POST['glaccountpcashtab'] . "')";
         $msg = _('The Petty Cash Tab') . ' ' . $_POST['tabcode'] . ' ' . _('has been created');
     }
 }
 if ($InputError != 1) {
     //run the SQL from either of the above possibilites
     $result = DB_query($sql, $db);
     prnMsg($msg, 'success');
     unset($SelectedTab);
     unset($_POST['tabcode']);
     unset($_POST['SelectUser']);
     unset($_POST['SelectTabs']);
     unset($_POST['SelectCurrency']);
     unset($_POST['tablimit']);
     unset($_POST['SelectAssigner']);
     unset($_POST['SelectAuthorizer']);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:PcTabs.php


示例6: Allocation

class Allocation
{
    var $TransID;
    var $Amount;
    function Allocation($TransID, $Amount)
    {
        $this->TransID = $TransID;
        $this->Amount = $Amount;
    }
}
include 'includes/session.inc';
include 'includes/SQL_CommonFunctions.inc';
include 'includes/GetPaymentMethods.php';
foreach ($_POST as $key => $value) {
    if (substr($key, 0, 6) == 'ExRate') {
        $_POST[$key] = filter_currency_input($value);
    }
}
if ((isset($_POST['PrintPDF']) or isset($_POST['PrintPDFAndProcess'])) and isset($_POST['FromCriteria']) and mb_strlen($_POST['FromCriteria']) >= 1 and isset($_POST['ToCriteria']) and mb_strlen($_POST['ToCriteria']) >= 1 and is_numeric($_POST['ExRate'])) {
    /*then print the report */
    $RefCounter = 0;
    include 'includes/PDFStarter.php';
    $pdf->addInfo('Title', _('Payment Run Report'));
    $pdf->addInfo('Subject', _('Payment Run') . ' - ' . _('suppliers from') . ' ' . $_POST['FromCriteria'] . ' to ' . $_POST['ToCriteria'] . ' in ' . $_POST['Currency'] . ' ' . _('and Due By') . ' ' . $_POST['AmountsDueBy']);
    $PageNumber = 1;
    $line_height = 12;
    /*Now figure out the invoice less credits due for the Supplier range under review */
    include 'includes/PDFPaymentRunPageHeader.inc';
    $sql = "SELECT suppliers.supplierid,\n\t\t\tSUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) AS balance\n\t\tFROM suppliers,\n\t\t\tpaymentterms,\n\t\t\tsupptrans,\n\t\t\tsystypes\n\t\tWHERE systypes.typeid = supptrans.type\n\t\tAND suppliers.paymentterms = paymentterms.termsindicator\n\t\tAND suppliers.supplierid = supptrans.supplierno\n\t\tAND supptrans.ovamount + supptrans.ovgst - supptrans.alloc !=0\n\t\tAND supptrans.duedate <='" . FormatDateForSQL($_POST['AmountsDueBy']) . "'\n\t\tAND supptrans.hold=0\n\t\tAND suppliers.currcode = '" . $_POST['Currency'] . "'\n\t\tAND supptrans.supplierNo >= '" . $_POST['FromCriteria'] . "'\n\t\tAND supptrans.supplierno <= '" . $_POST['ToCriteria'] . "'\n\t\tGROUP BY suppliers.supplierid\n\t\tHAVING SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) > 0\n\t\tORDER BY suppliers.supplierid";
    $SuppliersResult = DB_query($sql, $db);
    $SupplierID = '';
开发者ID:patmark,项目名称:weberp-elct,代码行数:31,代码来源:SuppPaymentRun.php


示例7: _

     $ErrMsg = _('The supplier purchasing details could not be added to the database because');
     $DbgMsg = _('The SQL that failed was');
     $AddResult = DB_query($sql, $db, $ErrMsg, $DbgMsg);
     prnMsg(_('This supplier purchasing data has been added to the database'), 'success');
     /* If the new purchdata is the preferred one, the old ones from the same suppliers shouldn't be preferred.
     		Are kept only for historic information only */
     if ($_POST['Preferred'] == 1) {
         $sql = "UPDATE purchdata SET preferred='0'\n\t\t\t\t\t\t\t\tWHERE purchdata.stockid='" . $StockID . "'\n\t\t\t\t\t\t\t\t\tAND purchdata.supplierno='" . $SupplierID . "'\n\t\t\t\t\t\t\t\t\tAND purchdata.effectivefrom < '" . FormatDateForSQL($_POST['EffectiveFrom']) . "'";
         $ErrMsg = _('The preferred supplier details could not be update because');
         $DbgMsg = _('The SQL that failed was');
         $UpdResult = DB_query($sql, $db, $ErrMsg, $DbgMsg);
         prnMsg(_('Supplier preferred flag has been updated'), 'success');
     }
 }
 if ($InputError == 0 and isset($_POST['UpdateRecord'])) {
     $sql = "UPDATE purchdata SET price='" . filter_currency_input($_POST['Price']) . "',\n\t\t\t\t\t\t\t\t\teffectivefrom='" . FormatDateForSQL($_POST['EffectiveFrom']) . "',\n\t\t\t\t\t\t\t\t\tsuppliersuom='" . $_POST['SuppliersUOM'] . "',\n\t\t\t\t\t\t\t\t\tconversionfactor='" . $_POST['ConversionFactor'] . "',\n\t\t\t\t\t\t\t\t\tuomdecimalplaces='" . $_POST['DecimalPlaces'] . "',\n\t\t\t\t\t\t\t\t\tsupplierdescription='" . $_POST['SupplierDescription'] . "',\n\t\t\t\t\t\t\t\t\tsuppliers_partno='" . $_POST['SupplierCode'] . "',\n\t\t\t\t\t\t\t\t\tleadtime='" . $_POST['LeadTime'] . "',\n\t\t\t\t\t\t\t\t\tminorderqty='" . $_POST['MinOrderQty'] . "',\n\t\t\t\t\t\t\t\t\tpreferred='" . $_POST['Preferred'] . "'\n\t\t\t\t\t\t\tWHERE purchdata.stockid='" . $StockID . "'\n\t\t\t\t\t\t\t\tAND purchdata.supplierno='" . $SupplierID . "'\n\t\t\t\t\t\t\t\tAND purchdata.effectivefrom='" . $_POST['WasEffectiveFrom'] . "'";
     $ErrMsg = _('The supplier purchasing details could not be update because');
     $DbgMsg = _('The SQL that failed was');
     $UpdResult = DB_query($sql, $db, $ErrMsg, $DbgMsg);
     prnMsg(_('Supplier purchasing data has been updated'), 'success');
 }
 if ($InputError == 0 and (isset($_POST['UpdateRecord']) or isset($_POST['AddRecord']))) {
     /*update or insert took place and need to clear the form  */
     unset($SupplierID);
     unset($_POST['Price']);
     unset($CurrCode);
     unset($_POST['SuppliersUOM']);
     unset($_POST['EffectiveFrom']);
     unset($_POST['ConversionFactor']);
     unset($_POST['SupplierDescription']);
     unset($_POST['LeadTime']);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:PurchData.php


示例8: _

            }
            $ErrMsg = _('The customer could not be updated because');
            $result = DB_query($sql, $db, $ErrMsg);
            prnMsg(_('Customer updated'), 'success');
            echo '<br />';
        } else {
            //it is a new customer
            /* set the DebtorNo if $AutoDebtorNo in config.php has been set to
            			something greater 0 */
            if ($_SESSION['AutoDebtorNo'] > 0) {
                /* system assigned, sequential, numeric */
                if ($_SESSION['AutoDebtorNo'] == 1) {
                    $_POST['DebtorNo'] = GetNextTransNo(500, $db);
                }
            }
            $sql = "INSERT INTO debtorsmaster (\n\t\t\t\t\t\t\tdebtorno,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\taddress1,\n\t\t\t\t\t\t\taddress2,\n\t\t\t\t\t\t\taddress3,\n\t\t\t\t\t\t\taddress4,\n\t\t\t\t\t\t\taddress5,\n\t\t\t\t\t\t\taddress6,\n\t\t\t\t\t\t\tcurrcode,\n\t\t\t\t\t\t\tclientsince,\n\t\t\t\t\t\t\tholdreason,\n\t\t\t\t\t\t\tpaymentterms,\n\t\t\t\t\t\t\tdiscount,\n\t\t\t\t\t\t\tdiscountcode,\n\t\t\t\t\t\t\tpymtdiscount,\n\t\t\t\t\t\t\tcreditlimit,\n\t\t\t\t\t\t\tsalestype,\n\t\t\t\t\t\t\tinvaddrbranch,\n\t\t\t\t\t\t\ttaxref,\n\t\t\t\t\t\t\tcustomerpoline,\n\t\t\t\t\t\t\ttypeid)\n\t\t\t\tVALUES ('" . $_POST['DebtorNo'] . "',\n\t\t\t\t\t'" . $_POST['CustName'] . "',\n\t\t\t\t\t'" . $_POST['Address1'] . "',\n\t\t\t\t\t'" . $_POST['Address2'] . "',\n\t\t\t\t\t'" . $_POST['Address3'] . "',\n\t\t\t\t\t'" . $_POST['Address4'] . "',\n\t\t\t\t\t'" . $_POST['Address5'] . "',\n\t\t\t\t\t'" . $_POST['Address6'] . "',\n\t\t\t\t\t'" . $_POST['CurrCode'] . "',\n\t\t\t\t\t'" . $SQL_ClientSince . "',\n\t\t\t\t\t'" . $_POST['HoldReason'] . "',\n\t\t\t\t\t'" . $_POST['PaymentTerms'] . "',\n\t\t\t\t\t " . filter_number_input($_POST['Discount']) . "/100,\n\t\t\t\t\t'" . $_POST['DiscountCode'] . "',\n\t\t\t\t\t " . filter_number_input($_POST['PymtDiscount']) . "/100,\n\t\t\t\t\t'" . filter_currency_input($_POST['CreditLimit']) . "',\n\t\t\t\t\t'" . $_POST['SalesType'] . "',\n\t\t\t\t\t'" . $_POST['AddrInvBranch'] . "',\n\t\t\t\t\t'" . $_POST['TaxRef'] . "',\n\t\t\t\t\t'" . $_POST['CustomerPOLine'] . "',\n\t\t\t\t\t'" . $_POST['typeid'] . "'\n\t\t\t\t\t)";
            $ErrMsg = _('This customer could not be added because');
            $result = DB_query($sql, $db, $ErrMsg);
            $BranchCode = mb_substr($_POST['DebtorNo'], 0, 4);
            echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">';
            echo '<div class="centre">' . _('You should automatically be forwarded to the entry of a new Customer Branch page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . '<a href="' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '"></a></div>';
            include 'includes/footer.inc';
            exit;
        }
    } else {
        prnMsg(_('Validation failed') . '. ' . _('No updates or deletes took place'), 'error');
    }
} elseif (isset($_POST['delete'])) {
    //the link to delete a selected record was clicked instead of the submit button
    $CancelDelete = 0;
    // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans'
开发者ID:patmark,项目名称:weberp-elct,代码行数:31,代码来源:Customers.php


示例9: DB_query

            $TagResult = DB_query($tagsql, $db);
            $TagMyrow = DB_fetch_row($TagResult);
            if ($PaymentItem->tag == 0) {
                $TagName = 'None';
            } else {
                $TagName = $TagMyrow[0];
            }
            echo '<tr>
					<td align=left>' . $PaymentItem->cheque . '</td>
					<td class="number">' . $PaymentItem->Amount . '</td>
					<td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td>
					<td>' . stripslashes($PaymentItem->Narrative) . '</td>
					<td>' . $PaymentItem->tag . ' - ' . $TagName . '</td>
					<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $PaymentItem->ID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this payment analysis item?') . '\');">' . _('Delete') . '</a></td>
				</tr>';
            $PaymentTotal += filter_currency_input($PaymentItem->Amount);
        }
        echo '<tr><td></td><td class="number"><b>' . locale_money_format($PaymentTotal, $_SESSION['PaymentDetail' . $identifier]->AccountCurrency) . '</b></td><td colspan="3"></td></tr></table><br />';
        echo '<button type="submit" name="CommitBatch">' . _('Accept and Process Payment') . '</button>';
    }
} else {
    /*a supplier is selected or the GL link is not active then set out
    the fields for entry of receipt amt and disc */
    if ($_SESSION['PaymentDetail' . $identifier]->Amount == 0) {
        echo '<table class="selection"><tr><td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail' . $identifier]->Currency . ':</td>
				<td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . locale_money_format(0, $_SESSION['PaymentDetail' . $identifier]->Currency) . '" /></td></tr>';
    } else {
        echo '<table class="selection"><tr><td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail' . $identifier]->Currency . ':</td>
				<td><input class="number" type="text" name="Amount" maxlength="12" size="13" value="' . locale_money_format($_SESSION['PaymentDetail' . $identifier]->Amount, $_SESSION['PaymentDetail' . $identifier]->Currency) . '" /></td></tr>';
    }
    if (isset($_SESSION['PaymentDetail' . $identifier]->SupplierID)) {
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:Payments.php


示例10: filter_currency_input

        /* Need to see if there is also a price entered that has an end date after the start date of this price and if
        		so we will need to update it so there is no ambiguity as to which price will be used*/
        //editing an existing price
        $sql = "UPDATE prices SET\n\t\t\t\t\ttypeabbrev='" . $_POST['TypeAbbrev'] . "',\n\t\t\t\t\tcurrabrev='" . $_POST['CurrAbrev'] . "',\n\t\t\t\t\tprice='" . filter_currency_input($_POST['Price']) . "',\n\t\t\t\t\tunits='" . $_POST['Units'] . "',\n\t\t\t\t\tconversionfactor='" . $_POST['ConversionFactor'] . "',\n\t\t\t\t\tdecimalplaces='" . $_POST['DecimalPlaces'] . "',\n\t\t\t\t\tstartdate='" . FormatDateForSQL($_POST['StartDate']) . "',\n\t\t\t\t\tenddate='" . $SQLEndDate . "'\n\t\t\t\tWHERE prices.stockid='" . $Item . "'\n\t\t\t\tAND startdate='" . $_POST['OldStartDate'] . "'\n\t\t\t\tAND enddate ='" . $_POST['OldEndDate'] . "'\n\t\t\t\tAND prices.typeabbrev='" . $_POST['OldTypeAbbrev'] . "'\n\t\t\t\tAND prices.currabrev='" . $_POST['OldCurrAbrev'] . "'\n\t\t\t\tAND prices.debtorno=''";
        $ErrMsg = _('Could not be update the existing prices');
        $result = DB_query($sql, $db, $ErrMsg);
        ReSequenceEffectiveDates($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db);
        prnMsg(_('The price has been updated'), 'success');
        echo '<br />';
    } elseif ($InputError != 1) {
        /*Selected price is null cos no item selected on first time round so must be adding a	record must be submitting new entries in the new price form */
        $sql = "UPDATE prices SET\n\t\t\t\t\tenddate='" . date('Y-m-d') . "'\n\t\t\t\tWHERE prices.stockid='" . $Item . "'\n\t\t\t\tAND startdate='" . FormatDateForSQL($_POST['StartDate']) . "'\n\t\t\t\tAND enddate ='" . $SQLEndDate . "'\n\t\t\t\tAND prices.typeabbrev='" . $_POST['TypeAbbrev'] . "'\n\t\t\t\tAND prices.currabrev='" . $_POST['CurrAbrev'] . "'\n\t\t\t\tAND prices.debtorno=''";
        $ErrMsg = _('Could not be update the existing prices');
        $result = DB_query($sql, $db, $ErrMsg);
        ReSequenceEffectiveDates($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db);
        $sql = "INSERT INTO prices (stockid,\n\t\t\t\t\t\t\t\t\ttypeabbrev,\n\t\t\t\t\t\t\t\t\tcurrabrev,\n\t\t\t\t\t\t\t\t\tunits,\n\t\t\t\t\t\t\t\t\tconversionfactor,\n\t\t\t\t\t\t\t\t\tdecimalplaces,\n\t\t\t\t\t\t\t\t\tstartdate,\n\t\t\t\t\t\t\t\t\tenddate,\n\t\t\t\t\t\t\t\t\tprice)\n\t\t\t\t\t\t\tVALUES ('" . $Item . "',\n\t\t\t\t\t\t\t\t'" . $_POST['TypeAbbrev'] . "',\n\t\t\t\t\t\t\t\t'" . $_POST['CurrAbrev'] . "',\n\t\t\t\t\t\t\t\t'" . $_POST['Units'] . "',\n\t\t\t\t\t\t\t\t'" . filter_number_input($_POST['ConversionFactor']) . "',\n\t\t\t\t\t\t\t\t'" . $_POST['DecimalPlaces'] . "',\n\t\t\t\t\t\t\t\t'" . FormatDateForSQL($_POST['StartDate']) . "',\n\t\t\t\t\t\t\t\t'" . $SQLEndDate . "',\n\t\t\t\t\t\t\t\t'" . filter_currency_input($_POST['Price']) . "')";
        $ErrMsg = _('The new price could not be added');
        $result = DB_query($sql, $db, $ErrMsg);
        ReSequenceEffectiveDates($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db);
        prnMsg(_('The new price has been inserted'), 'success');
        echo '<br />';
    }
    unset($_POST['Price']);
    unset($_POST['StartDate']);
    unset($_POST['EndDate']);
    unset($_POST['Units']);
    unset($_POST['ConversionFactor']);
    unset($_POST['DecimalPlaces']);
} elseif (isset($_GET['delete'])) {
    //the link to delete a selected record was clicked instead of the submit button
    $sql = "DELETE FROM prices\n\t\t\t\tWHERE prices.stockid = '" . $Item . "'\n\t\t\t\tAND prices.typeabbrev='" . $_GET['TypeAbbrev'] . "'\n\t\t\t\tAND prices.currabrev ='" . $_GET['CurrAbrev'] . "'\n\t\t\t\tAND  prices.startdate = '" . $_GET['StartDate'] . "'\n\t\t\t\tAND  prices.enddate = '" . $_GET['EndDate'] . "'\n\t\t\t\tAND prices.debtorno=''";
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:Prices.php


示例11: prnMsg

    } else {
        prnMsg(_('The other contract requirements cannot be altered because the customer has already placed the order'), 'warn');
    }
}
if (isset($_POST['EnterNewRequirement'])) {
    $InputError = false;
    if (!is_numeric(filter_number_input($_POST['Quantity']))) {
        prnMsg(_('The quantity of the new requirement is expected to be numeric'), 'error');
        $InputError = true;
    }
    if (!is_numeric(filter_currency_input($_POST['CostPerUnit']))) {
        prnMsg(_('The cost per unit of the new requirement is expected to be numeric'), 'error');
        $InputError = true;
    }
    if (!$InputError) {
        $_SESSION['Contract' . $identifier]->Add_To_ContractRequirements($_POST['RequirementDescription'], filter_number_input($_POST['Quantity']), filter_currency_input($_POST['CostPerUnit']));
        unset($_POST['RequirementDescription']);
        unset($_POST['Quantity']);
        unset($_POST['CostPerUnit']);
    }
}
/* This is where the other requirement as entered/modified should be displayed reflecting any deletions or insertions*/
echo '<form name="ContractReqtsForm" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier=' . $identifier . '" method="post">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/contract.png" title="' . _('Contract Other Requirements') . '" alt="" />  ' . _('Contract Other Requirements') . ' - ' . $_SESSION['Contract' . $identifier]->CustomerName . '</p>';
if (count($_SESSION['Contract' . $identifier]->ContractReqts) > 0) {
    echo '<table cellpadding="2" class="selection">';
    if (isset($_SESSION['Contract' . $identifier]->ContractRef)) {
        echo '<tr><th colspan="5">' . _('Contract Reference:') . ' ' . $_SESSION['Contract' . $identifier]->ContractRef . '</th></tr>';
    }
    echo '<tr>
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:ContractOtherReqts.php


示例12: _

if (isset($_POST['Update']) and $_POST['RowCounter'] > 1) {
    for ($Counter = 1; $Counter <= $_POST['RowCounter']; $Counter++) {
        if (isset($_POST['Clear_' . $Counter]) and $_POST['Clear_' . $Counter] == True) {
            /*Get amount to be cleared */
            $sql = "SELECT amount,\n\t\t\t\t\t\t\texrate\n\t\t\t\t\t\tFROM banktrans\n\t\t\t\t\t\tWHERE banktransid='" . $_POST['BankTrans_' . $Counter] . "'";
            $ErrMsg = _('Could not retrieve transaction information');
            $result = DB_query($sql, $db, $ErrMsg);
            $myrow = DB_fetch_array($result);
            $AmountCleared = round($myrow[0] / $myrow[1], 2);
            /*Update the banktrans recoord to match it off */
            $sql = "UPDATE banktrans SET amountcleared= '" . $AmountCleared . "'\n\t\t\t\t\t\t\t\t\tWHERE banktransid='" . $_POST['BankTrans_' . $Counter] . "'";
            $ErrMsg = _('Could not match off this payment because');
            $result = DB_query($sql, $db, $ErrMsg);
        } elseif (isset($_POST['AmtClear_' . $Counter]) and filter_currency_input($_POST['AmtClear_' . $Counter]) < 0 and $Type == 'Payments' or $Type == 'Receipts' and isset($_POST['AmtClear_' . $Counter]) and filter_currency_input($_POST['AmtClear_' . $Counter]) > 0) {
            /*if the amount entered was numeric and negative for a payment or positive for a receipt */
            $sql = "UPDATE banktrans SET amountcleared=" . filter_currency_input($_POST['AmtClear_' . $Counter]) . "\n\t\t\t\t\t WHERE banktransid='" . $_POST['BankTrans_' . $Counter] . "'";
            $ErrMsg = _('Could not update the amount matched off this bank transaction because');
            $result = DB_query($sql, $db, $ErrMsg);
        } elseif (isset($_POST['Unclear_' . $Counter]) and $_POST['Unclear_' . $Counter] == True) {
            $sql = "UPDATE banktrans SET amountcleared = 0\n\t\t\t\t\t WHERE banktransid='" . $_POST['BankTrans_' . $Counter] . "'";
            $ErrMsg = _('Could not unclear this bank transaction because');
            $result = DB_query($sql, $db, $ErrMsg);
        }
    }
    /*Show the updated position with the same criteria as previously entered*/
    $_POST['ShowTransactions'] = True;
}
echo '<div class="page_help_text">' . _('Use this screen to match webERP Receipts and Payments to your Bank Statement.  Check your bank statement and click the check-box when you find the matching transaction.') . '</div><br />';
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<input type="hidden" name="Type" value="' . $Type . '" />';
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:BankMatching.php


示例13: VALUES

         if (!($Result = DB_query($SQL, $db))) {
             $error = 'Could not delete old allocation record';
         }
     }
     //			 if ($AllocnItem->OrigAlloc != $AllocnItem->AllocAmt) // has previous allocated amount changed?
     //			 {
     if ($AllocnItem->AllocAmt > 0) {
         $SQL = "INSERT INTO\n\t\t\t\t\t\t\t\tcustallocns (\n\t\t\t\t\t\t\t\tdatealloc,\n\t\t\t\t\t\t\t\tamt,\n\t\t\t\t\t\t\t\ttransid_allocfrom,\n\t\t\t\t\t\t\t\ttransid_allocto\n\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t'" . date('Y-m-d') . "',\n\t\t\t\t\t\t\t\t'" . $AllocnItem->AllocAmt . "',\n\t\t\t\t\t\t\t\t'" . $_SESSION['Alloc']->AllocTrans . "',\n\t\t\t\t\t\t\t\t'" . $AllocnItem->ID . "'\n\t\t\t\t\t\t\t)";
         if (!($Result = DB_query($SQL, $db))) {
             $error = 'Could not change allocation record';
         }
     }
     $NewAllocTotal = $AllocnItem->PrevAlloc + $AllocnItem->AllocAmt;
     $AllAllocations = $AllAllocations + $AllocnItem->AllocAmt;
     $Settled = abs(filter_currency_input($NewAllocTotal - $AllocnItem->TransAmount)) < 0.005 ? 1 : 0;
     $SQL = "UPDATE debtortrans\n\t\t\t\t\t\tSET diffonexch='" . $AllocnItem->DiffOnExch . "',\n\t\t\t\t\t\talloc = '" . filter_currency_input($NewAllocTotal) . "',\n\t\t\t\t\t\tsettled = '" . $Settled . "'\n\t\t\t\t\t\tWHERE id = '" . $AllocnItem->ID . "'";
     if (!($Result = DB_query($SQL, $db))) {
         $error = 'Could not update difference on exchange';
     }
     //			 }
 }
 $Settled = abs($TotalAllocated + $_SESSION['Alloc']->TransAmt) < 0.01 ? 1 : 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) {
开发者ID:patmark,项目名称:weberp-elct,代码行数:31,代码来源:CustomerAllocations.php


示例14: date

     }
     $SQLTestExists = "SELECT price FROM prices\n\t\t\t\t\t\t\t\t\t\tWHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.typeabbrev ='" . $_POST['SalesType'] . "'\n\t\t\t\t\t\t\t\t\tAND prices.currabrev ='" . $_POST['CurrCode'] . "'\n\t\t\t\t\t\t\t\t\tAND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.startdate<='" . date('Y-m-d') . "'\n\t\t\t\t\t\t\t\t\tAND prices.enddate>'" . date('Y-m-d') . "'";
     $TestExistsResult = DB_query($SQLTestExists, $db);
     if (DB_num_rows($TestExistsResult) == 1) {
         //then we are updating
         $SQLUpdate = "UPDATE prices\n\t\t\t\t\t\t\t\t\tSET price = '" . filter_currency_input($_POST['Price_' . $PriceCounter]) . "'\n\t\t\t\t\t\t\t\tWHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.typeabbrev ='" . $_POST['SalesType'] . "'\n\t\t\t\t\t\t\t\t\tAND prices.currabrev ='" . $_POST['CurrCode'] . "'\n\t\t\t\t\t\t\t\t\tAND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.units ='" . $_POST['Units_' . $PriceCounter] . "'\n\t\t\t\t\t\t\t\t\tAND prices.conversionfactor ='" . filter_number_input($_POST['ConversionFactor_' . $PriceCounter]) . "'\n\t\t\t\t\t\t\t\t\tAND prices.startdate<='" . date('Y-m-d') . "'";
         $ResultUpdate = DB_query($SQLUpdate, $db);
         if (DB_error_no($db) == 0) {
             prnMsg(_('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('has been updated in the database'), 'success');
         } else {
             prnMsg(_('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('could not be updated'), 'error');
         }
         echo '<br />';
     } else {
         //we need to add a new price from today
         $SQLInsert = "INSERT INTO prices (\n\t\t\t\t\t\t\tstockid,\n\t\t\t\t\t\t\tprice,\n\t\t\t\t\t\t\ttypeabbrev,\n\t\t\t\t\t\t\tcurrabrev,\n\t\t\t\t\t\t\tdebtorno,\n\t\t\t\t\t\t\tbranchcode,\n\t\t\t\t\t\t\tstartdate,\n\t\t\t\t\t\t\tenddate,\n\t\t\t\t\t\t\tunits,\n\t\t\t\t\t\t\tconversionfactor\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t'" . $_POST['StockID_' . $PriceCounter] . "',\n\t\t\t\t\t\t\t'" . filter_currency_input($_POST['Price_' . $PriceCounter]) . "',\n\t\t\t\t\t\t\t'" . $_POST['SalesType'] . "',\n\t\t\t\t\t\t\t'" . $_POST['CurrCode'] . "',\n\t\t\t\t\t\t\t'" . $_POST['DebtorNo_' . $PriceCounter] . "',\n\t\t\t\t\t\t\t'" . $_POST['BranchCode_' . $PriceCounter] . "',\n\t\t\t\t\t\t\t'" . date('Y-m-d') . "',\n\t\t\t\t\t\t\t'2030-01-01',\n\t\t\t\t\t\t\t'" . $_POST['Units_' . $PriceCounter] . "',\n\t\t\t\t\t\t\t'" . filter_number_input($_POST['ConversionFactor_' . $PriceCounter]) . "'\n\t\t\t\t\t\t)";
         $ResultInsert = DB_query($SQLInsert, $db);
         if (DB_error_no($db) == 0) {
             prnMsg(_('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('has been inserted in the database'), 'success');
         } else {
             prnMsg(_('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('could not be inserted'), 'error');
         }
         echo '<br />';
     }
     $PriceCounter++;
 }
 DB_free_result($result);
 //clear the old result
 $result = DB_query($sql, $db);
 //re-run the query with the updated prices
 $numrow = DB_num_rows($result);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:31,代码来源:PricesByCost.php


示例15: banktrans

     $SQL = "INSERT INTO banktrans (type,\n\t\t\t\t\t\t\t\t\t\ttransno,\n\t\t\t\t\t\t\t\t\t\tbankact,\n\t\t\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\t\t\texrate,\n\t\t\t\t\t\t\t\t\t\tfunctionalexrate,\n\t\t\t\t\t\t\t\t\t\ttransdate,\n\t\t\t\t\t\t\t\t\t\tbanktranstype,\n\t\t\t\t\t\t\t\t\t\tamount,\n\t\t\t\t\t\t\t\t\t\tcurrcode)\n\t\t\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t\t12,\n\t\t\t\t\t\t\t\t\t\t'" . $ReceiptNumber . "',\n\t\t\t\t\t\t\t\t\t\t'" . $_POST['BankAccount'] . "',\n\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['Items' . $identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "',\n\t\t\t\t\t\t\t\t\t\t'" . $ExRate . "',\n\t\t\t\t\t\t\t\t\t\t'" . $BankAccountExRate . "',\n\t\t\t\t\t\t\t\t\t\t'" . $DefaultDispatchDate . "',\n\t\t\t\t\t\t\t\t\t\t'" . $_POST['PaymentMethod'] . "',\n\t\t\t\t\t\t\t\t\t\t'" . filter_currency_input(filter_currency_input($_POST['AmountPaid']) * $BankAccountExRate) . "',\n\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['Items' . $identifier]->DefaultCurrency . "')";
     $DbgMsg = _('The SQL that failed to insert the bank account transaction was');
     $ErrMsg = _('Cannot insert a bank transaction');
     $result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
     //insert a new debtortrans for the receipt
     $SQL = "INSERT INTO debtortrans (transno,\n\t\t\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\t\t\tdebtorno,\n\t\t\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\t\t\tinputdate,\n\t\t\t\t\t\t\t\t\t\t\tprd,\n\t\t\t\t\t\t\t\t\t\t\treference,\n\t\t\t\t\t\t\t\t\t\t\trate,\n\t\t\t\t\t\t\t\t\t\t\tovamount,\n\t\t\t\t\t\t\t\t\t\t\talloc,\n\t\t\t\t\t\t\t\t\t\t\tinvtext,\n\t\t\t\t\t\t\t\t\t\t\tsettled)\n\t\t\t\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t\t\t'" . $ReceiptNumber . "',\n\t\t\t\t\t\t\t\t\t\t\t12,\n\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['Items' . $identifier]->DebtorNo . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $DefaultDispatchDate . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . date('Y-m-d H-i-s') . "',\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'" . $InvoiceNo . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $ExRate . "',\n\t\t\t\t\t\t\t\t\t\t\t'-" . filter_currency_input($_POST['AmountPaid']) . "',\n\t\t\t\t\t\t\t\t\t\t\t'-" . filter_currency_input($_POST['AmountPaid']) . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $_SESSION['Items' . $identifier]->LocationName . ' ' . _('Counter Sale') . "',\n\t\t\t\t\t\t\t\t\t\t\t'1')";
     $DbgMsg = _('The SQL that failed to insert the customer receipt transaction was');
     $ErrMsg = _('Cannot insert a receipt transaction against the customer because');
     $result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
     $ReceiptDebtorTransID = DB_Last_Insert_ID($db, 'debtortrans', 'id');
     $SQL = "UPDATE debtorsmaster SET lastpaiddate = '" . $DefaultDispatchDate . "',\n\t\t\t\t\t\t\t\t\t\t\tlastpaid='" . filter_currency_input($_POST['AmountPaid']) . "'\n\t\t\t\t\t\t\t\t\tWHERE debtorsmaster.debtorno='" . $_SESSION['Items' . $identifier]->DebtorNo . "'";
     $DbgMsg = _('The SQL that failed to update the date of the last payment received was');
     $ErrMsg = _('Cannot update the customer record for the date of the last payment received because');
     $result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
     //and finally add the allocation record between receipt and invoice
     $SQL = "IN 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP filter_db_can_delete_filter函数代码示例发布时间:2022-05-15
下一篇:
PHP filter_configure函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap