Ejemplo n.º 1
0
 {
 	print "<script language=javascript>alert('错误:本次回款+去零合计不能为0');window.history.back(-1);</script>";
 	exit;
 }
 */
 try {
     //开启事务
     //$db->debug=1;
     $CaiWu = new CaiWu($db);
     $db->StartTrans();
     //插入回款记录
     $accesstype = "货款收取";
     if ($billinfo['billtype'] == 3) {
         $accesstype = "欠款收取";
     }
     $CaiWu->insertShoukuanReocord($_POST['customerid'], $_POST['dingdanbillid'], $shoukuan, $accountid, $_SESSION['LOGIN_USER_ID'], $accesstype, $oddment, $_POST['qici'], $_POST['guanlianplanid']);
     $CaiWu->updatesellplanmainhuikuan($_POST['dingdanbillid']);
     //回款计划
     if ($_POST['guanlianplanid'] != '') {
         $sql = "update huikuanplan set ifpay='已回款' where id=" . $_POST['guanlianplanid'];
         $n = $db->Execute($sql);
     }
     //是否事务出现错误
     if ($db->HasFailedTrans()) {
         print "<script language=javascript>alert('错误:" . str_replace("'", "\\'", $db->ErrorMsg()) . "');window.history.back(-1);</script>";
     } else {
         page_css("回款记录");
         $return = $_POST['url'];
         $return = $return . "?" . FormPageAction("action", "init_default");
         print_infor("回款记录已生成", 'trip', "location='?{$return}'", "{$return}", 0);
     }
Ejemplo n.º 2
0
 $chukubillid = $Store->insertSellOneChuKu($billid, $zhuti, $storeid);
 //付款
 $accountid = $_POST['accountid'];
 $oddment = floatval($_POST['quling']);
 $shoukuan = floatval($_POST['shoukuan']);
 $opertype = '';
 if ($_POST['ifpay'] == 1) {
     //付全款
     $opertype = '货款收取';
 } else {
     //付押金
     $opertype = '收押金';
 }
 //插入新回款记录
 if ($shoukuan != 0 || $oddment != 0) {
     $CaiWu->insertShoukuanReocord($customerid, $billid, $shoukuan, $accountid, $_SESSION['LOGIN_USER_ID'], $opertype, $oddment);
 }
 //发货
 if ($billinfo['fahuostate'] == 0 && $chukubillid > 0) {
     $Store->insertFaHuo($chukubillid, $customerid, $billid, $shouhuoren, $mobile, $address);
 }
 //开票
 if ($billinfo['kaipiaostate'] == 0 && $shoukuan + $oddment != 0) {
     $CaiWu->insertKaiPiao($customerid, $billid, $fapiaoneirong, $fapiaotype, $fapiaono, $shoukuan + $oddment, $_SESSION['LOGIN_USER_ID']);
 }
 $db->CompleteTrans();
 page_css("店面销售单");
 //是否事务出现错误
 if ($db->HasFailedTrans()) {
     throw new Exception($db->ErrorMsg());
 } else {