|
@@ -128,7 +128,7 @@ class SplitSale extends Command
|
|
|
$this->i++;
|
|
|
|
|
|
$sale_total = $cgd_total;
|
|
|
- $cgd_total = bcsub($cgd_total, bcmul($sale['total_price'] ?? 0, $pay_rate['rate'], 5), 5);
|
|
|
+ $cgd_total = bcsub($cgd_total, bcmul($sale['total_price'] ?? 0, $pay_rate['rate'], 3), 2);
|
|
|
|
|
|
//只处理采购单
|
|
|
if (strtoupper($pay_rate['companyNo']) == 'KH') {
|
|
@@ -197,17 +197,17 @@ class SplitSale extends Command
|
|
|
|
|
|
Db::commit();
|
|
|
|
|
|
- $output->writeln('处理完成');
|
|
|
+ $output->writeln(date('Y-m-d H:i:s') . '处理完成');
|
|
|
|
|
|
} catch (Exception $e) {
|
|
|
Db::rollback();
|
|
|
- $output->writeln('事务回滚:' . $e->getMessage() . '||' . $e->getFile() . '||' . $e->getLine());
|
|
|
+ $output->writeln(date('Y-m-d H:i:s') . '事务回滚:' . $e->getMessage() . '||' . $e->getFile() . '||' . $e->getLine());
|
|
|
}
|
|
|
|
|
|
Cache::store('redis')->set($key, 0);
|
|
|
|
|
|
} catch (Exception $exception) {
|
|
|
- $output->writeln('脚本执行出错,' . $exception->getMessage() . '||' . $exception->getFile() . '||' . $exception->getLine());
|
|
|
+ $output->writeln(date('Y-m-d H:i:s') . '脚本执行出错,' . $exception->getMessage() . '||' . $exception->getFile() . '||' . $exception->getLine());
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -215,7 +215,7 @@ class SplitSale extends Command
|
|
|
//构建销售单
|
|
|
private function _handle_sale_caixiao(array $sale = [], string $orderCode = '', string $cgdNo = '', float $sale_total = 0.00, array $customer = [], array $supplier = [])
|
|
|
{
|
|
|
- $sale_price = $sale['good_num'] > 0 ? bcdiv($sale_total, $sale['good_num'], 5) : 0;
|
|
|
+ $sale_price = $sale['good_num'] > 0 ? bcdiv($sale_total, $sale['good_num'], 3) : 0;
|
|
|
$tmp_sale = [
|
|
|
'origin_price' => $sale['origin_price'] ?? 0,
|
|
|
'sale_price' => round($sale_price, 2),
|
|
@@ -304,12 +304,12 @@ class SplitSale extends Command
|
|
|
private function _handle_cgd_caixiao(array $cgd = [], array $sale = [], array $pay_rate = [], string $cgdNo = '', string $orderCode = '', float $cgd_total = 0.00)
|
|
|
{
|
|
|
|
|
|
- $good_price = $sale['good_num'] > 0 ? bcdiv($cgd_total, $sale['good_num'], 5) : 0;
|
|
|
+ $good_price = $sale['good_num'] > 0 ? bcdiv($cgd_total, $sale['good_num'], 3) : 0;
|
|
|
|
|
|
$tmp_cgd = [
|
|
|
'cgder' => $sale['cgder'] ?? '',
|
|
|
'cgder_id' => $sale['cgderid'] ?? 0,
|
|
|
- 'good_price' => round($good_price, 2),
|
|
|
+ 'good_price' =>round($good_price,2),
|
|
|
'total_fee' => $cgd_total,
|
|
|
'pakage_fee' => $cgd['pakge_fee'] ?? 0,
|
|
|
'open_fee' => $cgd['open_fee'] ?? 0,
|